OpenCV453
公開メンバ関数 | 公開変数類 | 全メンバ一覧
cv::RotatedRect クラス

The class represents rotated (i.e. not up-right) rectangles on a plane. [詳解]

#include <types.hpp>

公開メンバ関数

 RotatedRect ()
 default constructor
 
 RotatedRect (const Point2f &center, const Size2f &size, float angle)
 
 RotatedRect (const Point2f &point1, const Point2f &point2, const Point2f &point3)
 
void points (Point2f pts[]) const
 
Rect boundingRect () const
 returns the minimal up-right integer rectangle containing the rotated rectangle
 
Rect_< float > boundingRect2f () const
 returns the minimal (exact) floating point rectangle containing the rotated rectangle, not intended for use with images
 

公開変数類

Point2f center
 returns the rectangle mass center
 
Size2f size
 returns width and height of the rectangle
 
float angle
 returns the rotation angle. When the angle is 0, 90, 180, 270 etc., the rectangle becomes an up-right rectangle.
 

詳解

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 #Size2f structure) and the rotation angle in degrees.

The sample below demonstrates how to use RotatedRect:

image

参照
CamShift, fitEllipse, minAreaRect, CvBox2D

構築子と解体子

◆ RotatedRect() [1/2]

cv::RotatedRect::RotatedRect ( const Point2f center,
const Size2f size,
float  angle 
)

full constructor

引数
centerThe rectangle mass center.
sizeWidth and height of the rectangle.
angleThe rotation angle in a clockwise direction. When the angle is 0, 90, 180, 270 etc., the rectangle becomes an up-right rectangle.

◆ RotatedRect() [2/2]

cv::RotatedRect::RotatedRect ( const Point2f point1,
const Point2f point2,
const Point2f point3 
)

Any 3 end points of the RotatedRect. They must be given in order (either clockwise or anticlockwise).

関数詳解

◆ points()

void cv::RotatedRect::points ( Point2f  pts[]) const

returns 4 vertices of the rectangle

引数
ptsThe points array for storing rectangle vertices. The order is bottomLeft, topLeft, topRight, bottomRight.

このクラス詳解は次のファイルから抽出されました: