Euclidean Distance Transform

There are several occasions when it is useful to calculate the Euclidean distance from every point in an image to the closest point in some feature set. For example, when calculating the nearest obstacle for robot navigation. Distance transforms can also be used to obtain useful shape information about an object which has been identified in an image. For example, the skeleton of an object is the set of points which lie on the "middle" of the object. The EDT can be used to locate these points and also to characterize the width of the object along the skeleton.

The distance program calculates exact Euclidean distances using a fast and simple four pass algorithm. The key to the approach is varying the size of the neighborhood search according to the current distance value at each point in the image. The proof of the correctness of this method is described in Mohamad Seaidoun's PhD dissertation. If you are interested in the details you are welcome to look at the code. (see code)

Command Usage

distance [options] infile outfile
       [-d]    Print debugging information
       [-e]    Calculate exact distances
       [-p #]  Number of passes (default=4)

Example

TO BE ADDED