pub struct ManhattanRGB {}
Expand description
Manhattan (i.e. L1) distance.
§Example
use graph_based_image_segmentation::{Distance, ImageNodeColor, ManhattanRGB};
let a = ImageNodeColor::new_bgr(0, 0, 0);
let b = ImageNodeColor::new_bgr(0, 255, 255);
let distance = ManhattanRGB::default();
assert_eq!(distance.distance(&a, &b), 0.6666667);
Trait Implementations§
Source§impl Default for ManhattanRGB
impl Default for ManhattanRGB
Source§impl Distance for ManhattanRGB
impl Distance for ManhattanRGB
Source§fn distance(&self, n: &ImageNodeColor, m: &ImageNodeColor) -> f32
fn distance(&self, n: &ImageNodeColor, m: &ImageNodeColor) -> f32
Compute the distance given two nodes. Read more
impl Send for ManhattanRGB
impl Sync for ManhattanRGB
Auto Trait Implementations§
impl Freeze for ManhattanRGB
impl RefUnwindSafe for ManhattanRGB
impl Unpin for ManhattanRGB
impl UnwindSafe for ManhattanRGB
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