Function:RGB2Gray

From CUVI Wiki
Revision as of 09:47, 30 April 2012 by Jawad (talk | contribs)

Converts an RGB image to gray scale using fixed transform coefficients

Function

CuviStatus RGB2Gray(CuviImage* srcImage,
                    CuviImage* dstImage,
                    CuviStream* stream = NULL);


Parameters

Name Type Description
srcImage CuviImage* Input 3-channel image
dstImage CuviImage* Output single channel image
stream CuviStream* GPU stream ID for execution


Image Type Support

Input Output
8uC3 8uC1
16uC3 16uC1

Sample

Color Image
Output Gray Image


Example

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

//Uploading RGB image to GPU
gimg->upload(img->imageData,img->widthStep);

//function call
cuvi::colorOperations::RGB2Gray(gimg,gout);