Horus Doc || Global Function Guide || General documentation   | Function documentation  

HxGreaterThan

Synopsis

HxImageRep HxGreaterThan(HxImageRep im1, HxImageRep im2)

Input

HxImageRep im1
The first input image.

HxImageRep im2
The second input image.

Return value

HxImageRep
The result of comparing whether the first input image is greater than the second input input, pixelwise. When a pixel from the first input image is greater than the corresponding pixel of the second input image, the value of the corresponding pixel in the result is 1, otherwise it is 0.

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

Valid input images
This function is only properly defined for scalar input images with equal sizes and equal dimensionality.

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;
}

exampleImage1.gif

First input image for the HxGreaterThan example.

exampleImage2.gif

Second input image for the HxGreaterThan example.

HxGreaterThanResult1.gif

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,


Generated on Mon Jan 27 15:45:00 2003 for GlobalFunctionGuide by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001