0

I am working with OpenCV on an Ubuntu machine. I could not compile a program using SURF. This is the code :

CvSURFParams params = cvSURFParams(500, 1);
cvExtractSURF( image, 0, &imageKeypoints, &imageDescriptors, storage, params );
for( i = 0; i < imageKeypoints->total; i++ )
    {
CvSURFPoint* r = (CvSURFPoint*)cvGetSeqElem( imageKeypoints, i );
CvPoint center;
int radius;
center.x = cvRound(r->pt.x);
center.y = cvRound(r->pt.y);
radius = cvRound(r->size*1.2/9.*2);
cvCircle( frame, center, radius, red_color[0], 1, 8, 0 );

The program doesn't recognize all of the above functions even if openCV is installed.

 error: ‘CvSURFParams’ was not declared in this scope
CvSURFParams params = cvSURFParams(500, 1);
error: expected ‘;’ before ‘params’
 CvSURFParams params = cvSURFParams(500, 1);

error: ‘params’ was not declared in this scope cvExtractSURF( image, 0, &imageKeypoints, &imageDescriptors, storage, params ); Thanks

Younès

  • Please don't use obsolete C syntax! If you're using OpenCV 3 those functions are gone! – Miki Mar 02 '16 at 14:52
  • this legacy code was removed a long time ago, don't waste any further time on that. for opencv3, [have a look here](http://docs.opencv.org/ref/master/d7/dff/tutorial_feature_homography.html) – berak Mar 02 '16 at 15:08
  • Where could I find the header #include "opencv2/xfeatures2d.hpp"? I am working on Ubuntu. – RAOUI Younès Mar 03 '16 at 16:29
  • http://stackoverflow.com/q/27418668/5008845 – Miki Mar 04 '16 at 08:47

0 Answers0