CImCombine:YpMean
The YpMean method merges the pixel values using the mean statistic at each location.
CImage = CImCombine:YpMean( CImageSet, power ) |
CImageSet contains the collection of images to be combined.
power is the exponent applied to the pixel value weights.
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 power-weighted mean of values at the same location in all the images of the CImageSet. This method 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 positive values or less weight to negative values, and the severity of the weighting scheme may be adjusted. 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 valuey, the statistic is computed by summing each sample member xraised to the power yas shown below. (Note: The symbol ^ denotes raising a number to a power, as in2^3 = 8):
Total = Sum(x^y)
The resulting mean value is then re-scaled as
Statistic = Total^(1/y) . Thus
p=0 gives the arithmetic mean.
p<0 gives lower weight to positive outliers.
p>0 gives lower weight to negative outliers.
Suppose a CImageSet named S exists. The following script combines the images by the YpMean 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 statistic |
|
-- scale to normalize the image set |
|
-- give lower weight to negative outliers |
|
-- combine image set and return new image |
|
-- show the new image |
|
-- when done with S, remove from memory |
Mira Pro x64 Script User's Guide, Copyright Ⓒ 2023 Mirametrics,
Inc. All Rights Reserved.