A new framework for computing the Euclidean distance and weighted dist
ance from the boundary of a given digitized shape is presented. The di
stance is calculated with sub-pixel accuracy. The algorithm is based o
n an equal distance contour evolution process. The moving contour is e
mbedded as a level set in a time varying function of higher dimension.
This representation of the evolving contour makes possible the use of
an accurate and stable numerical scheme, due to Osher and Sethian [22
]. The relation between the classical shape from shading problem and t
he weighted distance transform is presented, as well as an algorithm t
hat calculates the geodesic distance transform on surfaces.