|
SOLUTIONS
|
BUILT-IN MATHEMATICA SYMBOL
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 OptionsDetails and Options
- 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.
- ImageAdjust[result] normalizes the pixel values in the result from DistanceTransform.
- For multichannel images, DistanceTransform operates on the intensity averaged over all channels.
- DistanceTransform[image] is equivalent to DistanceTransform[image, 0].
- The following option can be given:
-
DistanceFunction EuclideanDistance distance metric function - The default setting is DistanceFunction->EuclideanDistance. Other typical settings include ManhattanDistance and ChessboardDistance.
- DistanceTransform takes a Padding option. The default setting is Padding->1.
ExamplesExamplesopen allclose all
Basic Examples (1)Basic Examples (1)
Distance transform of a binary image:
| In[1]:= |
| Out[1]= | ![]() |
New in 7 | Last modified in 8
Mathematica 9 is now available!
New to Mathematica?
Find your learning path »
Have a question?
Ask support »


