CImCombine:WeightedMean
The WeightedMean method combines the images by a weighted mean using an array of weight values.
CImage = CImCombine:WeightedMean( CImageSet, CArray ) where |
CImageSet contains the collection of images to be combined.
CArray is an array of weight values.
CImage is a new image created by this method. On failure, nil is returned.
Each pixel in the output image is the mean value of all images using an array of weight values. The weights are defined in a CArray. The weights are used as specified and are not normalized. For example, of the CArray has 4 elements with values 1.0, then the Weighted mean gives the same result as the Sum of 4 images. Conversely, if the weights are normalized, with values 0.25, then the result is the same as with the Mean method.
Suppose a CImageSet named S exists. The following script combines the images by the WeightedMean method after the weights are setup in the CArray A. The images are not normalized in this example:
|
-- create a CImCombine object |
|
-- initialize weights to 0.2, 0.2, 0.2, 0.2 |
|
-- make the weight of image 4 equal to 0.4 |
|
-- combine image set and return new image |
|
-- show the new image |
|
-- when object C if no longer needed |
|
-- delete object A if no longer needed |