YUV to RGB conversion in OV7620

Dec 07, 2010 1 Replies

Hello,



I am deveolping a VHDL code to get a image from a OV7620 camera. Until now I have managed to get YUV image in a binary file. When I display that image the Y component is correct (monochrome image) but the problem is in U and V components.


The whole image is all magenta because there isn't green component. I am using CCIR 601 YCbCr color space with formula:


R = 1.164(Y ? 16) + 1.596(Cr ? 128) G = 1.164(Y ? 16) ? 0.813(Cr ? 128) ? 0.391(Cb ? 128) B = 1.164(Y ? 16) + 2.018(Cb ? 128)



Registers setup are in default mode except for QVGA mode (bit 5 register



14) and CCIR 601 YCrCb (bit 7:6 register 67).


Thanks.


--------------------------------------- Posted through

formatting link


Make sure you are getting U and V correctly some devices habe a bit in one of the registers to determine if the first clock edge is U or V.

Does that model of sensor support a test colour bars output mode. If so use it to set up your colour decode circuit.

Your data stream could be swapped because you are clocking out of phase.

Paul Carpenter | paul@pcserviceselectronics.co.uk PC Services Timing Diagram Font GNU H8 - compiler & Renesas H8/H8S/H8 Tiny For those web sites you hate

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required