CStats:MinPix
The MinPix method returns the integral position of the minimum value in a data sample. The sample may be a Lua table or a class object of type CImage, CArray, or CMatrix. For CImage and CMatrix objects, an optional CRect object can be used to define the points used in the calculation. If the sample is a CImage, the position is a pixel location considered in 1 dimension.
nPix = CStats:MinPix( table ) nPix = CStats:MinPix( CImage, ) nPix = CStats:MinPix( CImage, CRect ) nPix = CStats:MinPix( CArray ) nPix = CStats:MinPix( CArray, CRect ) nPix = CStats:MinPix( CMatrix ) where |
table is a lua table containing the data.
CImage, CArray, and CMatrix are class objects containing the data to measure,
CRect is a CRect rectangle object that defines the region to sample.
nPix is the array position of the data member having the minimum value, starting at position 1. On failure, 0,0 is returned.
Suppose that a CImage I and a CRect R exist. The following script returns the position of the minimum value inside a rectangle:
|
-- create a CStats object |
|
-- get the column and row of the minimum value |
|
-- list the result |