openCV SURF error

openCV SURF error

本文关键字:error SURF openCV      更新时间:2023-10-16

我使用的是opencv 2.44, visual studio c++ 2010当我编译时,我得到这个错误

错误1错误LNK2019:未解析的外部符号"public: __thiscall cv::SURF::SURF(void)"(??0SURF@cv@@QAE@XZ)参考function _main c: users user desktop project prjprjsh1.obj撮合下

#include <opencv2imgprocimgproc_c.h>
#include <stdio.h>
#include <math.h>
#include <opencvhighgui.h>
#include <opencvcv.h>
#include <opencv2/features2d/features2d.hpp>
#include <opencv2/calib3d/calib3d.hpp>
#include <opencv2/core/core.hpp>
#include <opencv2/nonfree/features2d.hpp>
using namespace cv;
void main(){
char i; 
Mat image,img,ref;
ref=imread("hh.jpg");
// create window to show image 
namedWindow("window", CV_WINDOW_AUTOSIZE);
namedWindow("costel", CV_WINDOW_AUTOSIZE);
namedWindow("fanel", CV_WINDOW_AUTOSIZE);
Mat ig,ib,ibb;
Mat bkg;
Mat prev;
Mat stor;
cvtColor(ref, ref, CV_BGR2GRAY);
FastFeatureDetector detector(15);
vector<KeyPoint> keypoints1;
detector.detect(ref, keypoints1);
SurfDescriptorExtractor extractor;
Mat descriptors1;
extractor.compute(ref, keypoints1, descriptors1);
....

这似乎是我在设置项目属性的问题。属性->链接器->输入->额外的依赖关系VS.可能是你仔细检查,如果你添加了opencv_features2d244。opencv_nonfree244.lib

  1. 将所有需要使用的DLL复制到DEBUG文件夹或exe所在的位置。
  2. 检查所有源路径和头路径

好运。你可能是一个丢失的DLL神话,找到opencv_nonfree244.dll, opencv_features2d244.dll和所有其他DLL在你的cv安装文件夹,并将它们复制到文件夹应该修复它。