CStats:SigmaClipMean

CStats:YpMean


The YpMean method computes the mean value inside a rectangular region of the image using "Yp Mean" estimation to reduce the influence of deviant pixels. This is described in the Remarks section. The rectangle and image must have been previously initialized for the CStats object.

Syntax

nMean = CStats:YpMean( nPower )

    wherepower specifies the exponent parameter of the Yp Mean. See Remarks.

    On success, returns the mean value as a number.

    On failure, returns 0.

Remarks

This method assigns weights to values based upon their distance from the mean value. No rejection ("clipping") is performed. In contrast to the geometric mean, this method can be tuned to assign less weight to positive values or less weight to negative values, and the severity of the weighting scheme may be adjusted. The positive or negative tail bias depends upon the value of the exponent parameter and the severity of the weighting depends upon the absolute value of the exponent parameter.

For an exponent parameter of value y, the statistic is computed by summing each sample member x raised to the power y as shown below. (Note: The symbol ^ denotes raising a number to a power, as in 2^3 = 8):

     Total = Sum(x^y)

The resulting mean value is then re-scaled as

     Statistic = Total^(1/y) . Thus

    p=0 is invalid. Do not use.

    p>0 gives higher weight to positive outliers.

    p<0 gives lower weight to negative outliers.

Example

Suppose a CImage I and a CRect R exist and that the exponent parameter nPow is assigned a value. The following script fragment returns the Yp Mean value inside a rectangle on the image:

 

S = CStats:new()

-- create a CStats object

S:Init( I, R )

-- specify CImage and CRect to measure

nVal = S:YpMean( nPow )

-- return the Yp Mean value

Printf("mean=%lg\n", nVal)

-- list the result

S:delete()

-- when done with S, remove it from memory

Related Topics

CStats , CImage , CRect , GeomMean, ContraMean