PANDORE Version 6 GREYC-IMAGE

pvoronoi



Calculates the Voronoi diagram.



Synopsis

pvoronoi [-m mask] [rg_in|-] [rg_out|-][im_out|-]

Description

pvoronoi builds the Voronoi diagram from the seed map rg_in. A seed is a pixel that has a unique label value in the region map.

Voronoi diagrams represent the region of influence around each of a given set of seeds. Every point in the region around a seed is closer to that seed than to any of the other seeds.

The algorithm uses the Chanfrein distance which is an approximation of the euclidean distance.

rg_out is the Voronoi region map where region keeps the same label value than the related seed in the input region map rg_in.

im_out is the distance image that results from the Voronoi diagram. Each pixel is set with the distance to the closer seed.

The Delaunay triangulation is the geometric dual of the Voronoi diagram.

Inputs

Outputs

Result

Returns SUCCESS or FAILURE.

Examples

Calculates the Voronoi diagram from the centers of mass of tangram pieces:

   pbinarization 96 1e30 tangram.pan a.pan
   plabeling 8 a.pan b.pan
   pfillhole b.pan c.pan
   pcenterofmass c.pan d.pan
   pvoronoi d.pan out1.pan out2.pan

See also

Segmentation, pdelaunay.

C++ prototype

Errc PVoronoi( Reg &im_in, Reg2d &rg_out1, Img2dsl &im_out );

Version française

Calcul de la partition de Voronoï.


Author: Régis Clouard