Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

answered Apr 9 '15

essamzaky gravatar image

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

click to hide/show revision 2
No.2 Revision

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);