• 依赖库:Ceres-solver-2.0.0安装


    依赖库:Ceres-solver-2.0.0安装

    前言

    Ceres Solver是谷歌开源的C++非线性优化库,能够解决有约束或无约束条件下的非线性最小二乘问题。2010年之后大量的运用在谷歌的产品开发中,尤其在谷歌开源的cartographer中被大量的使用。

    ceres可以在Linux,Windows,macOS,Andrioid,IOS系统进行安装使用

    ceres被命名是由于高斯使用了最小二乘方法成功的预测了绕行至太阳背后的小行星ceres的位置。

    Ceres Solver 官网:http://ceres-solver.org/
    github:https://github.com/ceres-solver/ceres-solver

    本篇博客在 ubuntu 20.04 环境下安装 Ceres-solver-2.0.0

    安装ceres-solver-2.0.0

    先安装ceres依赖

    sudo apt-get install cmake
    sudo apt-get install libgoogle-glog-dev libgflags-dev
    sudo apt-get install libatlas-base-dev
    sudo apt-get install libeigen3-dev
    
    • 1
    • 2
    • 3
    • 4

    下载ceres-solver-2.0.0

    git clone https://github.com/ceres-solver/ceres-solver # 这样是安装最新版本
    git clone -b 2.0.0 https://github.com/ceres-solver/ceres-solver.git  #安装指定版本
    
    • 1
    • 2

    在这里插入图片描述
    下载完成后形成该文件

    然后进行编译

    cd ceres-solver
    mkdir build
    cd build
    cmake ..
    
    • 1
    • 2
    • 3
    • 4

    成功后提示

    – Build the examples.
    – Configuring done
    – Generating done
    – Build files have been written to: /home/jk-jone/ceres-solver/build

    在这里插入图片描述
    然后再进行make

    make -j4
    
    • 1

    成功后显示:

    [ 99%] Built target ba_iterschur_suitesparse_clusttri_user_test
    [100%] Linking CXX executable …/…/…/bin/ba_sparsecholesky_suitesparse_user_threads_test
    [100%] Built target ba_sparsecholesky_suitesparse_user_threads_test

    在这里插入图片描述
    最后进行安装

    sudo make install
    
    • 1

    成功后显示 :

    – Installing: /usr/local/include/ceres/internal/config.h
    – Installing: /usr/local/include/ceres/internal/export.h
    – Installing: /usr/local/lib/cmake/Ceres/CeresTargets.cmake
    – Installing: /usr/local/lib/cmake/Ceres/CeresTargets-release.cmake
    – Installing: /usr/local/lib/cmake/Ceres/CeresConfig.cmake
    – Installing: /usr/local/lib/cmake/Ceres/CeresConfigVersion.cmake
    – Installing: /usr/local/lib/cmake/Ceres/FindGlog.cmake

    在这里插入图片描述
    至此Ceres-solver-2.0.0安装完毕

    验证

    在build的文件夹下 生成的bin文件夹下 有个 simple_bundle_adjuster 的运行文件
    在这里插入图片描述
    在ceres-slover文件夹下的data文件夹中有个 problem-16-22106-pre.txt 数据文件
    在这里插入图片描述
    可用用这两个文件进行安装是否成功的验证

    在终端运行

    cd ceres-solver/build
    bin/simple_bundle_adjuster ../data/problem-16-22106-pre.txt
    
    • 1
    • 2

    在这里插入图片描述
    终端出现上面的求解过程与结构,说明安装正常。

  • 相关阅读:
    Django04_路由分发
    Docker面试整理-Docker镜像和容器有什么区别?
    算法与数据结构 学习笔记2
    uni-app props不能传递function的问题
    js数组按照id删除
    刷题笔记28——一直分不清的Kruskal、Prim、Dijkstra算法
    Stable Diffusion 手动安装扩展报错 catch exception for non git extensions
    基于风险容忍度的网络安全和风险管理战略和方法
    虹科技术 | 快速准确测量0.05m-500m--虹科dimetix激光测距传感器的优势
    海德上位机软件学习总结(NetScada5.0)
  • 原文地址:https://blog.csdn.net/qq_32761549/article/details/134545635