Robotics StackExchange | Archived questions

trying to do surf detection

i am trying to implement surf detection with ros and opencv but when i try to create the package it just shows me

[100%] Building CXX object project/CMakeFiles/Feature_Detector.dir/src/Feature_Detector.cpp.o

/home/maurice/catkin_ws/src/project/src/Feature_Detector.cpp:5:42: fatal error: opencv2/nonfree/features2d.hpp: No such file or directory

 #include <opencv2/nonfree/features2d.hpp>
                                          ^
compilation terminated.

make[2]: *** [project/CMakeFiles/Feature_Detector.dir/src/Feature_Detector.cpp.o] Error 1

make[1]: *** [project/CMakeFiles/Feature_Detector.dir/all] Error 2

make: *** [all] Error 2

Invoking "make -j4 -l4" failed

i have inserted the package in CMakeLists.txt

find_package(catkin REQUIRED COMPONENTS
  cv_bridge
  image_transport
  roscpp
  sensor_msgs
  std_msgs
  OpenCV 
)

and then i have also added the dependencies in the package.xml

<\build_depend>OpenCV<\build_depend>
<\run_depend>opencv<\run_depend>

Asked by MOH on 2016-04-12 06:20:05 UTC

Comments

Answers

As for Ubuntu, AFAIK the non free modules cannot just be installed directly using apt-get from the official ppa. In order to get the non free modules (including SURF) you could delete the opencv you have and install opencv by compiling it from source. Another alternative is to find some repositories that include the non free modules already. Some of them are mentioned here.

Asked by Mehdi. on 2016-04-12 09:32:10 UTC

Comments