0
votes

I'm trying to build OpenCV with the xfeatures2d module from opencv_contrib on linux but I'm unable to build any extra module. Here is what I have tried (I have basically followed the instructions I found on the net and in the README file in opencv_contrib):

  1. Downloading opencv and opencv_contrib from github:

$ git clone https://github.com/opencv/opencv.git

$ git clone https://github.com/opencv/opencv_contrib.git

  1. Creating a build directory:

$ cd ~/opencv

$ mkdir release

$ cd release

  1. Running cmake:

$ cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local –D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules -D WITH_LIBV4L=on -D WITH_GSTREAMER=on -D WITH_OPENGL=on -D WITH_VTK=on -D BUILD_EXAMPLES=ON -D WITH_GTK=on -D WITH_QT=on ..

I have specified the path to opencv_contrib/modules (also tried with the absolute path but no difference) and I'm sure this is the right path. CMake seems to run with no error however it doesn't want to build the extra modules. Here is the cmake output:

-- OpenCV modules:

-- To be built: core flann imgproc ml objdetect photo video dnn imgcodecs shape videoio highgui superres ts features2d calib3d java stitching videostab python2

-- Disabled: world

-- Disabled by dependency: -

-- Unavailable: cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev python3 viz

I only have the "standard" modules but nothing from opencv_contrib... If I build the library at this point, I only get the "standard" library (as expected). I have tried to explicitly enable xfeatures2d by adding -D BUILD_opencv_xfeatures2d=ON and I also tried not to build the examples but without any effect.

Anyone see what I have done wrong?

Thanks for your help.

1

1 Answers

0
votes

I was using the sources from OpenCV 3.2 from few weeks ago so I re-downloaded from github (OpenCV 3.3 this time) and re-installed following the same steps described in my first post and it worked!

Maybe I had some "bad" version of OpenCV 3.2 with some sneaky incompatibility problem.