CStats:MinPix
The MinPix method returns the pixel coordinate of the minimum value inside a rectangular region of the image. The rectangle and image must have been previously initialized for the CStats object.
x, y = CStats:MinPix() |
x, y are the pixel coordinates of the minimum value, relative to 1,1.
On success, returns x, y coordinates as non-zero.
On failure, returns 0,0.
Suppose a CImage I and a CRect R exist. The following script fragment returns the location of the minimum value inside a rectangle:
S = CStats:new() |
-- create a CStats object |
S:Init( I, R ) |
-- specify CImage and CRect to measure |
x, y = S:MinPix() |
-- get the column and row of the minimum value |
Printf("Min at %d,&d\n", x, y ) |
-- list the result |
S:delete() |
-- when done with S, remove it from memory |