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

HxLessThan

Synopsis

HxImageRep HxLessThan(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 less than the second input input, pixelwise. When a pixel from the first input image is less 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 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

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

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

exampleImage1.gif

First input image for the HxLessThan example.

exampleImage2.gif

Second input image for the HxLessThan example.

HxLessThanResult1.gif

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,


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