CImage:PixGELE


The PixGELE method returns the coordinates of the first pixel having a value outside the range between an upper and lower limit.

Syntax

x, y = CImage:PixGELE( CRect, highValue, lowValue )

bullet.gif    The region is specified by a CRect. having 1-based coordinates.

bullet.gif    highValue is the high target value, specified by a number or string.

bullet.gif    lowValue is the low target value, specified by a number or string.

bullet.gif    x,y are the returned pixel coordinates of the pixel.

bullet.gif    On success, this method returns x,y,true.

bullet.gif    On failure, 0,0,false is returned.

Remarks

Using a rectangle to limit its search, this method locates the first pixel with value at or above an upper threshold or at or below a lower 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 with value at or beyond the limits stops the search. The related PixGE method finds a pixel value using only the >= criterion.

Example

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

I = new_image()

-- Create a CImage

I:Open( sPath )

-- Open the image from sPath.

R = new_rect()

-- create a rectangle

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

-- columns 100:200, rows 250:350

x, y, bOK = I:PixGELE(R,100,-100)

-- Find the first pixel value >= 100 or <= -100

I:delete()

-- delete the CImage from memory

R:delete()

-- delete the CRect from memory

Related Topics

CImage class, PixGE


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