###### RotatedRect类（旋转矩形）

C++: 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.
C++: void RotatedRect::points(Point2f pts[]) const

 Parameters: pts – The points array for storing rectangle vertices.

C++: Rect boundingRect(InputArray points)

 Parameters: points – Input 2D point set, stored in std::vector or Mat.
The function calculates and returns the minimal up-right bounding rectangle for the specified point set.

#include <opencv2/opencv.hpp>
#include <iostream>
using namespace std;
using namespace cv;
int main()
{
Mat 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(image, vertices[i], vertices[(i+1)%4], Scalar(255,255,255));//白色矩形
Rect brect = rRect.boundingRect();
rectangle(image, brect, Scalar(255,0,0));
imshow("rectangles", image);
waitKey();
return 0;
}

#### opencv学习笔记：RotatedRect和CvBox2D的角度疑云

2015-05-15 12:19:51

#### RotatedRect类opencv

2016-06-15 19:41:39

#### 【OpenCV3】旋转矩形（cv::RotateRect）的绘制

2017-04-11 17:48:02

#### Cvbox2D（RotatedRect）的解析与应用

2014-09-03 08:55:28

#### C++实现图像的各种旋转操作

2017-06-23 16:03:14

#### OpenCV之RotatedRect类、minAreaRect函数详解

2017-07-19 11:37:13

#### 关于RotateRect的一些说明

2016-11-06 20:37:42

#### 【OpenCV】通过鼠标在图像中绘制RotatedRect旋转矩形

2016-04-08 19:54:57

#### 【OpenCV学习笔记】二十八、轮廓特征属性及应用(五)——最小外接矩形

2017-04-01 16:37:30

#### fitEllipse函数

2015-08-26 15:02:22

## 不良信息举报

RotatedRect类（旋转矩形）