Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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).

input file output canny opencv output canny scikit-image

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?