0
votes

I am using linux and want to install opencv contrib repo to include "opencv2/xfeatures2d.hpp" file. I have read the readme file from the link : https://github.com/Itseez/opencv_contrib , but still can't understand how to use the commands in the terminal . Can anyone help ? I have installed opencv in home (~/opencv) and the folder opencv_contrib-master in Downloads.

3
I got it working compiling from source on MacOS: stackoverflow.com/a/48042674/1602316Chris Gunawardena

3 Answers

0
votes

Just clone opencv_contrib to the any directory you like then build it as:

  1. git clone (opencv_contrib)
  2. cd opencv (main directory) and mkdir build
  3. cd build
  4. Here u have to provide the linkage to the opencv_contrib. I used the following command.

cmake -D CMAKE_BUILD_TYPE=DEBUG -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_TBB=ON -D BUILD_NEW_PYTHON_SUPPORT=ON -D WITH_V4L=ON -D INSTALL_C_EXAMPLES=ON -D INSTALL_PYTHON_EXAMPLES=ON -D BUILD_EXAMPLES=ON -D WITH_QT=ON -D WITH_OPENGL=ON -D ENABLE_FAST_MATH=1 -D CUDA_FAST_MATH=1 -D WITH_CUBLAS=1 -D OPENCV_EXTRA_MODULES_PATH../opencv_contrib/modules ..

0
votes

I have found the solution. I had to uninstall the library and install it again, like described in this link : http://embedonix.com/articles/image-processing/installing-opencv-3-1-0-on-ubuntu/

0
votes

Cut short the best way is to do

sudo apt-get install cmake-gui

go to the root of opencv folder mkdir build cmake-gui .. then put the path of the opencv_extra modules

build it and install it and enjoy.