Skip to main content

connected_components

Function connected_components 

Source
pub fn connected_components(
    image: &[f32],
    width: usize,
    height: usize,
) -> Result<Vec<u32>, ImageError>
Expand description

Connected component labeling using union-find (4-connectivity).

Input: binary image (0.0 = background, nonzero = foreground). Output: label array where each connected region has a unique ID (0 = background).

§Errors

Returns error if buffer length doesn’t match dimensions.