CStats:ContraMean

CStats:AlphaClipMean


The AlphaClipMean method computes the mean value inside a rectangular region of the image, rejecting the n highest and m lowest values from the sample. The rectangle and image must have been previously initialized for the CStats object.

Syntax

nMean = CStats:AlphaClipMean( nHigh, nLow )

Remarks

The calculated statistic excludes a specified number of lowest and highest values from the sample. The parameters n and m are known as "alpha" values. In comparison, the MinMaxClippedMean method uses alpha values of 1,1. For example, if nLow=10 andnHigh=20 , then the 10 lowest and 20 highest values in the sample are rejected from the mean value calculation.

This method uses the same algorithm as the AlphaClip method of the CImCombine class.

Example

Suppose a CImage named I and a CRect named R exist. The following script returns the alpha-clipped mean value inside a rectangle on the image:

 

S = CStats:new()

-- create a CStats object

S:Init( I, R )

-- CImage and CRect to be measured

nVal = S:AlphaClipMean( nHigh. nLow )

-- return the mean value

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

-- list the result

Related Topics

CStats, CImage, CRect, MinMaxClipMean, SigmaClipMean, RankClipMean, MtmSigmaClipMean