PANDORE Version 6 GREYC-IMAGE

pregionmean



Measures region mean grayscale value.



Synopsis

pregionmean name [-m mask] [rg_in|-] [im_in|-] [col_out|-]

Description

pregionmean measures the mean grayscale value of the regions inside the region map rg_in. Each region mean grayscale value is stored as a float in the array named name inside the collection col_out. The ith item in the array corresponds to the i+1th region because the region 0 is not considered.

The mean value is calculated as follows:

mi= SUM(im_in[p] / p in Ri) / N

where N is the number of pixels in the region.

Parameters

Inputs

Outputs

Result

Returns SUCCESS or FAILURE.

Examples

Displays mean of the regions yielded by a simple binarization of tangram.pan:

   pbinarization 100 1e30 tangram.pan a.pan
   plabeling 8 a.pan b.pan
   pregionmean mean b.pan tangram.pan c.pan
   pcol2txt c.pan

See also

Region Features Extraction

C++ prototype

Errc PRegionMean( const Reg2d &rg_in, const Img2duc &im_in, Collection &cold, const std::string &name );

Version française

Calcul de la moyenne des régions.


Author: Alexandre Duret-Lutz