hi , i am getting error in facerecognizer in opencv 2.4.10. what should i do.
below is code :
Ptr<facerecognizer> learnCollectedFaces(const vector<mat> preprocessedFaces, const vector<int> faceLabels, const string facerecAlgorithm) {
Ptr<FaceRecognizer> model;
cout << "Learning the collected faces using the [" << facerecAlgorithm << "] algorithm ..." << endl;
// Make sure the "contrib" module is dynamically loaded at runtime.
// Requires OpenCV v2.4.1 or later (from June 2012), otherwise the FaceRecognizer will not compile or run!
bool haveContribModule = initModule_contrib();
if (!haveContribModule) {
cerr << "ERROR: The 'contrib' module is needed for FaceRecognizer but has not been loaded into OpenCV!" << endl;
exit(1);
}
// Use the new FaceRecognizer class in OpenCV's "contrib" module:
// Requires OpenCV v2.4.1 or later (from June 2012), otherwise the FaceRecognizer will not compile or run!
model = Algorithm::create<FaceRecognizer>(facerecAlgorithm);
if (model.empty()) {
cerr << "ERROR: The FaceRecognizer algorithm [" << facerecAlgorithm << "] is not available in your version of OpenCV. Please update to OpenCV v2.4.1 or newer." << endl;
exit(1);
}
// Do the actual training from the collected faces. Might take several seconds or minutes depending on input!
model->train(preprocessedFaces, faceLabels);
return model;
}
error :