Function:MaxFilter

From CUVI Wiki
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

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

Error creating thumbnail: Unable to save thumbnail to destination
Input
Error creating thumbnail: Unable to save thumbnail to destination
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);