Skip to main content

label_components

Function label_components 

Source
fn label_components(mask: &[u8], d0: usize, d1: usize) -> (Vec<u32>, u32)
Expand description

Label the connected components of a slice mask, 4-connected.

4-connectivity, not 8, because that is what the region-growing unwrappers can actually traverse: their neighbourhood is the six face neighbours, which in plane is four. Returns labels (0 = outside the mask) and the number of components.