CStats:GeometricMean and CStats:GeometricMeanSdev


The GeometricMean method computes the geometric mean value that assigns lower weight to deviant pixels. The name GeoMean is an alias for this method.

Syntax

nMean = CStats:GeometricMean( CImage, CRect )

nMean = CStats:GeometricMean( CImage )

nMean = CStats:GeometricMean( table )

nMean, nSdev = CStats:GeometricMeanSdev( CImage, CRect )

nMean, nSdev = CStats:GeometricMeanSdev( CImage )

nMean, nSdev = CStats:GeometricMeanSdev( table )

bullet.gif    The CRect is a bounding rectangle for the CImage object.

bullet.gif    table must be a 1-dimensional array containing numbers.

bullet.gif    On success, returns the geometric mean value and standard deviation.

bullet.gif    On failure, returns 0, 0.

Remarks

This method calculates the mean value based on the geometric mean of the sample pixels. This results in pixels being assigned weight that is inversely proportional to their value-distance from the mean. No rejection ("clipping") is performed.

Example

Suppose a CImage named I and a CRect named R exist. The following script returns the geometric mean value inside a rectangle on the image:

S = new_stats()

-- create a CStats object

-- specify CImage and CRect to measure

 

nVal = S:GeometricMean(I, R)

-- return the geometric mean value

Printf("mean=%lg\n", nVal)

-- list the result

S:delete()

-- when done with S, remove it from memory

Related Topics

CStats class, CImage class, CRect class, Mean, SigmaClipMean , ContraMean , YpMean


Mira Pro x64 Script User's Guide, Copyright Ⓒ 2024 Mirametrics, Inc. All Rights Reserved.