PANDORE Version 6 GREYC-IMAGE

pdistance



Computes euclidean distance map to nearest contours.



Synopsis

pdistance [-m mask] [im_in|-] [im_out|-]

Description

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.

Inputs

Outputs

Result

Returns SUCCESS or FAILURE.

Examples

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

See also

Contour

C++ prototype

Errc PDistance( const Img2duc &im_in, Img2dsf &im_out );

Version française

Calcul d'une image de distance euclidienne aux contours.


Authors: Jean-Marie Janik & Abderrahim Elmoataz