Function:MaxFilter

From CUVI Wiki
Jump to: navigation, search

Filters an image using a max filter and default Anchor Position

Function

CuviStatus maxFilter(const CuviImage& src,
                     CuviImage& dst,
                     const CuviRect& roi,
                     const CuviSize& filterSize,
                     const CuviStream& stream = CuviStream());

Parameters

Name Type Description
src const CuviImage& Input Image
dst CuviImage& Output Image
roi const CuviRect& Region of Interest
filterSize const CuviSize& Max filter's kernel size
stream const CuviStream& GPU stream ID for execution

Image Type Support

Input Output
8uC1 8uC1
8uC3 8uC3
16uC1 16uC1
16uC3 16uC3


Sample

Input
Max 5x5


Example

//Input image
CuviImage gimg = cuvi::io::loadImage(path);
 
//Output Image
CuviImage gout;
 
//Choosing ROI
CuviRect roi(0,0,img.width(),img.height());
 
//Filter Size
CuviSize fSize(5,5);
 
//Applying Max filter of size 5x5 on the image
cuvi::imageFiltering::maxFilter(gimg, gout, roi, fSize);