Bug 259146

Summary: libface doesn't learn new faces (patch)
Product: [Applications] digikam Reporter: Teemu Autto <kde.org>
Component: Faces-DetectionAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: alexjironkin, caulier.gilles
Priority: NOR    
Version: 2.0.0   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In: 2.0.0
Attachments: Patch that makes learning work. Might not be a correct way to work with opencv.

Description Teemu Autto 2010-12-07 17:44:20 UTC
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) 
OS:                Linux

If trained face contains known face ID,
Eigenfaces::update() calls
d->learn(*it, cvCloneImage(newFaceArr.at(i).getFace()));

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.

Actual Results:  
OpenCV throws exception for not being able to calculate average.


Expected Results:  
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.
Comment 1 caulier.gilles 2010-12-07 18:49:40 UTC
Marcel, Adithya, this patch is correct ?

Gilles Caulier
Comment 2 Alex 2010-12-09 10:16:57 UTC
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.

Alex
Comment 3 caulier.gilles 2010-12-09 11:16:05 UTC
Patch applied to svn.

Gilles Caulier