首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >blob检测opencv249错误

问blob检测opencv249错误
EN

Stack Overflow用户
提问于 2015-11-25 22:22:15
回答 1查看 431关注 0票数 0

我正在运行这段代码,我得到了错误!

代码语言:javascript
复制
 #include "opencv\opencv.hpp"
    using namespace cv;
    using namespace std; 
    int main( int argc, char** argv ) {
    Mat im = imread( "blob.jpg", CV_LOAD_IMAGE_GRAYSCALE );
    SimpleBlobDetector::Params params;
    params.minThreshold = 10;
    params.maxThreshold = 200;
    params.filterByArea = true;
    params.minArea = 1500;
    params.filterByCircularity = true;
    params.minCircularity = 0.1;
    params.filterByConvexity = true;
    params.minConvexity = 0.87;
    params.filterByInertia = true;
    params.minInertiaRatio = 0.01;
    SimpleBlobDetector detector(params);
    std::vector<KeyPoint> keypoints;
    detector.detect( im, keypoints);
    Mat im_with_keypoints;
    drawKeypoints( im, keypoints, im_with_keypoints, Scalar(0,0,255), DrawMatchesFlags::DRAW_RICH_KEYPOINTS );
    imshow("keypoints", im_with_keypoints );
    waitKey(0);
    }

我得到的错误是

代码语言:javascript
复制
1>test.cpp(25): warning C4305: '=' : truncation from 'double' to 'float'
1>test.cpp(29): warning C4305: '=' : truncation from 'double' to 'float'
1>test.cpp(33): warning C4305: '=' : truncation from 'double' to 'float'
1>test.obj : error LNK2001: unresolved external symbol "public: void __thiscall cv::FeatureDetector::detect(class cv::Mat const &,class std::vector<class cv::KeyPoint,class std::allocator<class cv::KeyPoint> > &,class cv::Mat const &)const " (?detect@FeatureDetector@cv@@QBEXABVMat@2@AAV?$vector@VKeyPoint@cv@@V?$allocator@VKeyPoint@cv@@@std@@@std@@0@Z)
1>test.obj : error LNK2001: unresolved external symbol "public: virtual __thiscall cv::FeatureDetector::~FeatureDetector(void)" (??1FeatureDetector@cv@@UAE@XZ)
1>test.obj : error LNK2001: unresolved external symbol "void __cdecl cv::drawKeypoints(class cv::Mat const &,class std::vector<class cv::KeyPoint,class std::allocator<class cv::KeyPoint> > const &,class cv::Mat &,class cv::Scalar_<double> const &,int)" (?drawKeypoints@cv@@YAXABVMat@1@ABV?$vector@VKeyPoint@cv@@V?$allocator@VKeyPoint@cv@@@std@@@std@@AAV21@ABV?$Scalar_@N@1@H@Z)
1>test.obj : error LNK2001: unresolved external symbol "public: __thiscall cv::SimpleBlobDetector::Params::Params(void)" (??0Params@SimpleBlobDetector@cv@@QAE@XZ)
1>test.obj : error LNK2001: unresolved external symbol "public: __thiscall cv::SimpleBlobDetector::SimpleBlobDetector(struct cv::SimpleBlobDetector::Params const &)" (??0SimpleBlobDetector@cv@@QAE@ABUParams@01@@Z)

我已经检查了属性管理器,所有的设置都很好,我正在运行opencv249和vc2010,谢谢。

EN

回答 1

Stack Overflow用户

发布于 2015-11-26 02:37:07

您正面临一个与代码中的问题无关的链接问题。阅读本指南,了解如何将OpenCV与VS.NET正确链接:http://docs.opencv.org/2.4/doc/tutorials/introduction/windows_visual_studio_Opencv/windows_visual_studio_Opencv.html

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/33918966

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档