Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I found better solution without iterating through contours - by using numpy concatenate() function:

concat = np.concatenate(contours)
hulls = cv2.convexHull(concat)

Resulting hulls contour can be further approximated by cv2.approxPolyDP() function in order to get bounding rectangle.