CStats:MinPix


The MinPix method returns the pixel coordinates of the minimum value for a data object.

Syntax

x, y = CStats:MinPix( CImage, CRect )

x, y = CStats:MinPix( CImage )

x, y = CStats:MinPix( table )

bullet.gif    CRect is a bounding rectangle for the CImage object.

bullet.gif    table is a 1-dimensional array containing numbers.

bullet.gif    x, y are the pixel coordinates of the minimum value, relative to 1,1.

bullet.gif    On success, returns x, y coordinates as non-zero.

bullet.gif    On failure, returns 0,0.

Example

Suppose a CImage I and a CRect R exist. The following script returns the location of the minimum value inside a rectangle:

S = new_stats()

-- create a CStats object

-- specify CImage and CRect to measure

 

x, y = S:MinPix(I, R)

-- 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

Related Topics

CStats class, Min, MaxPix, CImage class, CRect class


Mira Pro x64 Script User's Guide, Copyright Ⓒ 2024 Mirametrics, Inc. All Rights Reserved.