PANDORE Version 6 GREYC-IMAGE

ppolygonalapproximation



Performs polygonal approximation of contours.



Synopsis

ppolygonalapproximation error [-m mask] [im_in|-] [im_out|-]

Description

ppolygonalapproximation approximates a given set of piecewise linear curves as 2D polygons. A curve is a chain of non null pixels and of 1 pixel thickness.

The precision of the polygonal approximation is controlled by the parameter error. The greater is the error value the coarser is the approximation and the less there are polygons.

The output image im_out contains a set of 2D lines, each of them use a different color.

Warning: if the contour is not 1 pixel thickness, the operator may have unpredictable behavior. It might be necessary to use the operator ppostthinning to guaranty 1 pixel thickness.

Parameters

Inputs

Outputs

Result

Returns SUCCESS or FAILURE.

Examples

Performs a polygonal approximation of the boundaries of tangram pieces:

   pbinarization 100 1e30 tangram.pan a.pan
   pboundary 8 a.pan b.pan
   ppostthinning b.pan c.pan
   ppolygonalapproximation 5 c.pan d.pan
   pbinarization 1 1e30 d.pan out.pan

See also

Contour

C++ prototype

Errc PPolygonalApproximation( const Img2duc &im_in, Img2duc &im_out, int error );

Version française

Approximation polygonale des contours d'une image.


Author: Serge Coudé