You are on page 1of 19

Face Detection using

Template Matching

Deepesh Jain
Husrev Tolga Ilhan
Subbu Meiyappan

EE 368 Digital Image Processing


Spring 2002-2003
05/30/03
Face Detection
Objectives

System Architecture

Skin Color Segmentation

Studied Methods

Iterative Template Matching

Classification

Experimental Results

Conclusions
Objectives
Devise Simple and Fast algorithm for
face detection
Detect as many faces as possible in the
training images, including occluded ones
Minimize detection of non-faces and
multiple detects
Results for Training_1.jpg
System Architecture

Skin
Segmentation Multi-resolution Face/
Input RGB JPEG Skin Iterative Non-Face
Image Pixels Template
RGB to YCbCr Classifier
RGB to HSV Matching
Threshold to
determine skin Using normxcorr2
regions
Average
Face Threshold
Skin Segmentation

Skin segmentation using (Cr, Cb, Hue)


space.

rgb2ycbcr() Skin pixel If Skin Pixels


Input 142 < Cr < 160
Image 100 < Cb < 150
rgb2hsv() 0.9 < Hue, Hue < 0.1

Cleanup using morphological operators


Skin Segmentation Results
Investigated Methods for Face Detection
1 2 3 4 5

Eigen Decomposition of faces


Dropped, eigenimages could not classify occluded images
For full face images, had 100% accuracy for both face
detection and gender recognition

Template Matching
Template matching with various average face pyramid levels

Wavelets and Neural Nets


Wavelets for multiresoltion analysis and ANNs for
classification (Linear Vector Quantization approach)
Eigen Decomposition
Sirovich and Kirby method
MSE Calculation (original & reconstructed)

First 8 Eigen Images


1 2 3 4 5 6 7 8

Original and Reconstructed Images


MSE = 1.19e-022
original reconstructed
Start

Template Matching Skin


Segmentation

Face
Candidates

Cross Correlation
between Image Blocks and
Next Block
all scaled average faces

No
Average Faces
Max(xcorr) > No All Blocks
Threshold Done?

Yes Yes

Find Face Location Stop

Face Loc = Pos(Max corr)


Face Size = Size(avg face)

Blank out the Face

Using Face Loc &


Size just found
Temple Matching Initially

image block

image
Temple Matching Step 1

image block

image
Temple Matching Step 2

image block

image
Temple Matching Step 3

image block

image
Temple Matching - Finally

image block - residue

image
Results on a Sample Image
Training_1.jpg
Results for Training_1.jpg
Results
TrainingI Final Detect # Hits # # False Dist. to CPU
mage Score Score Repeats Positives Centroid time
Training_1 21 21 21 0 0 12.10 163.87

Training_2 20 20 23 1 2 16.61 172.76

Training_3 23 23 25 0 2 8.84 161.54

Training_4 21 21 24 1 2 15.87 133.66

Training_5 23 23 23 0 0 11.91 146.11

Training_6 23 23 24 0 1 9.46 147.51

Training_7 20 20 22 1 0 17.55 198.78


Conclusion

Good skin segmentation is a key factor for


good face recognition
Eigenimages did not do well with occluded
faces
Template matching did very well for face
detection
Fast algorithm (<4 mins)
Multi-resolution Pyramid scheme necessary
to match faces of various sizes
Face Detection Gender Recognition
1 4 (19) 2 (1)
2 2 (20) 5 (0)
3 6 (18) 5 (0)
4 6 (18) 5 (0)
5 11 (13) 5 (0)
6 8 (17) 5 (0)
7 9 (16) 5 (0)
8 10 (14) 1 (2)
9 1 (22) 2 (1)
10 2 (20) 2 (1)
11 12 (08) 5 (0)
12 4 (19) 5 (0)
13
14
15
16
17

You might also like