Introduction - If you have any usage issues, please Google them yourself
Opencv realize the image edge by morphological operations.
First, convert the image to a binary image, and then expanded this binary image, the last image before subtracting the expansion would not have been the edge of the image.