2015-11-25 50 views
0

我正在運行此代碼,並且出現錯誤!blob detction opencv249錯誤

#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); 
    } 

我得到的錯誤是

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 " ([email protected]@[email protected]@[email protected]@[email protected]@[email protected]@[email protected]@[email protected]@@[email protected]@@[email protected]@[email protected]) 
1>test.obj : error LNK2001: unresolved external symbol "public: virtual __thiscall cv::FeatureDetector::~FeatureDetector(void)" ([email protected]@@[email protected]) 
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)" ([email protected]@@[email protected]@[email protected]@[email protected]@[email protected]@[email protected]@@[email protected]@@[email protected]@[email protected][email protected]@[email protected]@Z) 
1>test.obj : error LNK2001: unresolved external symbol "public: __thiscall cv::SimpleBlobDetector::Params::Params(void)" ([email protected]@[email protected]@[email protected]) 
1>test.obj : error LNK2001: unresolved external symbol "public: __thiscall cv::SimpleBlobDetector::SimpleBlobDetector(struct cv::SimpleBlobDetector::Params const &)" ([email protected]@@[email protected]@[email protected]@Z) 

我檢查物業經理和所有設置好,進出口運行的OpenCV 249和VC 2010 感謝

+1

您沒有鏈接opencv_features2d.lib? – berak

回答