Scaling
The face photographs were taken at different times under different conditions,
so faces varied in size considerably. Fortunately, all the pictures were
taken against a bright wall. In order to scale the faces, I set threshold
values for the brightness of the left side of the face, the top of the head,
and the right side of the face. Then, I detected the left edge of the
face by looking at a column of 20 pixels going from the center of the image
upwards. This column was moved to the right (starting at the left edge of
the image) until 3 of the 20 pixels were dark enough to be face pixels and
not background pixels. This avoided noise and gave good results. The top
of the head and the right side of the head were done in a similar fashion.
Since the pictures tend to have illumination from the left (there were
windows over there), I used three different thresholds (Caleb's skin is
very pale, making it impossible to use the same threshold for the left and
right, and Nik's bald head is brighter than the shadows on the right
side of people faces). The scaled image was created to be the same size
(200x135) as the original with a 5 pixel padding to the left, right, and
top.
 |
Becomes |
 |
Average Image
Next the average image was calculated by summing all the images (into a
long array as opposed the image unsigned char array) and dividing by the
number of images.
Difference Images
When doing comparisons and building face space, difference images--the
difference between an image and the average image--were always used. The
difference images were scaled to have a length of 1. (The visualizations
here rescale them to go from 0 to 255 instead of small negative to small
positive).
 |
Becomes |
 |