Face Recognition using OpenCV

15
Face detection in android media apps Adding more value to applications Hackathon, Mobile Day Endava 24.06.2013

description

Describing face recognition API exposed by OpenCV for Android. This small API makes use of Android NDK to get the most from OpenCV library.

Transcript of Face Recognition using OpenCV

Page 1: Face Recognition using OpenCV

Face detection in android media apps

Adding more value to applicationsHackathon, Mobile DayEndava24.06.2013

Page 2: Face Recognition using OpenCV

• Face detection/recognition – what’s all about?

• Pioneers in face recognition

• Add value to your media apps

• What we want to…

• Tools & technologies

• How it’s all mixed up?

• How all things work together?

• How can we make it work?

• Some facts

• Don’t forget about privacy

• Q&A

Highlights

2

Page 3: Face Recognition using OpenCV

3IN YOUR ZONE

Face detection/recognition – what’s all about?

•Face detection

• Definition

• Use cases

•Face recognition

•Definition

•Use cases

Page 4: Face Recognition using OpenCV

4IN YOUR ZONE

Pioneers in face recognition

•Marker points (position of eyes, ears, nose)

• Kanade, T. (November 1973) - Euclidean distance between feature vectors of a probe and reference image

• Eigenfaces – Turk, M. & Pentland, A. – a holistic approach to face recognition

• Fisherfaces – Belhumeur, P. N., Hespanha, J., and Kriegman, D. (1997) - Eigenfaces vs. Fisherfaces

• Local feature extraction:

• Gabor Wavelets – Wiskott, L., Fellous, J., Krüger, N., Malsburg, C. (1997)

• Discrete Cosinus Transform – Messer, K. (2006

• Local Binary Patterns – Ahonen, T., Hadid, A., and Pietikainen, M. (2004)

Page 5: Face Recognition using OpenCV

5IN YOUR ZONE

Add value to your media apps

• Face tagging in social media

• Sharing – open new ways to share

Page 6: Face Recognition using OpenCV

6IN YOUR ZONE

Add value to your media apps

•Android Device lock, specific applications face authorization

•Determining friends in video clips

Page 7: Face Recognition using OpenCV

7IN YOUR ZONE

What we want to…

•Detect faces in a specific image

• Recognize a tagged contact in Android Media library

Page 8: Face Recognition using OpenCV

8IN YOUR ZONE

Tools & technologies

Page 9: Face Recognition using OpenCV

9IN YOUR ZONE

How it’s all mixed up?

Page 10: Face Recognition using OpenCV

10IN YOUR ZONE

How all things work together?

Page 11: Face Recognition using OpenCV

11IN YOUR ZONE

How can we make it work?

Mat imgGray = imread(originalImageName, CV_LOAD_IMAGE_GRAYSCALE);CascadeClassifier face_cascade;if(face_cascade.load(cascadeFilePath)){ face_cascade.detectMultiScale(loadedImageData, faces);}

Ptr<FaceRecognizer> recognizer = createLBPHFaceRecognizer();//training modelrecognizer->train(images, labels);

//face predictionrecognizer->predict(scalledFace, predicted_label, predicted_confidence);

Face detection

Face detection

Face recognition

Page 12: Face Recognition using OpenCV

12IN YOUR ZONE

Some facts about face recognition

14 faces 25 faces 40 faces0.00

5.00

10.00

15.00

20.00

25.00

30.00

35.00

40.00

45.00

50.00

Recognition ratio

Local Binary Paths Histogram (LBPH) FisherFaces EigenFaces

Perc

enta

ge

Page 13: Face Recognition using OpenCV

13IN YOUR ZONE

Don’t forget about privacy

•Make use of privacy policies and/or disclaimers

Privacy matters to me!!!That’s why I’m using privacy visor…

Page 14: Face Recognition using OpenCV

14IN YOUR ZONE

Q&A

Page 15: Face Recognition using OpenCV

15IN YOUR ZONE

That’s it…

Vasile Chelban | Android Developer

thank you

http://opencv.org/platforms/android.html

http://developer.android.com/tools/sdk/ndk/index.html

http://developer.android.com/sdk/index.html