CImCombine:ContraMean
The ContaMean method merges the pixel values using the contra-harmonic mean statistic at each location.
CImage = CImCombine:ContraMean( CImageSet, power ) |
CImageSet contains the collection of images to be combined.
power is the exponent of the harmonic mean.
CImage is a new image created by this method.
On success, this method returns a new CImage.
On failure, this method returns nil.
Each pixel in the output image is the contra-harmonic mean of values at the same location in all the images of the CImageSet. This method uses the contra-harmonic mean statistic which assigns weights to values based upon their distance from the mean value. No rejection ("clipping") is performed. In contrast to the geometric mean, this method can be tuned to assign less weight to values lying above the sample or to values lying below the sample mean. The positive or negative tail bias depends upon the value of the exponent parameter and the severity of the weighting depends upon the absolute value of the exponent parameter.
For an exponent parameter of value e, the statistic is computed using a ratio of powers for each sample member x, as shown below. (Note: The symbol ^ denotes raising a number to a power, as in 2^3 = 8):
Statistic = Sum( x^(e+1)/x^e ).
Thus
e=0 gives the arithmetic mean.
e<0 gives lower weight to positive outliers.
e>0 gives lower weight to negative outliers.
Suppose a CImageSet named S exists. The following script combines the images by the ContraMean method after normalizing their luminance by the median statistic computed inside the central 10% of the image:
|
-- create a CImCombine object |
|
-- central 10% of the image |
|
-- specify CImage and CRect to measure |
|
-- use the median as the normalization statistic |
|
-- scale to normalize the image set |
|
-- exponent reduces the weight of negative outliers |
|
-- combine the image set and return a new image |
|
-- show the new image |
|
-- when done with S, remove it from memory |
Mira Pro x64 Script User's Guide, Copyright Ⓒ 2023 Mirametrics,
Inc. All Rights Reserved.