高博系列博客的练习。更正了一些错误。读取图片的方式做了更改,便于使用TUM数据集。main.cpp是不想关的文件。特征点提取改用opencv3方式。
具体的可执行文件编译参考CMakeLists.txt:
# add_executable(epnp main.cpp)
# target_link_libraries(epnp
# ${OpenCV_LIBS}
# ${EIGEN3_LIBS}
# ${Sophus_LIBS}
# )
# add_executable(pointcloud ./src/generatePointCloud.cpp)
# target_link_libraries(pointcloud
# ${OpenCV_LIBS}
# ${EIGEN3_LIBS}
# ${Sophus_LIBS}
# ${PCL_LIBRARIES}
# )
# ADD_EXECUTABLE( detectFeatures ./src/detectFeatures.cpp)
# TARGET_LINK_LIBRARIES( detectFeatures
# slambase
# ${OpenCV_LIBS}
# ${PCL_LIBRARIES} )
# ADD_EXECUTABLE( visualOdometry ./src/visualOdometry.cpp)
# TARGET_LINK_LIBRARIES( visualOdometry
# slambase
# ${OpenCV_LIBS}
# ${PCL_LIBRARIES}
# #${PROJECT_SOURCE_DIR}/Thirdparty/g2o/lib/libg2o.so
# ${CSPARSE_LIB} )
# ADD_EXECUTABLE( slamend ./src/slamEnd.cpp)
# TARGET_LINK_LIBRARIES( slamend
# slambase
# ${OpenCV_LIBS}
# ${PCL_LIBRARIES}
# ${G2O_LIB}
# ${CSPARSE_LIB}
# g2o_core g2o_types_slam3d g2o_solver_csparse g2o_stuff g2o_csparse_extension
# ${CSPARSE_LIBRARY}
# )
ADD_EXECUTABLE( slam ./src/slam.cpp)
TARGET_LINK_LIBRARIES( slam
slambase
${OpenCV_LIBS}
${PCL_LIBRARIES}
${G2O_LIB}
${CSPARSE_LIB}
g2o_core g2o_types_slam3d g2o_solver_csparse g2o_stuff g2o_csparse_extension
${CSPARSE_LIBRARY}
)