Difference between revisions of "Function:Max"

From CUVI Wiki
Line 69: Line 69:


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


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

Revision as of 18:23, 8 May 2012

Computes the maximum of image pixel values

Function

CuviStatus max(CuviImage* image,
               Cuvi64f* maxValue,
               CuviStream* stream = NULL);

Parameters

Name Type Description
image CuviImage* Input Image
maxValue Cuvi64f* Maximum pixel value in the image
stream 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 = new CuviImage(size, depth, nChannels);

Cuvi64f* max = new Cuvi64f[nChannels];

//Upload input data
gimg->upload(hostImg->imageData, hostImg->widthStep);


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