pub trait RotatedRectTraitConst {
    fn as_raw_RotatedRect(&self) -> *const c_void;

    fn center(&self) -> Point2f { ... }
    fn size(&self) -> Size2f { ... }
    fn angle(&self) -> f32 { ... }
    fn points(&self, pts: &mut [Point2f]) -> Result<()> { ... }
    fn bounding_rect(&self) -> Result<Rect> { ... }
    fn bounding_rect2f(&self) -> Result<Rect_<f32>> { ... }
}
Expand 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: RotatedRect_demo image

See also

CamShift, fitEllipse, minAreaRect, CvBox2D

Required Methods§

Provided Methods§

returns the rectangle mass center

returns width and height of the rectangle

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

returns 4 vertices of the rectangle

Parameters
  • pts: The points array for storing rectangle vertices. The order is bottomLeft, topLeft, topRight, bottomRight.

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

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

Implementors§