PANDORE Version 6 | GREYC-IMAGE |
pdistance computes the distance map to the nearest contour. The output image im_out is a float image where each pixel is set with the distance to the nearest contour point. A contour is a chain of connected non null pixels.
If the input image is a graph then the distance is computed from the node values.
In 2D, the algorithm uses the exact euclidian transform by Meijster.
In 3D, the algorithm uses the Eikonale equation (fast marching). It corresponds to a good approximation of the euclidean distance.
Reference: A. Meijster, J. B. T. M. Roerdink and W. H. Hesselink, "A general algorithm for computing distance transforms in linear time.", In: Mathematical Morphology and its Applications to Image and Signal Processing, Kluwer Acad. Publ., 2000, pp. 331-340.
Returns SUCCESS or FAILURE.
Closed contours yielded by a simple edge detection of tangram.pan:
psobel tangram.pan b.pan pbinarization 50 1e30 b.pan c.pan pskeletonization c.pan d.pan ppostthinning d.pan e.pan pdistance e.pan f.pan plocalmaxima 8 f.pan g.pan plabeling 8 g.pan h.pan pinverse f.pan i.pan pwatershed h.pan i.pan j.pan pboundary 8 j.pan out.pan
Calcul d'une image de distance euclidienne aux contours.
Authors: Jean-Marie Janik & Abderrahim Elmoataz