statstr
The stats function computes the mean, standard deviation, and other basic statistics for numeric data and returns them in a 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 ["name"]=value pairs, whereas stats returns an indexed array, like [1]=value.
tbl = statstr( CImage )
tbl = statstr( CImage, CRect )
tbl = statstr( CMatrix )
tbl = statstr( CArray )
tbl = statstr( table )
tbl = statstr( num1, num2, num3, ... )
The
returned value tbl contains the
following 8 values:
tbl["mean"] is the mean value.
tbl["median"] is the median
value.
tbl["sdev"] is the standard deviation.
tbl["min"] is the minimum value.
tbl["max"] is the maximum value.
tbl["skewness"] is the statistical
skewness.
tbl["kurtosis"] is the statistical
kurtosis.
tbl["count"] is the number of values
in the sample.
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 |
The next script calculates basic statistics for a series of 4 numbers:
|
-- compute stats for 4 numbers |
|
--mean = 3.0 +/- 1.29099 |
Mira Pro x64 Script User's Guide, v.8.77 Copyright Ⓒ 2024
Mirametrics, Inc. All Rights Reserved.