‘class cv::xfeatures2d::SURF’ has no member named ‘detectAndCompute
I had to deploy my code using surf on a remote server and I had to change the opencv library paths. In particular from /usr/local
to /home/spm1428/local
.
So now the original compile command was:
g++ -DCC_DISABLE_CUDA -I/home/luca/Dropbox/HKUST/CloudCache/cloudcache/CloudCache -I/usr/local/include/opencv -I/usr/local/include/opencv2 -I/usr/include/boost -I/home/luca/vlfeat -O3 -g -Wall -c -fopenmp -std=c++11 -c -o SURFOpenCV.o ../Descriptors/SURFOpenCV.cpp
And now is:
g++ -DCC_DISABLE_CUDA -I/home/spm1428/CloudCache -I/home/spm1428/local/include/opencv -I/home/spm1428/local/include/opencv2 -I/usr/include/boost -I/home/spm1428/vlfeat -O3 -g -Wall -c -fopenmp -std=c++11 -c -o SURFOpenCV.o ../Descriptors/SURFOpenCV.cpp
../Descriptors/SURFOpenCV.cpp: In member function ‘virtual void cc::SURFOpenCV::ComputeDescriptors(cv::Mat&, cv::Mat1f&)’:
../Descriptors/SURFOpenCV.cpp:34:9: error: ‘class cv::xfeatures2d::SURF’ has no member named ‘detectAndCompute’
surf->detectAndCompute(img, cv::Mat(), pts, descriptors);
Of course SURFOpenCV.cpp
contains #include "opencv2/xfeatures2d.hpp"
, it compiles correctly on my local version. /home/spm1428/local/include/opencv2/xfeatures2d.hpp
exists and I don't know why this happens.