Synopsis
HxImageRep HxGreaterThan(HxImageRep im1, HxImageRep im2)
Input
HxImageRep im1
HxImageRep im2
Return value
HxImageRep
Description
The function HxGreaterThan compares the corresponding pixels from the input images, which must be scalar. If the value of the pixel of the first input image is greater 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 HxGreaterThan
#include "HxImageRepGlobalFuncs.h" #include "HxImageRep.h" HxImageRep HxGreaterThanExample1(HxImageRep im1, HxImageRep im2) { im1 = HxGreaterThan(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 = HxGreaterThanExample1(im1, im2); HxWriteFile(im1, argv[3]); return 0; }
First input image for the HxGreaterThan example.
Second input image for the HxGreaterThan example.
Output image of the HxGreaterThan example.
In the example code we use HxGreaterThan
to compare the two input images. The contrast stretch is used for visualization purposes.
See also
HxGreaterEqual, HxLessThan, HxLessEqual, HxEqual, HxGreaterThanVal,
Keywords
Comparison, Binary,