Function:Mean

From CUVI Wiki
Jump to: navigation, search

Computes the mean of image pixel values. Each channel is processed individually.

Function

CuviStatus mean(const CuviImage& src,
                CuviScalar& mean,
                const CuviStream& stream = CuviStream());

Parameters

Name Type Description
src const CuviImage& Input Image
mean CuviScalar& Mean of all pixel values in the image
stream const CuviStream& GPU stream ID for execution

Image Type Support

Input Output
8uC1 CuviScalar
8uC3 CuviScalar
16uC1 CuviScalar
16uC3 CuviScalar
32fC1 CuviScalar
32fC3 CuviScalar

Sample

Mean2.PNG


Example

CuviImage gimg = cuvi::io::loadImage(path);
 
CuviScalar mean;
 
 
//Returns mean of all pixel values in the image	
cuvi::imageStatistics::mean(gimg, mean);