Skip to main content

label

Function label 

Source
pub fn label(
    mask: &Array2<bool>,
    structure: &Array2<bool>,
) -> Result<(Array2<usize>, usize), ErrorsJSL>
Expand description

Labels the connected components of a binary image (SciPy’s label). Returns the label image (0 for background, 1..=n for the components, numbered in the raster order of their first pixel) and the number of components n. structure must be symmetric with odd dimensions; cross gives 4-connectivity and square(3) 8-connectivity.