Re: Need help in converting YUV to RGB using OV7620
- From: "John B" <spamj_baraclough@xxxxxxxxxxxxxxxxxxx>
- Date: 16 Jan 2006 17:28:25 GMT
On 16/01/2006 the venerable nuky8181 etched in runes:
> > Why not set the OV7620 to output RGB data then you don't have to do the
> conversion.
> >
> > If you do want to use Y, Cb & Cr, then run a simple test using 100% RGB
> colour bars as dummy data
> > that will quickly tell you if your formulae are correct.
> >
> > R G B <-> Y Cr Cb
> > White 255 255 255 235 128 128
> > Yellow 255 255 0 210 146 16
> > Cyan 0 255 255 170 16 166
> > Green 0 255 0 145 34 54
> > Magenta 255 0 255 106 222 202
> > Red 255 0 0 81 240 90
> > Blue 0 0 255 41 110 240
> > Black 0 0 0 16 128 128
> >
> >
> > --
> > John B
> >
>
> Thanks John,
>
> May I know which forumla u base on to get the value? cos i tried a few I
> cant get the value.
Assuming R, G & B all have range 0->255, Y has range 16->235 and Cr & Cb have range 16->240, the
following are the conversions:
Y = (((65 * R) + (129 * G) + (25 * B)) / 256) + 16;
Cr = (((112 * R) - (94 * G) - (18 * B)) / 256) + 128;
Cb = (((-38 * R) - (74 * G) + (112 * B)) / 256) + 128;
--
John B
.
- References:
- Need help in converting YUV to RGB using OV7620
- From: nuky8181
- Re: Need help in converting YUV to RGB using OV7620
- From: John B
- Re: Need help in converting YUV to RGB using OV7620
- From: nuky8181
- Need help in converting YUV to RGB using OV7620
- Prev by Date: Re: [OT] Re: Looking for 68hc11
- Next by Date: Re: embedded questions!!!
- Previous by thread: Re: Need help in converting YUV to RGB using OV7620
- Next by thread: Re: Need help in converting YUV to RGB using OV7620
- Index(es):
Relevant Pages
|