[][src]Trait opencv::prelude::RotatedRectTrait

pub trait RotatedRectTrait {
    pub fn as_raw_RotatedRect(&self) -> *const c_void;
pub fn as_raw_mut_RotatedRect(&mut self) -> *mut c_void; pub fn center(&self) -> Point2f { ... }
pub fn set_center(&mut self, val: Point2f) { ... }
pub fn size(&self) -> Size2f { ... }
pub fn set_size(&mut self, val: Size2f) { ... }
pub fn angle(&self) -> f32 { ... }
pub fn set_angle(&mut self, val: f32) { ... }
pub fn points(&self, pts: &mut [Point2f]) -> Result<()> { ... }
pub fn bounding_rect(&self) -> Result<Rect> { ... }
pub fn bounding_rect2f(&self) -> Result<Rect_<f32>> { ... } }

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

Loading content...

Provided methods

pub fn center(&self) -> Point2f[src]

returns the rectangle mass center

pub fn set_center(&mut self, val: Point2f)[src]

returns the rectangle mass center

pub fn size(&self) -> Size2f[src]

returns width and height of the rectangle

pub fn set_size(&mut self, val: Size2f)[src]

returns width and height of the rectangle

pub fn angle(&self) -> f32[src]

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

pub fn set_angle(&mut self, val: f32)[src]

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

pub fn points(&self, pts: &mut [Point2f]) -> Result<()>[src]

returns 4 vertices of the rectangle

Parameters

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

pub fn bounding_rect(&self) -> Result<Rect>[src]

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

pub fn bounding_rect2f(&self) -> Result<Rect_<f32>>[src]

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

Loading content...

Implementors

impl RotatedRectTrait for RotatedRect[src]

Loading content...