REAL TIME FACE DETECTION Justin Rilling Pooja Mhapsekar Moinuddin Sayed Ogom J Obinor.

35
REAL TIME FACE DETECTION Justin Rilling Pooja Mhapsekar Moinuddin Sayed Ogom J Obinor

Transcript of REAL TIME FACE DETECTION Justin Rilling Pooja Mhapsekar Moinuddin Sayed Ogom J Obinor.

Page 1: REAL TIME FACE DETECTION Justin Rilling Pooja Mhapsekar Moinuddin Sayed Ogom J Obinor.

REAL TIME FACE DETECTION

Justin RillingPooja MhapsekarMoinuddin Sayed

Ogom J Obinor

Page 2: REAL TIME FACE DETECTION Justin Rilling Pooja Mhapsekar Moinuddin Sayed Ogom J Obinor.

2

IntroductionIntroduction

• The idea is to be able to detect faces appearing in an image.

• The faces can be of different sizes and orientations.

• The motivation behind implementing this on an FPGA is that image processing is inherently parallel in nature and lends itself well to an FPGA.

Page 3: REAL TIME FACE DETECTION Justin Rilling Pooja Mhapsekar Moinuddin Sayed Ogom J Obinor.

3

Viola and Jones’ DetectorViola and Jones’ Detector

Key Contributions

1. Integral Image – fast computation of features used by the detector.

2. Combines complex classifiers in “cascade” – focus on facial features.

Page 4: REAL TIME FACE DETECTION Justin Rilling Pooja Mhapsekar Moinuddin Sayed Ogom J Obinor.

4

Integral ImageIntegral Image

• Major contribution of the Viola and Jones detector.

• Summation of pixel values of the original image.

• Value at location (x,y) = sum of values of pixels above and to the left of (x,y).

• Whole image converted to integral image and a window buffer used to scan the entire image.

Page 5: REAL TIME FACE DETECTION Justin Rilling Pooja Mhapsekar Moinuddin Sayed Ogom J Obinor.

5

Haar ClassifiersHaar Classifiers

• Classifiers are composed of 2-3 rectangles.

• Weights and sizes associated with features – obtained through AdaBoost.

• Classifier sum = ∑ (area * weights)

• Integral image makes area calculation easy. Area = L4–L3–L2+L1.

• Several classifiers compose a stage.

Page 6: REAL TIME FACE DETECTION Justin Rilling Pooja Mhapsekar Moinuddin Sayed Ogom J Obinor.

6

StageStage

• Sum of all Haar feature classifiers compared with the stage threshold.

• Multiple stages, each stage has different number of classifiers.

• Threshold obtained from AdaBoost algorithm.

Page 7: REAL TIME FACE DETECTION Justin Rilling Pooja Mhapsekar Moinuddin Sayed Ogom J Obinor.

Face Detection Example

0.0Classifier Sum

< 0.0Classifier Threshold

0.0Right Value

0.0Left Value0.0

Stage Sum

+0.0Stage Threshold

<1

0

0Stage Number

0Classifier Number

Page 8: REAL TIME FACE DETECTION Justin Rilling Pooja Mhapsekar Moinuddin Sayed Ogom J Obinor.

Face Detection Example

426Classifier Sum

< 542Classifier Threshold

0.8378106Right Value

0.0337941Left Value0.0

Stage Sum

+0.8226894Stage Threshold

<1

0

0Stage Number

0Classifier Number

Page 9: REAL TIME FACE DETECTION Justin Rilling Pooja Mhapsekar Moinuddin Sayed Ogom J Obinor.

Face Detection Example

426Classifier Sum

< 542Classifier Threshold

0.8378106Right Value

0.0337941Left Value0.0337941

Stage Sum

+0.8226894Stage Threshold

<1

0

0Stage Number

0Classifier Number

Page 10: REAL TIME FACE DETECTION Justin Rilling Pooja Mhapsekar Moinuddin Sayed Ogom J Obinor.

Face Detection Example

887Classifier Sum

< 2045Classifier Threshold

0.7488812Right Value

0.1514132Left Value0.0337941

Stage Sum

+0.8226894Stage Threshold

<1

0

0Stage Number

1Classifier Number

Page 11: REAL TIME FACE DETECTION Justin Rilling Pooja Mhapsekar Moinuddin Sayed Ogom J Obinor.

Face Detection Example

887Classifier Sum

< 2045Classifier Threshold

0.7488812Right Value

0.1514132Left Value0.1852073

Stage Sum

+0.8226894Stage Threshold

<1

0

0Stage Number

1Classifier Number

Page 12: REAL TIME FACE DETECTION Justin Rilling Pooja Mhapsekar Moinuddin Sayed Ogom J Obinor.

Face Detection Example

349Classifier Sum

< 568Classifier Threshold

0.6374819Right Value

0.0900493Left Value0.1852073

Stage Sum

+0.8226894Stage Threshold

<1

0

0Stage Number

2Classifier Number

Page 13: REAL TIME FACE DETECTION Justin Rilling Pooja Mhapsekar Moinuddin Sayed Ogom J Obinor.

Face Detection Example

349Classifier Sum

< 568Classifier Threshold

0.6374819Right Value

0.0900493Left Value0.2752566

Stage Sum

+0.8226894Stage Threshold

<1

0

0Stage Number

2Classifier Number

Page 14: REAL TIME FACE DETECTION Justin Rilling Pooja Mhapsekar Moinuddin Sayed Ogom J Obinor.

Face Detection Example

349Classifier Sum

< 568Classifier Threshold

0.6374819Right Value

0.0900493Left Value0.2752566

Stage Sum

+0.8226894Stage Threshold

<1

0

0Stage Number

2Classifier Number

Window Buffer Failed Stage 0

Page 15: REAL TIME FACE DETECTION Justin Rilling Pooja Mhapsekar Moinuddin Sayed Ogom J Obinor.

Face Detection Example

0.0Classifier Sum

< 0.0Classifier Threshold

0.0Right Value

0.0Left Value0.0

Stage Sum

+0.0Stage Threshold

<1

0

0Stage Number

0Classifier Number

Page 16: REAL TIME FACE DETECTION Justin Rilling Pooja Mhapsekar Moinuddin Sayed Ogom J Obinor.

Face Detection Example

0.0Classifier Sum

< 0.0Classifier Threshold

0.0Right Value

0.0Left Value0.0

Stage Sum

+0.0Stage Threshold

<1

0

0Stage Number

0Classifier Number

Page 17: REAL TIME FACE DETECTION Justin Rilling Pooja Mhapsekar Moinuddin Sayed Ogom J Obinor.

Face Detection Example

0.0Classifier Sum

< 0.0Classifier Threshold

0.0Right Value

0.0Left Value0.0

Stage Sum

+0.0Stage Threshold

<1

0

0Stage Number

0Classifier Number

Page 18: REAL TIME FACE DETECTION Justin Rilling Pooja Mhapsekar Moinuddin Sayed Ogom J Obinor.

Face Detection Example

0.0Classifier Sum

< 0.0Classifier Threshold

0.0Right Value

0.0Left Value0.0

Stage Sum

+0.0Stage Threshold

<1

0

0Stage Number

0Classifier Number

Page 19: REAL TIME FACE DETECTION Justin Rilling Pooja Mhapsekar Moinuddin Sayed Ogom J Obinor.

Face Detection Example

0.0Classifier Sum

< 0.0Classifier Threshold

0.0Right Value

0.0Left Value0.0

Stage Sum

+0.0Stage Threshold

<1

0

0Stage Number

0Classifier Number

Page 20: REAL TIME FACE DETECTION Justin Rilling Pooja Mhapsekar Moinuddin Sayed Ogom J Obinor.

Face Detection Example

0.0Classifier Sum

< 0.0Classifier Threshold

0.0Right Value

0.0Left Value0.0

Stage Sum

+0.0Stage Threshold

<1

0

0Stage Number

0Classifier Number

Page 21: REAL TIME FACE DETECTION Justin Rilling Pooja Mhapsekar Moinuddin Sayed Ogom J Obinor.

Face Detection Example

0.0Classifier Sum

< 0.0Classifier Threshold

0.0Right Value

0.0Left Value0.0

Stage Sum

+0.0Stage Threshold

<1

0

0Stage Number

0Classifier Number

Page 22: REAL TIME FACE DETECTION Justin Rilling Pooja Mhapsekar Moinuddin Sayed Ogom J Obinor.

22

Top Level DesignTop Level Design

YES

Get ScaledImage

Get Integral Image

Window Buffer (21x21)

Face Detection PipelineEnd of

Image?

NO

Monitor

Draw RectangleIf face is det.

Get Image

Page 23: REAL TIME FACE DETECTION Justin Rilling Pooja Mhapsekar Moinuddin Sayed Ogom J Obinor.

Face Detection Pipeline

Page 24: REAL TIME FACE DETECTION Justin Rilling Pooja Mhapsekar Moinuddin Sayed Ogom J Obinor.

Original End Product

USB Webcam FPGA Display

USB DVI

Page 25: REAL TIME FACE DETECTION Justin Rilling Pooja Mhapsekar Moinuddin Sayed Ogom J Obinor.

Updated End Product

Digital Interface

1/3 Color Camera Mod C3188A-6018• Supports several standard image data

formats including YCrCb 4:2:2 • 640 x 480 resolution• 5 V signaling • 30 fps

FPGA Display DVI

Page 26: REAL TIME FACE DETECTION Justin Rilling Pooja Mhapsekar Moinuddin Sayed Ogom J Obinor.

3.3 VSignaling

Updated End Product

XC95144XLCPLD

Display

5 VSignaling

DVI1/3 Color Camera Mod C3188A-6018• Supports several standard image data

formats including YCrCb 4:2:2 • 640 x 480 resolution• 5 V signaling • 30 fps

FPGA

Page 27: REAL TIME FACE DETECTION Justin Rilling Pooja Mhapsekar Moinuddin Sayed Ogom J Obinor.

DVI Controller

Page 28: REAL TIME FACE DETECTION Justin Rilling Pooja Mhapsekar Moinuddin Sayed Ogom J Obinor.

Questions ???

References:

1. P. Viola and M. Jones, “Robust real-time object detection,” International Journal of Computer Vision, 57(2), 137-154, 2004.

2. Junguk Cho, Shahnam Mirzaei, Jason Oberg, Ryan Kastner, “FPGA-Based Face Detection System Using Haar Classifiers,” Proceeding of the ACM/SIGDA International Symposium on Field Programmable Gate Arrays, 103-112, 2009.

Page 29: REAL TIME FACE DETECTION Justin Rilling Pooja Mhapsekar Moinuddin Sayed Ogom J Obinor.

OpenCV Program – Lena.jpg

Page 30: REAL TIME FACE DETECTION Justin Rilling Pooja Mhapsekar Moinuddin Sayed Ogom J Obinor.

OpenCV Program – ER.jpg

Page 31: REAL TIME FACE DETECTION Justin Rilling Pooja Mhapsekar Moinuddin Sayed Ogom J Obinor.

OpenCV Program – ER.jpgWindow Buffer (2, 152, 122)Window Buffer (2, 152, 122)

Page 32: REAL TIME FACE DETECTION Justin Rilling Pooja Mhapsekar Moinuddin Sayed Ogom J Obinor.

Face Detection Pipeline

Page 33: REAL TIME FACE DETECTION Justin Rilling Pooja Mhapsekar Moinuddin Sayed Ogom J Obinor.

OpenCV Program – ER.jpgWindow Buffer (3, 165, 20)Window Buffer (3, 165, 20)

Page 34: REAL TIME FACE DETECTION Justin Rilling Pooja Mhapsekar Moinuddin Sayed Ogom J Obinor.

Face Detection Pipeline

Page 35: REAL TIME FACE DETECTION Justin Rilling Pooja Mhapsekar Moinuddin Sayed Ogom J Obinor.

Questions ???