Trait opencv::prelude::RotatedRectTraitConst [−][src]
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
See also
CamShift, fitEllipse, minAreaRect, CvBox2D
Required methods
fn as_raw_RotatedRect(&self) -> *const c_void
Provided methods
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.
fn bounding_rect(&self) -> Result<Rect>
fn bounding_rect(&self) -> Result<Rect>
returns the minimal up-right integer rectangle containing the rotated rectangle
fn bounding_rect2f(&self) -> Result<Rect_<f32>>
fn bounding_rect2f(&self) -> Result<Rect_<f32>>
returns the minimal (exact) floating point rectangle containing the rotated rectangle, not intended for use with images