findContours:ValueError: too many values to unpack (expected 2)

@[TOC](findContours:ValueError: too many values to unpack (expected 2))

contours, hierarchy = cv2.findContours(bw, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_NONE)#函数更改了
contours=sorted(contours, key=len)
cnt = contours[-1]
print('轮廓:')
print(cnt.shape)
shapeF = cnt
# cv2.drawContours(img, shapeF, -1, (0, 0, 255), 3)
cv2.drawContours(img, contours, -1, (0, 0, 255), 2)
cv2.imshow('contours', img)

一年前的代码现在运行不行了
更改位置


```python
binary,contours, hierarchy = cv2.findContours(bw, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_NONE)

总结:函数接收参数更改了。

上一篇:Arthas 实战,助你解决同名类依赖冲突问题(下)


下一篇:dotnetcore EF many-to-many mapping