pub struct BBox {
pub x_min: f64,
pub y_min: f64,
pub x_max: f64,
pub y_max: f64,
}Expand description
An axis-aligned box in pixel coordinates, [x_min, x_max] × [y_min, y_max].
Fields§
§x_min: f64§y_min: f64§x_max: f64§y_max: f64Implementations§
Source§impl BBox
impl BBox
pub const fn new(x_min: f64, y_min: f64, x_max: f64, y_max: f64) -> Self
Sourcepub fn from_xywh(x: f64, y: f64, width: f64, height: f64) -> Self
pub fn from_xywh(x: f64, y: f64, width: f64, height: f64) -> Self
A box from its top-left corner and size.
Sourcepub fn from_center_size(cx: f64, cy: f64, width: f64, height: f64) -> Self
pub fn from_center_size(cx: f64, cy: f64, width: f64, height: f64) -> Self
A box from its centre and size.
pub fn width(&self) -> f64
pub fn height(&self) -> f64
pub fn area(&self) -> f64
pub fn center(&self) -> (f64, f64)
Sourcepub fn unrotated(&self, degrees: u32, width: f64, height: f64) -> BBox
pub fn unrotated(&self, degrees: u32, width: f64, height: f64) -> BBox
This box, found in an image turned degrees clockwise (0, 90, 180 or
270; other values leave it as it is), in the pixels of the original
width × height image. For cameras mounted sideways, whose frames
are turned upright before detection.
Trait Implementations§
impl Copy for BBox
impl StructuralPartialEq for BBox
Auto Trait Implementations§
impl Forget for BBox
impl Freeze for BBox
impl Move for BBox
impl RefUnwindSafe for BBox
impl Send for BBox
impl Sync for BBox
impl Unpin for BBox
impl UnsafeUnpin for BBox
impl UnwindSafe for BBox
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> Scalar for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.