Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Hi,

you can check if the contour area is bigger than the perimeter:

 for contour in contours:
        if cv2.contourArea(contour) > cv2.arcLength(contour, True):
            cv2.drawContours(gray, contour, -1, (0, 255, 0), 5)

If the contour is open, the area should be zero

Best