pub struct BinaryMask { /* private fields */ }Expand description
Validated binary mask (0 background, 1 foreground).
Implementations§
Source§impl BinaryMask
impl BinaryMask
Sourcepub fn try_new(width: usize, height: usize, data: Vec<u8>) -> VisionResult<Self>
pub fn try_new(width: usize, height: usize, data: Vec<u8>) -> VisionResult<Self>
Creates a mask and rejects values other than zero and one.
Sourcepub fn from_threshold(
input: ImageView<'_, f32, 1>,
threshold: f32,
) -> VisionResult<Self>
pub fn from_threshold( input: ImageView<'_, f32, 1>, threshold: f32, ) -> VisionResult<Self>
Thresholds a float score image into a binary mask.
Sourcepub fn into_image(self) -> Image<u8, 1>
pub fn into_image(self) -> Image<u8, 1>
Consumes the wrapper and returns its image.
Trait Implementations§
Source§impl Clone for BinaryMask
impl Clone for BinaryMask
Source§fn clone(&self) -> BinaryMask
fn clone(&self) -> BinaryMask
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 BinaryMask
impl Debug for BinaryMask
Source§impl PartialEq for BinaryMask
impl PartialEq for BinaryMask
Source§fn eq(&self, other: &BinaryMask) -> bool
fn eq(&self, other: &BinaryMask) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for BinaryMask
impl StructuralPartialEq for BinaryMask
Auto Trait Implementations§
impl Freeze for BinaryMask
impl RefUnwindSafe for BinaryMask
impl Send for BinaryMask
impl Sync for BinaryMask
impl Unpin for BinaryMask
impl UnsafeUnpin for BinaryMask
impl UnwindSafe for BinaryMask
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 more