视觉slam14讲ch5总结(各种坑)

1.imageBasics

imageBasics.cpp不做修改

CMakeLists.txt

project(imageBasics)
cmake_minimum_required(VERSION 3.10)
add_executable(imageBasics imageBasics.cpp)
# 链接OpenCV库
find_package( OpenCV REQUIRED )
#添加头文件
include_directories( ${OpenCV_INCLUDE_DIRS})
target_link_libraries(imageBasics ${OpenCV_LIBS})
 
add_executable(undistortImage undistortImage.cpp)
# 链接OpenCV库
target_link_libraries(undistortImage ${OpenCV_LIBS})
set(CMAKE_CXX_FLAGS "-std=c++11")  

make完成后,在build终端里

执行命令为

./imageBasics ../ubuntu.png

运行结果如下

undistortImage.cpp不用修改

依旧在上一个build终端里,输入执行命令

./undistortImage ../distorted.png

运行结果如下

2.stereo

stereoVision.cpp修改如下

其他部分不做改动

CMakeLists.txt

project(stereo)
find_package(Pangolin REQUIRED)
 
add_executable(stereoVision stereoVision.cpp)
 
 
cmake_minimum_required(VERSION 3.10)
# 链接OpenCV库
find_package( OpenCV REQUIRED )
#添加头文件
include_directories( ${OpenCV_INCLUDE_DIRS})
target_link_libraries(stereoVision ${OpenCV_LIBS})
 
# 链接OpenCV库
target_link_libraries(stereoVision ${OpenCV_LIBS} ${Pangolin_LIBRARIES})
set(CMAKE_CXX_FLAGS "-std=c++14")  

运行方式./stereoVision

运行结果

 3.rgbd

joinMap.cpp修改处如下

视觉slam14讲ch5总结(各种坑)_第1张图片

 pose.txt路径要具体,可在其属性中复制其具体路径

注意白色竖杠处有两个..

运行方式./joinMap

运行结果

你可能感兴趣的:(SLAM,ubuntu)