CStats:StatsStr
The StatsStr method computes the mean, standard deviation, and other basic statistics for numeric data and returns them in a keyed table with each statistic being the key name.
tbl = CStats:StatsStr( CImage, CRect )
tbl = CStats:StatsStr( CImage )
tbl = CStats:StatsStr( CArray )
tbl = CStats:StatsStr( table )
CRect is a bounding rectangle for the CImage object.
CArray is a CArray object.
tbl is a 1-dimensional table containing keyed values.
The returned value tbl is a keyed table containing 8 named members:
nMean is the mean value.
nMedian is the median value.
nSdev is the standard deviation.
nMin is the minimum value.
nMax is the maximum value.
nSkewness is the statistical skewness.
nKurtosis is the statistical kurtosis.
nCount is the number of values in the sample.
On success, tbl is returned.
On failure, returns nil.
Suppose a CImage I exists. The following script returns the mean and standard deviation of 600 pixels in the corner of the image:
|
-- create a CStats object |
|
-- computes values inside the CRect |
|
-- list the result |
|
-- when done with S, delete it |
CStats class, Stats, CImage class, CRect class, stats function
Mira Pro x64 Script User's Guide, Copyright Ⓒ 2023 Mirametrics,
Inc. All Rights Reserved.