Penggunaan Metode Template Matching Untuk Mendeteksi Cacat ...
Face Detection using Template Matching
description
Transcript of Face Detection using Template Matching
Face Detection using Template Matching
Deepesh JainHusrev Tolga IlhanSubbu Meiyappan
EE 368 – Digital Image ProcessingSpring 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
SkinSegmentation
RGB to YCbCrRGB to HSVThreshold to
determine skinregions
Multi-resolutionIterative
TemplateMatching
Using normxcorr2
Classifier
Input RGB JPEGImage
SkinPixels
AverageFace Threshold
Face/Non-Face
Skin Segmentation
• Skin segmentation using (Cr, Cb, Hue) space.
• Cleanup using morphological operators
rgb2ycbcr()
rgb2hsv()
Skin pixel If142 < Cr < 160
100 < Cb < 1500.9 < Hue, Hue < 0.1
Skin PixelsInputImage
Skin Segmentation Results
• 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)
Investigated Methods for Face Detection
1 2 3 4 5 6 7 8
Eigen Decomposition
1 2 3 4 5 6 7 8
original
MSE = 1.19e-022reconstructed
First 8 Eigen Images
Original and Reconstructed Images
•Sirovich and Kirby method•MSE Calculation (original & reconstructed)
Start
SkinSegmentation
Cross Correlationbetween Image Blocks and
all scaled average faces
Find Face Location
Face Loc = Pos(Max corr)Face Size = Size(avg face)
Blank out the Face
Using Face Loc &Size just found
Max(xcorr) >Threshold
Next Block
All BlocksDone?
Stop
No
No
Yes Yes
FaceCandidates
Average Faces
Template Matching
Temple Matching – Initially
image block
image
Temple Matching – Step 1
image
image block
Temple Matching – Step 2
image
image block
Temple Matching – Step 3
image
image block
Temple Matching - Finally
image
image block - residue
Results on a Sample Image
Results for Training_1.jpg
Training_1.jpg
Results
TrainingImage
Final Score
Detect Score
# Hits # Repeat
s
# False Positiv
es
Dist. to Centroi
d
CPU 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
17
16
15
14
13
5 (0)4 (19)12
5 (0)12 (08)11
2 (1)2 (20)10
2 (1)1 (22)9
1 (2)10 (14)8
5 (0)9 (16)7
5 (0)8 (17)6
5 (0)11 (13)5
5 (0)6 (18)4
5 (0)6 (18)3
5 (0)2 (20)2
2 (1)4 (19)1
Gender RecognitionFace Detection
17
16
15
14
13
5 (0)4 (19)12
5 (0)12 (08)11
2 (1)2 (20)10
2 (1)1 (22)9
1 (2)10 (14)8
5 (0)9 (16)7
5 (0)8 (17)6
5 (0)11 (13)5
5 (0)6 (18)4
5 (0)6 (18)3
5 (0)2 (20)2
2 (1)4 (19)1
Gender RecognitionFace Detection