| Templates | Go back to the index | Normalized correlation |
Each color image is comprised by three matrixes of pixels. The photos are initially loaded in RGB format. However, as it will be explained next, this color space is not optimal for face recognition purposes.
The 3 matrixes are to be correlated with those of the templates. A normalized correlation results in a high value (close to 1) if the relative values of the pixels in the image are similar to the relative values of the pixels in the template, and the result is -1 if there is no similarity at all. Therefore, in order to effectively discriminate what is an image and what is not, it is desirable that the relative values of the pixels of the 3 matrixes of the photo to be as different as possible, such that only those areas where the 3 matrixes are similar to those of the template get a total high value.
In the RGB space, as shown in the 3 images, the relative values of the 3 matrixes are similar, and one is just a scaled version of another. This is due to the fact that the luminance of the image is determined by the sum of the 3, and this component dominates the relative values in all the 3 images.
![]() |
![]() |
![]() |
In order to avoid this problem, the color space of the image must be changed. A good choice is the Lab color space. This space is good choice because the luminance is separated from the color components. Therefore, all the color information is contained in two matrix, which have different relative values (note lips, eyes and eyebrows), as shown in the next images. In addition, this color space enables easy comparison between the template and the photo colors, as it separates the color components from the luminance.
![]() |
![]() |
![]() |
In conclusion, for its multiple advantages the Lab color space is used in the processing of all the images in this report.
| Templates | Go back to the index | Normalized correlation |