The class represents rotated (i.e. not up-right) rectangles on a plane.
More...
#include "types.hpp"
The class represents rotated (i.e. not up-right) rectangles on a plane.
Each rectangle is specified by the center point (mass center), length of each side (represented by cv::Size2f structure) and the rotation angle in degrees.
The sample below demonstrates how to use RotatedRect:
Point2f vertices[4];
rRect.points(vertices);
for (int i = 0; i < 4; i++)
line(image, vertices[i], vertices[(i+1)%4],
Scalar(0,255,0));
Rect brect = rRect.boundingRect();
image
- See also
- CamShift, fitEllipse, minAreaRect, CvBox2D
- Examples:
- fitellipse.cpp, and minarea.cpp.
cv::RotatedRect::RotatedRect |
( |
| ) |
|
cv::RotatedRect::RotatedRect |
( |
const Point2f & |
center, |
|
|
const Size2f & |
size, |
|
|
float |
angle |
|
) |
| |
- Parameters
-
center | The rectangle mass center. |
size | Width and height of the rectangle. |
angle | 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).
Rect cv::RotatedRect::boundingRect |
( |
| ) |
const |
returns the minimal up-right rectangle containing the rotated rectangle
void cv::RotatedRect::points |
( |
Point2f |
pts[] | ) |
const |
returns 4 vertices of the rectangle
- Parameters
-
pts | The points array for storing rectangle vertices. |
- Examples:
- fitellipse.cpp, and minarea.cpp.
float cv::RotatedRect::angle |
The documentation for this class was generated from the following file: