Difference between revisions of "Function:Mean"

From CUVI Wiki
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
__NOTOC__
__NOTOC__
Computes the mean of image pixel values. Each channel is processed individually.
Computes the mean of image pixel values. Each channel is processed individually.
===Function===
====Function====
{|
{|
|style="font-size:150%;"|
|style="font-size:100%;"|
<syntaxhighlight lang="cpp">
<syntaxhighlight lang="cpp">
CuviStatus mean(const CuviImage& src,
CuviStatus mean(const CuviImage& src,
Line 11: Line 11:
</syntaxhighlight>
</syntaxhighlight>
|}
|}
===Parameters===


====Parameters====
{|
|style="font-size:75%;"|
{|class="wikitable"
{|class="wikitable"
|-
|-
Line 30: Line 32:
| const CuviStream&
| const CuviStream&
| GPU stream ID for execution
| GPU stream ID for execution
 
|}
|}
|}


===Image Type Support===
====Image Type Support====
 
{|
|style="font-size:75%;"|
{| class="wikitable"
{| class="wikitable"
|-
|-
Line 57: Line 60:
| 32fC3
| 32fC3
| CuviScalar
| CuviScalar
|}
|}
|}


===Sample===
====Sample====
{|
{|
|-
|-
Line 65: Line 69:
|}
|}


 
====Example====
===Example===
{|
{|
|style="font-size:150%;"|
|style="font-size:100%;"|
<syntaxhighlight lang="cpp">
<syntaxhighlight lang="cpp">



Latest revision as of 18:31, 19 October 2022

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

Error creating thumbnail: Unable to save thumbnail to destination

Example

CuviImage gimg = cuvi::io::loadImage(path);

CuviScalar mean;


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