Need help in converting YUV to RGB using OV7620
- From: "nuky8181" <k2skate2003@xxxxxxxxx>
- Date: Fri, 13 Jan 2006 05:38:29 -0600
Hi,
I have read a few post about OV7620 and I cant find one that is related to
my problem. Hope you guys can give me some advise on converting the YUV
data obtained from OV7620 to RGB format.
I am using the OV7620 in its default mode thus I am only getting 16bit YUV
data. This is the first time I am using camera chip and from the data
***, the following is what I have understood. Pls correct me if I am
wrong.
YUV data is obtained in the following way
clk 1 Y0 U0
clk 2 Y1 V1
clk 3 Y2 U2 etc
The format is 4:2:2 format thus to get RGB I need to do the following
Example,
To get RGB for 1st pixel, Y0 U0 and V1 is used in the computation
to get RGB for 2nd pixel, Y1 U0 and V1 is used
The formula given in the data *** to get YUV was as followed
Y=0.59G +0.31R + 0.11B
U/Cr = 0.713(R-Y)
V/Cb = 0.594(B-r)
I used matlab to get the conversion from YUV to RGB in the following
R = Y + 1.4025[U-128]
G = 0.983*Y + 0.7369[U-128] - 0.3306[V-128]
B = Y - 1.773[V-128]
The 128 was include to shift U and V from the range 16 - 240 to
-112 - 112.
What I did was get the YUV data using DSPIC30F6012 and transfer it to
visual basic and use the RGB formula obtain above to get RGB but I never
seem to get it. the result is always a green image regardless the colour
of the image taken.
I have check that there is no data corruption during transfer and is now
really stuck. I have also tried other forumla found in other website where
one of which is microsoft msdn. Still, no avil.
I would really appreciate if anyone could help me out here.
Thanks in advance.
.
- Follow-Ups:
- Re: Need help in converting YUV to RGB using OV7620
- From: Paul Carpenter
- Re: Need help in converting YUV to RGB using OV7620
- From: John B
- Re: Need help in converting YUV to RGB using OV7620
- Prev by Date: Re: embedded questions!!!
- Next by Date: Re: MSP430, simulate reset (for a software bootstrap loader)
- Previous by thread: keychain remote coding
- Next by thread: Re: Need help in converting YUV to RGB using OV7620
- Index(es):