Re: Need help in converting YUV to RGB using OV7620



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
.



Relevant Pages

  • Re: Need help in converting YUV to RGB using OV7620
    ... >Why not set the OV7620 to output RGB data then you don't have to do the ... conversion. ... Thanks John, ... Prev by Date: ...
    (comp.arch.embedded)
  • Re: Tracking/Comparing Monthly Progress
    ... Thank you John, ... >> way to get my duration value to calculate to the approximate working times ... > the conversion factor is not needed. ... > of working time based on the Project calendar. ...
    (microsoft.public.project)
  • Re: display / return string data instead of code from lookup table
    ... Hi John, thanks for your answer. ... I've used the calculated field option for ... i'd like to use the conversion table option on one of the fields to ... Add the table to your query, join the field in the main table to fldValue in ...
    (microsoft.public.access.queries)
  • Re: Tracking/Comparing Monthly Progress
    ... > Thank you John, ... >> take into account the difference between Duration and the task span line ... >> the conversion factor is not needed. ... >> calculating. ...
    (microsoft.public.project)
  • Re: Filters in superheterodyne receivers
    ... >>I am trying to understand the principles of the superheterodyne receiver. ... > Double conversion isn't usually necessary for broadcast-type FM ... it will create horrendous distortion. ...
    (sci.electronics.basics)