找回密码
 立即注册
查看: 2196|回复: 0

[python] cv2.findContours not enough values to unpack(expected 3, got 2)

[复制链接]

3382

主题

19

回帖

39

积分

普通会员LV2

积分
39

技术达人

发表于 2022-3-14 09:50:16 | 显示全部楼层 |阅读模式
cv2.findContours not enough values to unpack(expected 3, got 2)

这个报错是新版opencv findContours只返回两个参数,老版本opencv返回3个参数,

修改方法,去掉第一个参数即可

_, contours, _ = cv2.findContours(result_window_bin, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)修改为contours, _ = cv2.findContours(result_window_bin, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

站长推荐上一条 /1 下一条

QQ|小黑屋|手机版|Archiver|易游网-易游模拟器 Copyright @2015-2026 ( 浙ICP备15028007号-1 )

GMT+8, 2026-9-27 06:10 , Processed in 0.029469 second(s), 10 queries , Gzip On, MemCache On.

Powered by Discuz! X3.5 Licensed

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表