Ich habe OpenCV3.1 mit Python 2.7 auf Ubuntu nach dieser link installiert. Für kurze, wenn die Bibliothek bauen, habe ich diesen FlagOpenCV 3.1 - Bibliothek von opencv_contrib nicht gefunden
gebencmake -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 ..
Bereits die OPENCV_EXTRA_MODULES_PATH
Fahne übergeben. Dann mag ich die neuen sfm
Modul aus den opencv_contrib
mit C++
versuchen, aber habe diesen Fehler:
/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)'
Ich denke, dies ist ein Linker Problem.
Was ist das Problem und wie kann ich das lösen?
Ich habe einen ähnlichen Weg bei der Installation der OpenCV in meinem Mac und auch nicht finden Sie die Korrespondenz-Bibliothek (wie libopencv_viz). Werde es nochmal versuchen. – Hilman
Das Problem wurde gelöst. Stellt sich heraus, um die SfM zu verwenden, muss ich die OpenCV mit -D WITH_VTK = ON (natürlich mit der vtk-Bibliothek im System installiert) zurückbauen. Abhängigkeiten, die von der SfM benötigt werden, müssten ebenfalls im System installiert werden. – Hilman