Mathematica 9 is now available
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.
Mathematica > Data Manipulation > Image Processing & Analysis > Mathematical Morphology > DistanceTransform >

DistanceTransform

Updated In 8 Graphic
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
treats values above t as foreground.
  • DistanceTransform gives an Image object in which the value of each pixel is the absolute Euclidean distance in pixels to the nearest pixel of background.
  • For multichannel images, DistanceTransform operates on the intensity averaged over all channels.
  • The following option can be given:
DistanceFunctionEuclideanDistancedistance metric function
Distance transform of a binary image:
Distance transform of a binary image:
In[1]:=
Click for copyable input
Out[1]=
Distance transform of a color image:
Apply a LoG filter to the output of a distance transform:
Ultimate erosion of a binary image:
New in 7 | Last modified in 8
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team
Format:   HTML  |  CDF