mahaveerverma / hand-gesture-recognition-opencv

A project on hand detection and hand gesture recognition developed using OpenCV on Python 2.7.
MIT License
319 stars 132 forks source link

ValueError: too many values to unpack #10

Closed xtremecreative closed 6 years ago

xtremecreative commented 6 years ago

while executing the program after pressing b and then c this error is coming

Traceback (most recent call last): File "HandRecognition.py", line 207, in contours,hierarchy=cv2.findContours(contour_frame,cv2.RETR_TREE,cv2.CHAIN_APPROX_SIMPLE) ValueError: too many values to unpack

and the bounding boxes being displayed like this as per image bellow

I am very much new to all these things Kindly guide me further

sc_001

jatinparab commented 6 years ago

Seems like you are using opencv version 3+ Change the line contours,hierarchy=cv2.findContours(contour_frame,cv2.RETR_TREE,cv2.CHAIN_APPROX_SIMPLE) to _ ,contours, hierarchy=cv2.findContours(contour_frame,cv2.RETR_TREE,cv2.CHAIN_APPROX_SIMPLE) the new findContours function returns 3 values.

xtremecreative commented 6 years ago

Thanks sulphurgfx its really solved the problem !!!!