Synopsis
HxImageRep HxMul(HxImageRep im1, HxImageRep im2)
Input
HxImageRep im1
HxImageRep im2
Return value
HxImageRep
Description
The function HxMul multiplies two images on a pixel-by-pixel basis. Vector pixel types of the same dimension are multiplied component wise. Pixel types of different dimensions can be multiplied, as long as the pixel dimensionality of one of the input images is 1. The image with pixel dimensionality 1 is then treated as an image with the same pixel dimensionality as the other image (with equal values per pixel).
Remarks
Examples
Multiplying two images
#include "HxImageRepGlobalFuncs.h" #include "HxImageRep.h" HxImageRep HxMulExample1(HxImageRep im1, HxImageRep im2) { im1 = HxImageAsDouble(im1); im2 = HxImageAsDouble(im2); im1 = HxMul(im1, im2); im1 = HxContrastStretch(im1, 255.0); im1 = HxImageAsByte(im1); return im1; } int main(int argc, char* argv[]) { HxImageRep im1 = HxMakeFromFile(argv[1]); HxImageRep im2 = HxMakeFromFile(argv[2]); im1 = HxMulExample1(im1, im2); HxWriteFile(im1, argv[3]); return 0; }
First input image for the HxMul example.
First input image for the HxMul example.
Output image of the HxMul example.
In this example we multiply two (scalar) images. After multiplying the images, we stretch the result for visualization purposes.
See also
Keywords
Binary, Arithmetic,