CStats:SigmaClipMean
The SigmaClipMean method computes the mean value inside a rectangular region of the image, using iterative sigma clipping for removing deviant values from the statistic. The rectangle and image must have been previously initialized for the CStats object.
nMean = CStats:SigmaClipMean( nSigmaHigh, nSigmaLow ) |
The calculated statistic trims bad data away from the mean value using the standard deviation to identify and reject deviant values in an iterative fashion. Use this method to reduce the biased result when the region contains a moderate percentage of deviant pixel values.
This method uses the same algorithm as the SigmaClip method of the CImCombine class.
Suppose a CImage I and a CRectR exist. The following script returns the clipped mean value inside a rectangle on the image. The clipping is done at 3 sigmas above the mean and 5 sigmas below the mean:
|
-- create a CStats object |
|
-- specify CImage and CRect to measure |
|
-- clips 3 sigmas above and 5 sigmas below |
|
-- list the results |
|
-- when done with S, remove it from memory |
CStats, CImage, CRect, MinMaxClipMean, MtmSigmaClipMean, RankClipMean