Synopsis
HxImageRep HxLessThan(HxImageRep im1, HxImageRep im2)
Input
HxImageRep im1
HxImageRep im2
Return value
HxImageRep
Description
The function HxLessThan compares the corresponding pixels from the input images, which must be scalar. If the value of the pixel of the first input image is less than the value of the pixel of the second input pixel, the corresponding pixel in the result image will be 1, otherwise it will be 0.
The dimensions of the input images must equal, but the pixel types can be anything, as long as they are scalar. The resulting images is an image with the same dimensions as the input images, with integer pixel values.
Remarks
Examples
Example of using HxLessThan
#include "HxImageRepGlobalFuncs.h" #include "HxImageRep.h" HxImageRep HxLessThanExample1(HxImageRep im1, HxImageRep im2) { im1 = HxLessThan(im1, im2); im1 = HxContrastStretch(im1, 255); return im1; } int main(int argc, char* argv[]) { HxImageRep im1 = HxMakeFromFile(argv[1]); HxImageRep im2 = HxMakeFromFile(argv[2]); im1 = HxLessThanExample1(im1, im2); HxWriteFile(im1, argv[3]); return 0; }
First input image for the HxLessThan example.
Second input image for the HxLessThan example.
Output image of the HxLessThan example.
In the example code we use HxLessThan to compare the two input images. The contrast stretch is used for visualization purposes.
See also
HxLessEqual, HxGreaterThan, HxGreaterEqual, HxEqual, HxLessThanVal,
Keywords
Comparison, Binary,