Specifications
Intel
®
Image Processing Library Reference Manual
10-12
10
Comparing Images
This section describes the functions that allow you to compare images.
Each compare function writes its results to a 1-bit output image. The output
pixel is set to 1 if the corresponding input pixel(s) satisfied the compare
condition; otherwise, the output pixel is set to 0. Often, you might wish to
use the compare functions to generate a 1-bit mask image for future use in
other image-processing operations.
Functions whose names have a capital
S (for example, iplGreaterS)
compare the pixels of a single input image and a scalar variable. Functions
whose names don’t have an
S (such as iplGreater) compare the
corresponding pixels in two input images. The two input images must have
the same bit depth, origin, and channel of interest (COI) setting.
When the input pixels have more than one channel and the COI is not set,
the result will be 1 only for those pixels in which each channel satisfies the
compare condition.
For example, in case of
iplGreater (two input images) one RGB pixel is
“greater” than another only if all three channel values of the first pixel are
greater than those of the second. Thus, if at least one of the channel values
in an input pixel is less than or equal to that channel’s value in the other
image, then
iplGreater will set the corresponding output pixel to 0.
Functions that use a single input image work similarly. If you don’t set the
COI, the function compares all channel values to the input scalar value.
Again, the result will be 1 only for those pixels in which each channel
satisfies the required condition. For example, an RGB pixel is considered
to be “equal” to the input scalar value only if all three RGB channels are
equal to that value. If at least one of the channel values is greater or less
than the scalar value, the function
iplEqualS will set the corresponding
output pixel to 0.