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

I 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 

Anxiety line

 #include "opencv2/contrib/contrib.hpp" 

The contrib directory is not in my usr/local/include/opencv/ directory. I referred to the following SO Question , but it looks like it only handles the case from scratch.

In addition, the repository that it refers to opencv_contrib does not even contain the contrib.hpp file

How can I just add the necessary source files to the current assembly without having to completely rebuild everything?

+6
source share
1 answer

Since you are explicitly using opencv3.0:

depositors were outsourced a separate github repo

You will need to do this, add it to your main opensv (re) file, and then:

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

(extra namespace added here)

+9
source

Source: https://habr.com/ru/post/985709/


All Articles