Closed ausk closed 5 years ago
The OpenCV changes cv2.findContours in different versions. In OpenCV 3:
cv2.findContours
findContours(image, mode, method[, contours[, hierarchy[, offset]]]) -> image, contours, hierarchy
In OpenCV 4:
findContours(image, mode, method[, contours[, hierarchy[, offset]]]) -> contours, hierarchy
To make the code work in all versions, we can just write like this:
contours = cv2.findContours(...)[-2]
Thanks!
The OpenCV changes
cv2.findContours
in different versions. In OpenCV 3:In OpenCV 4:
To make the code work in all versions, we can just write like this: