CStats:MinClipMean
The MinClipMean method computes the minimum-clipped mean value of a data sample. This method calculates the mean after rexcluding the minimum value from the sample. Use this method to avoid a biased result when the region is known to contain one deviant, low pixel value. The sample may be a Lua table or a class object of type CImage, CArray, or CMatrix. For CImage and CMatrix objects, an optional CRect object can be used to define the points used in the calculation.
nMean, nStdDev = CStats:MinClipMean( table ) nMean, nStdDev = CStats:MinClipMean( CImage ) nMean, nStdDev = CStats:MinClipMean( CImage, CRect ) nMean, nStdDev = CStats:MinClipMean( CArray ) nMean, nStdDev = CStats:MinClipMean( CArray, CRect ) nMean, nStdDev = CStats:MinClipMean( CMatrix ) where |
table is a lua table containing the data.
CImage, CArray, and CMatrix are class objects containing the data to measure,
CRect is a CRect rectangle object that defines the region to measure.
nMean and nStdDev are the min-clipped mean and standard deviation of the data. On failure, 0,0 is returned.
Suppose that CImage object I and CRect object R exist. The following script returns the mean value inside a rectangle on the image, discarding the 1 lowest pixel value:
|
-- returns the mean value for this CImage and CRect |
|
-- list the results |
|
-- when done with S, remove it from memory |
The following script returns the min-clipped mean value for a table of data:
|
-- create a CStats object |
|
-- create some data in a table |
|
-- list the result |