CImage:PixGELE CImage:Val

CImage:PixGE


The PixGE method returns the coordinates of the first pixel with value greater than or equal to a target value.

Syntax

x, y = CImage:PixGE( CRect, value )

Remarks

Using a rectangle to limit its search, this method locates the first pixel with value at or above a threshold. The search is performed in a row-wise fashion, examining each pixel value along a row before advancing to the next row. The first pixel meeting the criterion stops the search. The related PixGELE method finds a pixel value above or below two thresholds.

Example

The following script fragment opens an image from the file at sPath, then searches for the first pixel with value>=1000. The search is limited to columns 100:200 and rows 250:350:

I = CImage:new()

-- Create a CImage

I:Open( sPath )

-- Open the image from sPath.

R = CRect:new()

-- create a rectangle

R:Set(100,200,250,350)

-- columns 100:200, rows 250:350

x, y, bOK = I:PixGE(R,1000)

-- Find the first pixel value >= 1000

I:delete()

-- delete the CImage from memory

R:delete()

-- delete the CRect from memory

Related Topics

CImage, PixGELE