bwdist
Distance transform of binary image
Description
[
also returns the closest-pixel map in the form of an index array,
D,idx] = bwdist(___)idx, using any combination of input arguments from the
previous syntaxes. Each element of idx contains the linear
index of the nearest nonzero pixel of BW. The closest-pixel map
is also called the feature map, feature transform, or nearest-neighbor
transform.
Examples
Input Arguments
Output Arguments
Algorithms
bwdist uses fast algorithms to compute the true Euclidean distance
transform, especially in the 2-D case. The other methods are provided primarily for
pedagogical reasons. However, the alternative distance transforms are sometimes
significantly faster for multidimensional input images, particularly those that have
many nonzero elements.
For Euclidean distance transforms,
bwdistuses the fast algorithm [1].For cityblock, chessboard, and quasi-Euclidean distance transforms,
bwdistuses the two-pass, sequential scanning algorithm [2].The different distance measures are achieved by using different sets of weights in the scans, as described in [3].
References
[1] Maurer, Calvin, Rensheng Qi, and Vijay Raghavan, "A Linear Time Algorithm for Computing Exact Euclidean Distance Transforms of Binary Images in Arbitrary Dimensions," IEEE Transactions on Pattern Analysis and Machine Intelligence, Vol. 25, No. 2, February 2003, pp. 265-270.
[2] Rosenfeld, Azriel and John Pfaltz, "Sequential operations in digital picture processing," Journal of the Association for Computing Machinery, Vol. 13, No. 4, 1966, pp. 471-494.
[3] Paglieroni, David, "Distance Transforms: Properties and Machine Vision Applications," Computer Vision, Graphics, and Image Processing: Graphical Models and Image Processing, Vol. 54, No. 1, January 1992, pp. 57-58.

