Specifications

Histogram, Threshold, and Compare Functions
10-19
10
LessS
Tests if the image’s pixel values
are less than an integer scalar
value.
IPLStatus iplLessS (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 iplLessS() compares the pixels of the input image
src
and
a scalar value
s
for “less than” and writes the results to a 1-bit image
dst
.
If a pixel’s value is less 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
iplLessSFP()
described on the next page.) If the source image COI is not set, a pixel is
considered to be “less” than
s
only if each channel in the pixel is less 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.