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):
- Downloading opencv and opencv_contrib from github:
$ git clone https://github.com/opencv/opencv.git
$ git clone https://github.com/opencv/opencv_contrib.git
- Creating a build directory:
$ cd ~/opencv
$ mkdir release
$ cd release
- 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.