Ceres可以求解以下形式的有界约束非线性最小二乘问题:

这种形式的问题来源于科学工程的多个领域,从统计学的曲线拟合到计算机视觉中从图像中构建三维模型。

最近在做sfm方面的重建问题,需要对得到的相机位姿和3维点做BA优化,ceres-solver和g2o都能做ba

ceres-solver是有依赖项eigen的,而且Ceres can also use Eigen as a sparse linear algebra library.

但是EIGENSPARSE 在camke的时候是默认关闭的,所以当我在程序中调用

ceres_config_options.sparse_linear_algebra_library_type = ceres::EIGEN_SPARSE;

编译无错,能编译成功,但是调用的时候,会报错

E0606 ::29.387037   solver.cc:] Terminating: Can't use SPARSE_SCHUR with EIGEN_SPARSE because Eigen's sparse linear algebra was not enabled when Ceres was built.
Bundle Adjustment failed.

所以解决方案只能把ceres-solver重新装一遍


1.卸载

进入ceres-solver的编译文件夹,执行卸载命令

cd ceres-solver/build
sudo make uninstall

执行命令之后就可以完全卸载成功了。

2.安装ceres-solver

安装之前请确保你已经安装了ceres-solver的依赖项,因为我装过,所以不用再装依赖项了,你可以安装以下命令安装,

可以参考官方文档:http://www.ceres-solver.org/installation.html

# CMake
sudo apt-get install cmake
# google-glog + gflags
sudo apt-get install libgoogle-glog-dev
# BLAS & LAPACK
sudo apt-get install libatlas-base-dev
# Eigen3
sudo 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-
sudo apt-get update
sudo apt-get install libsuitesparse-dev

3.编译安装

以上步骤都完成后就可以编译安装ceres-solver了,cmake的时候要把 EIGENSPARSE 设置为 ON,进入到编译目录,执行命令

cd ceres-solver/build
cmake -D EIGENSPARSE=ON ..
make
sudo make install

这样就可以编译成功了

参考:http://www.ceres-solver.org/installation.html

安装支持eigen线性迭代的ceres_solver的更多相关文章

  1. 在树莓派Raspbian下安装支持Hard Float的.NET环境

    [题外话] 最近入了个树莓派玩,系统装的官方推荐的Hard Float的Raspbian,由于衍生自Debian,所以Mono什么的非常好装.但是官方源中的Mono在Hard Float的Raspbi ...

  2. ubuntu将python3设为默认后再安装支持python3.x的包

    简介: ubuntu默认python2.7版本,如果想要装python3.x版本,请记住python2.7版本一定不能卸载!!!但是即使我 python3.x版本安装成功,当运行python脚本时,系 ...

  3. (译)综合指南:通过Ubuntu 16.04上从Source构建来安装支持GPU的Caffe2

    (译)综合指南:通过Ubuntu 16.04上从Source构建来安装支持GPU的Caffe2 译者注: 原文来自:https://tech.amikelive.com/node-706/compre ...

  4. 在 Ubuntu 16.04 中安装支持 CPU 和 GPU 的 Google TensorFlow 神经网络软件

    TensorFlow 是用于机器学习任务的开源软件.它的创建者 Google 希望提供一个强大的工具以帮助开发者探索和建立基于机器学习的应用,所以他们在去年作为开源项目发布了它.TensorFlow ...

  5. 基于Web的Kafka管理器工具之Kafka-manager的编译部署详细安装 (支持kafka0.8、0.9和0.10以后版本)(图文详解)(默认端口或任意自定义端口)

    不多说,直接上干货! 至于为什么,要写这篇博客以及安装Kafka-manager? 问题详情 无奈于,在kafka里没有一个较好自带的web ui.启动后无法观看,并且不友好.所以,需安装一个第三方的 ...

  6. nginx编译安装支持lua脚本

    一.准备编译环境 1.操作系统:CentOS7.6 2.安装编译所需安装包 yum install gcc pcre pcre-devel zlib zlib-devel openssl openss ...

  7. 安装支持elasticsearch使用sql查询插件

    一.ElasticSearch-SQL介绍 ElasticSearch-SQL(后续简称es-sql)是ElasticSearch的一个插件,提供了es 的类sql查询的相关接口.支持绝大多数的sql ...

  8. Ubuntu安装支持PCL、LAS的CloudCompare

    git clone --recursive https://github.com/cloudcompare/trunk.git cd trunk mkdir build cd build cmake ...

  9. spice在桌面虚拟化中的应用系列之二(Linux平台spice客户端的编译安装,支持USB映射)

    1.系统环境 1.1 测试环境 centos6.4最小化安装(centos6.x桌面版也适用) 使用yum源为163源加EPEL源 1.2 spice客户端介绍 spice作为远程连接工具,可以支持远 ...

随机推荐

  1. python打造线程池

    # coding=utf-8 import threading import Queue import time import traceback class ThreadPoolExecutor(o ...

  2. MS Chart Control 學習手記(二) - 圓餅圖

    using System.Web.UI.DataVisualization.Charting; 02 using System.Drawing; 03   04 namespace Chart.AJA ...

  3. 关于Android中Animation的停止【转载】

    转载自:http://blog.csdn.net/easonx1990/article/details/8231520 最近遇到一个需求,通过在GridView上改变焦点,并且GridView上每个i ...

  4. 一段代码让DedeCMS完美兼容PHP5.4

    DedeCMS V5.7版本,在本地部署后,正确登录后台的情况下页面没有任何输出和显示(错误登录或密码错误时才有显示),也没有报错.进到脚本调试,发现问题出在userLogin类所在的脚本userlo ...

  5. warning C4305:“初始化”:从“double”到“float”截断

    编译VS项目时出现警告: warning C4305:“初始化”:从“double”到“float”截断(warning C4305: 'initializing' : truncation from ...

  6. button按钮不能点击鼠标形状css 代码,禁用button按钮时鼠标形状

    cursor:not-allowed;

  7. codeforces水题100道 第二十题 Codeforces Round #191 (Div. 2) A. Flipping Game (brute force)

    题目链接:http://www.codeforces.com/problemset/problem/327/A题意:你现在有n张牌,这些派一面是0,另一面是1.编号从1到n,你需要翻转[i,j]区间的 ...

  8. Centos6下Python3的编译安装

    本文转载自 Centos6下Python3的编译安装 系统环境:CentOS 6.8-Minimal 安装Python依赖包: 1 [root@Python src]# yum install zli ...

  9. pom.xml文件错误

    刚创建的maven项目,马上pom.xml的第一行就报错这是第一行:<project xmlns="http://maven.apache.org/POM/4.0.0" xm ...

  10. Clojure 学习入门(14)—— 循环控制

    Clojure 基于函数的流程控制   repeatedly 字面意思为重复函数.一般的用法如下: #(rand-int 11)) 8 2 6 6) 重复产生5次随机数.rand-int 11表示0至 ...