Face Detection

Henry Chang and Ulises Robles


nextpreviouscontents

Template Matching


This section shows how to do the matching between the part of the image corresponding to the skin region and the template face.

For the image corresponding to the skin region, we first close the holes in the region and  multiplying this image by the original one. the development toolkit provides a function to close the holes based on the neighboring pixels.In Figure 9, we show the same baby image with and without the holes, and the product of the image without holes by the original image.
 

Figure 9. (Left) A Skin Region 
(Middle) The same region without the holes. 
(Right) Result of the original grayscale image by the image in the middle.

The template face has to be positioned and rotated in the same coordinate as the skin region image. This is done as follows:

Figure 10
(Left) Original template face. (Right) Resized according to height and width.
Figure 11
(Left) Rotated template face (Right). The result of cropping the image on the left.
Figure 12. The center of the Template face is located in the center of  the skin region.

We then compute the cross-correlation value betweenthe part of the image corresponding to the skin region (Right in Figure 9) and the template face properly proceessed and centered (Figure 11). We empirically determined, from our experiments, that a good threshold value for classifying a region as a face is if the resulting autocorrelation value is greater that 0.6.

After the system decided that the skin region correspond to a frontal human face, we get a new image with a hole exactly the size and shape of  that of the processed template face. We then invert the pixel values of this image to generate a new one, which, multiplied by the original grayscale image, will yield an image as the original one, but with the template face located in the selected skin region. This is shown in Figure 13(4), in which the face of the baby is replaced by the template face.
 
 

Figure 13 (1) As in  Figure 12, but with a hole in the template face
Figure 13 (2)
As in (1), but inverted
Figure 13 (3)
The previous image is multipled by the original one
Figure 13 (4) 
As in (3), but adding the Template face to it.

We finally get the coordinates of the part of the image that has the template face. With these coordinates, we  draw a rectangle in the original color image. This is the output of the system which in this case, detected the face of the baby as shown in Figure 14.
 
 

Figure 14. Final Result

We present more results in the next section.
 

nextpreviouscontents

Next: Results and Discussion Previous: Skin Regions Contents: Face Detection



Henry Chang and Ulises Robles
Last modified: Thu. May 25, 2000