CImage:PixGELE
The PixGELE method returns the coordinates of the first pixel having a value outside the range between an upper and lower limit.
x, y = CImage:PixGELE( CRect, highValue, lowValue ) |
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.
The following script fragment 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:
|
-- Create a CImage |
|
-- Open the image from sPath. |
|
-- create a rectangle |
|
-- columns 100:200, rows 250:350 |
|
-- Find the first pixel value >= 100 or <= -100 |
|
-- delete the CImage from memory |
|
-- delete the CRect from memory |