graph-based-image-segmentation 0.2.1

An implementation of graph-based image segmentation algorithms based on superpixels.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/// Represents an edge between two pixels in an image.
///  Each edge is characterized by a weight and the adjacent nodes.
#[derive(Debug, PartialOrd, PartialEq, Copy, Clone, Default)]
pub struct ImageEdge {
    /// Index of first node.
    pub n: usize,
    /// Index of second node.
    pub m: usize,
    /// Edge weight, i.e. the distance of two pixels in feature space.
    pub w: f32,
}

impl ImageEdge {
    pub fn new(n: usize, m: usize, w: f32) -> Self {
        Self { n, m, w }
    }
}