CImage:CreatePixelMaskLow
The CreatePixelMaskLow method creates a pixel mask file containing the coordinates of pixels having values below a threshold value.
bSuccess = CImage:CreatePixelMaskLow( sMask, vLow ) bSuccess = CImage:CreatePixelMaskLow( sMask, vLow, CRect ) where |
sMask is the name of the text file where the pixel mask will be saved.
vLow is the low threshold value.
CRect is the target rectangle; if nil, then the entire image is searched.
bSuccess is the returned success code. On success it is true, otherwise false.
This method produces a text file consisting of pixel coordinate pairs, one per line, in the form column, row. This format is described in the topic Pixel Mask File.
The following script makes a pixel mask containing the coordinates of pixel values below -32000. The entire image is sampled because the CRect R is not specified:
|
-- Create a CImage |
|
-- Open the image from sPath. |
|
-- create the pixel mask |