CStats:RankClipMean
The RankClipMean method computes the mean value inside a rectangular region of the image, clipping pixel values below and above the specified rank percentiles. The rectangle and image must have been previously initialized for the CStats object.
nMean = CStats:RankClipMean( nHigh, nLow ) |
The calculated statistic computes the mean value using data above a low percentile and below a high percentile rank. These rank percentiles are absolute on the scale 0 to 100 percent. For example, passing the argumentsnLow=5 and nHigh=95 calculates the region mean value after rejecting data in both the lower 5 percentile and the upper 5 percentile of the sample.
This method uses the same algorithm as the RankClip method of the CImCombine class.
Suppose a CImage I and a CRect R exist. The following script returns the rank clipped mean value inside a rectangle on the image:
|
-- create a CStats object |
|
-- specify CImage and CRect to measure |
|
-- mean value between 5th and 95th percentile |
|
-- list the results |
CStats, CImage, CRect, MinMaxClipMean, SigmaClipMean, AlphaClipMean