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?