CImCombine:WeightedMean
The WeightedMean method combines the images by a weighted mean using a 1-dimensional array of weight values.
CImage = CImCombine:WeightedMean( CImageSet, CArray ) |
CImageSet contains the collection of images to be combined.
CArray is a 1-dimensional array of weight values.
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 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 done with S, remove from memory |
|
-- delete the CArray |
Mira Pro x64 Script User's Guide, Copyright Ⓒ 2023 Mirametrics,
Inc. All Rights Reserved.