Когда я запускаю это:
contours,_,hierarchy = cv2.findContours(thresh.copy(),cv2.RETR_TREE, cv2.CHAIN_APPROX_NONE)
Я получаю эту ошибку:
ValueError: not enough values to unpack (expected 3, got 2)
Я также пробовал:
_, contours,hierarchy = cv2.findContours(thresh.copy(),cv2.RETR_TREE, cv2.CHAIN_APPROX_NONE)
и
contours,hierarchy,_ = cv2.findContours(thresh.copy(),cv2.RETR_TREE, cv2.CHAIN_APPROX_NONE)
и получил эту ошибку:
Traceback (most recent call last):
File "C:/Users/HASHMATI/AppData/Local/Programs/Python/Python37-32/new2hand.py", line 152, in <module>
gestureRecognition(frame,roi_rect,frame[y:y+h, x:x+w])
File "C:/Users/HASHMATI/AppData/Local/Programs/Python/Python37-32/new2hand.py", line 99, in gestureRecognition
detectGesture(src,roi_rect,img_dilated)
File "C:/Users/HASHMATI/AppData/Local/Programs/Python/Python37-32/new2hand.py", line 21, in detectGesture
contours,_,hierarchy = cv2.findContours(thresh.copy(),cv2.RETR_TREE, cv2.CHAIN_APPROX_NONE)
ValueError: not enough values to unpack (expected 3, got 2)