At startup, application tries to
locate USB camera and runs it in YUV mode. In success main application window
will appear as the following.
Base view Camera view
Main window is divided into 2 views.
Right view usually contents view from camera (“Camera view”). Left view is for
image database (“Base view”).
- 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
person(s) 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.
Base view.
When face database is opened “Base 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 show below.
In “person mode” all
faces of one person are shown. This is depicted below.
How to switch between “all mode” and “person mode?
To switch from “all mode” to “person mode” double click on
image of person you are interested.
To switch from “person mode” to “all mode” double click on
free (not image) space of base view.
At startup, application creates empty database. By default,
new base is placed in untitled_base.txt file. To specify new database file
press button and fill fields of following dialog
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 person
will be trained and during training segmentation of first image of person will
appear.
Note, than
you add/delete person images, corresponding HMM becomes untrained, and after
all changes user must train all untrained HMMs.
If all
HMMs are trained you can try to recognize somebody.
For this
1) Select
face region in “camera view” (from camera of BMP file)
2) Press button.
Result of recognition will appear as message box with 3
person names. First name will correspond to most similar person etc. “Base 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 base: 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.
1)
Create first face base in usual way. Save it.
2)
Create second base, which consists of people from first base
(names must be equal in both bases), using another images. Save it.
3)
Load first base and train it.
4)
Go menu item “Options->Recognize another base”. You will
be prompted to define .txt file, which is file of base you want recognize.
Choose the base and recognition starts.
5) Recognition can take much time with large base. Be patient during cursor is “clock”. In the end of recognition massage box will appear. It will report how many images were processed and successfully recognized.
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.
If “Width” box is checked and “Height” is not checked, then
all images will be scaled to have specified width, height of every image will
be scaled proportionally.
If “Height” box is checked and “Width” is not checked, then
all images will be scaled to have specified height, width of every image will
be scaled proportionally.
If “Width” box is checked and “Height” is checked, then all
images will be scaled to have specified width and specified height.
“Suppress intensity” flag allows not considering lowest DCT coefficient. This can help in case of different illumination conditions in training images and tested image.
1)
When you start/exit application, it loads/stores settings
from/into windows registry.
2)
Every time you train base or recognize person settings,
which are displayed in property pages, are used.
3)
If any
person of facebase was trained and you save facebase – configuration file,
which stores all settings, are saved.
If the name of facebase file is “Base.txt”, then config file
will have “BaseCFG.txt” name.
If there
are no trained persons in the base – config file will not be created.
4) When you load facebase from file and there is corresp. Config file, then settings from this file will be loaded.
5) If you have facebase loaded into application and you
changes any parameters from property pages (HMM topology or sampling params)
all (trained?) information will be removed. And you must train HMMs again.
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.