pub struct ConfidenceMap {
pub width: usize,
pub height: usize,
pub data: Vec<f64>,
}Expand description
A 2-D confidence map stored as a flat row-major vector.
Fields§
§width: usizeWidth (number of columns)
height: usizeHeight (number of rows)
data: Vec<f64>Row-major confidence values clamped to [0, 1]
Implementations§
Source§impl ConfidenceMap
impl ConfidenceMap
Sourcepub fn new(width: usize, height: usize) -> Self
pub fn new(width: usize, height: usize) -> Self
Create a new confidence map initialised to zero.
Sourcepub fn filled(width: usize, height: usize, value: f64) -> Self
pub fn filled(width: usize, height: usize, value: f64) -> Self
Create a confidence map filled with a constant value.
Sourcepub fn get(&self, x: usize, y: usize) -> Option<f64>
pub fn get(&self, x: usize, y: usize) -> Option<f64>
Get the confidence value at (x, y). Returns None if out of bounds.
Sourcepub fn set(&mut self, x: usize, y: usize, value: f64) -> bool
pub fn set(&mut self, x: usize, y: usize, value: f64) -> bool
Set the confidence value at (x, y). The value is clamped to [0, 1].
Returns false if out of bounds.
Sourcepub fn gaussian_blur(&self, radius: usize) -> Self
pub fn gaussian_blur(&self, radius: usize) -> Self
Apply a Gaussian blur to smooth the confidence map.
radius is the kernel half-size (the full kernel is 2*radius+1).
Sourcepub fn statistics(&self) -> ConfidenceStats
pub fn statistics(&self) -> ConfidenceStats
Compute aggregate statistics for this map.
Trait Implementations§
Source§impl Clone for ConfidenceMap
impl Clone for ConfidenceMap
Source§fn clone(&self) -> ConfidenceMap
fn clone(&self) -> ConfidenceMap
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ConfidenceMap
impl Debug for ConfidenceMap
Source§impl PartialEq for ConfidenceMap
impl PartialEq for ConfidenceMap
Source§fn eq(&self, other: &ConfidenceMap) -> bool
fn eq(&self, other: &ConfidenceMap) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ConfidenceMap
Auto Trait Implementations§
impl Freeze for ConfidenceMap
impl RefUnwindSafe for ConfidenceMap
impl Send for ConfidenceMap
impl Sync for ConfidenceMap
impl Unpin for ConfidenceMap
impl UnsafeUnpin for ConfidenceMap
impl UnwindSafe for ConfidenceMap
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,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable 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.