Missing/double edges in OpenCV/scikit-image implementations of Canny edge detector
If found that the Canny edge detector in OpenCV (2.4.9 on OSX via brew), applied on the binary test image below (left), misses an edge segment at the upper right corner (middle). For comparison I tried scikit-image (right), which produces a small hole at the top (can be fixed using different parameters) and double edges (which should not happend according to my understanding of the algorithm).
I tried different parameters with no effect, probably because the input image is already a binary image.
Code:
# opencv
canny=cv2.Canny(image,300,500)
# scikit-image
canny = img_as_ubyte(feature.canny(image, 1, 300, 500))
Is this expected behaviour? Anything I can do to prevent those gaps?
try do disable opencl and fixed aperture size to 5 and make an issue Can you post orignal image in png instead of jpg?
Thanks for the suggestions! The images are all png already...
sorry I made an error it's a png image but it's not a binary image you have got some values like 64, 128, 192 and 255 in your image. Forget this remark that's not an answer to your problem
Yeah true the donut is not binary, don't think it should make a difference, though.
Using an aperture size of 5 works in this case. However, I can't answer my own question yet.