Reputation: 21
I am working on a project of faiale recognition using PCA algorithm. I have to develop this project in JAVA and I have some questions related to the implementation of this algorithm:
First: When calculating the average face (meanface) should I talk into consideration that I am working on images, meaning the average of all images vector can’t be calculated in the same way as in algebra, but we should sum
the same components for each pixel (ex: red with red, green with green, etc.) with each other, then divide the result by the number of image’s vectors. Is this correct or not?
If the previous method is correct, then what about multiplication of vectors? How should I calculate it when I am dealing with vectors of images?
Second: Let’s suppose that the previous subjection is incorrect, when I calculated the feature vectors for the images (by using the algebra method as explained in the algorithm) the resulting vectors contains pixels with very huge numbers that can’t represent any image when trying to retrieve the source images by use of feature vectors and Transformation matrix, so what is my problem!?
Upvotes: 1
Views: 999
Reputation: 594
All the images should be converted into grayscale first. The mean face is then calculated in the same way as the algebraic average for each pixel across all images, so the average of all pixels(0,0) in all images is the pixel(0,0) of the mean face and so on.
All other calculations are done pixel wise.
In case you don't have this, to convert rgb to gray scale use P = 0.587*red + 0.299*green + 0.114*blue
Upvotes: 1