M-File Help: distancexform | View code for distancexform

# distancexform

Distance transform of occupancy grid

d = distancexform(world, goal) is the distance transform of the occupancy grid world 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.

d = distancexform(world, goal, metric) as above but specifies the distance metric as either 'cityblock' or 'Euclidean' (default).

d = distancexform(world, goal, metric, show) as above but shows an animation of the distance transform being formed, with a delay of show seconds between frames.

## Notes

- The Machine Vision Toolbox function imorph is required.
- The goal is [X,Y] not MATLAB [row,col].

## See also

imorph, DXform

© 1990-2014 Peter Corke.