Function:BorderMask

From CUVI Wiki
Revision as of 17:26, 26 April 2012 by Jawad (talk | contribs) (Created page with "__NOTOC__ Adds borders on the input specified bythe 4 arguments: top, bottom, left and right. By default the masking value is 0 (black). ===Function=== {| |style="font-size:1...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Adds borders on the input specified bythe 4 arguments: top, bottom, left and right. By default the masking value is 0 (black).

Function

CuviStatus borderMask(CuviImage* srcImage,
                      CuviImage* dstImage,
                      Cuvi32u top,
                      Cuvi32u bottom,
                      Cuvi32u left, 
                      Cuvi32u right,
                      Cuvi32u mask = 0,
                      CuviStream* stream = NULL);

Parameters

Name Type Description
srcImage CuviImage* Input Image
dstImage CuviImage* Output Image
top Cuvi32u Number of pixels to mask from top
bottom Cuvi32u Number of pixels to mask from bottom
left Cuvi32u Number of pixels to mask from left
right Cuvi32u Number of pixels to mask from right
stream CuviStream* GPU stream ID for execution

Image Type Support

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

Sample

Input Image
Masked Image


Example

CuviImage* gimg = new CuviImage(size,img->depth,img->nChannels);
CuviImage* gout = new CuviImage(size,img->depth,img->nChannels);

//Populate input image with pixel data
gimg->upload(img->imageData,img->widthStep);

//Mask borders with pixel value of 128
cuvi::ColorOperations::borderMask(gimg,gout,10,10,10,10,128);