CStats:MinClipMean and CStats:MinClipMeanSdev


The MinClipMean method computes the minimum-clipped mean value for a data object after rejecting the lowest value of the set.

Syntax

nMean = CStats:MinClipMean( CImage, CRect )

nMean = CStats:MinClipMean( CImage )

nMean = CStats:MinClipMean( table )

nMean, nSdev = CStats:MinClipMeanSdev( CImage, CRect )

nMean, nSdev = CStats:MinClipMeanSdev( CImage )

nMean, nSdev = CStats:MinClipMeanSdev( table )

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

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

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

bullet.gif    On failure, returns 0, 0.

Remarks

The calculated statistic excludes the lowest (minimum value) pixel inside the region. Use this method to avoid a biased result when the region is known to contain one deviant, low pixel value.

Example

Suppose a CImage named I and a CRect named R exist. The following script returns the mean value inside a rectangle on the image, discarding the 1 lowest pixel value:

 

S = new_stats()

-- create a CStats object

-- specify CImage and CRect to measure

 

nVal = S:MinClipMean(I, R)

-- returns the mean value for this CImage and CRect

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

-- list the results

S:delete()

-- when done with S, remove it from memory

Related Topics

CStats class, CImage class, CRect class, MaxClipMean , MinMaxClipMean


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