我执行下面的代码时遇到上述错误。
img = cv2.imread('034.jpg',0)
ret,thresh = cv2.threshold(img,127,255,0)
contours,hierarchy = cv2.findContours(thresh, 1, 2)
错误:
文件“bb.py”,第6行,in contours,hierarchy = cv2.findContours(thresh,1,2)ValueError:解包的值太多(预期为2)
答案 0 :(得分:0)
正如OpenCV Documentation中所述,你需要另一个变量来解压缩cv2.findContours。例如;
userid date time result sr no
1 11/29/17 11:30 AM pass 1
2 11/29/17 11:45 AM pass 2
3 11/29/17 12:00 AM fail 3
4 11/29/17 12:30 AM pass 3