Face Detection Project
Waqar Mohsin wmohsin@stanford.edu
Noman Ahmed khattak@stanford.edu
Chung-Tse Mar ctmar@stanford.edu
May 26, 2003
EE368 Digital Image Processing
Spring 2002-2003
Department of Electrical Engineering
Stanford University
EE368 Digital Image Processing
1 Introduction
The goal of this project is to detect and locate human faces in a color image. A set of seven
training images were provided for this purpose. The objective was to design and implement a face
detector in MATLAB that will detect human faces in an image similar to the training images.
The problem of face detection has been studied extensively. A wide spectrum of techniques have
been used including color analysis, template matching, neural networks, support vector machines
(SVM), maximal rejection classification and model based detection. However, it is difficult to
design algorithms that work for all illuminations, face colors, sizes and geometries, and image
backgrounds. As a result, face detection remains as much an art as science.
Our method uses rejection based classification. The face detector consists of a set of weak
classifiers that sequentially reject non-face regions. First, the non-skin color regions are rejected
using color segmentation. A set of morphological operations are then applied to filter the clutter
resulting from the previous step. The remaining connected regions are then classified based on
their geometry and the number of holes. Finally, template matching is used to detect zero or more
faces in each connected region. A block diagram of the detector is shown in Figure 1.
Figure 1. Block diagram of face detector
2 Skin Color Segmentation
The goal of skin color segmentation is to reject non-skin color regions from the input image. It is
based on the fact that the color of the human face across all races agrees closely in its
chrominance value and varies mainly in its luminance value.
We chose the HSV (Hue, Saturation, Value) color space for segmentation since it decouples the
chrominance information from the luminance information. Thus we can only focus on the hue
and the saturation component. The faces in each training image were extracted using the ground
truth data and a histogram was plotted for their H and S color component (Figure 2). The
histograms reveal that the H and S color components for faces are nicely clustered. This
information was used to define appropriate thresholds for H and S space that correspond to faces.
The threshold values were embedded into the color segmentation routine.
During the execution of the detector, segmentation is performed as follows:
1. The input image is subsampled at 2:1 to improve computational efficiency
2. The resulting image is converted to HSV color space
3. All pixels that fall outside the H and S thresholds are rejected (marked black).
The result is shown in Figure 3.
1
EE368 Digital Image Processing
Figure 2. Histograms for the H and S components of all faces in training image1
Figure 3. Image after histogram thresholding (training image 1)