Skip to main content

Module particle_features

Module particle_features 

Source
Expand description

Particle features from binary / labelled masks — centroids for Crocker–Grier linking.

Pure Rust. Connected components on u8 intensity (threshold or pre-labelled). Centroid list is caller-buffered (&mut [ParticleCentroid]).

Cold path may allocate a visit mask / BFS queue (bounded by image size); public output is fixed-capacity and suitable for the particle linker.

Structs§

ParticleCentroid
2D particle feature used by super::crocker_grier_link().

Constants§

MAX_PARTICLES_PER_FRAME
Maximum particles reported from a single frame (stack-friendly bound for callers).

Functions§

centroid_from_bbox
Centroid of a bounding box (integer mid-point) — convenience for box→particle bridges.
centroids_from_binary
Extract centroids of connected components where pixel ≥ thresh (4-connected).
centroids_from_labels
Extract centroids from a pre-labelled u8 mask (label 0 = background).