mahaveerverma / hand-gesture-recognition-opencv

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

Program run error! #14

Closed EricSun787 closed 3 years ago

EricSun787 commented 5 years ago

when i press 'c' to capture hand histogram ,the program returned and display "contours,hierarchy=cv2.findContours(contour_frame,cv2.RETR_TREE,cv2.CHAIN_APPROX_SIMPLE) ValueError: too many values to unpack."

Thank you.

vrajpal-jhala commented 5 years ago

when i press 'c' to capture hand histogram ,the program returned and display "contours,hierarchy=cv2.findContours(contour_frame,cv2.RETR_TREE,cv2.CHAIN_APPROX_SIMPLE) ValueError: too many values to unpack."

Thank you.

funtion "cv2.findContours(contour_frame,cv2.RETR_TREE,cv2.CHAIN_APPROX_SIMPLE)" returns total 3 values, so you have to put 3 variables on the LHS of the assignment

just replace that line with...

_,contours,hierarchy=cv2.findContours(contour_frame,cv2.RETR_TREE,cv2.CHAIN_APPROX_SIMPLE)

EricSun787 commented 5 years ago

Thank you!