stats (replaces TStats)
The stats function computes the mean, standard deviation, and other basic statistics for numeric data and returns them in an indexed table. The parameters may be a CImage, CMatrix, or CArray object, a 1-dimensional array, or a list of numbers. The parameters must contain numbers or strings that can be converted to numbers.
This function returns an array of values like [1]=value, whereas statstr returns a table with ["name"]=value pairs.
tbl = stats( CImage )
tbl = stats( CImage, CRect )
tbl = stats( CMatrix )
tbl = stats( CArray )
tbl = stats( table )
tbl = stats( num1, num2, num3, ... )
The
returned value tbl is an indexed table
containing the following 8 values:
tbl[1] is
the mean value returned in table index 1.
tbl[2] is the median value returned
in table index 2.
tbl[3] is
the standard deviation returned in table index 3.
tbl[4] is the minimum value returned
in table index 4.
tbl[5] is the maximum value returned
in table index 5.
tbl[6] is the statistical skewness
returned in table index 6.
tbl[7] is the statistical kurtosis
returned in table index 7.
tbl[8] is the number of values in the
sample returned in table index 8.
On
success, tbl is returned.
On
failure, nil is
returned.
Suppose a CImage I exists. The following script returns the mean and standard deviation of 600 pixels in the corner of the image:
|
-- computes values inside the CRect |
|
-- list the result |
Mira Pro x64 Script User's Guide, v.8.77 Copyright Ⓒ 2024
Mirametrics, Inc. All Rights Reserved.