PANDORE Version 6 GREYC-IMAGE

pregionvariance



Measures region variance.



Synopsis

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

Description

pregionvariance measures the internal variance of the regions inside the region map rg_in. Each region variance 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 variance for the region i is calculated as follows:

var = ((n*sigma2)-(sigma*sigma)) / (N*N)

where sigma is the sum of the gray levels inside the region i.
where sigma2 is the sum of the square of the gray levels inside the region i;
where N is the number of pixels inside the region i.

Parameters

Inputs

Outputs

Result

Returns SUCCESS or FAILURE.

Examples

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

   pbinarization 100 1e30 tangram.pan a.pan
   plabeling 8 a.pan b.pan
   pregionvariance variance b.pan tangram.pan c.pan
   pcol2txt c.pan

See also

Region Features Extraction

C++ prototype

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

Version française

Calcul de la variance des régions.


Author: Alexandre Duret-Lutz