有向边框RotatedRect的绘制 以及外边框计算
2017-03-03 17:41
489 查看
RotatedRect
class RotatedRect
The class represents rotated (i.e. notup-right) rectangles on a plane. Each rectangle is specified by the centerpoint (mass center), length of each side (represented by cv::Size2f structure)and the rotation angle in degrees.
C++: RotatedRect::RotatedRect()
C++: RotatedRect::RotatedRect(const Point2f& center, const Size2f& size, float angle)
C++: RotatedRect::RotatedRect(const CvBox2D& box)
Parameters
center – The rectangle masscenter.
size – Width and height of therectangle.
angle – The rotation angle in aclockwise direction. When the angle is 0, 90, 180,270 etc., the rectanglebecomes an up-right rectangle.
box – The rotated rectangle parametersas the obsolete CvBox2D structure.
C++: void RotatedRect::points(Point2f pts[]) const
C++: Rect RotatedRect::boundingRect() const
C++: RotatedRect::operator CvBox2D() const
Parameters
pts – The points array forstoring rectangle vertices.
[cpp]
view plain
copy
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(0,255,0));
Rect brect = rRect.boundingRect();
rectangle(image, brect, Scalar(255,0,0));
imshow("rectangles", image);
原文地址:http://blog.csdn.net/wdy_yx/article/details/8955518
class RotatedRect
The class represents rotated (i.e. notup-right) rectangles on a plane. Each rectangle is specified by the centerpoint (mass center), length of each side (represented by cv::Size2f structure)and the rotation angle in degrees.
C++: RotatedRect::RotatedRect()
C++: RotatedRect::RotatedRect(const Point2f& center, const Size2f& size, float angle)
C++: RotatedRect::RotatedRect(const CvBox2D& box)
Parameters
center – The rectangle masscenter.
size – Width and height of therectangle.
angle – The rotation angle in aclockwise direction. When the angle is 0, 90, 180,270 etc., the rectanglebecomes an up-right rectangle.
box – The rotated rectangle parametersas the obsolete CvBox2D structure.
C++: void RotatedRect::points(Point2f pts[]) const
C++: Rect RotatedRect::boundingRect() const
C++: RotatedRect::operator CvBox2D() const
Parameters
pts – The points array forstoring rectangle vertices.
[cpp]
view plain
copy
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(0,255,0));
Rect brect = rRect.boundingRect();
rectangle(image, brect, Scalar(255,0,0));
imshow("rectangles", image);
原文地址:http://blog.csdn.net/wdy_yx/article/details/8955518
相关文章推荐
- opencv2.32学习笔记 有向边框RotatedRect的绘制 以及外边框计算
- 基于百度地图api的移动路径绘制以及距离计算
- iOS开发Quzrtz2D 十:圆形图片的绘制以及加边框圆形图片的绘制
- [置顶] arcgis api for js入门开发系列二十 用HTML5 canvas绘制地图 瓦片以及如何计算
- 【OpenCV】通过鼠标在图像中绘制RotatedRect旋转矩形
- OpenCV中RotatedRect 以及 Rect介绍
- RotatedRect 可选择矩形 的绘制
- opencv(18)---直方图计算以及绘制
- 关于无线数据传输中产生的流量的一些计算方法以及问题!
- 快速计算子网掩码的方法以及工具(3个,附件中)
- C#绘制Label边框
- ASP.NET中string转换DataTime以及计算日期差
- Powershell 下计算SHA1 以及MD5 摘要[转]
- C#中string转换DataTime以及计算日期差
- GPA以及计算
- 计算两个日期之间的间隔天数、周末天数、以及为当年的哪一周
- WinAPI: DrawFocusRect - 绘制焦点矩形
- 不能不说的C#特性-迭代器(下),yield以及流的延迟计算
- 综合利用数组以及条件分支计算一个班级的成绩
- 任意输入10个数,计算所有正数的和、负数的和以及10个数的和