Function:Mean

From CUVI Wiki
Revision as of 15:17, 8 May 2012 by Jawad (talk | contribs) (Created page with "__NOTOC__ Computes the mean of image pixel values ===Function=== {| |style="font-size:150%;"| <syntaxhighlight lang="cpp"> CuviStatus mean(CuviImage* image, Cu...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Computes the mean of image pixel values

Function

CuviStatus mean(CuviImage* image,
                Cuvi64f* mean,
                CuviStream* stream = NULL);

Parameters

Name Type Description
image CuviImage* Input Image
mean Cuvi64f* Mean of all pixel values in the image
stream CuviStream* GPU stream ID for execution

Image Type Support

Input Output
8uC1 Cuvi64f single value
8uC3 Cuvi64f three values

Sample

File:Mean.PNG


Example

CuviImage* gimg = new CuviImage(size, depth, nChannels);

Cuvi64f* mean= -1;

//Upload input data
gimg->upload(hostImg->imageData, hostImg->widthStep);


//Returns mean of all pixel values in the image	
cuvi::arithmeticLogical::mean(gimg, &mean);