Ask Your Question

Revision history [back]

click to hide/show revision 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.

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)