Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

contrib module missing in opencv 3.0?

I am using OpenCV 3.0 beta.

I tried to create a face recogniser using createLBPHFaceRecognizer(); class as,

   **Ptr <FaceRecognizer> model =  createLBPHFaceRecognizer();**

the error I have is

   **error: 'createLBPHFaceRecognizer' was not declared in this scope**

I have researched and found that the class exists in contrib module of opencv2 (opencv2/contrib/contrib.hpp) in previous versions of OpenCV

But this module is not available in opencv 3.0 beta. So where are the recogniser classes defined in opencv 3.0?

If they are not defined,how can we add this module in addition to the existing modules?

like image 781
Jayendhar Gautham Avatar asked Feb 04 '15 13:02

Jayendhar Gautham


1 Answers

you will have to download and build the opencv_contrib repo.

after running cmake, make, make install,

#include <opencv2/face.hpp>

// note the additional namespace:    
cv::Ptr <cv::face::FaceRecognizer> model = cv::face::createLBPHFaceRecognizer();
// proceed as usual
like image 155
berak Avatar answered Oct 31 '22 04:10

berak