解决ValueError: not enough values to unpack (expected 3, got 2)
程序员文章站
2022-04-22 11:41:47
opencv ValueError: not enough values to unpack (expected 3, got 2)操作# 找出所有轮廓binary,contours, hierarchy = cv.findContours(binary, cv.RETR_EXTERNAL, cv.CHAIN_APPROX_NONE)报错信息ValueError: not enough values to unpack (expected 3, got 2)解决办法查看版本pip li...
opencv ValueError: not enough values to unpack (expected 3, got 2)
操作
# 找出所有轮廓
binary,contours, hierarchy = cv.findContours(binary, cv.RETR_EXTERNAL, cv.CHAIN_APPROX_NONE)
报错信息
ValueError: not enough values to unpack (expected 3, got 2)
解决办法
查看版本
pip list
opencv-python 4.4.0.42
# 切换版本
pip install opencv-python==3.4.3.18 -i https://pypi.douban.com/simple
Installing collected packages: opencv-python
Attempting uninstall: opencv-python
Found existing installation: opencv-python 4.4.0.42
Uninstalling opencv-python-4.4.0.42:
Successfully uninstalled opencv-python-4.4.0.42
Successfully installed opencv-python-3.4.3.18
opencv 降版本就完了,虽然麻烦,但好使
本文地址:https://blog.csdn.net/weixin_41194171/article/details/108264669