Ask Your Question
1

ROS Melodic OpenCV xfeatures2d

asked 2019-01-14 03:01:16 -0500

sam_123 gravatar image

On ROS Melodic ros-melodic-opencv3 doesn't exist anymore as e.g. on ROS Kinetic. Instead it is recommended to install libopencv-dev http://wiki.ros.org/melodic/Migration... , however, this package does not contain xfeatures2d, neither does libopencv-contrib-dev.

How am I supposed do install xfeatures2d (SURF, SIFT, etc.)? Do I have to build OpenCV 3 now from source?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2019-01-28 10:51:52 -0500

sapient84 gravatar image

updated 2019-02-07 07:18:10 -0500

Since xfeatured2d module is not part of OpenCV anymore, but now included in opencv_contrib ( https://github.com/opencv/opencv_cont... ) you need to build and install from source and add those modules to the build configuration.

Summarizing what you can find in the following link ( https://linuxize.com/post/how-to-inst... ).

  1. Install the necessary packages
  2. Clone the OpenCV source code and mostly important for you, clone the opencv_contrib repository
  3. Set up the OpenCV build with CMake. Since xfeatured2d is a nonfree module, you will need to set OPENCV_ENABLE_NONFREE=ON. The whole command would look something like this:
cmake -D CMAKE_BUILD_TYPE=RELEASE \  
        -D CMAKE_INSTALL_PREFIX=/usr/local \  
        -D INSTALL_C_EXAMPLES=ON \  
        -D INSTALL_PYTHON_EXAMPLES=ON \  
        -D OPENCV_EXTRA_MODULES_PATH=~/opencv_build/opencv_contrib/modules \  
        -D BUILD_EXAMPLES=ON .. \  
        -D OPENCV_ENABLE_NONFREE=ON ..
  1. Compile OpenCV
  2. Install OpenCV
edit flag offensive delete link more

Comments

Yeah, I build now our own OpenCV Contrib debian packages. No idea why they didn't include all the contrib features into the "official" debian packages.

sam_123 gravatar imagesam_123 ( 2019-02-07 01:21:55 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2019-01-14 03:01:16 -0500

Seen: 1,044 times

Last updated: Feb 07