I'm following an older tutorial on face recognition based on OpenCV in C++ and have an error I can't resolve. The relevant code snippet:
#include "opencv2/core/core.hpp"
#include "opencv2/face.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/objdetect/objdetect.hpp"
...
Ptr<face::FaceRecognizer> model = face::createFisherFaceRecognizer();
model->train(images, labels);
...
I have my OpenCV compiled correctly with contrib modules, have them included but it still gives the error:
error: 'createFisherFaceRecognizer()' is not a member of 'cv::face'
I also trief this one:
Ptr<face::FaceRecognizer> model = face::FisherFaceRecognizer_create();
error: 'FisherFaceRecognizer_create()' is not a member of 'cv::face'
I looked up the face.hpp, ad the class has a function 'create', so I tried to use it, but this also failed:
Ptr<face::FaceRecognizer> model = face::FisherFaceRecognizer.create();
error: expected primary-expression before '.' token
which is weird since the function has parameters with default values. All the online solutions I treid failed. What was changed in the newer OpenCV versions and how can I create a face recognizer object correctly?