Realm

oa::image::connected_components

Connected-component labeling per plane, following connectedComponents: every pixel above threshold is a foreground candidate and receives a unique initial label; bounded min-label propagation merges neighbors under the selected connectivity (4 or 8). The U32 output carries plane x height x width labels with u32::MAX on background pixels. propagation_passes bounds label propagation (zero selects height + width per plane); components with diameters beyond the bound resolve to sub-components. Errors Returns an error unless the image is a nonempty FP32 NCHW/CHW image and threshold is finite.

FnRust public API

Function Documentation

pub fn connected_components( input: &Image, threshold: f32, connectivity: Connectivity, propagation_passes: u32 ) -> Result<Matrix>
Connected-component labeling per plane, following connectedComponents: every pixel above threshold is a foreground candidate and receives a unique initial label; bounded min-label propagation merges neighbors under the selected connectivity (4 or 8). The U32 output carries plane x height x width labels with u32::MAX on background pixels. propagation_passes bounds label propagation (zero selects height + width per plane); components with diameters beyond the bound resolve to sub-components. Errors Returns an error unless the image is a nonempty FP32 NCHW/CHW image and threshold is finite.