Function:MinMax

From CUVI Wiki
Jump to: navigation, search

Computes the minimum and maximum pixel values in the image

Function

CuviStatus minMax(const CuviImage& src,
                  CuviScalar& minValue,
                  CuviScalar& maxValue,
                  const CuviStream& stream = CuviStream());

Parameters

Name Type Description
src const CuviImage& Input Image
minValue CuviScalar& Minimum pixel value(s) in the image
maxValue CuviScalar& Maximum pixel value(s) in the image
stream const CuviStream& GPU stream ID for execution

Image Type Support

Input Output
8uC1 2 x CuviScalar
8uC3 2 x CuviScalar
16uC1 2 x CuviScalar
16uC3 2 x CuviScalar
32fC1 2 x CuviScalar
32fC3 2 x CuviScalar

Sample

Minmax.PNG


Example

CuviImage gimg = cuvi::io::loadImage(path);
 
CuviScalar min, max;
 
//Returns minimum and maximum pixel value(s)	
cuvi::imageStatistics::minMax(gimg, min, max);