Home » Source Code » Face Detection using YCbCr Color Space

Face Detection using YCbCr Color Space

ramani
2014-08-12 10:30:59
The author
View(s):
Download(s): 1
Point (s): 1 
Category Category:
Image ProcessingImage Processing MatlabMatlab

Description

Face detection is a computer technology that determines the locations and sizes of human faces in digital images. It detects face and ignores anything else, such as buildings, trees and bodies. Face detection can be regarded as a more general case of face localization. In face localization, the task is to find the locations and sizes of a known number of faces (usually one). In face detection, face is processed and matched bitwise with the underlying face image in the database. Any slight change in facial expression, e.g. smile, lip movement, will not match the face.

Face detection can be regarded as a specific case of object-class detection. In object-class detection, the task is to find the locations and sizes of all objects in an image that belong to a given class. Examples include upper torsos, pedestrians, and cars.

Face-detection algorithms focus on the detection of frontal human faces. It is analogous to image detection in which the image of a person is matched bit by bit. Image matches with the image stores in database. Any facial feature changes in the database will invalidate the matching process.

YCbCrY′CbCr, or Y Pb/Cb Pr/Cr, also written as YCBCR or Y′CBCR, is a family of color spaces used as a part of the color image pipeline in videoand digital photography systems. Y′ is the luma component and CB and CR are the blue-difference and red-difference chroma components. Y′ (with prime) is distinguished from Y, which is luminance, meaning that light intensity is nonlinearly encoded based on gamma corrected RGB primaries.

Y′CbCr is not an absolute color space; rather, it is a way of encoding RGB information. The actual color displayed depends on the actual RGBprimaries used to display the signal. Therefore a value expressed as Y′CbCr is predictable only if standard RGB primary chromaticities are used.

YCbCr is sometimes abbreviated to YCC. Y′CbCr is often called YPbPr when used for analog component video, although the term Y′CbCr is commonly used for both systems, with or without the prime.

Y′CbCr is often confused with the YUV color space, and typically the terms YCbCr and YUV are used interchangeably, leading to some confusion; when referring to signals in video or digital form, the term "YUV" mostly means "Y′CbCr".

Y′CbCr signals (prior to scaling and offsets to place the signals into digital form) are called YPbPr, and are created from the corresponding gamma-adjusted RGB (red, green and blue) source using two defined constants KB and KR as follows: 
\begin{align}
Y' &= K_R \cdot R' + (1 - K_R - K_B) \cdot G' + K_B \cdot B'\\
P_B &=\frac12 \cdot \frac{B' - Y'}{1 - K_B}\\
P_R &=\frac12 \cdot \frac{R' - Y'}{1 - K_R}
\end{align}

where KB and KR are ordinarily derived from the definition of the corresponding RGB space. (The equivalent matrix manipulation is often referred to as the "color matrix".)

Here, the prime ′ symbols mean gamma correction is being used; thus R′, G′ and B′ nominally range from 0 to 1, with 0 representing the minimum intensity (e.g., for display of the color black) and 1 the maximum (e.g., for display of the color white). The resulting luma (Y) value will then have a nominal range from 0 to 1, and the chroma (PB and PR) values will have a nominal range from -0.5 to +0.5. The reverse conversion process can be readily derived by inverting the above equations.

When representing the signals in digital form, the results are scaled and rounded, and offsets are typically added. For example, the scaling and offset applied to the Y′ component per specification (e.g. MPEG-2[1]) results in the value of 16 for black and the value of 235 for white when using an 8-bit representation. The standard has 8-bit digitized versions of CB and CR scaled to a different range of 16 to 240. Consequently, rescaling by the fraction (235-16)/(240-16) = 219/224 is sometimes required when doing color matrixing or processing in YCbCr space, resulting in quantization distortions when the subsequent processing is not performed using higher bit depths.

The scaling that results in the use of a smaller range of digital values than what might appear to be desirable for representation of the nominal range of the input data allows for some "overshoot" and "undershoot" during processing without necessitating undesirable clipping. This "head-room" and "toe-room" can also be used for extension of the nominal color gamut, as specified by xvYCC.

Since the equations defining YCbCr are formed in a way that rotates the entire nominal RGB color cube and scales it to fit within a (larger) YCbCr color cube, there are some points within the YCbCr color cube that cannot be represented in the corresponding RGB domain (at least not within the nominal RGB range). This causes some difficulty in determining how to correctly interpret and display some YCbCr signals. These out-of-range YCbCr values are used by xvYCC to encode colors outside the BT.709 gamut.


Sponsored links

File list

Tips: You can preview the content of files by clicking file names^_^
Name Size Date
face_detection.m2.02 kB2011-07-28 23:11
light_compensate.m540.00 B2008-09-22 05:02
mouthMap.m1.19 kB2008-12-01 12:00
normal.m141.00 B2008-09-16 12:22
Wcb.m620.00 B2008-09-13 19:26
Wcr.m256.00 B2008-09-08 11:36
01.jpg170.23 kB1999-12-03 21:45
Cb_bar.m259.00 B2008-09-13 18:53
Cb2Cb_.m333.00 B2008-09-13 19:49
color_cluster.m2.56 kB2008-09-22 04:50
connected_component_2.m1.04 kB2008-09-19 16:01
Cr_bar.m222.00 B2008-09-08 11:33
Cr2Cr_.m161.00 B2008-09-08 11:33
...
Sponsored links

Comments

(Add your comment, get 0.1 Point)
Minimum:15 words, Maximum:160 words
  • 1
  • Page 1
  • Total 1

Face Detection using YCbCr Color Space (174.20 kB)

Need 1 Point(s)
Your Point (s)

Your Point isn't enough.

Get 22 Point immediately by PayPal

Point will be added to your account automatically after the transaction.

More(Debit card / Credit card / PayPal Credit / Online Banking)

Submit your source codes. Get more Points

LOGIN

Don't have an account? Register now
Need any help?
Mail to: support@codeforge.com

切换到中文版?

CodeForge Chinese Version
CodeForge English Version

Where are you going?

^_^"Oops ...

Sorry!This guy is mysterious, its blog hasn't been opened, try another, please!
OK

Warm tip!

CodeForge to FavoriteFavorite by Ctrl+D