Specifications

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