Difference between revisions of "Function:Sum"
From CUVI Wiki
| (6 intermediate revisions by 2 users 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: | |style="font-size:100%;"| | ||
<syntaxhighlight lang="cpp"> | <syntaxhighlight lang="cpp"> | ||
CuviStatus sum(CuviImage | CuviStatus sum(const CuviImage& src, | ||
Cuvi64f* sum, | Cuvi64f* sum, | ||
CuviStream | const CuviStream& stream = CuviStream()); | ||
</syntaxhighlight> | </syntaxhighlight> | ||
|} | |} | ||
===Parameters=== | ===Parameters=== | ||
{| | |||
|style="font-size:75%;"| | |||
{|class="wikitable" | {|class="wikitable" | ||
|- | |- | ||
| Line 18: | Line 20: | ||
! Description | ! Description | ||
|- | |- | ||
| | | src | ||
| CuviImage | | const CuviImage& | ||
| Input Image | | Input Image | ||
|- | |- | ||
| Line 27: | Line 29: | ||
|- | |- | ||
| stream | | stream | ||
| 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: | |style="font-size:100%;"| | ||
<syntaxhighlight lang="cpp"> | <syntaxhighlight lang="cpp"> | ||
CuviImage | CuviImage gimg = cuvi::io::loadImage(path); | ||
Cuvi64f* sum = new Cuvi64f[gimg.channels()]; | |||
gimg | |||
//Sum of all pixel values | //Sum of all pixel values | ||
cuvi:: | cuvi::imageStatistics::sum(gimg, sum); | ||
</syntaxhighlight> | </syntaxhighlight> | ||
|} | |} | ||
Latest revision as of 10:34, 19 October 2022
Computes the sum of all pixel values in the image
Function
|
Parameters
|
Image Type Support
|
Sample
Example
|