Making SURF working on UBUNTU 14.04 in c [closed]
Hi everybody,
I'm currently working on my master thesis and I need to do some feature detection. For that purpose I would like to use the cvExtractSURF function. As the title says, I'm working on Ubuntu 14.04 and my code is written in c (not c++).
I've installed opencv 2.4.11 following this tutorial. My code is the following:
I've already tried many proposed solutions as this one or that one. As you can see, I already tried to link the nonfree librairies. /nonfree.hpp is commented, if not I get the following error:/usr/local/include/opencv2/nonfree/nonfree.hpp:48:1: error: unknown type name ‘namespace’ namespace cv. I think it has something to do with the fact I'm coding in c and not c++.
I did my best to install the nonfree librairies. In my /home/xxx/opencv-2.4.11/build/lib folder, I've got the following lib files (related to the nonfree lib): 1) libopencv_nonfree.so 2) libopencv_nonfree.so.2.4 3) libopencv_nonfree.so.2.4.11
Result when I make openCV: OpenCV modules: -- To be built: core flann imgproc highgui features2d calib3d ml video legacy objdetect photo gpu ocl nonfree contrib java python stitching superres ts videostab viz
When I try to make my main.c with the following makefile:
I still get the error OpenCV Error: The function/feature is not implemented (OpenCV was built without SURF support) in cvExtractSURF, file /home/xxx/opencv-2.4.11/modules/legacy/src/features2d.cpp, line 77 terminate called after throwing an instance of 'cv::Exception'.
Can somebody help me ? I REALLY need to make it work for my thesis. Already lost 3 days to find a solution (and btw I'm quite new to linux OS...)
Thanks in advance for your help!
please do not use opencv's legacy c-api. it is no more a valid option in 2015
also, yes, SIFT and SURF are inside
namespace cv
, which means, you have to use g++ and the c++ api , to use it. also, cvSurfParams does no more exist.o man C and SURF and Ubuntu14.04 in the same title :D horrific ...
2.4 docs again are outdated, too.
Why do people still use the C api of OpenCV?
Because about 75% of all tutorials out there are C-API. Thats the downside of the big world wide web ...
ubuntu's fault , too.
@berak I would say thats the fault of programmers themselves, I wonder why people try to use standard repositories ... nothing better than the download page of the actual package. Its just a way of thinking.
For simple users/students that usually work with small projects indeed it is unexcused. On the other hand, in a company/institute or whatever if there is already a running system, relatively quite big then usually it is a pain in the ass to port it into the new API and since it works they just do not mess with it until it breaks and it does not work anymore. All this because it just does the job, however, usually at the end they are forced to adapt the new API/updates. Of course if you want to be called a serious company you are concerned beforehand and you have some software engineers doing this job and be ready before you are forced to. Unfortunately, that's my experience from the market and I have seen only a few companies not working like that.
Moreover, coming back to the users if you consider that the most of them they just want the job to be done without wondering how and why, just by following blindfolded guides and tutorials then you end with questions like this one ;-)