码迷,mamicode.com
首页 > 编程语言 > 详细

python调用cv2.findContours时报错:ValueError: not enough values to unpack (expected 3, got 2)

时间:2019-12-05 13:21:53      阅读:97      评论:0      收藏:0      [点我收藏+]

标签:got   find   ret   expected   exp   rar   报错   ==   app   

OpenCV旧版,返回三个参数:

im2, contours, hierarchy = cv2.findContours(mask, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE)

要想返回三个参数

把OpenCV 降级成3.4.3.18 就可以了,在终端输入pip install opencv-python==3.4.3.18

OpenCV 新版调用,返回两个参数

 contours, hierarchy = cv2.findContours(mask, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE)

python调用cv2.findContours时报错:ValueError: not enough values to unpack (expected 3, got 2)

标签:got   find   ret   expected   exp   rar   报错   ==   app   

原文地址:https://www.cnblogs.com/liuwenhua/p/11988351.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!