Function:BorderMask

From CUVI Wiki
Revision as of 17:27, 26 April 2012 by Jawad (talk | contribs)

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

Error creating thumbnail: Unable to save thumbnail to destination
Input Image
Error creating thumbnail: Unable to save thumbnail to destination
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 0
cuvi::colorOperations::borderMask(gimg,gout,10,10,5,3,0);