CStats:MaxPix CStats:MinPix

CStats:Min


The Min method computes the minimum value inside a rectangular region of the image. The rectangle and image must have been previously initialized for the CStats object.

Syntax

nMinValue = CStats:Min()

    On success, returns the minimum value as a number.

    On failure, returns 0.

Example

Suppose a CImage named I and a CRect named R exist. The following script fragment returns the minimum value inside a rectangle on the image:

 

S = CStats:new()

-- create a CStats object

S:Init( I, R )

-- specify CImage and CRect to be measured

nVal = S:Min()

-- returns the minimum value

Printf("Min=%lg\n", nVal)

-- list the result

S:delete()

-- when done with S, remove it from memory

Related Topics

CStats, MinPix, Max, CImage, CRect