M-File Help: distancexform View code for distancexform

distancexform

Distance transform

d = distancexform(im, options) is the distance transform of the binary image im. The elements of d have a value equal to the shortest distance from that element to a non-zero pixel in the input image im.

d = distancexform(occgrid, goal, options) is the distance transform of the occupancy grid occgrid with respect to the specified goal point goal = [X,Y]. The cells of the grid have values of 0 for free space and 1 for obstacle. The resulting matrix d has cells whose value is the shortest distance to the goal from that cell, or NaN if the cell corresponds to an obstacle (set to 1 in occgrid).

Options:

'euclidean' Use Euclidean (L2) distance metric (default)
'cityblock' Use cityblock or Manhattan (L1) distance metric
'show', D Show the iterations of the computation, with a delay of D seconds between frames.
'noipt' Don't use Image Processing Toolbox, even if available
'novlfeat' Don't use VLFeat, even if available
'nofast' Don't use IPT, VLFeat or imorph, even if available.

Notes

See also

imorph, DXform


 

© 1990-2014 Peter Corke.