CStats:SdevValue


The Sdev method computes the standard deviation inside a rectangular region relative to a specified mean value.

Syntax

nSdev = CStats:SdevValue( CImage, nMeanValue, CRect )

nSdev = CStats:SdevValue( CImage, nMeanValue )

nSdev = CStats:SdevValue( table, nMeanValue )

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

bullet.gif    table is a 1-dimensional array containing numbers.

bullet.gif    On success, returns the standard deviation1.

bullet.gif    On failure, returns 0.

Example

Suppose a CImage I and a CRect R exist. The following script returns the standard deviation relative to the simple arithmetic mean value inside a rectangle on the image. The following script returns the standard deviation relative to a specified mean value inside a rectangle on the image:

S = new_stats()

-- create a CStats object

-- specify CImage and CRect

 

nSdev = S:SdevValue( I, nMeanValue, R )

-- return the standard deviation relative to nMean

Printf("Sdev=%lg\n", nSdev)

-- list the results

S:delete()

-- when done with S, remove it from memory

Related Topics

CStats class, CImage class, CRect class


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