Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Thanks to Balaji, Canny now works

image description

thresh = 50
maxValue = 255
th, dst = cv2.threshold(img, thresh, maxValue, cv2.THRESH_BINARY);
maxVal = 200
edges1 = cv2.Canny(dst,minVal,maxVal)
cv2.imshow('Edge image after thresholding image',edges) 
cv2.imwrite('EdgeAfterThresh.png',edges1)

Thanks to Balaji, Canny now works

image description

thresh = 50
maxValue = 255
th, dst = cv2.threshold(img, thresh, maxValue, cv2.THRESH_BINARY);
maxVal = 200
edges1 = cv2.Canny(dst,minVal,maxVal)
cv2.imshow('Edge image after thresholding image',edges) 
cv2.imwrite('EdgeAfterThresh.png',edges1)
cv2.waitKey(0)

Thanks to Balaji, Canny now works

I'd still like to understand why Canny does not find the edge on the lower right virtex but has no issue with the lower left. I guess I could try flipping the image in the vertical axis. Canny should fail on the lower left then if its a data dependent issue.

image description

thresh = 50
maxValue = 255
th, dst = cv2.threshold(img, thresh, maxValue, cv2.THRESH_BINARY);
maxVal = 200
edges1 = cv2.Canny(dst,minVal,maxVal)
cv2.imshow('Edge image after thresholding image',edges) 
cv2.waitKey(0)