Skip to content
Advertisement

OpenCV Python: cv2.findContours – ValueError: too many values to unpack

I’m writing an opencv program and I found a script on another stackoverflow question: Computer Vision: Masking a human hand

When I run the scripted answer, I get the following error:

JavaScript

The code:

JavaScript

Any help is appreciated!

Advertisement

Answer

I got the answer from the OpenCV Stack Exchange site. Answer

THE ANSWER:

I bet you are using the current OpenCV’s master branch: here the return statements have changed, see http://docs.opencv.org/modules/imgproc/doc/structural_analysis_and_shape_descriptors.html?highlight=findcontours.

Thus, change the corresponding line to read:

JavaScript

Or: since the current trunk is still not stable and you probably will run in some more problems, you may want to use OpenCV’s current stable version 2.4.9.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement