Skip to content

Instantly share code, notes, and snippets.

@OzTamir
Created January 16, 2014 13:26
Show Gist options
  • Save OzTamir/8454946 to your computer and use it in GitHub Desktop.
Save OzTamir/8454946 to your computer and use it in GitHub Desktop.
for cnt in contours:
approx = cv2.approxPolyDP(cnt,cv2.arcLength(cnt,True)*0.02,True)
if len(approx)==4:
cv2.drawContours(im,[approx],0,(0,0,255),2)
x,y,w,h = cv2.boundingRect(cnt)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment