2012-08-28 39 views
7

Tôi đang cố chạy một trong các ví dụ hướng dẫn từ OpenCV. Đó là về việc tìm kiếm một đối tượng được biết đến với việc sử dụng Flann dựa trên điểm khớp chính. Mã số có thể được tìm thấy trên Features2D + Homography to find a known object.Flann chức năng bên ngoài chưa được giải quyết

Tôi biết bạn sẽ hỏi "Bạn đã liên kết các thư viện chưa?" hoặc câu hỏi tương tự. Có, tôi đã sử dụng OpenCV trong 3 tuần với nhiều ví dụ khác nhau, sử dụng gần như tất cả các thư viện. Và không có vấn đề gì cho đến ngày nay.

Vì vậy, tôi đã thêm các phụ thuộc thư viện này vào cài đặt trình liên kết của Visual Studio. Bao gồm các thư mục cũng làm việc tốt.

C:\OpenCV2.4\lib\opencv_core242d.lib 
C:\OpenCV2.4\lib\opencv_highgui242d.lib 
C:\OpenCV2.4\lib\opencv_video242d.lib 
C:\OpenCV2.4\lib\opencv_ml242d.lib 
C:\OpenCV2.4\lib\opencv_legacy242d.lib 
C:\OpenCV2.4\lib\opencv_imgproc242d.lib 
C:\OpenCV2.4\lib\opencv_objdetect242d.lib 
C:\OpenCV2.4\lib\opencv_flann242d.lib 
C:\OpenCV2.4\lib\opencv_nonfree242d.lib 
C:\OpenCV2.4\lib\opencv_calib3d242d.lib 

Lỗi tôi nhận được là lỗi liên kết. Nó không thể giải quyết các chức năng của Flann.

1>------ Build started: Project: flannMatch, Configuration: Debug Win32 ------ 
1>flannMatch.obj : error LNK2019: unresolved external symbol "void __cdecl cv::drawMatches(class cv::Mat const &,class std::vector<class cv::KeyPoint,class std::allocator<class cv::KeyPoint> > const &,class cv::Mat const &,class std::vector<class cv::KeyPoint,class std::allocator<class cv::KeyPoint> > const &,class std::vector<struct cv::DMatch,class std::allocator<struct cv::DMatch> > const &,class cv::Mat &,class cv::Scalar_<double> const &,class cv::Scalar_<double> const &,class std::vector<char,class std::allocator<char> > const &,int)" ([email protected]@@[email protected]@[email protected]@[email protected]@[email protected]@[email protected]@@[email protected]@@[email protected]@[email protected]@[email protected]@[email protected]@[email protected]@@[email protected]@@[email protected]@[email protected]@[email protected][email protected][email protected]@[email protected]@@[email protected]@Z) referenced in function _main 
1>flannMatch.obj : error LNK2019: unresolved external symbol "public: void __thiscall cv::DescriptorMatcher::match(class cv::Mat const &,class cv::Mat const &,class std::vector<struct cv::DMatch,class std::allocator<struct cv::DMatch> > &,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]) referenced in function_main 
1>flannMatch.obj : error LNK2019: unresolved external symbol "public: __thiscall cv::FlannBasedMatcher::FlannBasedMatcher(class cv::Ptr<struct cv::flann::IndexParams> const &,class cv::Ptr<struct cv::flann::SearchParams> const &)" ([email protected]@@[email protected][email protected]@[email protected]@@@[email protected][email protected]@[email protected]@@@[email protected]@Z) referenced in function _main 
1>flannMatch.obj : error LNK2019: unresolved external symbol "public: void __thiscall cv::DescriptorExtractor::compute(class cv::Mat const &,class std::vector<class cv::KeyPoint,class std::allocator<class cv::KeyPoint> > &,class cv::Mat &)const " ([email protected]@[email protected]@[email protected]@[email protected]@[email protected]@[email protected]@[email protected]@@[email protected]@@[email protected]@[email protected]@Z) referenced in function _main 
1>flannMatch.obj : error LNK2019: 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]) referenced in function _main 
1>flannMatch.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall cv::DescriptorMatcher::~DescriptorMatcher(void)" ([email protected]@@[email protected]) referenced in function "public: virtual __thiscall cv::FlannBasedMatcher::~FlannBasedMatcher(void)" ([email protected]@@[email protected]) 
1>flannMatch.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall cv::DescriptorMatcher::DescriptorCollection::~DescriptorCollection(void)" ([email protected]@[email protected]@[email protected]) referenced in function "public: virtual __thiscall cv::FlannBasedMatcher::~FlannBasedMatcher(void)" ([email protected]@@[email protected]) 
1>flannMatch.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall cv::FeatureDetector::~FeatureDetector(void)" ([email protected]@@[email protected]) referenced in function "public: virtual __thiscall cv::Feature2D::~Feature2D(void)" ([email protected]@@[email protected]) 
1>flannMatch.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall cv::DescriptorExtractor::~DescriptorExtractor(void)" ([email protected]@@[email protected]) referenced in function "public: virtual __thiscall cv::Feature2D::~Feature2D(void)" ([email protected]@@[email protected]) 

Tôi cũng biết rằng lướt và sàng lọc đã được chuyển sang không miễn phí, nhờ một trong các câu hỏi ở đây. Thoạt nhìn, tôi nghĩ có thể là do tôi có hai phiên bản OpenCV (2.2 và 2.4) và do đó nó tạo nên sự khác biệt. Vì vậy, tôi đã xóa 2.2 và cố gắng chạy một chương trình khác. Nó đã được làm việc tốt nhưng vẫn còn lỗi này đã không biến mất.

Vì vậy, câu hỏi của tôi, tôi thiếu gì ở đây? Có phụ thuộc thư viện nào khác không? Cái gì mà tôi không thể thấy? Bất kỳ trợ giúp được đánh giá cao.

- EDIT -

Làm thế nào tôi có thể không nhìn thấy nó? Tôi thực sự xin lỗi vì đã đăng một câu hỏi dễ như thế này. Tôi cảm thấy thật ngu ngốc. Tôi đã quên thêm sự phụ thuộc này.

C:\OpenCV2.4\lib\opencv_features2d242d.lib 

Tôi không nghĩ ai sẽ bỏ lỡ điều đó một lần nữa.

+0

Bạn không phải là người đầu tiên, cũng không phải là người cuối cùng sẽ tìm thấy câu trả lời ngay sau khi đăng câu hỏi :). Cảm ơn bạn đã chia sẻ câu trả lời với chúng tôi. – bjoernz

+0

Tuy nhiên, câu trả lời sẽ được chia sẻ dưới dạng câu trả lời * *, không phải là một phần của câu hỏi. –

+0

Tôi biết nhưng vì danh tiếng, tôi không thể trả lời câu hỏi của tôi cho đến 8 giờ trôi qua. Vẫn còn 6 giờ để đi: D – yutasrobot

Trả lời

2

Làm cách nào tôi không nhìn thấy? Tôi thực sự xin lỗi vì đã đăng một câu hỏi dễ như thế này. Tôi cảm thấy thật ngu ngốc. Tôi đã quên thêm sự phụ thuộc này.

C:\OpenCV2.4\lib\opencv_features2d242d.lib 

Tôi không nghĩ ai sẽ bỏ lỡ điều đó một lần nữa.

Các vấn đề liên quan