Difference between revisions of "Function:RGB2Gray"

From CUVI Wiki
Line 11: Line 11:
CuviStatus rgb2gray(const CuviImage& src,
CuviStatus rgb2gray(const CuviImage& src,
                     CuviImage& dst,
                     CuviImage& dst,
                     Cuvi32f coeffs[3],
                     const CuviScalar& coeffs,
                     const CuviStream& stream = CuviStream());
                     const CuviStream& stream = CuviStream());


Line 35: Line 35:
|-
|-
| coeffs
| coeffs
| Cuvi32f[]
| CuviScalar&
| Custom transformation coeficients
| Custom transformation coefficients
|-
|-
| stream
| stream
Line 58: Line 58:
| 16uC3
| 16uC3
| 16uC1
| 16uC1
|-
| 32fC3
| 32fC1
|}
|}



Revision as of 13:57, 13 June 2014

Converts an RGB image to gray scale using fixed or custom transform coefficients

Function

CuviStatus rgb2gray(const CuviImage& src,
                    CuviImage& dst,
                    const CuviStream& stream = CuviStream());

CuviStatus rgb2gray(const CuviImage& src,
                    CuviImage& dst,
                    const CuviScalar& coeffs,
                    const CuviStream& stream = CuviStream());


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
Color Image
Error creating thumbnail: Unable to save thumbnail to destination
Output Gray Image


Example

CuviImage gimg = cuvi::io::loadImage(path), gout;

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