1 | initial version |
if you're using opencv3:
>>> help(cv2.findContours)
findContours(...)
findContours(image, mode, method[, contours[, hierarchy[, offset]]]) -> image, contours, hierarchy
i'd say, cv2.findContours(....)[0]
is wrong, and that it has to be: cv2.findContours(....)[1]
instead.
2 | No.2 Revision |
if you're using opencv3:
>>> help(cv2.findContours)
findContours(...)
findContours(image, mode, method[, contours[, hierarchy[, offset]]]) -> image, contours, hierarchy
i'd say, cv2.findContours(....)[0]
is wrong, and that it has to be: cv2.findContours(....)[1]
instead.
(in other words, make sure to feed the contours into the boundingRect(), not the image)