Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

you filter them by area:

largest_area=0
largest_rect = None
for r in rects:
    a = cv2.contourArea(r)
    if a > largest_area:
         largest_area = a
         largest_rect = r