How to include xfeatures2d.hpp from the extra modules to run SURF [closed]

asked 2015-06-16 13:47:58 -0600

RoyRin gravatar image

I have gone through the instructions for running cmake a number of times, and it works for the basic modules that are included in Opencv, but when it comes to the old 'nonfree' modules, in the Extra Modules git download , it won't compile to be able to run a program that has #include "opencv/xfeatures2d.hpp"

https://github.com/Itseez/opencv_contrib ^This is the place to download the extra modules

This what Terminal gives me when I try to 'make'

smithj :surf_matcher smithj$ make

Scanning dependencies of target SurfMatcher

[ 50%] Building CXX object CMakeFiles/SurfMatcher.dir/Surf_Matcher.cpp.o /Users/smithj/research/opencv-Work/surf_matcher/Surf_Matcher.cpp:11:10: fatal error: 'opencv2/xfeatures2d.hpp' file not found

#include "opencv2/xfeatures2d.hpp"

\ ^

1 error generated. make[2]: * [CMakeFiles/SurfMatcher.dir/Surf_Matcher.cpp.o] Error 1 make[1]: [CMakeFiles/SurfMatcher.dir/all] Error 2 make: ** [all] Error 2

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by sturkmen
close date 2020-10-10 22:33:03.502742

Comments

2

when building the opencv libs, did you run a make install ? this should have copied all the headers to your install/include folder.

berak gravatar imageberak ( 2015-06-17 01:08:29 -0600 )edit

I am also having the same error, and I did make install. But when I run my project it says xfeatures2d.hpp file not found.

sgarg2 gravatar imagesgarg2 ( 2019-09-03 04:55:00 -0600 )edit