HOW TOP NONFREE RUN
I have gone through the instructions for running cmake a number of times, and it works for the basic modules that are included in Opencv, but when it comes to the old 'nonfree' modules, in the Extra Modules git download , it won't compile to be able to run a program that has #include "opencv/xfeatures2d.hpp"
https://github.com/Itseez/opencv_contrib ^This is the place to download the extra modules
This what Terminal gives me when I try to 'make' GIVE NO ERROR AFTER THAT I COMPILE MY PROGRAM GIVING ERROR
g++ -I/usr/local/include/opencv -I/usr/local/include/opencv2 -L/usr/local/lib/ -g -o test test.cpp -lopencv_core -lopencv_imgproc -lopencv_highgui -lopencv_ml -lopencv_video -lopencv_features2d -lopencv_calib3d -lopencv_objdetect -lopencv_stitching -lopencv_xobjdetect -lopencv_nonfree
test.cpp: In function ‘int main(int, char**)’:
test.cpp:44:44: error: no matching function for call to ‘cv::xfeatures2d::SURF::SURF(int&)’
SurfFeatureDetector detector( minHessian );
^
In file included from test.cpp:20:0:
/usr/local/include/opencv2/xfeatures2d/nonfree.hpp:116:20: note: candidate: cv::xfeatures2d::SURF::SURF()
class CV_EXPORTS_W SURF : public Feature2D
^
/usr/local/include/opencv2/xfeatures2d/nonfree.hpp:116:20: note: candidate expects 0 arguments, 1 provided
/usr/local/include/opencv2/xfeatures2d/nonfree.hpp:116:20: note: candidate: cv::xfeatures2d::SURF::SURF(const cv::xfeatures2d::SURF&)
/usr/local/include/opencv2/xfeatures2d/nonfree.hpp:116:20: note: no known conversion for argument 1 from ‘int’ to ‘const cv::xfeatures2d::SURF&’
test.cpp:44:23: error: cannot declare variable ‘detector’ to be of abstract type ‘cv::xfeatures2d::SURF’
SurfFeatureDetector detector( minHessian );
^
In file included from test.cpp:20:0:
/usr/local/include/opencv2/xfeatures2d/nonfree.hpp:116:20: note: because the following virtual functions are pure within ‘cv::xfeatures2d::SURF’:
class CV_EXPORTS_W SURF : public Feature2D
^
/usr/local/include/opencv2/xfeatures2d/nonfree.hpp:132:26: note: virtual void cv::xfeatures2d::SURF::setHessianThreshold(double)
CV_WRAP virtual void setHessianThreshold(double hessianThreshold) = 0;
^
/usr/local/include/opencv2/xfeatures2d/nonfree.hpp:133:28: note: virtual double cv::xfeatures2d::SURF::getHessianThreshold() const
CV_WRAP virtual double getHessianThreshold() const = 0;
^
/usr/local/include/opencv2/xfeatures2d/nonfree.hpp:135:26: note: virtual void cv::xfeatures2d::SURF::setNOctaves(int)
CV_WRAP virtual void setNOctaves(int nOctaves) = 0;
^
/usr/local/include/opencv2/xfeatures2d/nonfree.hpp:136:25: note: virtual int cv::xfeatures2d::SURF::getNOctaves() const
CV_WRAP virtual int getNOctaves() const = 0;
^
/usr/local/include/opencv2/xfeatures2d/nonfree.hpp:138:26: note: virtual void cv::xfeatures2d::SURF::setNOctaveLayers(int)
CV_WRAP virtual void setNOctaveLayers(int nOctaveLayers) = 0;
^
/usr/local/include/opencv2/xfeatures2d/nonfree.hpp:139:25: note: virtual int cv::xfeatures2d::SURF::getNOctaveLayers() const
CV_WRAP virtual int getNOctaveLayers() const = 0;
^
/usr/local/include/opencv2/xfeatures2d/nonfree.hpp:141:26: note: virtual void cv::xfeatures2d::SURF::setExtended(bool)
CV_WRAP virtual void setExtended(bool extended) = 0;
^
/usr/local/include/opencv2/xfeatures2d/nonfree.hpp:142:26: note: virtual bool cv::xfeatures2d::SURF::getExtended() const
CV_WRAP virtual bool getExtended() const = 0;
^
/usr/local/include/opencv2/xfeatures2d/nonfree.hpp:144:26: note: virtual void cv::xfeatures2d::SURF::setUpright(bool)
CV_WRAP virtual void setUpright(bool ...
would you also be so kind to close your issue here ?
this is clearly not a library bug, but a usage problem.