CImage:PixGE
The PixGE method returns the coordinates of the first pixel with value greater than or equal to a target value.
x, y, bSuccess = CImage:PixGE( CRect, value ) where |
The region is specified by a CRect. having 1-based coordinates.
value is the target value, specified by a number or string.
x,y are the returned pixel coordinates of the pixel.
bSuccess is the returned success code. On success it is true, otherwise false.
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.
The following script 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:
|
-- Create a CImage |
|
-- Open the image from sPath. |
|
-- create a rectangle |
|
-- columns 100:200, rows 250:350 |
|
-- Find the first pixel value >= 1000 |
|
-- delete the CImage from memory |
|
-- delete the CRect from memory |