Function:MinFilter

From CUVI Wiki
Jump to: navigation, search

Filters an image using a min filter and default Anchor Position

Function

CuviStatus minFilter(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& Min 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
Min 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 Min filter of size 5x5 on the image
cuvi::imageFiltering::minFilter(gimg, gout, roi, fSize);