Sunday, January 27, 2008

Difference between YCbCr, YPbPr, YUV, sampling

YCbCr has an important advantage over RGB, that is the Cr and Cb components may be represented with a lower resolution than Y because the Human Visual System HVS is less sensitive to color than luminance

Cb = B − Y, Cr = R - Y, Cg = G - Y

Cb, Cr and Cg represent the difference between the color intensity and the mean luminance of each image sample.

Cb + Cr + Cg is a constant and so only two of the three chroma components need to be stored

The different between YCbCr and YUV [update: Dec. 26, 2008]
YUV <-> RGB


YCrCb <-> RGB

YUV is a basic color model used in analog color TV broadcasting, YCbCr is a scaled and offset version of the YUV color space, used in digital video applications.

Component Video is known as YPbPr. YPbPr is the analog version of YCbCr digital video. (YCbCr is often called YPbPr when used for analog component video)

Analog RGB is normally used in the computer graphics, whereas component video is primarily employed in the consumer electronics arena.

Sampling:

4:4:4 sampling preserves the full fidelity of the chrominance components.

In 4:2:2 sampling, the chrominance components have the same vertical resolution as the luma but half the horizontal resolution (the numbers 4:2:2 mean that for every four luminance samples in the horizontal direction there are two Cb and two Cr samples) [ So why use half horizontal resolution, not vertical? think of the video interlace problem (Wrong! 6/25). Update: 6/24/09]

4:2:0 sampling format (‘YV12’), Cb and Cr each have half the horizontal and vertical resolution of Y. 4:2:0 YCbCr video requires exactly half as many samples as 4:4:4 (or R:G:B) video.

Using 4:4:4 sampling, a total of 12 samples are required, four each of Y, Cb and Cr, requiring a total of 12 × 8 = 96 bits, an average of 96/4 = 24 bits per pixel. Using 4:2:0 sampling, only six samples are required, four Y and one each of Cb, Cr, requiring a total of 6 × 8 = 48 bits, an average of 48/4 = 12 bits per pixel. [add--] 4:2:0 sampling is sometimes described as '12 bits per pixel'. (the 420 in following figure is kind of wrong, right bottom looks better)[update: Dec. 03, 2008)



Video frame format:

sub-QCIF : 128x96
QCIF : 176x144
CIF : 352x288
4CIF : 704x576

1 comment:

  1. Sir,

    Hi I'm using a Bassler SCA640-70GC with NI Vision. I could set Pixel format through max and take mono/color videos. But the property is not writable programmatic through LabVIEW even while initializing. Any ideas why?

    thanks.

    ReplyDelete