Skip to main content

centroids_from_labels

Function centroids_from_labels 

Source
pub fn centroids_from_labels(
    labels: GrayView<'_>,
    frame: u32,
    out: &mut [ParticleCentroid],
) -> Result<usize, CvError>
Expand description

Extract centroids from a pre-labelled u8 mask (label 0 = background).

Each non-zero grey value is treated as a distinct label class; connected components of the same label are separate particles. Labels > 0 only.