Converts an RGB image to gray scale using custom transform coefficients
Function
CuviStatus color2Gray(CuviImage* srcImage,
CuviImage* dstImage,
Cuvi32f coeffs[3],
CuviStream* stream = NULL);
|
Parameters
| Name
|
Type
|
Description
|
| srcImage
|
CuviImage*
|
Input 3-channel image
|
| dstImage
|
CuviImage*
|
Output single channel image
|
| coeffs[3]
|
Cuvi32f
|
Transform coefficients
|
| 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);
gimg->upload(img->imageData,img->widthStep);
//Transform coefficients
float* coff = new float[3];
coff[0]= 0.3f;
coff[1]= 0.59f;
coff[2]= 0.11f;
//function call
cuvi::colorOperations::color2Gray(gimg,gout,coff);
|