full constructor Any 3 end points of the [RotatedRect]. They must be given in order (either clockwise or anticlockwise).
full constructor
The rectangle mass center.
Width and height of the rectangle.
The rotation angle in a clockwise direction. When the angle is 0, 90, 180, 270 etc., the rectangle becomes an up-right rectangle.
Any 3 end points of the [RotatedRect]. They must be given in order (either clockwise or anticlockwise).
returns 4 vertices of the rectangle
The points array for storing rectangle vertices. The order is bottomLeft, topLeft, topRight, bottomRight.
Generated using TypeDoc
Each rectangle is specified by the center point (mass center), length of each side (represented by Size2f structure) and the rotation angle in degrees.
The sample below demonstrates how to use RotatedRect:
Mat test_image(200, 200, CV_8UC3, Scalar(0)); RotatedRect rRect = RotatedRect(Point2f(100,100), Size2f(100,50), 30); Point2f vertices[4]; rRect.points(vertices); for (int i = 0; i < 4; i++) line(test_image, vertices[i], vertices[(i+1)%4], Scalar(0,255,0), 2); Rect brect = rRect.boundingRect(); rectangle(test_image, brect, Scalar(255,0,0), 2); imshow("rectangles", test_image); waitKey(0);
CamShift, fitEllipse, minAreaRect, CvBox2D
Source: opencv2/core/types.hpp.