|
This face recognition tool gives the computer the ability to recognize a face from image files (BMP format) or directly from an USB camera. The system requirements for this application are a Pentium® processor-based computer and Microsoft* Windows* NT 4.0, 98, or 2000. The face recognition uses OpenCV code for embedded hidden Markov model. The approach is described in "Face recognition using an embedded HMM" paper.
At startup, application tries to locate USB camera. If succeeded the main application window will appear:
There are two panes or views - camera view on the right and face database on the left. Initially, no database is loaded.
- create new face database. Current base will be saved to disk.
- open face database (stored in txt file) or open BMP file.
- specify current face database parameters.
- add face into face database.
- delete face from database.
- zoom face database images.
- decimate face database images.
- pause/resume camera capture.
- specify camera resolution.
- adjust video quality parameters.
- select whole image in Camera view.
- train HMM(s).
- recognize face, selected in camera view.
- delete all HMM information for face base.
- about HMMDemo.
Initially camera view contents picture from camera. Button pauses/resumes capture.
User can specify rectangular image region on camera view using mouse (please begin selecting region from top left corner and finish at right bottom corner to avoid crashes). Whole image can be selected by button.
Selected rectangular region can be added into database using button or recognized using button.
Camera view can also content image from BMP file. BMP file can be opened by button.
When face database is opened “Database view” contents images from this base. Base view can be stated in 2 modes: “all mode” and “person mode”.
In “all mode”, for every person, stored in database, only one picture is shown. This situation is shown below.
In “person mode” all faces of one person are shown. This is depicted below.
How to switch between “all mode” and “person mode?
Type filename and some signature in specified fields.
Now you can add faces into base.
Select region with new face and press button.
If “base view” is in “person mode”, face will be added to person feces list.
If “base view” in “all mode” you can be asked to specify person name. You can choose name from list of existing names (in this case image will join corresponding person images) or type new name (in this case new person with specified name will be created)
You can always delete any image or any person from base. For this purposes click on image or person you want to delete and press button.
When you perform add/delete operations, database saves automatically all your changes.
When you've collected several persons and several photos present each one, you can train HMMs of every person. You can do it both in “all mode” and “person mode”.
To train HMMs of all persons switch to “all mode” and press button. All untrained HMMs will be trained (clock-cursor will be shown during training process).
To train HMM of concrete person switch to “person mode” and press button. HMM of the current person will be trained and the changing segmentation of the first image of the person will be rendered.
Note, than you add/delete person images, corresponding HMM becomes untrained, and after all changes user must retrain all untrained HMMs.
If all HMMs are trained you can try to recognize somebody. To do this
Result of recognition will appear as message box with 3 person names. First name will correspond to most similar person etc. “Database view” will be switched into “all mode” and most similar person will be highlighted with magenta rectangle.
To demonstrate recognition rate of eHMM technique the batch recognition was implemented in HMMDemo.
For batch recognition you must have 2 face bases: one as training base and other as base for recognition. Both bases must be “personally” equal, i.e. base for recognition must consist of persons, which present in training base (true matching is made by names).
Here is scenario of batch recognition.
There are several types of settings in HMMDemo concerning use of HMMs.
To obtain settings property sheet go to Options->Settings item of menu.
Presently we have the following types of parameters.
1) Sampling parameters
2) HMM parameters
Number of checked checkboxes = number of superstates of HMM.
Value in editbox near checkbox is number of states within corresponding superstate.
All internal states of HMM have the same number of component of Gaussian mixture (here 3)
3) Other parameters
In HMM face recognition it is important that face images must have not very different sizes. So we must scale images, when we train or recognize. Above dialog allows to specify what scaling will be used.
Also you can store and load settings to/from any other config file.
Use “File->Save config file” and “File->Load config file” for these purposes.
Every time you change settings via property pages or loading config file and these new settings differs from you had before – all training information (hmms) are cleared.