Difference between revisions of "Function:YUV2RGB"

From CUVI Wiki
(Created page with "__NOTOC__ Convert YUV color model to an RGB image ===Function=== {| |style="font-size:150%;"| <syntaxhighlight lang="cpp"> CuviStatus yuv2rgb(CuviImage* srcImage, ...")
 
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
__NOTOC__
__NOTOC__
Convert YUV color model to an RGB image
Convert YUV color model to an RGB image
===Function===
====Function====
{|
{|
|style="font-size:150%;"|
|style="font-size:100%;"|
<syntaxhighlight lang="cpp">
<syntaxhighlight lang="cpp">
CuviStatus yuv2rgb(CuviImage* srcImage,
CuviStatus yuv2rgb(const CuviImage& src,
                   CuviImage* dstImage,
                   CuviImage& dst,
                   CuviStream* stream = NULL);
                   const CuviStream& stream = CuviStream());
</syntaxhighlight>
</syntaxhighlight>
|}
|}


 
====Parameters====
===Parameters===
{|
 
|style="font-size:75%;"|
{|class="wikitable"
{|class="wikitable"
|-
|-
Line 20: Line 20:
! Description
! Description
|-
|-
| srcImage
| src
| CuviImage*
| const CuviImage&
| Input YUV image
| Input YUV image
|-
|-
| dstImage
| dst
| CuviImage*
| CuviImage&
| Output RGB image
| Output RGB image
|-
|-
| stream
| stream
| CuviStream*
| const CuviStream&
| GPU stream ID for execution
| GPU stream ID for execution
 
|}
|}
|}


 
====Image Type Support====
 
{|
===Image Type Support===
|style="font-size:75%;"|
 
{| class="wikitable"
{| class="wikitable"
|-
|-
Line 49: Line 48:
| 16uC3
| 16uC3
|}
|}
===Sample===
{|
|-
|[[File:YUV_RGB_In.jpg|frame|YUV Image]]
|[[File:YUV_RGB_Out.jpg|frame|RGB Image]]
|}
|}


====Sample====
[[File:YUV_RGB_In.jpg|none|frame|YUV Image]]
<br/>
[[File:YUV_RGB_Out.jpg|none|frame|RGB Image]]
<br/>


 
====Example====
===Example===
{|
{|
|style="font-size:150%;"|
|style="font-size:100%;"|
<syntaxhighlight lang="cpp">
<syntaxhighlight lang="cpp">


CuviImage* gimg = new CuviImage(size,img->depth,img->nChannels);
CuviImage input = cuvi::io::loadImage(path), output;
CuviImage* gout = new CuviImage(size,img->depth,img->nChannels);
 
//Upload YUV data to GPU
gimg->upload(img->imageData,img->widthStep);
 


//function call
//Convert YUV image to RGB
cuvi::colorOperations::YUV2RGB(gimg,gout);
cuvi::colorOperations::yuv2rgb(input,output);


</syntaxhighlight>
</syntaxhighlight>
|}
|}

Latest revision as of 21:15, 18 October 2022

Convert YUV color model to an RGB image

Function

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

Parameters

Name Type Description
src const CuviImage& Input YUV image
dst CuviImage& Output RGB image
stream const CuviStream& GPU stream ID for execution

Image Type Support

Input Output
8uC3 8uC3
16uC3 16uC3

Sample

Error creating thumbnail: Unable to save thumbnail to destination
YUV Image


Error creating thumbnail: Unable to save thumbnail to destination
RGB Image


Example

CuviImage input = cuvi::io::loadImage(path), output;

//Convert YUV image to RGB
cuvi::colorOperations::yuv2rgb(input,output);