EstervQrCode 1.1.1
Library for qr code manipulation
Public Member Functions | Public Attributes | List of all members
cv::RotatedRect Class Reference

The class represents rotated (i.e. not up-right) rectangles on a plane. More...

#include <types.hpp>

Public Member Functions

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

Public Attributes

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

Detailed Description

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

See also
CamShift, fitEllipse, minAreaRect, CvBox2D

Constructor & Destructor Documentation

◆ RotatedRect() [1/3]

CV_WRAP cv::RotatedRect::RotatedRect ( )

default constructor

◆ RotatedRect() [2/3]

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

full constructor

Parameters
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() [3/3]

CV_WRAP 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).

Member Function Documentation

◆ boundingRect()

CV_WRAP Rect cv::RotatedRect::boundingRect ( ) const

returns the minimal up-right integer rectangle containing the rotated rectangle

◆ boundingRect2f()

CV_WRAP Rect2f cv::RotatedRect::boundingRect2f ( ) const

returns the minimal (exact) floating point rectangle containing the rotated rectangle, not intended for use with images

◆ points() [1/2]

CV_WRAP void cv::RotatedRect::points ( CV_OUT std::vector< Point2f > &  pts) const

◆ points() [2/2]

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

returns 4 vertices of the rotated rectangle

Parameters
ptsThe points array for storing rectangle vertices. The order is bottomLeft, topLeft, topRight, bottomRight.
Note
Bottom, Top, Left and Right sides refer to the original rectangle (angle is 0), so after 180 degree rotation bottomLeft point will be located at the top right corner of the rectangle.

Member Data Documentation

◆ angle

CV_PROP_RW float cv::RotatedRect::angle

returns the rotation angle. When the angle is 0, 90, 180, 270 etc., the rectangle becomes an up-right rectangle.

◆ center

CV_PROP_RW Point2f cv::RotatedRect::center

returns the rectangle mass center

◆ size

CV_PROP_RW Size2f cv::RotatedRect::size

returns width and height of the rectangle


The documentation for this class was generated from the following file: