Difference between revisions of "Function:Sum"

From CUVI Wiki
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
__NOTOC__
__NOTOC__
Computes the sum of all pixel values in the image
Computes the sum of all pixel values in the image
===Function===
====Function====
{|
{|
|style="font-size:150%;"|
|style="font-size:100%;"|
<syntaxhighlight lang="cpp">
<syntaxhighlight lang="cpp">
CuviStatus sum(const CuviImage& src,
CuviStatus sum(const CuviImage& src,
Line 10: Line 10:
</syntaxhighlight>
</syntaxhighlight>
|}
|}
===Parameters===
===Parameters===
 
{|
|style="font-size:75%;"|
{|class="wikitable"
{|class="wikitable"
|-
|-
Line 29: Line 31:
| 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 44: Line 47:
| 8uC3
| 8uC3
| Cuvi64f three values
| Cuvi64f three values
|}
|}
|}


===Sample===
====Sample====
{|
{|
|-
|-
Line 52: Line 56:
|}
|}


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



Latest revision as of 18:34, 19 October 2022

Computes the sum of all pixel values in the image

Function

CuviStatus sum(const CuviImage& src,
               Cuvi64f* sum,
               const CuviStream& stream = CuviStream());

Parameters

Name Type Description
src const CuviImage& Input Image
sum Cuvi64f* Sum of all pixel values of the image
stream const CuviStream& GPU stream ID for execution

Image Type Support

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

Sample

Error creating thumbnail: Unable to save thumbnail to destination

Example

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

Cuvi64f* sum = new Cuvi64f[gimg.channels()];


//Sum of all pixel values	
cuvi::imageStatistics::sum(gimg, sum);