Ceres使用(一)
来源:互联网 发布:弗莱生涯数据 编辑:程序博客网 时间:2024/06/06 18:18
安装:
1.下载源码:
git clone https://ceres-solver.googlesource.com/ceres-solver
2.安装依赖项
# CMakesudo apt-get install cmake# google-glog + gflagssudo apt-get install libgoogle-glog-dev# BLAS & LAPACKsudo apt-get install libatlas-base-dev# Eigen3sudo apt-get install libeigen3-dev# SuiteSparse and CXSparse (optional)# - If you want to build Ceres as a *static* library (the default)# you can use the SuiteSparse package in the main Ubuntu package# repository:sudo apt-get install libsuitesparse-dev# - However, if you want to build Ceres as a *shared* library, you must# add the following PPA:sudo add-apt-repository ppa:bzindovic/suitesparse-bugfix-1319687sudo apt-get updatesudo apt-get install libsuitesparse-dev
3.在下载好的Ceres源码文件中,用cmake形式编译。
# in ceres-solver directorymkdir buildcd buildcmake ..make -j4sudo make install(optional)
4.指定路径安装
可以通过指定安装路径,把Ceres安装在非系统路径下:-DCMAKE_INSTALL_PREFIX="/some/where/local",这样在cmake中使用时,就需要指定这个路径:
find_package(Ceres REQUIRED PATHS "/some/where/local/")
在CMake中使用Ceres
为了在CMake中通过find_package()使用Ceres,可通过以下两种方式:
1.编译Ceres时必须通过sudo make install安装;
2.ceres的编译目录在配置时,通过EXPORT_BUILD_DIR选项导出。
以examples/helloworld.cc为例展示其在CMake中的使用:
cmake_minimum_required(VERSION 2.8)project(helloworld)find_package(Ceres REQUIRED)include_directories(${CERES_INCLUDE_DIRS})# helloworldadd_executable(helloworld helloworld.cc)target_link_libraries(helloworld ${CERES_LIBRARIES})无论Ceres是安装还是导出,如果检测到多个版本,通过设置Ceres_DIR来控制用哪个版本。如果Ceres是安装方式,Ceres_DIR应该是包含了安装文件CeresConfig.cmake的路径,例如/usr/local/share/Ceres。如果Ceres是导出方式,Ceres_DIR应该是导出的Ceres编译路径。
阅读全文
0 0
- Ceres使用(一)
- Ceres使用(二)
- Ceres使用(三)
- Ceres-Solver库使用(一)--windows下安装配置
- Ceres-Solver库使用(二)--HelloWorld
- ceres-solver使用
- ceres solver使用
- Ceres Solver使用
- Ceres-Solver库使用(三)--导数(Derivatives)
- Ceres-Solver库使用(四)-- 一些例子
- Ceres学习(四)
- Ceres
- Ceres
- ceres-solver库使用示例
- Ceres库和g2o库的使用
- 边缘化(marginalization )和稀疏化(sparsification)---ceres-solver
- Ceres solver
- Ceres solver2
- qt中关于设置颜色(QPalette和QPixmap)
- HTML&CSS实验(6)
- linux的ps命令的10个操作
- Android中Glide加载圆形图片和圆角图片简单实例代码
- 循环结构(基础学习)
- Ceres使用(一)
- linux的基本操作
- 03-树2 List Leaves(25 分)
- y=x++ + ++x(int x=0)的结果?
- Java读取以.xlsx结尾的excel文件,并写出每张表对应的c#类、java类、保存数据的xml文件、读取xml文件的工具类
- 关于typedef的用法总结
- Oracle基础知识3 : 单表查询练习
- python os模块常用函数
- 通过yum下载rpm包及其依赖包