Function:Divide

From CUVI Wiki
Revision as of 14:40, 30 April 2012 by Jawad (talk | contribs) (Created page with "__NOTOC__ Divides pixel values of first image by corresponding pixels values from second image ===Function=== {| |style="font-size:150%;"| <syntaxhighlight lang="cpp"> CuviSta...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Divides pixel values of first image by corresponding pixels values from second image

Function

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

Parameters

Name Type Description
srcImage1 CuviImage* Dividend Image
srcImage2 CuviImage* Divisor Image
dstImage CuviImage* Resultant Image
stream CuviStream* GPU stream ID for execution

Image Type Support

Input 1 Input 2 Output
8uC1 8uC1 8uC1
8uC3 8uC3 8uC3
16uC1 16uC1 16uC1
16uC3 16uC3 16uC3
32fC1 32fC1 32fC1
32fC3 32fC3 32fC3


Example

CuviImage* gimg1 = new CuviImage(size,img1->depth,img1->nChannels);
CuviImage* gimg2 = new CuviImage(size,img2->depth,img2->nChannels);
CuviImage* gout = new CuviImage(size,img2->depth,img2->nChannels);

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

//Divide
cuvi::arithmeticLogical::AND(gimg1,gimg2,gout);