I tried to detect and recognize face through LBPH algorithm. For that, I tried the following example:
Mastering OpenCV Chapter 8 FaceRecognition
The code runs and works successfully for Eignefaces and Fisherfaces but gives an exception when recognize for LBPH algorithm. I can't figure it out. The exception is:
OpenCV Error: Bad argument (no parameter 'eigenvectors' is found) in unknown function, file "..\modules\core\src\algorithm.cpp" line 882.
In line 882,
CV_Error_( CV_StsBadArg, ("No parameter '%s' is found", parameter ? parameter : "<NULL>") );
The above line is called after the following line which causes the exception
Mat eigenvectors = model->get<Mat>("eigenvectors");
So, what am I doing wrong? Please experts come and rescue me. Thanks
After posting the same question in OpenCV Forum, I learned that the problem is in my sample code. Some portions are not applicable for LBPH Algorithm. The lines are below:
The above lines of code are applicable for Eigenfaces and Fisherfaces which I don't know! After commenting those lines of code, I simply call
which gives the prediction result and hence.