Specifications
Histogram, Threshold, and Compare Functions
10-15
10
Equal
Tests if the pixel values of the
first image are equal to those of
the second image.
IPLStatus iplEqual (IplImage*
img1, IplImage* img2
,
IplImage*
dst
);
img1, img2
The source images.
dst
The resultant 1-bit image.
Discussion
The function iplEqual() compares the corresponding pixels of two input
images for equality and writes the results to a 1-bit image
dst
. If a pixel’s
value in
img1
is equal to that pixel’s value in
img2
, then the corresponding
pixel in
dst
is set to 1; otherwise the pixel in
dst
is set to 0.
The images
img1
and
img2
must have the same bit depth, origin, and COI
settings. If the COI is not set, an
img1
pixel is considered to be equal to an
img2
pixel only if each channel in the
img1
pixel is equal to that channel in
the
img2
pixel. If the COI is set, the function compares only the COI
values.
The function returns
IPL_StsOK if the compare operation is successful.
If you pass incompatible
img1
and
img2
or a null pointer, the function does
not perform the compare operation and returns an error status code.