Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

you can use boundingRect function the first parameter of this function is the list of points in the squar

you can use boundingRect function the first parameter of this function is the list of points in the squar

Example:
vector<Point> contour;
contour.push_back(Point2f(0, 0));
contour.push_back(Point2f(10, 0));
contour.push_back(Point2f(10, 10));
contour.push_back(Point2f(5, 4));
Rect ResultedboundingRect  = boundingRect(contour);