CStats:MaxPix
The MaxPix method returns the pixel coordinates of the maximum value for a data object.
x, y = CStats:MaxPix( CImage, CRect ) x, y = CStats:MaxPix( CImage ) x, y = CStats:MaxPix( table ) |
CRect is a bounding rectangle for the CImage object.
table is a 1-dimensional array containing numbers.
x and y are the pixel coordinates of the maximum value, relative to 1,1.
On success, returns x and y coordinates as non-zero.
On failure, returns 0,0.
Suppose a CImage named I and a CRect named R exist. The following script returns the location of the maximum value inside a rectangle:
|
-- create a CStats object |
|
-- specify CImage and CRect to measure |
|
-- get the column and row of the maximum value |
|
-- list the result |
|
-- when done with S, remove it from memory |
CStats class, Max, MinPix, CImage class, CRect class
Mira Pro x64 Script User's Guide, Copyright Ⓒ 2023 Mirametrics,
Inc. All Rights Reserved.