Skip to content

Instantly share code, notes, and snippets.

@aniruddha27
Created April 25, 2020 09:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aniruddha27/81925df09f07a52be5a0eae6f1142d8f to your computer and use it in GitHub Desktop.
Save aniruddha27/81925df09f07a52be5a0eae6f1142d8f to your computer and use it in GitHub Desktop.
# Finding contours
im_gray = gray(im)
im_blur = blur(im_gray)
im_thresh = threshold(im_blur)
contours, _ = cv2.findContours(im_thresh, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_NONE)
@saeedmaham
Copy link

ValueError: too many values to unpack (expected 2)

I'm having this error. How can I solve it?

Any idea.

@aniruddha27
Copy link
Author

Hi, could you try the following code because it could be possible you have a different OpenCV version.

_, contours, _ = cv2.findContours(im_thresh, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_NONE)

@saeedmaham
Copy link

Thank you
It's working now.

@aniruddha27
Copy link
Author

Welcome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment