imageproc::distance_transform

Function euclidean_squared_distance_transform

Source
pub fn euclidean_squared_distance_transform(
    image: &Image<Luma<u8>>,
) -> Image<Luma<f64>>
Expand description

Computes the square of the L2 (Euclidean) distance transform of image. Distances are to the nearest foreground pixel, where a pixel is counted as foreground if it has non-zero value.

Uses the algorithm from Distance Transforms of Sampled Functions to achieve time linear in the size of the image.