Nonfree module is missing in OpenCV 3.0
Asked Answered
E

2

21

I have built the openCV 3.0 alpha version from source with support for CUDA and TBB. Now, I want to do feature detection and feature matching using SURF algorithm. SurfFeatureDetector is present in the include file

opencv2/nonfree/features2d.hpp & opencv2/nonfree/features2d.hpp

But the module nonfree is missing in this version of openCV. I tried checking the opencv forums at answers.opencv.org but the site is under construction.

How to use the non free modules?

Epanorthosis answered 11/12, 2014 at 8:47 Comment(5)
Seems to be a duplicate of #25550102 (though with their page being down it won't help much - maybe those people can explain what they did?)Netta
afaik non_free module has to be chosen explicitly during building. So if you used CMake, there might be a flag you missed?Sandor
@GregorPetrin- So what should I do? Do you happen to read the solution at linkEpanorthosis
@Micka- I used the Cmake-gui. Where in the Cmake gui should I explicitly choose the non free module? Thanks.Epanorthosis
for opencv 249 there is a BUILD_opencv_nonfree checkbox in CMake GUISandor
L
24

with opencv3.0, SURF/SIFT and some other things have been moved to a seperate opencv_contrib repo .

you will have to download that, add it to your main opencv cmake settings (please look at the readme there), and rerun cmake/make.

then:

#include "opencv2/xfeatures2d.hpp"

...
Ptr<SIFT> sift = cv::xfeatures2d::SIFT::create(...);
sift->detect(...);
Lanielanier answered 11/12, 2014 at 9:14 Comment(1)
Thanks berak. I am following your suggested method. I have extracted the opencv_contrib-master in the opencv source folder. I am about to configure using Cmake(GUI), So I wanted to ask if there are any special flags in Cmake so that the build is built with the contrib modules?Epanorthosis
E
0

You could also install all the non-free stuff from this PPA

sudo add-apt-repository ppa:ignaciovizzo/opencv3-nonfree
sudo apt-get update
sudo apt install libopencv-dev
Eczema answered 19/5, 2019 at 23:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.