Synopsis
HxImageRep HxAnd(HxImageRep im1, HxImageRep im2)
Input
HxImageRep im1
HxImageRep im2
Return value
HxImageRep
Description
The function HxAnd takes the logical `and' of corresponding pixels in the two images. The `and' of two vectors is taken component wise.
Remarks
Examples
Taking the logical `and'
#include "HxImageRepGlobalFuncs.h" #include "HxImageRep.h" HxImageRep HxAndExample1(HxImageRep im1, HxImageRep im2) { im1 = HxImageAsDouble(im1); im2 = HxImageAsDouble(im2); im1 = HxContrastStretch(im1, 1.0); im2 = HxContrastStretch(im2, 1.0); im1 = HxImageAsByte(im1); im2 = HxImageAsByte(im2); im1 = HxAnd(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 = HxAndExample1(im1, im2); HxWriteFile(im1, argv[3]); return 0; }
First input image for the HxAnd example.
Second input image for the HxAnd example.
Output image of the HxAnd example.
In this example we take the logical `and' of the two input images. We first convert them to binary format after which the logical `and' is taken.
See also
Keywords
Binary, Logical,