Difference between revisions of "Function:CalcHist"

From CUVI Wiki
(Created page with "__NOTOC__ Computes the histogram of input image. ===Function=== {| |style="font-size:150%;"| <syntaxhighlight lang="cpp"> CuviStatus calcHist(const CuviImage& src, ...")
 
 
(4 intermediate revisions by the same user not shown)
Line 3: Line 3:
===Function===
===Function===
{|
{|
|style="font-size:150%;"|
|style="font-size:100%;"|
<syntaxhighlight lang="cpp">
<syntaxhighlight lang="cpp">


Line 12: Line 12:
</syntaxhighlight>
</syntaxhighlight>
|}
|}
===Parameters===
===Parameters===
 
{|
|style="font-size:75%;"|
{|class="wikitable"
{|class="wikitable"
|-
|-
Line 31: Line 33:
| 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 47: Line 50:
| CuviHistogram
| CuviHistogram
|}
|}
 
|}
===Sample===
 
 


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



Latest revision as of 10:24, 19 October 2022

Computes the histogram of input image.

Function

CuviStatus calcHist(const CuviImage& src, 
                    CuviHistogram& hist, 
                    const CuviStream& stream = CuviStream());

Parameters

Name Type Description
src const CuviImage& Input Image
hist CuviHistogram& Computed histogram of input image
stream const CuviStream& GPU stream ID for execution

Image Type Support

Input Output
8uC1 CuviHistogram
8uC3 CuviHistogram

Example

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

//Create histogram according to image type
CuviHistogram hist(input.type());

//Calculate the histogram
cuvi::imageStatistics::calcHist(input, hist);