Ask Your Question
0

Undefined reference to `cv::xfeatures2d::SURF::create(double, int, int, bool, bool)' [closed]

asked 2017-03-30 08:43:47 -0500

TJB gravatar image

I try tro get SURF running with OpenCV 3.2 on a Windows 7 maschine but I get the error message:"undefined reference to `cv::xfeatures2d::SURF::create(double, int, int, bool, bool)" "

I've installed contrib modules and set:

  • OPENCV_ENABLED_NONFREE = true.
  • OPENCV_EXTRA_MODULES_PATH = E:/Tools/OpenCv/sources/opencv_contrib/modules
  • WITH_QT = true

My code is:


#include "mainwindow.h"
#include "ui_mainwindow.h"

#include "opencv2/core/core.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/xfeatures2d/nonfree.hpp"

using namespace cv;

MainWindow::MainWindow(QWidget *parent) :
  QMainWindow(parent),
  ui(new Ui::MainWindow)
{
  ui->setupUi(this);

  // this works
  Mat img_object = imread( "E:/Test/ColorChecker.jpg", CV_LOAD_IMAGE_COLOR );
  namedWindow("My Image");
  imshow("My Image", img_object);
  int minHessian = 400;

  // this fails
   cv::xfeatures2d::SURF::create( minHessian );

  // as well as 
  Ptr<surf> detector = SURF::create(400, 4, 3, true, true);
...

I searched around for a solution f.e. http: // answers.opencv.org/question/133017/undefined-reference-to-cvxfeatures2dsurfcreatedouble-int-int-bool-bool but nothing worked to me.

Thanks for any help.

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by TJB
close date 2017-03-30 08:54:11.576254

1 answer

Sort by ยป oldest newest most voted
0

answered 2017-03-30 08:47:21 -0500

berak gravatar image

updated 2017-03-30 08:48:10 -0500

this is a linker error, - in your current project, you probably forgot to add opencv_xfeatures2d320.lib to your additional libs.

edit flag offensive delete link more

Comments

1

I did have -lopencv_features2d320.dll in already, checked it at least 10 times, but never seen the missing "x". Thank a lot from a "blind duck". :-)

TJB gravatar imageTJB ( 2017-03-30 08:56:03 -0500 )edit

oook ;) good luck !

berak gravatar imageberak ( 2017-03-30 08:57:32 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2017-03-30 08:43:47 -0500

Seen: 1,434 times

Last updated: Mar 30 '17