essai
PANDORE Version 6 GREYC-IMAGE

pcenterofmass



Locates the center of mass of regions.



Synopsis

pcenterofmass [-m mask] [rg_in|-] [rg_out|-]

Description

pcenterofmass builds a new region map im_out with the center of mass of each region of the input region map im_in. A center of mass is represented as a point in the output region map with the same label value than the related region.

The center of mass of a region of size N is calculated as follows:

   gx = SUM(x[Ri])/N
   gy = SUm(y[Ri])/N

Warning: It might occur some overlapping between centers of mass because there are not necessarily located into the region. Therefore, a center of mass can hide another.

Inputs

Outputs

Result

Returns SUCCESS or FAILURE.

Examples

Locates the center of mass of regions in the region map rin.pan:

   pcenterofmass rin.pan rout.pan

See also

Region

C++ prototype

Errc PCenterOfMass( const Reg2d &rg_in, Reg2d &rg_out );

Version française

Localisation des centres de gravité de régions.


Author: Régis Clouard