Why findContours in Python doesn't return two Numpy arrays?

Python function

cv.findContours(	image, mode, method[, contours[, hierarchy[, offset]]]	) ->	contours, hierarchy

returns <class ‘tuple’> and <class ‘numpy.ndarray’>. Is there a good reason to not return two Numpy arrays instead?

it returns a tuple of…

  • list of numpy arrays, one array per contour
  • array for hierarchy

do you expect multiple contours to fit in a single numpy array? what would that look like? and how would that fail?

It is a tuple of numpy arrays, one array per contour.

It’s possible with dtype=object.