0

I'm trying to use the drawKeypoints function. This is how i'm calling it:

drawKeypoints( img1, keypoints1, final, color, flags);

Where:

img1 = my image (Mat)
keypoints = vector<KeyPoint> generated from calling the ORB detector
final = output Mat
color = Scalar::all(-1)
flags = DrawMatchesFlags::DEFAULT;

But i get this linking error:

Undefined symbols for architecture x86_64:
  "cv::drawKeypoints(cv::_InputArray const&, std::vector<cv::KeyPoint, std::allocator<cv::KeyPoint> > const&, cv::_InputOutputArray const&, cv::Scalar_<double> const&, int)", referenced from:

These are my includes:

#include <opencv2/core/core.hpp>
#include "opencv2/imgcodecs/imgcodecs.hpp"
#include "opencv2/features2d.hpp"
#include "opencv2/opencv.hpp"
#include "opencv2/highgui/highgui.hpp"

Why can't my compiler (XCode) find that function?

Thanks!

Gambit2007
  • 3,260
  • 13
  • 46
  • 86

1 Answers1

0

You need to link against OpenCV's "opencv_features2d" library which provides the cv::drawKeypoints function.

See the red- and blue-outlined boxes on this answer.

Community
  • 1
  • 1
Mark Setchell
  • 191,897
  • 31
  • 273
  • 432