CStats:MinPix CStats:MinMaxClipMean

CStats:MinClipMean


The MinClipMean method computes the minimum-clipped mean value inside a rectangular region of the image. The rectangle and image must have been previously initialized for the CStats object.

Syntax

nMean = CStats:MinClipMean()

    On success, returns the min-clipped mean value as a number.

    On failure, returns 0.

Example

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

 

S = CStats:new()

-- create a CStats object

S:Init( I, R )

-- specify CImage and CRect to measure

nVal = S:MinClipMean()

-- 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

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.

Related Topics

CStats, CImage, CRect, MaxClipMean , MinMaxClipMean