I have an image with a shape in it. For some reasons, findContours does not detect any contour in my image and I would like to know why. Also I made a shape myself in paint that is similar and for that shape the function works. The shape not being complete I was wondering if it's possible to "close" the shape via the contours.
Here is the shape I made myself and trying to connect the unfinished lines
This is the image where the function doesn't detect the shape at all.
img = cv2.imread("crop4_2.png", cv2.IMREAD_GRAYSCALE)
contours, hierarchy = cv2.findContours(img, cv2.RETR_CCOMP, cv2.CHAIN_APPROX_NONE)
for c in contours:
cv2.drawContours(img, [c], -1, (random.randrange(0, 255), random.randrange(0, 256), random.randrange(0, 255)), 50)