Difference between revisions of "Function:RGB2Gray"

From CUVI Wiki
Line 1: Line 1:
__NOTOC__
__NOTOC__
Converts an RGB image to gray scale using fixed transform coefficients
Converts an RGB image to gray scale using fixed or custom transform coefficients
===Function===
===Function===
{|
{|
Line 8: Line 8:
                     CuviImage& dst,
                     CuviImage& dst,
                     const CuviStream& stream = CuviStream());
                     const CuviStream& stream = CuviStream());
CuviStatus rgb2gray(const CuviImage& src,
                    CuviImage& dst,
                    Cuvi32f coeffs[3],
                    const CuviStream& stream = CuviStream());
</syntaxhighlight>
</syntaxhighlight>
|}
|}
Line 27: Line 33:
| CuviImage&
| CuviImage&
| Output single channel image
| Output single channel image
|-
| coeffs
| Cuvi32f[]
| Custom transformation coeficients
|-
|-
| stream
| stream

Revision as of 08:07, 18 April 2013

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,
                    Cuvi32f coeffs[3],
                    const CuviStream& stream = CuviStream());


Parameters

Name Type Description
src CuviImage& Input 3-channel image
dst CuviImage& Output single channel image
coeffs Cuvi32f[] Custom transformation coeficients
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 = cuvi::io::loadImage(path), gout;

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