CImCombine:YpMean


The YpMean method merges the pixel values using the mean statistic at each location.

Syntax

CImage = CImCombine:YpMean( CImageSet, power )

where

    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 failure, nil is returned.

  

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.

Example

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:

C = CImCombine:new()

-- create a CImCombine object

R = NewRect(10,50,10,50)

-- central 10% of the image

C:SetRelRect( R )

-- specify CImage and CRect to measure

C:SetNormStat("median")

-- use the median as the statistic

C:SetNormMethod("scale")

-- scale to normalize the image set

power = 0.5

-- give lower weight to negative outliers

I = C:YpMean(S,power)

-- combine image set and return new image

I:Display()

-- show the new image

Related Topics

CImCombine class

CImageSet class

CImage class

CRect class