Ceres-Solver 安装与卸载ubuntu20.04
卸载
sudo rm -rf /usr/local/lib/cmake/Ceres /usr/local/include/ceres /usr/local/lib/libceres.a
安装
sudo apt-get install libatlas-base-dev libsuitesparse-dev
git clone https://github.com/ceres-solver/ceres-solver
cd ceres-solver
git checkout $(git describe --tags)
mkdir build
cd build
cmake .. -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF
make -j12
sudo make install
1、cmake
cmake时的日志
(base) r****@r*******:~/3dTracking/tools/ceres-solver-1.14.0$ sudo apt-get install libgtest-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
libgtest-dev is already the newest version (1.10.0-2).
(base) r****@r*******:~/3dTracking/tools/ceres-solver-1.14.0/build$ cmake ..
-- The C compiler identification is GNU 7.5.0
-- The CXX compiler identification is GNU 7.5.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Detected Ceres version: 1.14.0 from /home/r****/3dTracking/tools/ceres-solver-1.14.0/include/ceres/version.h
-- No preference for use of exported Eigen CMake configuration set, and no hints for include directory provided. Defaulting to preferring an installed/exported Eigen CMake configuration if available.
-- Found installed version of Eigen: /usr/local/share/eigen3/cmake
-- Found Eigen: /usr/local/include/eigen3 (found version "3.3.90")
-- Found Eigen version 3.3.90: /usr/local/include/eigen3
-- Enabling use of Eigen as a sparse linear algebra library.
-- Looking for sgemm_
-- Looking for sgemm_ - not found
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Looking for dgemm_
-- Looking for dgemm_ - found
-- Found BLAS: /usr/lib/x86_64-linux-gnu/libf77blas.so;/usr/lib/x86_64-linux-gnu/libatlas.so
-- Found LAPACK library: /usr/lib/x86_64-linux-gnu/liblapack.so;/usr/lib/x86_64-linux-gnu/libf77blas.so;/usr/lib/x86_64-linux-gnu/libatlas.so
-- Found AMD headers in: /usr/include/suitesparse
-- Found AMD library: /usr/lib/x86_64-linux-gnu/libamd.so
-- Found CAMD headers in: /usr/include/suitesparse
-- Found CAMD library: /usr/lib/x86_64-linux-gnu/libcamd.so
-- Found COLAMD headers in: /usr/include/suitesparse
-- Found COLAMD library: /usr/lib/x86_64-linux-gnu/libcolamd.so
-- Found CCOLAMD headers in: /usr/include/suitesparse
-- Found CCOLAMD library: /usr/lib/x86_64-linux-gnu/libccolamd.so
-- Found CHOLMOD headers in: /usr/include/suitesparse
-- Found CHOLMOD library: /usr/lib/x86_64-linux-gnu/libcholmod.so
-- Found SUITESPARSEQR headers in: /usr/include/suitesparse
-- Found SUITESPARSEQR library: /usr/lib/x86_64-linux-gnu/libspqr.so
-- Did not find Intel TBB library, assuming SuiteSparseQR was not compiled with TBB.
-- Found SUITESPARSE_CONFIG headers in: /usr/include/suitesparse
-- Found SUITESPARSE_CONFIG library: /usr/lib/x86_64-linux-gnu/libsuitesparseconfig.so
-- Found LIBRT library: /usr/lib/x86_64-linux-gnu/librt.so
-- Adding librt: /usr/lib/x86_64-linux-gnu/librt.so to SuiteSparse_config libraries (required on Linux & Unix [not OSX] if SuiteSparse is compiled with timing).
-- Found METIS library: /usr/lib/x86_64-linux-gnu/libmetis.so
-- Found SuiteSparse: TRUE (found version "5.7.1")
-- Found SuiteSparse 5.7.1, building with SuiteSparse.
-- Found CXSparse: /usr/include/suitesparse (found version "3.2.0")
-- Found CXSparse version: 3.2.0, building with CXSparse.
-- No preference for use of exported gflags CMake configuration set, and no hints for include/library directories provided. Defaulting to preferring an installed/exported gflags CMake configuration if available.
-- Found installed version of gflags: /usr/lib/x86_64-linux-gnu/cmake/gflags
-- Detected gflags version: 2.2.2
-- Found Gflags: /usr/include
-- Found Google Flags header in: /usr/include, in namespace: google
-- No preference for use of exported glog CMake configuration set, and no hints for include/library directories provided. Defaulting to preferring an installed/exported glog CMake configuration if available.
-- Found installed version of glog: /usr/local/lib/cmake/glog
-- Detected glog version: 0.6.0
-- Found Glog: glog::glog
-- Found Google Log (glog). Assuming glog was built with gflags support as gflags was found. This will make gflags a public dependency of Ceres.
-- Building with OpenMP.
-- Performing Test COMPILER_HAS_CXX11_FLAG
-- Performing Test COMPILER_HAS_CXX11_FLAG - Success
-- Looking for C++ include unordered_map
-- Looking for C++ include unordered_map - found
-- Performing Test HAVE_UNORDERED_MAP_IN_STD_NAMESPACE
-- Performing Test HAVE_UNORDERED_MAP_IN_STD_NAMESPACE - Success
-- Found unordered_map/set in std namespace.
-- Looking for C++ include memory
-- Looking for C++ include memory - found
-- Performing Test HAVE_SHARED_PTR_IN_STD_NAMESPACE
-- Performing Test HAVE_SHARED_PTR_IN_STD_NAMESPACE - Success
-- Found shared_ptr in std namespace using <memory> header.
-- Performing Test CXX11_MATH_FUNCTIONS_FOUND
-- Performing Test CXX11_MATH_FUNCTIONS_FOUND - Success
-- Building Ceres as a static library.
-- No build type specified; defaulting to CMAKE_BUILD_TYPE=Release.
-- Creating configured Ceres config.h output directory: /home/r****/3dTracking/tools/ceres-solver-1.14.0/build/config/ceres/internal
-- Enabling CERES_USE_EIGEN_SPARSE in Ceres config.h
-- Enabling CERES_USE_OPENMP in Ceres config.h
-- Enabling CERES_HAVE_PTHREAD in Ceres config.h
-- Enabling CERES_HAVE_RWLOCK in Ceres config.h
-- Enabling CERES_STD_UNORDERED_MAP in Ceres config.h
-- Build the examples.
-- Configuring done
-- Generating done
-- Build files have been written to: /home/r****/3dTracking/tools/ceres-solver-1.14.0/build
2、make
报错:error: ambiguous overload for ‘operator<<’
解决:安装较新版本的glog
下载0.6.0版本:Release google-glog 0.6.0 · google/glog · GitHub
tar -zxvf glog-0.6.0.tar.gz
cd glog
mkdir build
cd build
cmake ..
make -j 24
sudo make install
成功安装后重新make
make日志过长,省略,只放最后几行
[100%] Building CXX object examples/slam/pose_graph_3d/CMakeFiles/pose_graph_3d.dir/pose_graph_3d.cc.o
[100%] Linking CXX executable ../../../bin/pose_graph_3d
[100%] Built target pose_graph_3d
3、make install,成功
日志过长,省略,只放最后几行
-- Installing: /usr/local/lib/cmake/Ceres/CeresConfigVersion.cmake
-- Installing: /usr/local/lib/cmake/Ceres/FindEigen.cmake
-- Installing: /usr/local/lib/cmake/Ceres/FindGlog.cmake
-- Installing: /usr/local/lib/cmake/Ceres/FindGflags.cmake
-- Installing: /usr/local/lib/libceres.a
4、测试

CMakeLists.txt如下
cmake_minimum_required(VERSION 3.8.0)project(ceres_example)set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)find_package(Ceres REQUIRED)include_directories(${CERES_INCLUDE_DIRS}
)add_executable(ceres_example
ceres_example.cpp)target_link_libraries(ceres_example${CERES_LIBRARIES}
)
例程如下
#include <ceres/ceres.h>class CostFunctor {
public:template <typename T>bool operator()(const T* const x, T* residual) const{residual[0] = 10.0 - x[0];return true;}
};int main(int argc, char const* argv[])
{double initial_x = 5.0;double x = initial_x;// Build the problem.ceres::Problem problem;// Set up the only cost function (also known as residual). This uses// auto-differentiation to obtain the derivative (jacobian).ceres::CostFunction* cost_function = new ceres::AutoDiffCostFunction<CostFunctor, 1, 1>(new CostFunctor);problem.AddResidualBlock(cost_function, nullptr, &x);// Run the solver!ceres::Solver::Options options;options.linear_solver_type = ceres::DENSE_QR;options.minimizer_progress_to_stdout = true;ceres::Solver::Summary summary;Solve(options, &problem, &summary);std::cout << summary.BriefReport() << "\n";std::cout << "x : " << initial_x<< " -> " << x << "\n";return 0;
}
mkdir build
cd build
cmake ..
make
./ceres_example
输出如下
(base) r***@r***-*-***:~/tools/testCeres/build$ ./ceres_example
iter cost cost_change |gradient| |step| tr_ratio tr_radius ls_iter iter_time total_time0 1.250000e+01 0.00e+00 5.00e+00 0.00e+00 0.00e+00 1.00e+04 0 1.79e-05 4.24e-051 1.249750e-07 1.25e+01 5.00e-04 5.00e+00 1.00e+00 3.00e+04 1 3.17e-05 2.31e-042 1.388518e-16 1.25e-07 1.67e-08 5.00e-04 1.00e+00 9.00e+04 1 4.95e-06 2.44e-04
Ceres Solver Report: Iterations: 3, Initial cost: 1.250000e+01, Final cost: 1.388518e-16, Termination: CONVERGENCE
x : 5 -> 10
参考:
error: ambiguous overload for ‘operator<<’ (operand types are ‘std::ostream {aka std::basic_ostream_赫本的猫689的博客-CSDN博客
三维重建_COLMAP安装、使用和参数说明(翻译自官方文档)_圣右的博客-CSDN博客
关于ubuntu18.04中Ceres solver安装与测试-CSDN博客
相关文章:
Ceres-Solver 安装与卸载ubuntu20.04
卸载 sudo rm -rf /usr/local/lib/cmake/Ceres /usr/local/include/ceres /usr/local/lib/libceres.a 安装 sudo apt-get install libatlas-base-dev libsuitesparse-dev git clone https://github.com/ceres-solver/ceres-solver cd ceres-solver git checkout $(git descr…...
汇编系列02-借助操作系统输出Hello World
说明:本节的程序使用的是x86_64指令集的。 汇编语言是可以编译成机器指令的,机器指令是可以直接在CPU上面执行的。我们编写的汇编程序既可以直接在操作系统的帮助下执行,也可以绕过操作系统,直接在硬件上执行。 如果你打算编写的汇编程序在…...
【2023unity游戏制作-mango的冒险】-前六章API,细节,BUG总结小结
👨💻个人主页:元宇宙-秩沅 hallo 欢迎 点赞👍 收藏⭐ 留言📝 加关注✅! 本文由 秩沅 原创 收录于专栏:unity游戏制作 ⭐mango的冒险前六章总结⭐ 文章目录⭐mango的冒险前六章总结⭐👨&a…...
进程控制及其操作
进程创建1.1 fork()函数1.2 fork()函数的返回值进程等待2.1 进程等待的必要性1.之前讲过,子进程退出,父进程如果不管不顾,就可能造成‘僵尸进程’的问题,进而造成内存泄漏。 2.另外,进程一旦变成僵尸状态,那…...
Git常用命令复习笔记
1. Git与SVN区别,各自优缺点 Git: 分布式,每个参与开发的人的电脑上都有一个完整的仓库,不担心硬盘出问题;在不联网的情况下,照样可以提交到本地仓库,可以查看以往的所有log,等到有…...
代码随想录算法训练营day49 | 动态规划 123.买卖股票的最佳时机III 188.买卖股票的最佳时机IV
day49123.买卖股票的最佳时机III1.确定dp数组以及下标的含义2.确定递推公式3.dp数组如何初始化4.确定遍历顺序5.举例推导dp数组188.买卖股票的最佳时机IV1.确定dp数组以及下标的含义2.确定递推公式4.dp数组如何初始化4.确定遍历顺序5.举例推导dp数组123.买卖股票的最佳时机III …...
【教学典型案例】14.课程推送页面整理-增加定时功能
目录一:背景介绍1、代码可读性差,结构混乱2、逻辑边界不清晰,封装意识缺乏3、展示效果不美观二:案例问题分析以及解决过程1、代码可读性…...
【算法基础】DFS BFS 进阶训练
DFS与BFS的基础篇详见:https://blog.csdn.net/m0_51339444/article/details/129301451?csdn_share_tail=%7B%22type%22%3A%22blog%22%2C%22rType%22%3A%22article%22%2C%22rId%22%3A%22129301451%22%2C%22source%22%3A%22m0_51339444%22%7D 一、案例分析1 (树的重心 —— D…...
GO语言中的回调函数
0.前言 回调函数是一种在编程中常见的技术,通常在异步编程中使用。简单来说,回调函数是一个被传递给另一个函数的函数,它在该函数的某个时间点被调用,以完成某些特定的操作或任务。 在Go语言中,可以将函数直接作为参…...
28个案例问题分析---014课程推送页面逻辑整理--vue
一:背景介绍 项目开发过程中,前端出现以下几类问题: 代码结构混乱代码逻辑不清晰页面细节问题 二:问题分析 代码结构混乱问题 <template><top/><div style"position: absolute;top: 10px"><C…...
佛科院单片机原理2——80C51单片机结构
一、程序存储器的入口地址:程序入口地址:0000H外部中断0入口地址:0003H定时器0溢出中断入口地址:000BH外部中断1入口地址:00013H定时器1溢出中断入口地址:001BH串行口中断入口地址:0023H定时器2…...
数据结构与算法_动态顺序表
顺序表是线性表的一种。 线性表是n个具有相同特性的数据元素的有限序列。 逻辑上,它们是线性结构,是一条连续的直线;但是在物理上,它们通常以数组和链式结构存储。 常见的线性表有顺序表、栈、队列、字符串等。 顺序表是用一段…...
逃避浏览器JS检测打开开发者工具
20230304 - 0. 引言 看到一些视频网站之后,想把视频离线下载下来怎么办?直接的方法是通过开发者工具来查看网络流量,一般可以在传输的请求类型中搜索m3u8,然后找到这部分请求,然后利用某些播放器或者下载器直接下载。…...
ceph介绍、原理、架构、算法...个人学习记录
前言 之前公司安排出差支援非结构化项目,采用springcloud(redismysql数据冷热处理)s3escephkafka还涉及一些区块链技术等等…,在与大佬的沟通交流下对ceph产生了兴趣,私下学习记录一下;后续工作之余会采用上面相关技术栈手动实现不…...
Spring MVC源码解析——HandlerMapping(处理器映射器)
Sping MVC 源码解析——HandlerMapping处理器映射器1. 什么是HandlerMapping2. HandlerMapping2.1 HandlerMapping初始化2.2 getHandler解析3. getHandlerInternal()子类实现3.1 AbstractUrlHandlerMapping与AbstractHandlerMethodMapping的区别3.2 AbstractUrlHandlerMapping3…...
【Word/word2007】将标题第1章改成第一章
问题:设置多级列表没有其他格式选的解决办法和带来的插入图注解的问题,将标题第1章改成第一章的问题其他方案。 按照百度搜索的方法设置第一章,可以是没有相应的样式可以选。 那就换到编号选项 设置新的编号值 先选是 然就是变得很丑 这时打开…...
NLP预训练模型
Models Corpus RoBERTa: A Robustly Optimized BERT Pretraining Approach 与BERT主要区别在于: large mini-batches 保持总训练tokens数一致,使用更大的学习率、更大的batch size,adam β20.98\beta_20.98β20.98;dynamic ma…...
Typora上传文档图片链接失效的问题+PicGo布置图床在Github
文章目录typora图片链接失效原因PicGO开源图床布置先配置Github2.1先创建新仓库、用于存放图片2.2生成一个token,用picGo访问github3.下载picGo,并进行配置3.1 配置v4.1typora图片链接失效原因 因为你是保存在本地的,因此图片是不能访问,可以…...
win10安装oracle
文件放到最后。我的电脑是win11的,因为老师让写下安装笔记,在11上安装的时候没有截屏,所以在虚拟机上重新安装下吧。室友说要把文件夹放到c盘才能打开。我试了下,具体的是要把Oracle11g文件夹放到c盘根目录下。如果解压后不是这个…...
AQS为什么用双向链表?
首先,在AQS中,等待队列是通过Node类来表示的,每个Node节点包含了等待线程的信息以及等待状态。下面是Node类的部分源码:static final class Node {// 等待状态volatile int waitStatus;// 前驱节点volatile Node prev;// 后继节点…...
C++初阶-list的底层
目录 1.std::list实现的所有代码 2.list的简单介绍 2.1实现list的类 2.2_list_iterator的实现 2.2.1_list_iterator实现的原因和好处 2.2.2_list_iterator实现 2.3_list_node的实现 2.3.1. 避免递归的模板依赖 2.3.2. 内存布局一致性 2.3.3. 类型安全的替代方案 2.3.…...
java_网络服务相关_gateway_nacos_feign区别联系
1. spring-cloud-starter-gateway 作用:作为微服务架构的网关,统一入口,处理所有外部请求。 核心能力: 路由转发(基于路径、服务名等)过滤器(鉴权、限流、日志、Header 处理)支持负…...
CVPR 2025 MIMO: 支持视觉指代和像素grounding 的医学视觉语言模型
CVPR 2025 | MIMO:支持视觉指代和像素对齐的医学视觉语言模型 论文信息 标题:MIMO: A medical vision language model with visual referring multimodal input and pixel grounding multimodal output作者:Yanyuan Chen, Dexuan Xu, Yu Hu…...
python打卡day49
知识点回顾: 通道注意力模块复习空间注意力模块CBAM的定义 作业:尝试对今天的模型检查参数数目,并用tensorboard查看训练过程 import torch import torch.nn as nn# 定义通道注意力 class ChannelAttention(nn.Module):def __init__(self,…...
Spark 之 入门讲解详细版(1)
1、简介 1.1 Spark简介 Spark是加州大学伯克利分校AMP实验室(Algorithms, Machines, and People Lab)开发通用内存并行计算框架。Spark在2013年6月进入Apache成为孵化项目,8个月后成为Apache顶级项目,速度之快足见过人之处&…...
逻辑回归:给不确定性划界的分类大师
想象你是一名医生。面对患者的检查报告(肿瘤大小、血液指标),你需要做出一个**决定性判断**:恶性还是良性?这种“非黑即白”的抉择,正是**逻辑回归(Logistic Regression)** 的战场&a…...
day52 ResNet18 CBAM
在深度学习的旅程中,我们不断探索如何提升模型的性能。今天,我将分享我在 ResNet18 模型中插入 CBAM(Convolutional Block Attention Module)模块,并采用分阶段微调策略的实践过程。通过这个过程,我不仅提升…...
阿里云ACP云计算备考笔记 (5)——弹性伸缩
目录 第一章 概述 第二章 弹性伸缩简介 1、弹性伸缩 2、垂直伸缩 3、优势 4、应用场景 ① 无规律的业务量波动 ② 有规律的业务量波动 ③ 无明显业务量波动 ④ 混合型业务 ⑤ 消息通知 ⑥ 生命周期挂钩 ⑦ 自定义方式 ⑧ 滚的升级 5、使用限制 第三章 主要定义 …...
Linux相关概念和易错知识点(42)(TCP的连接管理、可靠性、面临复杂网络的处理)
目录 1.TCP的连接管理机制(1)三次握手①握手过程②对握手过程的理解 (2)四次挥手(3)握手和挥手的触发(4)状态切换①挥手过程中状态的切换②握手过程中状态的切换 2.TCP的可靠性&…...
TRS收益互换:跨境资本流动的金融创新工具与系统化解决方案
一、TRS收益互换的本质与业务逻辑 (一)概念解析 TRS(Total Return Swap)收益互换是一种金融衍生工具,指交易双方约定在未来一定期限内,基于特定资产或指数的表现进行现金流交换的协议。其核心特征包括&am…...
