fixed problem with LBPHFaceRecognizer::update() without breaking binary compatibility.
authorVadim Pisarevsky <vadim.pisarevsky@itseez.com>
Thu, 8 Nov 2012 12:15:04 +0000 (16:15 +0400)
committerVadim Pisarevsky <vadim.pisarevsky@itseez.com>
Thu, 8 Nov 2012 12:15:04 +0000 (16:15 +0400)
modules/contrib/src/facerec.cpp

index 7a8ab74..fbf124a 100644 (file)
@@ -300,7 +300,13 @@ public:
 //------------------------------------------------------------------------------
 // FaceRecognizer
 //------------------------------------------------------------------------------
-void FaceRecognizer::update(InputArrayOfArrays, InputArray) {
+void FaceRecognizer::update(InputArrayOfArrays src, InputArray labels ) {
+    if( dynamic_cast<LBPH*>(this) != 0 )
+    {
+        dynamic_cast<LBPH*>(this)->update( src, labels );
+        return;
+    }
+    
     string error_msg = format("This FaceRecognizer (%s) does not support updating, you have to use FaceRecognizer::train to update it.", this->name().c_str());
     CV_Error(CV_StsNotImplemented, error_msg);
 }