Making SURF working on UBUNTU 14.04 in c

asked 2015-03-16 06:11:44 -0500

Flouse gravatar image

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: Code

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: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!

edit retag flag offensive close merge delete

Comments

1

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.

berak gravatar imageberak ( 2015-03-16 06:13:06 -0500 )edit
1

o man C and SURF and Ubuntu14.04 in the same title :D horrific ...

StevenPuttemans gravatar imageStevenPuttemans ( 2015-03-16 07:03:26 -0500 )edit

2.4 docs again are outdated, too.

berak gravatar imageberak ( 2015-03-16 07:08:50 -0500 )edit

Why do people still use the C api of OpenCV?

thdrksdfthmn gravatar imagethdrksdfthmn ( 2015-03-16 07:11:41 -0500 )edit

Because about 75% of all tutorials out there are C-API. Thats the downside of the big world wide web ...

StevenPuttemans gravatar imageStevenPuttemans ( 2015-03-16 07:17:58 -0500 )edit
berak gravatar imageberak ( 2015-03-16 07:21:44 -0500 )edit

@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.

StevenPuttemans gravatar imageStevenPuttemans ( 2015-03-16 07:26:43 -0500 )edit
2

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.

theodore gravatar imagetheodore ( 2015-03-16 08:22:37 -0500 )edit
2

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 ;-)

theodore gravatar imagetheodore ( 2015-03-16 08:26:30 -0500 )edit