CStats:RankClipMean and CStats:RankClipMeanSdev
The RankClipMean method computes the rank-clipped mean value for a data sample, clipping the values above and below the specified rank percentiles.
nMean = CStats:RankClipMean( CImage, nHigh, nLow, CRect ) nMean = CStats:RankClipMean( CImage, nHigh, nLow ) nMean = CStats:RankClipMean( table, nHigh, nLow ) nMean, nSdev = CStats:RankClipMeanSdev( CImage, nHigh, nLow, CRect ) nMean, nSdev = CStats:RankClipMeanSdev( CImage, nHigh, nLow ) nMean, nSdev = CStats:RankClipMeanSdev( table, nHigh, nLow ) |
CRect is a bounding rectangle for the CImage object.
nHigh and nLow are percentile values in the range 0 to 100. See Remarks, below.
table is a 1-dimensional array containing numbers.
On success, returns the rank-clipped mean value and standard deviation.
On failure, returns 0, 0.
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=5 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 upper 5th and lower 5th percentile |
|
-- list the results |
CStats class, CImage class, CRect class, MinMaxClipMean, SigmaClipMean, AlphaClipMean
Mira Pro x64 Script User's Guide, Copyright Ⓒ 2023 Mirametrics,
Inc. All Rights Reserved.