簡體   English   中英

OpenCV 3.1-找不到opencv_contrib庫

[英]OpenCV 3.1 - Cannot find library of opencv_contrib

按照此鏈接,我已經在Ubuntu上安裝了帶有Python 2.7的OpenCV3.1。 簡而言之,在構建庫時,我已經傳遞了此標志

cmake -D CMAKE_BUILD_TYPE=RELEASE \\ -D CMAKE_INSTALL_PREFIX=/usr/local \\ -D INSTALL_C_EXAMPLES=ON \\ -D INSTALL_PYTHON_EXAMPLES=ON \\ -D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib/modules \\ -D BUILD_EXAMPLES=ON ..

已經傳遞了OPENCV_EXTRA_MODULES_PATH標志。 然后,我想嘗試新的sfm從模塊opencv_contribC++ ,但得到這個錯誤:

/tmp/ccHDBnbF.o: In function `main': cam_motion.cpp:(.text+0x999): undefined reference to `cv::sfm::reconstruct(cv::_InputArray const&, cv::_OutputArray const&, cv::_OutputArray const&, cv::_InputOutputArray const&, cv::_OutputArray const&, bool)' cam_motion.cpp:(.text+0xb5a): undefined reference to `cv::viz::Viz3d::Viz3d(cv::String const&)' cam_motion.cpp:(.text+0xba7): undefined reference to `cv::viz::Viz3d::setBackgroundColor(cv::viz::Color const&, cv::viz::Color const&)' cam_motion.cpp:(.text+0xbc0): undefined reference to `cv::viz::Viz3d::registerKeyboardCallback(void (*)(cv::viz::KeyboardEvent const&, void*), void*)' cam_motion.cpp:(.text+0xe2c): undefined reference to `cv::viz::Viz3d::wasStopped() const' cam_motion.cpp:(.text+0xeaf): undefined reference to `cv::Mat::eye(int, int, int)' cam_motion.cpp:(.text+0xfd4): undefined reference to `cv::viz::WCube::WCube(cv::Point3_<double> const&, cv::Point3_<double> const&, bool, cv::viz::Color const&)' cam_motion.cpp:(.text+0x1001): undefined reference to `cv::viz::Widget::setRenderingProperty(int, double)'

我猜這是一個鏈接器問題。

有什么問題,我該如何解決?

您是否下載了OpenCV contrib軟件包並將其放置在指定位置? 如果沒有,請從這里下載

然后將其放在特定的文件夾中,並在使用Cmake進行編譯時,給出路徑(絕對路徑)直到modules文件夾。 然后嘗試再次構建它。

如果仍然遇到任何問題,請評論有關它的詳細信息。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM