Project 4 Artifact
by Oscar
Danielsson
General Remarks
- The
interface for the std::list that we used for this project was not very
intuitive. For example, all descriptions that I read said that when
inserting an element into the list using the insert(iterator,element)
function, the new element will be inserted after the element to which the
iterator points. This turned out to be wrong and in fact the new element
is inserted before the element to which the iterator points. This took a
lot of time to discover.
- Another
list related problem was that the provided sort algorithm did not work and
the ordering out put from the algorithm did not put the eigenvalues in
descending order (not in ascending order either for that matter). That
resulted in worse recognition performance than expected. (maybe the list
was behaving strangely because I was working in VC++ 2003?)
- The
list implementations obviously differ between VC++2003 and VC++2005 – for
example: I used dynamically allocated Position structures in my list and
in VC++2003 it worked well to use the delete command to free that memory
space when popping or removing elements from the list. In VC++2005,
however, the delete command caused the program to crash.
- In
order to make sure the algorithm finds the faces in the images, one has to
make sure to go through big enough scales (bigger scales mean that the 25
by 25 face finding window encapsulates less of the searched image). The
reason is that in order to get a good mach the face finding window needs
to include only the center of the face (that is the mouth, nose and eyes),
but nothing else.
- Finally,
it turned out that dividing by the standard deviation instead of the
variance when calculating the error in the findFace routine gave slightly
better performance.
Extra Credit
- I
implemented the speedup for 1 whistle.
Eigenfaces and Average Face
Below are the ten most significant eigenfaces along with the
average face.

Average Face

Recognition Results
The figure below shows the results when using a varying
number of eigenfaces acquired from the set of images of nonsmiling students to
recognize the images of the smiling students.

It is obvious that one gains little by using more than 10-11
eigenfaces. In some cases the algorithm did not do correct classification for
any number of eigenfaces. A couple of examples of hard cases are shown below:
Image 01 was often
recognized as image 22:
à
Image 13 was often
recognized as image 04:
à
Finding Faces in Images
Using ten eigenfaces to span face space we shall try to find
patches representing faces in images. Several examples are shown below.
Cropping elf.tga
(scales: 0.35 – 0.45, step: 0.01)

Original

Cropped
Cropping a picture of
myself (scales: 0.15 – 0.25, step:0.01)

Original (scaled down)

Cropped
Finding the three
faces in IMG_0031.tga (scales: 0.45 – 0.55, step: 0.01)

Original

Faces marked
Finding faces in
another group photo (scales: 0.7 – 1.2, step: 0.05)

Original

Faces marked
We see that the algorithm can have problems with images
where the background has similar colors and shapes as the faces. We can also
see that the algorithm does not find faces that are partially occluded, which
was expected. Getting good performance out of the algorithm and finding the
faces in an image usually comes down to searching a good range of scales. That
range differs a lot between different images and often some intervention from
the user is required to find good scales. If we had unlimited time or
processing power, we could off course get around this problem by just searching
a wide range of scales with a small step size.
Batch files:
recognize.bat
experiment.bat
experiment2.bat