CStats:AlphaClipMean and CStats:AlphaClipMeanSdev


The AlphaClipMean method computes the mean value after rejecting the nHigh highest and nLow lowest values from the sample.

Syntax

nMean = CStats:AlphaClipMean( CImage, nHigh, nLow, CRect )

nMean = CStats:AlphaClipMean( CImage, nHigh, nLow )

nMean = CStats:AlphaClipMean( CPlotView, nHigh, nLow )

nMean = CStats:AlphaClipMean( table, nHigh, nLow )

nMean, nSdev = CStats:AlphaClipMeanSdev( CImage, nHigh, nLow, CRect )

nMean, nSdev = CStats:AlphaClipMeanSdev( CImage, nHigh, nLow )

nMean, nSdev = CStats:AlphaClipMeanSdev( CPlotView, nHigh, nLow )

nMean, nSdev = CStats:AlphaClipMeanSdev( table, nHigh, nLow )

bullet.gif    CRect is a bounding rectangle for the CImage object.

bullet.gif    nHigh and nLow specify the number of values to reject from the calculation.

bullet.gif    table is a 1-dimensional array containing numbers.

bullet.gif    On success, returns the alpha clipped mean value and standard deviation.

bullet.gif    On failure, returns 0, 0.

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.

When a CPlotView is passed, the only the current CPlot is processed.

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 = new_stats()

-- create a CStats object

-- CImage and CRect to be measured

 

nVal = S:AlphaClipMean( I, nHigh nLow, R )

-- return the mean value

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

-- list the result

Related Topics

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


Mira Pro x64 Script User's Guide, Copyright Ⓒ 2023 Mirametrics, Inc. All Rights Reserved.