Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

RGB -> YUV -> RGB. conversion problems

Status
Not open for further replies.

u24c02

Advanced Member level 1
Joined
May 8, 2012
Messages
404
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,298
Activity points
4,101
Hi..
I trying to converse from RGB to YUV again RGB like as the following.

for (i=0; i<640*480; i++)
{
Y = (char)((float)0.213*R+(float)0.715*G+(float)0.072*B);
CB = (char)((float)-0.117*R-(float)0.394*G+(float)0.511*B)+128;
CR = (char)((float)0.511*R-(float)0.464*G-(float)0.047*B)+128;



}

////////////////////////////////////////////////////////////////

for (i=0; i<640*480; i++)
{
R = (char)((float)Y+(float)1.540*(CR-128));
G = (char)((float)Y-(float)0.459*(CR-128)-0.183*(CB-128));
B = (char)((float)Y+(float)1.816*(CB-128));
}


When i have conversed, some pixels are strange exchanged.

Q1. How much each have range above Y, CB, CR.?
Q2. Above transform code is right?
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top