【问题标题】:opencv 2.2.0 surfFeaturedetecoropencv 2.2.0 surfFeaturedetector
【发布时间】:2012-06-23 13:59:52
【问题描述】:

我正在使用带有 Visual Studio 2008 的 open cv 2.2.0 版,我正在做一些图像处理尝试了很多事情,但我在进行 SURF 匹配时遇到了困难......在这里给出了一些错误......

错误 2 错误 LNK2019:函数 _main test1 中引用的未解析外部符号“public: __thiscall cv::SurfFeatureDetector::SurfFeatureDetector(double,int,int)”(??0SurfFeatureDetector@cv@@QAE@NHH@Z)。 obj cvtest2008

错误 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;
}

请帮忙

【问题讨论】:

    标签: visual-studio-2008 dll opencv linker


    【解决方案1】:

    我不是 C++ 程序员,但看起来你的链接器不知道你的 opencv 库在哪里。对于 2.2,我相信他们在这里:

    ...\OpenCV2.2\lib

    在我的this SO question 中,很多都不适用,但链接和库部分可能是您需要的。当然,请忽略我最初的问题并跳至其中一个答案。

    【讨论】:

    • 好的,谢谢,只是因为我没有添加 features2d 库
    猜你喜欢
    • 2015-10-02
    • 2012-04-15
    • 2015-02-10
    • 2012-11-27
    • 1970-01-01
    • 2013-07-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多