Skip to content

Conversation

@jackz314
Copy link

In newer OpenCV versions, the function findCountours only returns two values, contours and hierarchy, instead of the three values returned previously.
See the docs for more information.

In newer OpenCV versions, the function `findCountours` only returns two values, contours and hierarchy, instead of the three values returned previously.
See https://docs.opencv.org/2.4/modules/imgproc/doc/structural_analysis_and_shape_descriptors.html#findcontours
@ab-10
Copy link

ab-10 commented Jul 4, 2020

I would suggest adding [-2:] for backwards compatability:

cont, hierarchy = cv2.findContours(thresh, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE)[-2:]

@amarlearning
Copy link
Owner

opencv-python version has been updated now and the issue has been resolved

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants