Ask Your Question

Featuretracker: OpenCV has been compiled without SIFT support

asked 2013-08-26 08:47:52 -0500

todor gravatar image


I tried runnign the "hybridtrackingsample" example (from the contrib module) and got an "OpenCV has been compiled without SIFT support" exception. I looked trough the "featuretracker.cpp" file and added #include "opencv2/nonfree/nonfree.hpp" and initModule_nonfree(); , however that just gives me another error: undefined reference to `cv::initModule_nonfree()'. I think it has something to do with the order in which the modules are compiled or linked, but I'm new to C++ so I got stuck at this point.

Here is the full error message i get when running cpp-example-hybridtracker: "OpenCV Error: The function/feature is not implemented (OpenCV has been compiled without SIFT support) in CvFeatureTracker, file /opt/opencv-, line 58 terminate called after throwing an instance of 'cv::Exception' what(): /opt/opencv- error: (-213) OpenCV has been compiled without SIFT support in function CvFeatureTracker"

Hot to reproduce:

Build opencv >= 2.4, make sure to also build the examples. Run the cpp-example-hybridtrackingsample with the live parameter.

Any ideas on how I could get the featuretracker to work ?

edit retag flag offensive close merge delete



You have to compile or get a compiled version of opencv which includes the nonfree module.

Rui Marques gravatar imageRui Marques ( 2013-08-26 09:56:17 -0500 )edit

I've built opencv from source. I used cmake-gui and made sure the BUILD_opencv_nonfree is ticked. I can use surf and sift after building the project. The order in which it builds the modules might be wrong, but since I don't know much c/c++ i got stuck there.

todor gravatar imagetodor ( 2013-08-26 10:10:21 -0500 )edit

2 answers

Sort by ยป oldest newest most voted

answered 2013-08-29 08:07:25 -0500

todor gravatar image

updated 2013-08-29 08:07:45 -0500

Ok, so I found the solution

Step1: the CMakeLists.txt in the contrib module is missing the opencv_nonfree module, just add that entry there.

Step2: the FeatureTracker.cpp has a bug in it and is missing two break; statements, more on this here:

edit flag offensive delete link more


Actually, the featuretracker bug has already been fixed. If you use OpenCV 2.4.6, then the fix should be included, just checked the latest 2.4 branch on github. Using older versions always comes with risks! I submitted a pull request for the cmakelists.txt, will see if developers agree on this.

StevenPuttemans gravatar imageStevenPuttemans ( 2013-08-29 09:09:25 -0500 )edit will keep you updated of the result :)

StevenPuttemans gravatar imageStevenPuttemans ( 2013-08-29 09:12:58 -0500 )edit

I have the same problem with OpenCV 2.4.6 (I downloaded from git and sourceforge, no difference!). It seems that they changed CMakeLists.txt in the version 2.4.6 because I cannot locate contrib module to add opencv_nonfree module. Any idea how to fix this problem?

Rasoul gravatar imageRasoul ( 2013-10-15 14:35:35 -0500 )edit

@Rasoul, if you would have checked my pull request, you would have seen the solution. It is submitted as a pull request to the source code, however, opencv developers are not convinced this is the most clean way to do so. I guess we have to wait until they merge the request!

StevenPuttemans gravatar imageStevenPuttemans ( 2013-10-16 01:36:40 -0500 )edit

Fix is merged!

StevenPuttemans gravatar imageStevenPuttemans ( 2013-10-17 06:46:21 -0500 )edit

answered 2014-05-15 08:41:01 -0500

Y Simson gravatar image

This worked for me on version 2.4.9. I had the exact same problem trying to run the hybridtracking example

Goto opencv_contrib module->$(OPENCV_DIR)\sources\modules\contrib\src\featuretracker.cpp

Replace these lines:

#include "opencv2/nonfree/nonfree.hpp"

static bool makeUseOfNonfree = initModule_nonfree();

With the following:

#include "opencv2/nonfree/nonfree.hpp"

static bool makeUseOfNonfree = cv::initModule_nonfree();
edit flag offensive delete link more


... though that define probably should not go into the src code, but into the makefile/project

berak gravatar imageberak ( 2014-05-15 09:02:11 -0500 )edit

Question Tools


Asked: 2013-08-26 08:47:52 -0500

Seen: 4,194 times

Last updated: May 15 '14