PANDORE Version 6 GREYC-IMAGE

pdistance1



Computes distance map to nearest contour.



Synopsis

pdistance1 d1 d2 d3 [-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.

The distance is computed from the specified distance between neighbors: d1, d2 and d3:

	+d2 +d1 +d2
	+d1  x  +d1
	+d2 +d1 +d2

For 3D, d3 is the distance between the diagonal neighbors.

If the input image is a graph then distance is computed from the node values.

Parameters

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
   pdistance1 1 1 1 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 PDistance1( const Img2duc &im_in, Img2dsf &im_out, float d1, float d2, float d3 );

Version française

Calcul d'une image de distance quelconque aux contours.


Author: Régis Clouard