I have been trying to run the sample code given in the opencv_contrib repo --> https://github.com/Itseez/opencv_contrib/tree/master/modules/reg/samples
It is the image registration module. I am compiling the map_test.cpp program. -->https://github.com/Itseez/opencv_contrib/blob/master/modules/reg/samples/map_test.cpp
Now, the code compiles the first time. However, when you #define COMPARE_FEATURES to compare feature based vs. pixel based registration, the program doesn't compile and gives these errors
map_test.cpp: In function ‘void calcHomographyFeature(const cv::Mat&, const cv::Mat&)’:
map_test.cpp:299:41: error: no matching function for call to ‘cv::xfeatures2d::SURF::SURF(int&)’
map_test.cpp:299:41: note: candidates are:
In file included from /app_MS/ocv3/include/opencv2/xfeatures2d.hpp:43:0,
from map_test.cpp:51:
/app_MS/ocv3/include/opencv2/xfeatures2d/nonfree.hpp:116:20: note: cv::xfeatures2d::SURF::SURF()
/app_MS/ocv3/include/opencv2/xfeatures2d/nonfree.hpp:116:20: note: candidate expects 0 arguments, 1 provided
/app_MS/ocv3/include/opencv2/xfeatures2d/nonfree.hpp:116:20: note: cv::xfeatures2d::SURF::SURF(const cv::xfeatures2d::SURF&)
/app_MS/ocv3/include/opencv2/xfeatures2d/nonfree.hpp:116:20: note: no known conversion for argument 1 from ‘int’ to ‘const cv::xfeatures2d::SURF&’
map_test.cpp:299:22: error: cannot declare variable ‘detector’ to be of abstract type ‘cv::xfeatures2d::SURF’
In file included from /app_MS/ocv3/include/opencv2/xfeatures2d.hpp:43:0,
from map_test.cpp:51:
/app_MS/ocv3/include/opencv2/xfeatures2d/nonfree.hpp:116:20: note: because the following virtual functions are pure within ‘cv::xfeatures2d::SURF’:
/app_MS/ocv3/include/opencv2/xfeatures2d/nonfree.hpp:132:26: note: virtual void cv::xfeatures2d::SURF::setHessianThreshold(double)
/app_MS/ocv3/include/opencv2/xfeatures2d/nonfree.hpp:133:28: note: virtual double cv::xfeatures2d::SURF::getHessianThreshold() const
/app_MS/ocv3/include/opencv2/xfeatures2d/nonfree.hpp:135:26: note: virtual void cv::xfeatures2d::SURF::setNOctaves(int)
/app_MS/ocv3/include/opencv2/xfeatures2d/nonfree.hpp:136:25: note: virtual int cv::xfeatures2d::SURF::getNOctaves() const
/app_MS/ocv3/include/opencv2/xfeatures2d/nonfree.hpp:138:26: note: virtual void cv::xfeatures2d::SURF::setNOctaveLayers(int)
/app_MS/ocv3/include/opencv2/xfeatures2d/nonfree.hpp:139:25: note: virtual int cv::xfeatures2d::SURF::getNOctaveLayers() const
/app_MS/ocv3/include/opencv2/xfeatures2d/nonfree.hpp:141:26: note: virtual void cv::xfeatures2d::SURF::setExtended(bool)
/app_MS/ocv3/include/opencv2/xfeatures2d/nonfree.hpp:142:26: note: virtual bool cv::xfeatures2d::SURF::getExtended() const
/app_MS/ocv3/include/opencv2/xfeatures2d/nonfree.hpp:144:26: note: virtual void cv::xfeatures2d::SURF::setUpright(bool)
/app_MS/ocv3/include/opencv2/xfeatures2d/nonfree.hpp:145:26: note: virtual bool cv::xfeatures2d::SURF::getUpright() const
map_test.cpp:307:26: error: cannot declare variable ‘extractor’ to be of abstract type ‘cv::xfeatures2d::SURF’
In file included from /app_MS/ocv3/include/opencv2/xfeatures2d.hpp:43:0,
from map_test.cpp:51:
/app_MS/ocv3/include/opencv2/xfeatures2d/nonfree.hpp:116:20: note: since type ‘cv::xfeatures2d::SURF’ has pure virtual functions
There seems to be a problem with the SURF feature detector and the Matcher etc. Does anyone know a fix for this? Are there library linking issues? I am using OpenCV3 with opencv_contrib functionality installed as well.