Ask Your Question

AdamStar's profile - activity

2016-03-30 08:38:36 -0600 asked a question drawMatches missing -- c++

I am using OpenCV 3.1.0 on a mac OSX 10.11.4, compiling with g++ (gcc version 4.9.3). I installed opencv using macports, including +contrib ... to install xfeatures, etc.

I am trying to compile the FLANN test function under: http://docs.opencv.org/3.1.0/d5/d6f/t...

My Makefile compiles the flann example code (t.cpp) thus:

g++ -I /opt/local/include -L/opt/local/lib -lopencv_calib3d -lopencv_core -lopencv_features2d \ -lopencv_flann -lopencv_highgui -lopencv_imgcodecs -lopencv_imgproc -lopencv_ml -lopencv_objdetect \ -lopencv_photo -lopencv_shape -lopencv_stitching -lopencv_superres -lopencv_video -lopencv_videoio \ -lopencv_videostab -o t t.cpp

While this works for other examples, like the Harris corner detector, for example, it fails here with the flann example with:

============================================================================================ Undefined symbols for architecture x86_64: "cv::drawMatches(cv::_InputArray const&, std::vector<cv::keypoint, std::allocator<cv::keypoint=""> > const&, cv::_InputArray const&, std::vector<cv::keypoint, std::allocator<cv::keypoint=""> > const&, std::vector<cv::dmatch, std::allocator<cv::dmatch=""> > const&, cv::_InputOutputArray const&, cv::Scalar_<double> const&, cv::Scalar_<double> const&, std::vector<char, std::allocator<char=""> > const&, int)", referenced from: _main in ccg40qRC.o "cv::xfeatures2d::SURF::create(double, int, int, bool, bool)", referenced from: _main in ccg40qRC.o "cv::DescriptorMatcher::match(cv::_InputArray const&, cv::_InputArray const&, std::vector<cv::dmatch, std::allocator<cv::dmatch=""> >&, cv::_InputArray const&) const", referenced from: _main in ccg40qRC.o ld: symbol(s) not found for architecture x86_64 collect2: error: ld returned 1 exit status

============================================================================================

I get thie drawMatches problem with other demos too, e.g. the ORB detector, etc.

Any suggestions?