我正在使用带有 Visual Studio 2008 的 open cv 2.2.0 版,我正在做一些图像处理尝试了很多事情,但我在做 SURF 匹配时遇到了困难......在这里给出了一些错误......
错误 2 错误 LNK2019:函数 _main test1.obj cvtest2008 中引用的未解析外部符号“public: __thiscall cv::SurfFeatureDetector::SurfFeatureDetector(double,int,int)”(??0SurfFeatureDetector@cv@@QAE@NHH@Z)
错误 3 错误 LNK2019:未解析的外部符号“public: virtual __thiscall cv::FeatureDetector::~FeatureDetector(void)”(??1FeatureDetector@cv@@UAE@XZ) 在函数“public: virtual __thiscall cv::SurfFeatureDetector: :~SurfFeatureDetector(void)" (??1SurfFeatureDetector@cv@@UAE@XZ) test1.obj cvtest2008
错误 4 致命错误 LNK1120: 2 unresolved externals C:\Documents and Settings\User.MYPC\Desktop\cvtest2008\Debug\cvtest2008.exe cvtest2008
这是我的简单代码...
#include <iostream>
#include <vector>
#include <opencv2/core/core.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/features2d/features2d.hpp>
int main() {
// Read input images
cv::Mat image1= cv::imread("i1.jpg",0);
cv::Mat image2= cv::imread("i2.jpg",0);
if (!image1.data || !image2.data)
return 0;
// Display the images
cv::namedWindow("Right Image");
cv::imshow("Right Image",image1);
cv::namedWindow("Left Image");
cv::imshow("Left Image",image2);
// vector of keypoints
std::vector<cv::KeyPoint> keypoints1;
std::vector<cv::KeyPoint> keypoints2;
// Construction of the SURF feature detector
cv::SurfFeatureDetector surf(3000);
cv::waitKey();
return 0;
}
请帮忙