CStats:MinClipMean CStats:MtmSigmaClipMean

CStats:MinMaxClipMean


The MinMaxClipMean method computes the mean value inside a rectangular region of the image, excluding the minimum and maximum pixel values from the result. The rectangle and image must have been previously initialized for the CStats object.

Syntax

nMean = CStats:MinMaxClipMean()

Remarks

The calculated statistic excludes the lowest (minimum value) and highest (maximum value) pixels inside the region. Use this method to avoid a biased result when the region is suspected to contain one deviant high value and one deviant low value.

Example

Suppose a CImageI and a CRectR exist. The following script fragment returns the mean value inside a rectangle on the image, discarding the 1 highest pixel value:

S = CStats:new()

-- create a CStats object

S:Init( I, R )

-- specify CImage and CRect to measure

nVal = S:MinMaxClipMean()

-- returns the mean value

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

-- list the results

S:delete()

-- when done with S, remove it from memory

Related Topics

CStats, CImage, CRect, MinClipMean, MaxClipMean