CStats:Max and CStats:MaxXy
The Max method computes the maximum value of a 1-dimensional array, CImage, or list of numbers. The array and list parameters must contain a mixture of numbers and strings that can be converted to numbers. This function is similar to the CStat:Mean method but does not require calling new_stats() beforehand to create a CStats object.
nMaxValue = CStats:Max( CImage, CRect ) nMaxValue = CStats:Max( CImage ) nMaxValue = CStats:Max( table ) nMaxValue = CStats:Max( n1, n2, n3, ... ) nMaxValue, nX, nY = CStats:MaxXy( CImage, CRect ) nMaxValue, nX, nY = CStats:MaxXy( CImage ) nMaxValue, nX, nY = CStats:MaxXy( table ) nMaxValue, nX, nY = CStats:MaxXy( n1, n2, n3, ... ) |
CRect is a bounding rectangle for the CImage object.
table is a 1-dimensional array containing numbers.
n1, n2, n3, ... are numbers or string values that can be converted to numbers.
On success, the maximum value and the x and y coordinates of the maximum value are returned.
On failure, returns 0, 0, 0.
Suppose a CImage named I and a CRect named R exist. The following script returns the maximum value inside a rectangle on the image:
|
-- create a CStats object |
-- specify CImage and CRect to measure |
|
|
-- returns the maximum value |
|
-- list the result |
|
-- when done with S, remove it from memory |
CStats class, MaxPix, Min, CImage class, CRect class
Mira Pro x64 Script User's Guide, Copyright Ⓒ 2024 Mirametrics,
Inc. All Rights Reserved.