Face Detection Based On Skin Color: Yang Ling Gu Xiaohan June2012
Face Detection Based On Skin Color: Yang Ling Gu Xiaohan June2012
Face Detection Based On Skin Color: Yang Ling Gu Xiaohan June2012
Yang Ling
Gu Xiaohan
June2012
Abstract
This work is on a method for face detection through analysis of photos. Accurate
location of faces and point out the faces are implemented. In the first step, we use Cb
and Cr channel to find where the skin color parts are on the photo, then remove noise
which around the skin parts, finally, use morphology technique to detect face part
exactly. Our result shows this approach can detect faces and establish a good technical
based for future face recognition.
Key words: Face detection, Cb and Cr channel, Morphology technique, Accurate location
Contents
1 Introduction ................................................................................................................ 1
1.1 Aim3
1.2 Background...........................................................................................................................................3
1.3 Previous research .8
1.4 Delimitation8
3 Results ..................................................................................................................... 17
3.1where photos from .17
3.2interfaceofthefacedetection..17
3.3The accurateness19
4 Discussions .............................................................................................................. 20
5 Conclusion .............................................................................................................. 22
6 Acknowledgements ................................................................................................ 22
7 Reference ................................................................................................................ 23
8 Appendix...24
1. Introduction
In accordance with rapid population growth throughout the world, facial detection technology
plays a more significant and crucial role in our daily lives, namely in such aspects as criminal
investigations, login systems, entrance systems, etc. Face detection accuracy is influenced by
different variations in classifying a target object in an image; this may include pose variation and
facial occlusion. The challenges of face detection will be discussed in later sections of this chapter.
The following factors explain the importance of face detection:
1. Facial recognition: Facial recognition entails identification and verification of people. These
are mainly considered for security measures.
2. Human computer interactions: Human computer interaction is the study of interaction
between humans and computers. It is important for increasing the user-machine
experience/interaction; as a result an intelligent human computer interaction system is
established. For example, facial expression recognition can help disabled people.
3. Facial expression recognition: This technique figures out the meaning of expressions from
detected people.
This is the definition of face detection: the system acquires an arbitrary image, and it can analyze
the messages included in the image accurately, and determine the exact position and region of
the face [1]. Face detection can detect whether or not a human face exists on the image, and if it
does, then the numbers and positions of the human face/s on the image can be determined.
Like these two figures below.
protects most enterprise computers. Naturally, such PC-based verification systems can be
extended to control authorization for single-sign-in to multiple networked services, for access to
encrypted documents and transaction authorization, though again uptake of the technology has
been slow.
Banks have been very conservative in deploying biometrics as they risk losing far more through
customers disaffected by being falsely rejected than they might gain in fraud prevention.
Customers are unwilling to bear the burden of additional security measures, their personal
responsibility has to be restricted by law. For better acceptance, robust passive acquisition
systems with very low false rejection probabilities are necessary. Physical access control is
another domain where face recognition is attractive and here it can even be used in combination
with other biometrics. BioId [2] is a system which combines face recognition with speaker
identification and lip motion.
Also Identification System is an application in face detection. Two US States (Massachusetts and
Connecticut [3]) are testing face recognition for the policing of Welfare benefits. This is an
identification task, where any new applicant being enrolled must be compared against the entire
database of previously enrolled claimants, to ensure that they are not claiming under more than
one identity. Unfortunately face recognition is not currently able to reliably identify one person
among the millions enrolled in a single states database, so demographics (zip code, age, name
etc.) are used to narrow the search (thus limiting its effectiveness), and human intervention is
required to review the false alarms that such a system will produce. Here a more accurate system
such as fingerprint or iris-based person recognition is more technologically appropriate, but face
recognition is chosen because it is more acceptable and less intrusive. In Connecticut, face
recognition is the secondary biometric added to an existing fingerprint identification system.
Several US States, including Illinois, have also instituted face recognition for ensuring that people
do not obtain multiple driving licenses.
Face recognition has attracted more and more attention in recent years. Especially face detection
is an important part of face recognition as the first step, but face detection is not straightforward,
because it has many variations of image appearance, such as pose variation (front, non-front),
illuminating condition and facial expression and so on. There are many different algorithms that
have been implemented for face detection, including the use of color information, edge
detection, and neural networks [4].
Face detection technology has been developed over the years. With the hardware and software
improved the accuracy of the detection is getting better and better. However, the accuracy still
cannot meet all the requirements. There are many influencing factors when you detect faces
from an image, e.g., the brightness and background. You may detect some parts of the image
that may not belong to the face or even fail to detect any face at all. The face detection is not a
simple process. It is easy for humans to find by their eyes but not easy for a computer to do so.
In our thesis, we would like to conduct face detection in multi face field. At the same time, the
image processing technology has matured. In this section, we will describe the theoretical
background of this study needed to perform this task.
1.1 Aim
The goal of our thesis is to create a new application that uses the MATLAB software to achieve
human facial information detection, finding the human facial area in the input image. Our
research problem: Is it possible to recognize face accurately from a picture that contains more
than 3 people?
1.2 Background
Recently, there has been a lot of research on face detection in modern life. Normally, face
detection is divided into five parts: input image, image pretreatment, face location, background
separation, and face detection.
Figure 4:The top left side of each image is resolution of each one. Left side image is the original.
An image 3000 pixels in width and 2000 pixels in height, means it has 3000 x 2000 = 6000000
pixels or 6 megapixels. If the image has been resized into 1000 pixels in width and 600 pixels in
height, image only has been 0.6 megapixels.
In the above chart, the shape of a graph has been widened which is the meaning of average
scatter in the histogram.
This method usually increases the contrast of the input image. On the left hand side of Figure 6 is
a resized grayscale image. The other is an output image after the processing of histogram
equalization. There is a significant difference in the end result.
to the Y component in video. The human eye will not detect the changes in image quality after
the sub sampling of the chrominance components. The main sub-sampling formats are YCbCr
4:2:0, YCbCr 4:2:2 andYCbCr 4:4:4.
On the other hand, the formula which we used is RGB conversion formula for YCbCr below:
Figure 9: The four basic morphological operations for binary image processing
As you can see in Figure9 (b) is making objects larger. The objects are larger with half the size of
the structuring element. Figure9 (c) is making objects defined by shape in the structuring
element smaller. The objects are smaller with half the size of the structuring element. The
Figure9 (d) and Figure9 (e) show the two derivational operations from the Erosion and Dilation.
Opening is defined as an erosion followed by dilation and closing is defined as dilation followed
by erosion.
(2)
Close operation is firstly executed dilation then erosion; it can also smooth the edge of the image
and fill the small holds in the image or connecting adjacent objects. Contrary to the open
operation, it can generally integrate the narrow gap, remove the small holes and fill the gaps on
the contour. As shown in equation 3.
Operations are defined A B ( A B) B
(3)
(a)Original image
1.3.1 AdaBoost
7
Adaboost [8] is an iterative algorithm. The core idea of Adaboost is to train different weak
classifiers depend on the same training set, and then combine them together, in order to make a
stronger classifier. The algorithm itself is basically changing the data distribution, it determine the
weights of each sample value according to the accuracy of classification of each samples, and the
last overall classification accuracy. Then give the modified weights to lower classifier for the
purpose of classification. Finally, mix all the classifiers together, as the final decision classifier. To
use the Adaboost classifier can exclude unnecessary training data characteristics. The algorithm is
a simple promotion process of weak classification algorithm. This process is by way of continuous
training
to
improve
the
ability
of
data
classification.
1.4 Delimitation
The following items are the summary of the main delimitation in face detection:
1. Illumination condition: different lighting and the quality of camera directly affect the quality of
the face. Sometimes it can be varied greater than facial expression and occlusion.
2. Occlusion: face detection not only deals with different faces, however, it also needs to deal
with any optional object. For example, hairstyle, sunglasses are all the occlusion in face detection.
The long hair and the sunglasses will cover the faces making the detection harder, because the
non-face object will affect the process of skin detection.
3. Uncontrolled background: face detection system can not only detect faces on simple
environment. In reality, people are always located on complex background with different texture
and object. These things are the major factors to affect the performance of face detection
system.
About our program, the limitation is the distance between person and camera, which should not
be a big range, distance, must be appropriate for our program. Otherwise, our application cannot
detect faces from photos.
Next, we will demonstrate our face detection algorithm with a color image of size 368x314 pixels
as shown in Figure 13(a). Face in the picture you can see 5 frontal people, and the brightness is
normal in the morning, the distance between people and camera is 2 meters long.
(a)
(b)
10
(b)
(d)
(e)
Figure 13: The result of the first step. (a) RGB Color Image; (b) The derived YCbCr image;
(c) Y component of (b); (d) Cb component of (b); (e) Cr component of (b).
(a)
(b)
(c)
11
(d)
(e)
(f)
Figure 14: Skin color detection based on adaptive histogram segmentation.
(a)Histogram of Cb component image, (b)Cb color range[107, 122].
(c)The segment image of Cb component. (d) Histogram of Cr component image.
(e)Cr color range [138, 151]. (f)The segment image of Cr component.
The combination of image segmentation, and then evaluated to determine whether and where
the face is there. This results in a binary black & white image shown in Figure 15 and we can find
that the mask image covers most skin color ranges.
Figure 15: Result of the 2th step is a skin color filtered binary image: segmented skin regions
1 f ( x, y), if
f o ( x, y )
0
Ishole( x, y ) 1
others
(4)
Where is hole(x,y)=1 means the pixel point (x,y) lies in a hole which is an area of dark pixels
surrounded by lighter pixels. In Figure 16, an example is given to demonstrate the operation
above, in which Figure 16(a) is reduced noise image of Figure 16 by using a morphological erosion
and dilation with 3 x 3 structural elements, and Figure 16(b) is the result of filling holes.
12
(a)
(b)
13
RG(0) ( F ) F ;
1) K=0;
2) Do
a)
K=k+1;
b)
k 1
3) Until RG ( F ) RG ( F );
(k )
Take the image shown in Figure 18(a) as examples. Notes that Figure 18(a) is the mask image G
and Figure 18(b) is the marker image F, i.e. the erosion of Figure 18(a) with the structuring
element B. Figure 18(c) is the opening by reconstruction of F with respect to G. For the purpose
of comparison, we computed the opening of the mask image G using the same structuring
element B, as shown in Figure 18(d). The result in Figure 18(c) shows that the face candidate
areas were restored accurately, and all other non-face small areas were removed.
14
15
16
3. Results
3.1 Where are the photos come from?
We selected 10 pictures in order to test our program. The first one contains two people with no
glasses on and they both have short hair. The second one has 5 people on the photo, three of
them have glasses, and the background is white. The third one contains three people, one of
them wearing glasses, and the background is an outdoor environment. The fourth has 3 people
on the photo, none wearing glasses, and their hair is short. The fifth has 6 people on the image
and detecting all of them may be difficult; some part of the background is affected by the sun.
The sixth shows 3 people on the photo; one of them wearing sunglasses which will have more
effects than normal glasses. The seventh displays 5 people on the photo, some of them have long
hair. In the eighth photo, there are 7 people; all of them have short hair, it will be easier to detect.
The ninth has 2 people on the picture, I think they are in a forest, and detecting two people may
not be as difficult. The tenth is our exemplary picture, containing all of the information about a
model photo we have introduced above. All the images are almost at the same distance from
camera.
3.2 The interface of the face detection
In this part we are going to introduce the interface of the detection program.
1 Select a photo to detect
17
Figure 23: This is the first step that you should choose a photo to detect
2 click open button to input the photos. The results are shows in Figure 24 below:
Figure 24: The results after you click the open button
The number: 5 represent the face number, and all the faces are marked by white circles as Figure
25 shows:
18
More than
Quantity
Success
Error
Accuracy
80
10
100
75
50
10
70
3 faces
Background 10
is difficult
Dont have
collar
Have
glasses
In total
19
our program is not affected by the background, because the skin color is totally different from the
background color; we delete the background part in 2.2 Skin Detection. And we can also ignore
the effects of glasses, but other parts are not as good as the first two parts we have introduced.
Those with more than 3 faces, have the accuracy rate at 80 percent. The lowest percentage is
seen in collar part, with a percentage of 75.
4. Discussions
In our program processing, we personally searched the database that we used, which included 10
test images. Depend on our program, the most detection is accurate, but there are also some
images that cannot be detected correctly, here are some examples:
The next task is to try to find out where the error occurred then identify images and analysis
results.
20
21
the circle include her hair and face, the reason is her hair color is similar as her skin color, so our
program detect her hair as part of the face, and the first and second woman on the left are also
not detected correctly, the reason is also about skin color and hair color. Our program divides the
background and faces by color, so it will be a limitation.
However, our project aim is limited, although there are some incidents as shown above, this
program can detect correctly in most images taken by the cameras at the middle distance. This is
the biggest limitation of our program, the reason is: I classify the faces depend on the size of the
skin color part, it will be a standard pixel size of our classifier which is 8x7 pixels head size, it is a
experienced value, so if the distance is too long or too short, the faces size will be too small or
too big, then the system will mistake them as noise to remove. The 8x7 pixel standard face size is
an experienced value. We defined it after training a large amount of times. This is also the most
important drawbacks for our program.
5. Conclusions
In short, this paper described a program which can detect faces from 8 X 7 pixels head size
photos using image process. The program can not only detect single face photo but also can
detect multi face photo correctly. Therefore, our research problem is almost successful
accomplished (see Chapter 1.4). Clearly, we have almost reached our research question; although
the distance should be appropriate, we can change the threshold number to detect person in
different distance. We can use our program to detect multi face photos more than three person,
at the same time, if a photo has only one or two person, our program can also detect them out,
so we have solved our problem correctly.
6. Acknowledgements
This work would not have been finished without the help of our supervisor Julia. Her input is
greatly appreciated, thank you.
7. Reference:
1 C.feng, Quwang, Yunming Du. Face Detection Based on Membership and Geometry Feature,
Journal, Information Technology, Harbin, 2007, 31(8), pp.84-87.
2 http://www.bioid.com/index.php?q=downloads/software/bioid-face-database.html accessed
2013.01.13.
3 http://wenku.baidu.com/view/3f5c70946bec0975f465e225.htm accessed 2013.01.13
4 Y. Ming Detecting Human Faces in Color Images from Beckman Institute and Department of
Electrical and Computer Engineering 2009 15th.
5 Z. ming Li; Li jieXue; Fei Tan; , "Face detection in complex background based on skin color
features and improved AdaBoost algorithms," Dec. 2010.
6 Prakash, C.; Gangashetty, S.V.; , "Bessel transform for image resizing," Systems, Signals and
Image Processing (IWSSIP), 2011 18th International Conference on , pp.1-4, 16-18 June 2011
22
7 J-Youn Kim; Lee-Sup Kim; Seung-Ho Hwang; , Circuits and Systems for Video Technology, IEEE
Transactions on "An advanced contrast enhancement using partially overlapped sub-block
histogram equalization,", pp.475-484, Apr 2001
8 X Jin; XinwenHou; Cheng-Lin Liu; , "Multi-class AdaBoost with Hypothesis Margin," Pattern
Recognition (ICPR), pp.65-68, 23-26 Aug. 2010
9 YCbCr Color Space, http://en.wikipedia.org/wiki/YCbCr accessed 2013.01.13
10 An introduction to face detection technology. http://inform.nu/Articles/Vol3/v3n1p01-07.pdf
accessed 2013.01.13
11 P. Viola and M. Jones, "Rapid object detection using a boosted cascade of simple features,"
Proceedings of IEEE Conference on ComputerVision and Pattern Recognition. May 2004
12 Glossary Grayscale Image, http://homepages.inf.ed.ac.uk/rbf/HIPR2/gryimage.htm, accessed
2013.01.13
13 M. Hu; Qiang Zhang; Zhiping Wang; , "Application of rough sets to image pre-processing for
Face detection," Information and Automation, 2008. ICIA 2008, pp.545-548, 20-23 June 2008
14 Meghabghab, G "Fuzzy Rough Sets as a Pair of Fuzzy Numbers: A New Approach and New
Findings," Fuzzy Information Processing Society, 2006. NAFIPS 2006. Annual meeting of the
North American, pp.46-51, 3-6 June 2006
15 Robert E. Schapire, Yoav Freund, Peter Bartlett, and Wee Sun Lee. Boosting the margin: A new
explanation for the effectiveness of voting methods. In Proceedings of the Fourteenth
International Conference on Machine Learning, 1997
16 Fleuret.F "Coarse-to-Fine Face Detection," International Journal of Computer Vision 41(1/2),
85107, 2001, 2001 Kluwer Academic Publishers. Manufactured in The Netherlands. Accepted
March 3, 2000
17 Terrillon, Jean-Christophe; Akamatsu, Shigeru (2000), Comparative Performance of Different
Chrominance Spaces for Color Segmentation, International Conference on Face and Gesture
Recognition, pp. 5461, retrieved 2008-02-10
18 http://140.129.118.16/~richwang/ImageProcessing/DIPBeginning.html accessed 2013.01.13
19 http://haltair.wordpress.com/2010/07/17/histogram-equalization-part-i/ accessed
2013.01.13
20http://en.pudn.com/downloads91/sourcecode/graph/texture_mapping/detail347209_en.htm
l accessed 2013.01.13
21 http://baike.baidu.com/albums/2395336/2395336/0/0.html#0$8a95ad1caa0770b087d6b6e7
accessed 2013.01.13
8. Appendix
The other photos result are shown below
23
24
25
26
27