Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
valid_cntrs = []
for i,cntr in enumerate(contours):
x,y,w,h = cv2.boundingRect(cntr)
if (x <= 200) & (y >= 80) & (cv2.contourArea(cntr) >= 25):
valid_cntrs.append(cntr)
# count of discovered contours
len(valid_cntrs)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment