eumnq8 发表于 2022-3-14 09:50:16

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

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]
查看完整版本: cv2.findContours not enough values to unpack(expected 3, got 2)