Difference between revisions of "Function:Max"

From CUVI Wiki
Line 5: Line 5:
|style="font-size:150%;"|
|style="font-size:150%;"|
<syntaxhighlight lang="cpp">
<syntaxhighlight lang="cpp">
CuviStatus max(CuviImage* image,
CuviStatus max(const CuviImage& src,
               Cuvi64f* maxValue,
               Cuvi64f* maxValue,
               CuviStream* stream = NULL);
               const CuviStream& stream = CuviStream());


</syntaxhighlight>
</syntaxhighlight>
Line 19: Line 19:
! Description
! Description
|-
|-
| image
| src
| CuviImage*
| const CuviImage&
| Input Image
| Input Image
|-
|-
Line 28: Line 28:
|-
|-
| stream  
| stream  
| CuviStream*
| const CuviStream&
| GPU stream ID for execution
| GPU stream ID for execution


Line 60: Line 60:




CuviImage* gimg = new CuviImage(size, depth, nChannels);
CuviImage gimg = cuvi::io::loadImage(path);


Cuvi64f* max = new Cuvi64f[nChannels];
Cuvi64f* max = new Cuvi64f[gimg.channels()];
 
//Upload input data
gimg->upload(hostImg->imageData, hostImg->widthStep);




//Returns maximum pixel value
//Returns maximum pixel value
cuvi::arithmeticLogical::max(gimg, max);
cuvi::imageStatistics::max(gimg, max);


</syntaxhighlight>
</syntaxhighlight>
|}
|}

Revision as of 05:29, 19 April 2013

Computes the maximum of image pixel values

Function

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

Parameters

Name Type Description
src const CuviImage& Input Image
maxValue Cuvi64f* Maximum pixel value in the image
stream const CuviStream& GPU stream ID for execution

Image Type Support

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

Sample

Max.PNG


Example

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

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


//Returns maximum pixel value	
cuvi::imageStatistics::max(gimg, max);