Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

both minAreaRect() and boundingRect() expect a single contour, not a std::vector<std::vector<cv::Point>>

you'll have to build a single vector<Point> , and then apply your favourite function:

vector<Point> joined;
for (size_t i=0; i<contours.size(); i++) {
      joined.insert(joined.end(), contours[i].begin(), contours[i].end());
}

boundingRect(joined);
minAreaRect(joined);