You are on page 1of 2

11/3/13 mjp/FaceRecognition

https://github.com/mjp/FaceRecognition 1/2
[
HTTPS clone URL
https://github.com/mjp/FaceRecognition.git
You can clone with HTTPS, SSH,
or Subversion.
_ latest commit 0d6e1dacae
An example iOS application for face detection and recognition using OpenCV

Update Readme.md
mjp authored 2 months ago
M FaceRecognition.xcodeproj Can use either camera 4 months ago
M FaceRecognition Can use either camera 4 months ago
M opencv2.framework Add openCV framework a year ago
_ .gitmodules Can use either camera 4 months ago
_ LICENSE Add MIT license (closes #4) 4 months ago
_ Readme.md Update Readme.md 2 months ago
Readme.md
This is an example iPhone application that performs face detection and recognition using the excellent OpenCV
framework.
First you need to initialise the (ELCImagePickerController)[https://github.com/elc/ELCImagePickerController]
submodule:
$gitsubmoduleupdateinitrecursive
Obviously, the app needs the camera to function, and will not work on the simulator.
The app was tested on iOS 6 using an iPhone 5. Other iOS versions and devices will probably work, but I can't
say for sure. On iPhone 4 you will have to play with the spacing of the buttons.
The first step will be to train the model with some faces. Importing existing images is not supported for various
reasons, so you will need to capture face images using the camera. The steps to perform this are as follows:
1. Navigate to the "People" tab, and add a new person.
2. Once the person shows up in the list, tap on their name.
3. Instructions are provided on how to capture images of that person's face for later detection. The app uses
either camera.
4. When capturing images, try and move the camera slightly to capture different angles of your face.
5. Alternative you can pick images from the library. You should pick 10 with the face you want the app to
learn.
6. Repeat for other people as necessary.
Once the app has at least one person in the database with face images, face recognition can occur.
Navigate to the "Recognize" tab, and the camera will start. If a face is detected, it will be highlighted with a red
box. If that face is recognized from the database, it will be highlighted with a green box. The name of that person
will appear on top of the image, and a confidence score of the face recognition will be displayed.
rupaksp [ y (
7 51 18
@ Watch Star Fork
mjp / FaceRecognition
PUBLIC
g
O Code
Issues 0
Q Pull Requests 0
Wiki
+ Pulse
@ Graphs
y Network
_
@
g Clone in Desktop
Download ZIP
Q 26 commits y 1 branch ( 0 releases Q 3 contributors
[ y master branch: FaceRecognition / _
Face Detection & Recognition on iOS
Usage
Explore Gist Blog Help Search or type a command This repository @
11/3/13 mjp/FaceRecognition
https://github.com/mjp/FaceRecognition 2/2
The confidence value provided by the face recognition algorithm is basically a difference score between the
input image and what the model knows about a given person's face.
Therefore, a lower confidence score means the model is more confident of its suggested match - because there
is less of a difference between the input face and the faces of that person in the database.
The CustomFaceRecognizer class can be initialized using one of 3 different face recognition algorithms. By
default it uses an Eigenfaces algorithm, but you can change this easily by using a different initWith method. For
a discussion of the various algorithms available, see this OpenCV tutorial.
The available algorithms are:
Eigenfaces (initWithEigenFaceRecognizer)
Fisherfaces (initWithFisherFaceRecognizer)
Local Binary Patterns Histogram (initWithLBPHFaceRecognizer)
After you have initialized the recognizer with one of these methods, training and recognition works the same.
You can switch algorithms without having to re-train the model.
Setting up OpenCV in iOS
Face detection in OpenCV
Face recognition in OpenCV
A note about confidence scores
Using different algorithms
Credits
Status API Training Shop Blog About 2013 GitHub, Inc. Terms Privacy Security Contact
[

You might also like