Newsletter

Industrial Control DesignLine  >  Design Center

Fundamentals of embedded video, part 2

Part 2 of this 5-part series discuss color spaces and gamma correction, and explains the basics of digital video.

Page 1 of 4

Courtesy of DSP DesignLine

[Part 1 explains the basic components of video signals. Part 3 looks at video from a system level, discussing video sources and displays.]

Color Spaces
There are many different ways of representing color, and each color system is suited for different purposes. The most fundamental representation is RGB color space.

RGB stands for "Red-Green-Blue," and it is a color system commonly employed in camera sensors and computer graphics displays. As the three primary colors that sum to form white light, they can combine in proportion to create most any color in the visible spectrum. RGB is the basis for all other color spaces, and it is the overwhelming choice of color space for computer graphics.

Gamma Correction
"Gamma" is a crucial phenomenon to understand when dealing with color spaces. This term describes the nonlinear nature of luminance perception and display. Note that this is a twofold manifestation: the human eye perceives brightness in a nonlinear manner, and physical output devices (such as CRTs and LCDs) display brightness nonlinearly. It turns out, by way of coincidence, that human perception of luminance sensitivity is almost exactly the inverse of a CRT's output characteristics.

Stated another way, luminance on a display is roughly proportional to the input analog signal voltage raised to the power of gamma. On a CRT or LCD display, this value is ordinarily between 2.2 and 2.5. A camera's precompensation, then, scales the RGB values to the power of (1/gamma).

The upshot of this effect is that video cameras and computer graphics routines, through a process called "gamma correction," prewarp their RGB output stream both to compensate for the target display's nonlinearity and to create a realistic model of how the eye actually views the scene. Figure 1 illustrates this process.

Gamma-corrected RGB coordinates are referred to as R'G'B' space, and the luma value Y' is derived from these coordinates. Strictly speaking, the term "luma" should only refer to this gamma-corrected luminance value, whereas the true "luminance" Y is a color science term formed from a weighted sum of R, G, and B (with no gamma correction applied).

Often when we talk about YCbCr and RGB color spaces in this series, we are referring to gamma-corrected components – in other words, Y'CbCr or R'G'B'. However, because this notation can be distracting and doesn't affect the substance of our discussion, and since it's clear that gamma correction needs to take place at sensor and/or display interfaces to a processor, we will confine ourselves to the YCbCr/RGB nomenclature even in cases where gamma adjustment has been applied. The exception to this convention is when we discuss actual color space conversion equations.


(Click to enlarge)

Figure 1: Gamma correction linearizes the intensity produced for a given input amplitude.

While RGB channel format is a natural scheme for representing real-world color, each of the three channels is highly correlated with the other two. You can see this by independently viewing the R, G, and B channels of a given image – you'll be able to perceive the entire image in each channel. Also, RGB is not a preferred choice for image processing because changes to one channel must be performed in the other two channels as well, and each channel has equivalent bandwidth.

To reduce required transmission bandwidths and increase video compression ratios, other color spaces were devised that are highly uncorrelated, thus providing better compression characteristics than RGB does. The most popular ones – YPbPr, YCbCr, and YUV -- all separate a luminance component from two chrominance components. This separation is performed via scaled color difference factors (B'-Y') and (R'-Y'). The Pb/Cb/U term corresponds to the (B'-Y') factor, and the Pr/Cr/V term corresponds to the (R'-Y') parameter. YPbPr is used in component analog video, YUV applies to composite NTSC and PAL systems, and YCbCr relates to component digital video.

Separating luminance and chrominance information saves image processing bandwidth. Also, as we'll see shortly, we can reduce chrominance bandwidth considerably via subsampling, without much loss in visual perception. This is a welcome feature for video-intensive systems.

As an example of how to convert between color spaces, the following equations illustrate translation between 8-bit representations of Y'CbCr and R'G'B' color spaces, where Y', R', G' and B' normally range from 16-235, and Cr and Cb range from 16-240.

Y' = (0.299)R + (0.587)G + (0.114)B

Cb = -(0.168)R - (0.330)G + (0.498)B + 128

Cr = (0.498)R - (0.417)G - (0.081)B + 128

R = Y' + 1.397(Cr - 128)

G = Y' - 0.711(Cr - 128) - 0.343(Cb - 128)

B = Y' + 1.765(Cb - 128)



Page 2: Chroma subsampling  

Page 1 | 2 | 3 | 4



Rate this article
WORSE | BETTER
1 2 3 4 5




 Featured Jobs
Videon Central seeking VP of Engineering in State College, PA

Protingent Staffing seeking Electrical Engineer in Mountain View, CA

True Circuits seeking Analog-Mixed-Signal IC Layout Engr in Los Altos, CA

ON Semiconductor seeking Sr Analog Design Engineer in Colorado Springs, CO

SanDisk seeking Sr Process Integration Engr in Milpitas, CA

More jobs on EETimesCareers
 Sponsor
 CAREER CENTER
Ready to take that job and shove it?
SEARCH JOBS:

 SPONSOR

 RECENT JOB POSTINGS
For more great jobs, career related news, features and services, please visit EETimes' Career Center.