DistanceTransform

DistanceTransform[image]

gives the distance transform of image, in which the value of each pixel is replaced by its distance to the nearest background pixel.

DistanceTransform[image,t]

treats values above t as foreground.

Details and Options

Examples

open allclose all

Basic Examples  (2)

Distance transform of a binary image:

In[1]:=
Click for copyable input
Out[1]=

Distance transform of a 3D image:

In[1]:=
Click for copyable input
Out[1]=

Scope  (1)

Options  (2)

Applications  (3)

See Also

InverseDistanceTransform  SkeletonTransform  Erosion  Dilation  MorphologicalComponents  Nearest

Tutorials

Introduced in 2008
(7.0)
| Updated in 2014
(10.0)