OpenCV Contours - need more than 2 values to unpack
findContours returns just three values image, contours and hierarchy in opencv3
image, contours, hierarchy = cv2.findContours(thresh,cv2.RETR_TREE,cv2.CHAIN_APPROX_SIMPLE)
It now returns three values:
findContours(image, mode, method[, contours[, hierarchy[, offset]]])
return image, contours, hierarchy
In OpenCV 2, findContours
returns just two values, contours
and hierarchy
. The error occurs when python tries to assign those two values to the three names given on left in this statement:
image, contours, hierarchy = cv2.findContours(thresh,cv2.RETR_TREE,cv2.CHAIN_APPROX_SIMPLE)