Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

fatal error: opencv2/contrib/contrib.hpp' file not found (open cv already built)

I have downloaded and built open cv according to these open cv docs.

I am trying to compile this Eigenfaces demo, and I am getting the following error.

fatal error: 'opencv2/contrib/contrib.hpp' file not found

The line of concern is

#include "opencv2/contrib/contrib.hpp"

The contrib directory is not in my usr/local/include/opencv/ directory. I have referenced the following SO Question, but it seems to only handle the case of building from scratch.

Also, the repository that it references opencv_contrib does not even contain the file contrib.hpp

How can I simply add the necessary source files to my current build without having to completely rebuild everything?

like image 861
Brian Avatar asked Apr 22 '15 19:04

Brian


1 Answers

Since you're obviously using opencv3.0:

the contrib parts have been outsourced to a separate github repo

You'll have to get that, append it to your main opencv (re-)build, and then:

   #include <opencv2/face.hpp>
   using namespace cv;
   Ptr<face::FaceRecognizer> model = face::createLBPHFaceRecognizer(...)

(an additional namespace was added here)

like image 177
berak Avatar answered Oct 06 '22 01:10

berak