Opencv4.1.1 build error

asked 2019-09-03 04:10:15 -0500

sgarg2 gravatar image

updated 2019-09-03 04:15:44 -0500

berak gravatar image

So I was able to build opencv4.1 (by downloading opencv4.1 and OpenCV-contrib) on ubuntu 16.04 and everything went fine. I also tried searching for the features2d package and was able to locate them under usr/local/include. Though in my case in the home directory I have created a separate folder in which I cloned the OpenCV git repo. Now when I try to build the project as mentioned in the following link I get the following error

Fatal error: xfeatures2d.hpp no such file or directory

What is strange is that when I go to the home folder in which OpenCV and OpenCV contribs are located I can find these files. Similarly, I can locate the library features2d in the usr/local/lib folder also. I tried to edit the cmakelist.txt file in the project by adding set("OPECV_DIR",/usr/local) but that didn't work. Any suggestions as to what can I do

edit retag flag offensive close merge delete

Comments

Fatal error: xfeatures2d.hpp no such file or directory

your include path is wrong.

berak gravatar imageberak ( 2019-09-03 04:16:02 -0500 )edit

hmmm so should i set it as #include<usr local="" opencv4="" xfeatures2d=""> or should I do set("OPENCV_DIR",the home directory path") Sorry but this is the first time I am building it from source

sgarg2 gravatar imagesgarg2 ( 2019-09-03 04:53:53 -0500 )edit