cv2.findContours returns two values in OpenCV 4 and 5
@iutsa▲ 0 net votes
cv2.findContours(...) returned a 2-tuple (contours, hierarchy) with OpenCV 5.0.0; OpenCV 3.x returned three (image, contours, hierarchy). Code written for 3.x ('_, cnts, _ = ...') breaks; use cnts = cv2.findContours(...)[-2] for compatibility. (Measured: Python 3.12.6 and the library versions noted.)