Function:Multiply

From CUVI Wiki

Multiplies two images

Function

CuviStatus multiply(CuviImage* srcImage1,
                    CuviImage* srcImage2,
                    CuviImage* dstImage,
                    CuviStream* stream =  NULL);

Parameters

Name Type Description
srcImage1 CuviImage* First Input Image
srcImage2 CuviImage* Second Input Image
dstImage CuviImage* Resultant Image
stream CuviStream* GPU stream ID for execution

Image Type Support

Input 1 Input 2 Output
8u 8u 8u
8u 8u 16u
16u 16u 16u
32f 32f 32f

Sample

Error creating thumbnail: Unable to save thumbnail to destination
First Input Image (8-bit)
Error creating thumbnail: Unable to save thumbnail to destination
Second Input Image (8-bit)
Error creating thumbnail: Unable to save thumbnail to destination
Resultant Image (16-bit)

Example

CuviImage* gimg1 = new CuviImage(size,depth,nChannels);
CuviImage* gimg2 = new CuviImage(size,depth,nChannels);
CuviImage* gout = new CuviImage(size,depth2,nChannels);

//Upload input data
gimg1->upload(img1->imageData,img1->widthStep);
gimg2->upload(img2->imageData,img2->widthStep);

//Add	
cuvi::arithmeticLogical::multiply(gimg1,gimg2,gout);