Difference between revisions of "Function:RGB2Gray"
From CUVI Wiki
Line 79: | Line 79: | ||
CuviImage gimg = cuvi::io::loadImage(path), gout; | CuviImage gimg = cuvi::io::loadImage(path), gout; | ||
// | //Convert to gray-scale using standard coefficients | ||
cuvi::colorOperations::rgb2gray(gimg,gout); | cuvi::colorOperations::rgb2gray(gimg,gout); | ||
//Convert to gray-scale using custom coefficients | |||
CuviScalar coeffs(0.33, 0.33, 0.33); | |||
cuvi::colorOperations::rgb2gray(gimg,gout, coeffs); | |||
</syntaxhighlight> | </syntaxhighlight> | ||
|} | |} |
Revision as of 16:06, 13 June 2014
Converts an RGB image to gray scale using fixed or custom transform coefficients
Function
|
Parameters
Name | Type | Description |
---|---|---|
src | CuviImage& | Input 3-channel image |
dst | CuviImage& | Output single channel image |
coeffs | CuviScalar& | Custom transformation coefficients |
stream | CuviStream& | GPU stream ID for execution |
Image Type Support
Input | Output |
---|---|
8uC3 | 8uC1 |
16uC3 | 16uC1 |
32fC3 | 32fC1 |
Sample
Error creating thumbnail: Unable to save thumbnail to destination |
Error creating thumbnail: Unable to save thumbnail to destination |
Example
|