找回密码
 注册
搜索
查看: 758|回复: 2

[讨论] OV7640 YUV data output format

[复制链接]
发表于 2005-7-28 14:57:00 | 显示全部楼层 |阅读模式
When the OV7640 is reset, the registers have their default values.

The ones that interest me are :

COMA (at address 12h) ; default value 14h
COMB (at address 13h) ; default value A3h
COMD (at address 15h) ; default value 00h

As a result of these settings, the datasheet specifies the data coming out
of Y[7:0] is structured as follows : UYVYUYVY

On the front page of the datasheet a feature is listed as YUV (4:2:2)

I understand the 4:2:2 means that Y is sampled at twice the frequency of U
and V, which is why Y appears twice as frequently as U or V in the extract :
UYVYUYVY

I would like to clarify my understanding of the data I capture :

For each frame, I capture 640 x 480 pixels = 307200 pixels

UYVYUYVY

Pixel 1 : is a U value
Pixel 2 : is a Y value
Pixel 3 : is a V value
Pixel 4 : is a Y value
...

the first pixel of line 2 : Pixel 641 : is a U value ?
Pixel 642 : is a Y value ?
Pixel 643 : is a V value ?
Pixel 644 : is a Y value ?

For example, for pixel 642, I have the Y value, but no corresponding U or V.
So in order to estimate the U or V value for this pixel, I need to use an
algorithm such as nearest neighbor replication or bilinear interpolation?

Is this understanding correct? Or is the data packed in a similar way to
RGB 5:6:5 where within 2 bytes of Y[7:0] you get an R,G and a B value
(albeit not at 8 bits resolution!)

Thank you for your assistance.

Paul.
发表于 2005-8-2 10:06:00 | 显示全部楼层
>When the OV7640 is reset, the registers have their default values.
>
>The ones that interest me are :
>
>COMA (at address 12h) ; default value 14h
>COMB (at address 13h) ; default value A3h
>COMD (at address 15h) ; default value 00h
>
>As a result of these settings, the datasheet specifies the data coming out
>of Y[7:0] is structured as follows : UYVYUYVY
>
>On the front page of the datasheet a feature is listed as YUV (4:2:2)
>
>I understand the 4:2:2 means that Y is sampled at twice the frequency of U
>and V, which is why Y appears twice as frequently as U or V in the extract :
>UYVYUYVY

Alternatively look at this way for every TWO Y pixels, there is only ONE
corresponding U and ONE corresponding V. You have to decode the colour
matrix of U and V to use with TWO adjacent Y points. U used with one pair
of Y and V used with a different pair (ideally).

>I would like to clarify my understanding of the data I capture :
>
>For each frame, I capture 640 x 480 pixels = 307200 pixels
>
>UYVYUYVY
>
>Pixel 1 : is a U value
>Pixel 2 : is a Y value
>Pixel 3 : is a V value
>Pixel 4 : is a Y value
>...

No that is four data points and TWO pixels.

>the first pixel of line 2 : Pixel 641 : is a U value ?
>Pixel 642 : is a Y value ?
>Pixel 643 : is a V value ?
>Pixel 644 : is a Y value ?

I would expect the first data BYTE of line 2 to be data BYTE 1281 (starting
at 1 or 1280 starting at 0).

>For example, for pixel 642, I have the Y value, but no corresponding U or V.
>So in order to estimate the U or V value for this pixel, I need to use an
>algorithm such as nearest neighbor replication or bilinear interpolation?

The bytes coming out should be in multiples of FOUR to give 4:2:2 coding,
which correspond in CCIR656 format (4:2:2 down one byte wide stream) as
twice as many data points as pixels.

>Is this understanding correct? Or is the data packed in a similar way to
>RGB 5:6:5 where within 2 bytes of Y[7:0] you get an R,G and a B value
>(albeit not at 8 bits resolution!)

You really need FOUR bytes to obtain an RGB matrix conversion as 4:2:2 should
be sampled as

Y Y Y
U U
V V

Hence the pairings of U and V for diffeent pairs of Y. Until you have the
THIRD byte at least you cannot give an RGB value for the first PIXEL.

However they are often sampled for simpler clocking and data pipeline

Y Y Y Y
U U
V V

Until you have the second pair of bytes the RGB values cannot be determined.

A good reference is Keith Jack's Video Demystified (now edition 4)
with a link from the Omnivision technical pages.

ISBN 0-7506-7822-4

Just gone from 1st edition to 4th edition myself.
发表于 2008-9-8 20:48:00 | 显示全部楼层
good questions. but i just envy your english can be so fascinate! lol.sorry i can't help u.but i think you can help me to being a good software guy,if you dont mind. pls contect with me in mail. software@aplustec.com  this is my e-mail address.[em01]
点评回复

使用道具 举报

高级模式
B Color Image Link Quote Code Smilies

本版积分规则

Archiver|手机版|小黑屋|52RD我爱研发网 ( 沪ICP备2022007804号-2 )

GMT+8, 2024-10-6 00:04 , Processed in 0.045726 second(s), 17 queries , Gzip On.

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表