BUG(跑SLAM14-ch9)
程序员文章站
2022-05-28 18:03:09
...
Q1:OpenCV问题
OpenCV Error: Parsing error (../rgbd_dataset_freiburg1_xyz(0): Valid XML should start with '<?xml ...?>') in icvXMLParse, file /home/junwang/下载/opencv-3.1.0/modules/core/src/persistence.cpp, line 2220
terminate called after throwing an instance of 'cv::Exception'
what(): /home/junwang/下载/opencv-3.1.0/modules/core/src/persistence.cpp:2220: error: (-212) ../rgbd_dataset_freiburg1_xyz(0): Valid XML should start with '<?xml ...?>' in function icvXMLParse
已放弃 (核心已转储)
解决方法:卸载了之前装的所有版本的OpenCV,新装了OpenCV3.1.0并在此次编译中编译上了VTK.Q2
CMake Error in src/CMakeLists.txt:
Imported target "opencv_viz" includes non-existent path
"/usr/local/include/opencv"
* The path was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and references files it does not
provide.
解决方法:将/usr/local/opencv310/share/OpenCV路径下的OpenCVConfig.cmake文件中第113行的CACHE去掉,如下
# Extract the directory where *this* file has been installed (determined at cmake run-time)
get_filename_component(OpenCV_CONFIG_PATH "${CMAKE_CURRENT_LIST_FILE}" PATH CACHE)//改前
get_filename_component(OpenCV_CONFIG_PATH "${CMAKE_CURRENT_LIST_FILE}" PATH )//改后
原因:如果加CACHE,OpenCV的路径就会定位到/usr/。不加CACHE就会正确定位。不知道是为什么。原则上说CACHE只是把路径加到缓存里面,可以提高效率,应该不会出这个问题。参考:https://blog.csdn.net/bluewhalerobot/article/details/73658248
上一篇: slam 14讲学习过程中遇到的编译问题
下一篇: 简单工厂模式的例子