opencv_nonfree module provides very useful features such as two prominent image features SIFT and SURF (including the CUDA’s implementation). In this tutorial, I demonstrate how to install this module into OpenCV 3 on Ubuntu.
- Remove the old version which has been installed in the system.
- Do not install
sudo apt-get install cmake
- Download opencv
git clone https://github.com/opencv/opencv
- Do not download the source from homepage.
- Download the
git clone https://github.com/opencv/opencv_contrib
- Check both
opencv_contribare the latest versions otherwise we can not compile them.
- Check both
- Extract the source.
Run Cmake: cmake-gui
- In the textbox
Where is the source code, it should be the path of OpenCV
Where to build the binaries: path to your build directory, e.g,
- When the dialog
CMakeSetuppops up, configure the compiler according to your system. (Most of the time is to select
Unix Makefilesas the generator and
Use default native compilersas well.)
After automatically generating Makefiles, CMake will show all available settings.
OPENCV>OPENCV_EXTRA_MODULES_PATH, give the path to folder
Configurethe project again. On the output window, check whether it produces
Non-free algorithms are enabled.
BUILD, make sure that you have selected the appropriate modules for features extraction, e.g,
Configurethe project again.
make all(To speed up :
make all -j8)