distancetransform
Distance transform is a foundational image processing operation that assigns to every pixel a value representing its distance to the nearest feature pixel, according to a chosen distance metric. In binary images, a common convention is to compute, for each foreground pixel, the distance to the nearest background (zero-valued) pixel. The resulting distance map is used to quantify proximity to boundaries, locate centers of shapes, and support further analysis such as segmentation and skeletonization. Some formulations also compute the distance from background pixels to the nearest foreground pixel, depending on the application.
Metrics. The Euclidean distance transform (EDT) uses straight-line distance. Alternatives include the city-block (L1) distance and
Algorithms. Simple approaches compute distances by sweeping the image multiple times; more efficient methods include Felzenszwalb
Applications. Distance transforms support shape analysis, object localization, and feature extraction. They underpin skeletonization, Voronoi diagram