mahaveerverma / hand-gesture-recognition-opencv

A project on hand detection and hand gesture recognition developed using OpenCV on Python 2.7.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Program run error!

EricSun787 opened this issue · comments

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.

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)

Thank you!