Skip to main content

distance_transform_cdt

Function distance_transform_cdt 

Source
pub fn distance_transform_cdt(
    mask: &Array2<bool>,
    metric: ChamferMetric,
) -> Array2<Option<u32>>
Expand description

The chamfer distance transform (SciPy’s distance_transform_cdt), in integer steps: a forward raster sweep takes each pixel’s distance from its already visited neighbours (up and left), and a backward sweep from the others. Background pixels get 0. Images without background give None for every pixel.