Created attachment 54262 [details]
Patch that makes learning work. Might not be a correct way to work with opencv.
Version: 2.0.0 (using KDE 4.5.4)
If trained face contains known face ID,
to average old face and new face, but in Eigenfaces::EigenfacesPriv::learn() second argument newFace is commented out, and not included into tempFaces for average calculation.
Reproducible: Didn't try
Steps to Reproduce:
Train face database twice with same id.
OpenCV throws exception for not being able to calculate average.
Average is calculated, and stored.
Current averaging method puts too much value for lastly trained face (50%), and isn't really an "average" of trained faces.
Marcel, Adithya, this patch is correct ?
Yeah this patch is correct. I forgot to add this line.
It is actually not averaging anymore. To combine previous examples with a new one it projects both new and old images into Eigen space and stores the projected image. Then when another face is added to the same id, once again it projects the new face with the projected face and stores the projected face.
P.S. I will apply the fix ASAP. Thanks for the patch.
Patch applied to svn.