gives the distance transform of image, in which the value of each pixel is replaced by its distance to the nearest background pixel.
treats values above t as foreground.
Details and Options
- DistanceTransform gives an image 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 options are available:
DistanceFunction EuclideanDistance the distance function to be used Padding 1 padding method
- Other possible settings for DistanceTransform are ManhattanDistance, ChessboardDistance, and SquaredEuclideanDistance.
- DistanceTransform works with Image3D objects.
Examplesopen allclose all
Wolfram Research (2008), DistanceTransform, Wolfram Language function, https://reference.wolfram.com/language/ref/DistanceTransform.html (updated 2014).
Wolfram Language. 2008. "DistanceTransform." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2014. https://reference.wolfram.com/language/ref/DistanceTransform.html.
Wolfram Language. (2008). DistanceTransform. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/DistanceTransform.html