View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
Face Recognition Software

4.5 | 6 ratings Rate this file 88 Downloads (last 30 days) File Size: 4 MB File ID: #37351 Version: 1.3
image thumbnail

Face Recognition Software


Omid Sakhi (view profile)


29 Jun 2012 (Updated )

Face recognition software using Hidden Markov Models (HMM) and SVD features for education and study.

| Watch this File

File Information

Version : 1.0

Please visit the official website for this program at the address:

To run the program:

    1- copy all files and directories to the MATLAB's work folder

    2- find the file named "mainmenu.m"

    3- Double click on this file or type "main" in the command window

    4- The system is already trained for ORL database and loaded. You do not need to load or generate anything.

    5- click on "Recognize a Face" to guess the person name.

Currently the recognition rate is about 96% in less than 0.22 sec per person.

Based on:
H. Miar-Naimi and P. Davari, "A New Fast and Efficient HMM-Based Face Recognition System Using a 7-State HMM Along With SVD Coefficients"

Required Products Data Acquisition Toolbox
Image Processing Toolbox
MATLAB release MATLAB 7.11 (R2010b)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (18)
25 Oct 2016 Sonia Mittal

18 Oct 2016 Leonardo Cuaresma

Sir Omid,

do you have any basis why did you used 7 state HMM?

Comment only
07 Oct 2016 Leonardo Cuaresma

sir may I just know why did you used 7state HMM?

01 Oct 2016 Mahendra Singh Meena

Dear Mr Omid,

I know it difficult for you now as the code was written long back but can you please please please update the MATLAB files with comments so code is little easy to understand. Personally speaking I have been trying to understand the code for last one week and I could only understand 20% of it.

Comments will be really helpful.

And one question: when I am applying illumination normalization techniques instead of 2D static filter recognition rate goes for a toss. Any specific reason behind it??

Thank you in advance.

27 Jul 2016 Adnan

Adnan (view profile)

Thank you so much

Comment only
14 Jun 2016 Hau Le Hanh

Thanks you!

Comment only
28 Sep 2015 zainab shaheen

AOA sir.. sir can u please tell me why wo use ORL database in the form of s1 to s40 formate and each folder contain 10 images in pgm formate..

my 2nd question is how we recognize a face through ORL Data base,,, and what is output of this project..

plzz help me/...

Comment only
29 Apr 2014 Faniya Mokhayeri

19 Apr 2014 Anry

Anry (view profile)

30 Mar 2014 Mubeen

Mubeen (view profile)

Sir, I am get the following error while generating a new database. I have tried the ORL database which was provided with the code.

Loading Faces ...
Reference to non-existent element of a cell array.

Error in gendata (line 55)
blk_coeffs = myDatabase{2,person_index}{block_index,image_index};

Please could you point out what is going wrong.

Comment only
16 May 2013 Sofineti Mihai

Can someone explain or comment this code?
From where i can download or buy guide "Face Recognition Guide + Code for MATLAB"?
Thank's in advance.

Comment only
16 May 2013 Sofineti Mihai

Can someone explain or comment this code? Thank's in advance.

Comment only
01 Mar 2013 Rachid

Rachid (view profile)

with the variant:
vid = videoinput('winvideo', 1, 'RAW8_1280x1024');
it hasn't worked either, what i still can change so that the webcam option works?

Comment only
02 Feb 2013 ahmed alhamdani

Dear Omid Sakhi;

Thank you for interested.


The specific for what I need help is about how I can use the output data from SVM as input to HMM. My project is about ( ISOLATED WORD speech RECOGNITION Using Hybrid SVM /HMM).


The data base consists 25 speakers ,male ,female, young and child each speaker the same utter the same 20 words .

The file is saved as (*.wav);

The preprocessing includes sampling, segmentation, framing and windowing.

Sampling frequency=11025Hz

16 – Bit A/D Converter.

Framing the continuous speech signal is blocked into frames of N samples N=256(which is equivalent to23msec) .

Overlaps between frames =128;

Using Hamming window for windowing each frame.

My question is this procedure right or not???


Feature extraction

The Discrete wavelet transform(DTW) daubechies filter and pitchdetection used In order to evaluate feature vectors . Used this feature vectors as input to Hybrid SVM/HMM for training and testing system .

I will do all this pre-processing and processing steps and I have a table of feature vector for each word.

My question is this procedure right or not???

Hybrid model of SVM/HMM

The hybrid model includes two parts: training and classification. Firstly , parameters of model can be obtained by training. Secondly, it can be calculated the probability estimate by Viterbi.

But the output of SVM is numerical value. For combined with HMM easily, it should transform the value into probability .

My question how can Ido that when I used this feature vector as input to Hybrid SVM/HMM for training and testing system to recognize each word (so I needed algorithm and program to do that using matlab).

With Best Regards

Ahmed Alhamdani

warsaw -poland


Comment only
04 Sep 2012 Nicola Franzoso

Omid, now it's clear, just a question
about your constant setting inside the code example TRGUESS and so on ..
If i have different type of face images can i use your settings or is possible to improved the recognition during the generation data ?
Thank's in advance


Comment only
20 Jul 2012 Omid Sakhi

Omid Sakhi (view profile)

Hey Nicola. The reason is that we have many labels that can be used in each state. When you decrease the number of training images per person from 5 to 1, the HMM model does not have enough sequence/data to work with. The transition and emission probabilities become dangerously sparse with lots of zeros (or do not change much from the initial probabilities). That is why the recognition accuracy declines.

Comment only
16 Jul 2012 Nicola Franzoso

Mr Omid, if you try with one persone for each the system not work so well, why ?

Comment only
02 Jul 2012 robin

robin (view profile)

C'est Magnifique!!!

13 Feb 2013 1.1

In this update, I have just corrected some typos and I also changed the name from face recognition system to face recognition software.

13 Feb 2013 1.2


13 Feb 2013 1.3

The last update didn't go through.

Contact us