Face detection


Automatic color recognition Go back to the indexAutomatic clustering

Once the sum of the combined correlations has been calculated, and the automatic color detection has been performed, both results must be combined to give the final image from which the face will have to be detected. The following pair of images show the original image and the final result:

The detection algorithm consists of a series of operations and thresholds to detect as accurately as possible all the faces present in the photo. The thresholds used in the algorithm have been optimized and tested through several natural photos.

First, if the maximum correlation value is below 12 the algorithm determines that there is no face in the photo. Theoretically, the maximum possible value is 47, while the minimum theoretical value is -47. Natural photos with faces have never shown a value over 22, while natural photos with no faces have never had a value below 8.

If the algorithm determines that there is a face in the photo, the next step is to apply a relative threshold to all pixels in the image. Those pixels below 70% of the value of the maximum are made equal to 0. In this case we apply a relative threshold because the images with faces have proven to have significant variations from one to another.

Next, the local maxima present in the resulting image are calculated. As the image has already been threshold these local maxima potentially represent the faces in the image. However, as shown in the following example, they do not necessarily represent a face for each local maxima. The following image shows with red dots the position of the local maxima in the threshold image. The blue dot and the green box calculation will be explained in the next section.

Automatic color recognition Go back to the indexAutomatic clustering