该类表示平面上旋转的(即非垂直的)矩形。 更多...
#include <opencv2/core/types.hpp>
该类表示平面上旋转的(即非垂直的)矩形。
每个矩形由中心点(质心)、每条边的长度(由 Size2f 结构表示)和以度为单位的旋转角度指定。
下面的示例演示了如何使用 RotatedRect
for (int i = 0; i < 4; i++)
{
line(test_image, vertices[i], vertices[(i+1)%4],
Scalar(0,255,0), 2);
putText(test_image, vertex_names[i], vertices[i], FONT_HERSHEY_SIMPLEX, 1,
Scalar(255,255,255));
}
imshow(
"rectangles", test_image);
- 另请参见
- CamShift, fitEllipse, minAreaRect, CvBox2D
- 示例
- samples/cpp/camshiftdemo.cpp, samples/cpp/fitellipse.cpp, and samples/cpp/minarea.cpp.
◆ RotatedRect() [1/3]
| cv::RotatedRect::RotatedRect |
( |
| ) |
|
| Python |
|---|
| cv.RotatedRect( | | ) -> | <RotatedRect object> |
| cv.RotatedRect( | center, size, angle | ) -> | <RotatedRect object> |
| cv.RotatedRect( | point1, point2, point3 | ) -> | <RotatedRect object> |
◆ RotatedRect() [2/3]
| cv::RotatedRect::RotatedRect |
( |
const Point2f & | center, |
|
|
const Size2f & | size, |
|
|
float | angle ) |
| Python |
|---|
| cv.RotatedRect( | | ) -> | <RotatedRect object> |
| cv.RotatedRect( | center, size, angle | ) -> | <RotatedRect object> |
| cv.RotatedRect( | point1, point2, point3 | ) -> | <RotatedRect object> |
完整构造函数
- 参数
-
| center | 矩形质心。 |
| size | 矩形的宽度和高度。 |
| angle | 顺时针方向的旋转角度。当角度为 0、90、180、270 等时,矩形变为垂直矩形。 |
◆ RotatedRect() [3/3]
| Python |
|---|
| cv.RotatedRect( | | ) -> | <RotatedRect object> |
| cv.RotatedRect( | center, size, angle | ) -> | <RotatedRect object> |
| cv.RotatedRect( | point1, point2, point3 | ) -> | <RotatedRect object> |
◆ boundingRect()
| Rect cv::RotatedRect::boundingRect |
( |
| ) |
const |
| Python |
|---|
| cv.RotatedRect.boundingRect( | | ) -> | retval |
◆ boundingRect2f()
| Rect2f cv::RotatedRect::boundingRect2f |
( |
| ) |
const |
| Python |
|---|
| cv.RotatedRect.boundingRect2f( | | ) -> | retval |
返回包含旋转矩形的最小(精确)浮点矩形,不适用于图像
◆ points() [1/2]
| void cv::RotatedRect::points |
( |
Point2f | pts[] | ) |
const |
| Python |
|---|
| cv.RotatedRect.points( | | ) -> | pts |
◆ points() [2/2]
| void cv::RotatedRect::points |
( |
std::vector< Point2f > & | pts | ) |
const |
| Python |
|---|
| cv.RotatedRect.points( | | ) -> | pts |
◆ angle
| float cv::RotatedRect::angle |
返回旋转角度。当角度为 0、90、180、270 等时,矩形变为垂直矩形。
◆ center
◆ size
此类文档是从以下文件生成的