contrib module missing in opencv 3.0? up vote 3 down vote favorite I am using OpenCV 3.0 beta.

来源:互联网 发布:caffe on spark 编辑:程序博客网 时间:2024/06/01 10:06

contrib module missing in opencv 3.0?

up vote3 down vote favorite

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?

shareimprove this question
 

1 Answer

activeoldest votes
up vote2 down vote accepted

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
shareimprove this answer
 
 
Thanks for your reply..I tried to build opencv_contrib using cmake gui, but i couldnt find any cmake lists in the repository. cmake lists were found in individual modules inside the repository. But building individual modules throws error. how to resolve the problem ? –  Jayendhar Gautham Feb 4 at 14:28
1 
you add the opencv_contrib module to you cmake int themain opencv dir -DOPENCV_EXTRA_MODULES_PATH=<opencv_contrib>/modules and re-build themain opencv repo, not seperated. –  berak Feb 4 at 14:49
 
Thanks..How to add this path in cmake-GUI "DOPENCV_EXTRA_MODULES_PATH".? – balajichinna Feb 4 at 15:08
 
click 'grouped', -> opencv ->OPENCV_EXTRA_MODULES_PATH – berak Feb 4 at 15:11
 
Or just search for "OPENCV_EXTRA_MODULES_PATH" and CMke-gui will find it for you :) – cyriel Feb 5 at 1:59
0 0
原创粉丝点击