Reputation: 341
I am trying to build this code: https://docs.opencv.org/3.2.0/d5/d6f/tutorial_feature_flann_matcher.html
I am using Ubuntu 16.04 with CLion 2017.3 and have OpenCV 3.4 installed.
xfeatures2d.hpp can't be found on the system.
I have looked at many different problems on the internet, but couldn't find a solution.
Any help?
Upvotes: 1
Views: 9865
Reputation: 19140
Here's what I had to do to compile OpenCV with xfeatures2d:
~/src/opencv_contrib-4.5.5
opencv-4.5.2
) with CMake, add the following option to cmake command line (adjusting the value to be your actual path to the modules
subdirectory of the opencv_contrib
tarball):-DOPENCV_EXTRA_MODULES_PATH=$HOME/src/opencv_contrib-4.5.5/modules/
The above actions gave me the expected file (among others): /usr/include/opencv4/opencv2/xfeatures2d.hpp
.
Upvotes: 0
Reputation: 1411
You have to include cmake comiplation flag to opencv OPENCV_EXTRA_MODULES_PATH and set it to the opencv_contrib/modules.
cmake -DOPENCV_EXTRA_MODULES_PATH=../opencv_contrib/modules
Upvotes: 0