Ask Your Question

ROS Melodic OpenCV xfeatures2d

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

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 , 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

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

sapient84 gravatar image

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

Since xfeatured2d module is not part of OpenCV anymore, but now included in opencv_contrib ( ) 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 ( ).

  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:
        -D CMAKE_INSTALL_PREFIX=/usr/local \  
        -D OPENCV_EXTRA_MODULES_PATH=~/opencv_build/opencv_contrib/modules \  
        -D BUILD_EXAMPLES=ON .. \  
  1. Compile OpenCV
  2. Install OpenCV
edit flag offensive delete link more


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 image sam_123  ( 2019-02-07 01:21:55 -0600 )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



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

Seen: 2,270 times

Last updated: Feb 07 '19