Specifications
Histogram, Threshold, and Compare Functions
10-17
10
GreaterS
Tests if the image’s pixel values
are greater than an integer
scalar value.
IPLStatus iplGreaterS (IplImage*
src
, int
s
,
IplImage*
dst
);
src
Thesourceimage.
s
The integer scalar value to be compared with
pixel values.
dst
The resultant 1-bit image.
Discussion
The function iplGreaterS() compares the pixels of the input image
src
and a scalar value
s
for “greater than” and writes the results to a 1-bit
image
dst
. If a pixel’s value is greater than
s
, then the corresponding pixel
in
dst
is set to 1; otherwise the pixel in
dst
is set to 0.
The function supports all pixel data types except 32-bit floating-point data.
(For images with floating-point data, use the function
iplGreaterSFP()
described on the next page.) If the source image COI is not set, a pixel is
considered to be “greater” than
s
only if each channel in the pixel is greater
than
s
. If the COI is set, the function compares
s
and the pixel values in the
COI.
The function returns
IPL_StsOK if the compare operation is successful.
If you pass an image with data of an unsupported type or a null pointer, the
function does not perform the compare operation and returns an error status
code.