第十章 位姿与点联合估计

Chapter 10   Pose-and-Point Estimation


10.1 束调整 / Bundle Adjustment

10.1.1 问题描述 / Problem Setup

中文

束调整(Bundle Adjustment, BA) 是计算机视觉与机器人中最重要的非线性最小二乘问题之一:同时估计相机轨迹( 个位姿)和场景地图( 个路标点)。

与第 9 章位姿估计不同,这里路标点坐标 也是未知量,需要与位姿一起优化。

待估状态

其中 是第 个相机位姿,(齐次坐标)是第 个路标点的世界坐标。

可观测性(Gauge Freedom)

仅靠视觉测量,绝对坐标系无法确定(整体平移、旋转、尺度不可观)。标准处理方式:固定第 0 个位姿 ,不参与优化。这消除了规范自由度(gauge freedom)。

测量模型

每次相机 观测到路标 产生一个测量:

其中 是复合映射:先将路标转换到相机坐标系,再经过相机投影模型:

可以是针孔模型、立体相机模型等任意非线性投影。


English

Bundle Adjustment (BA) is a cornerstone algorithm in computer vision and robotics: simultaneously estimate camera poses and landmark positions from visual measurements.

State to estimate:

where and (homogeneous).

Gauge freedom: visual measurements determine only relative geometry. We fix (not included in the state) to remove the unobservable rigid-body gauge freedom.

Measurement model: camera observing landmark :


10.1.2 最大似然解 / Maximum Likelihood Solution

中文

在全部测量 已知的情况下,最大似然(ML)问题等价于最小化

其中测量残差

线性化:在工作点 处,对位姿施加李代数扰动、对路标施加线性扰动:

其中 将 3D 扰动嵌入齐次坐标。残差线性化为

其中雅可比矩阵

是投影函数的雅可比, 的伴随算子。

将全部扰动向量堆叠:

费用函数的二次近似为

其中

最优扰动 满足线性方程

然后更新工作点:

迭代至收敛(高斯-牛顿法 Gauss-Newton)。

GN vs. Newton’s Method

  • GN 近似,仅用一阶雅可比,舍去 Hessian 的二阶项。适用于残差较小时(近最优时成立)。
  • Newton 法,包含二阶项。收敛域更大,但计算代价高。 BA 问题通常用 GN 法,因为残差(重投影误差)在最优解附近很小。

English

The ML objective is

Linearizing about using left perturbations for poses and additive perturbations for landmarks:

The Jacobians are

Stacking all perturbations , the quadratic approximation is

and the GN step solves , then updates operating points via the Lie exponential and vector addition.


10.1.3 利用稀疏结构 / Exploiting Sparsity

中文

矩阵 的块结构

其中

关键观察:

  1. 是块对角矩阵。 原因: 中不同路标的列块之间没有耦合(每个路标的扰动 只影响自身行),因此
  1. 也是块对角矩阵。 原因:每个测量只关联一个位姿,因此 的每行只对应一个位姿的列块,导致 呈块对角形式:

整个矩阵 呈**箭头形(arrowhead)**稀疏结构:

其中左上角 (位姿-位姿块)和右下角 (路标-路标块,块对角)。

Schur 补消去路标

利用块消去(Schur 补)先消去路标变量:

其中

由于 块对角,其逆 可逐块求解,计算量仅 (每个 块求逆)。然后求解规模为 的缩减位姿系统,再回代求路标扰动:

总体复杂度 ,相比直接解 有巨大提升。

Cholesky 分解

也可以利用 的稀疏结构做 Cholesky 分解

其中 块对角(继承自 ),求逆高效。后向回代即可得到 和不确定性


English

The matrix has arrowhead sparsity: (landmark-landmark) is block-diagonal because each landmark’s perturbation only appears in its own rows, while (pose-pose) is dense among poses that share landmarks.

Schur complement (eliminate landmarks first):

Since is block-diagonal (each block inverted independently), the reduced pose system has size . Back-substitution recovers the landmark corrections. Total cost: .

Cholesky: A block-Cholesky factorization exploits the same sparsity and allows efficient extraction of posterior covariances.


10.1.4 初始化策略 / Initialization

中文

BA 是非凸优化,GN 需要良好的初值。实践中常用:

  1. 旋转平均(rotation averaging):从成对相对旋转中初始化绝对旋转。
  2. 平移求解(translation solver):固定旋转后线性求解平移。
  3. 三角化(triangulation):固定位姿后,用线性最小二乘初始化路标位置。

经典策略:先做递增式 BA(每添加一帧做一次小型 BA),再做全局 BA 精化。


English

BA is non-convex; GN requires good initialization. Common strategy: rotation averaging → translation initialization → triangulation → incremental BA → global BA refinement.


10.1.5 插值示例 / Interpolation Example

中文

欠约束 BA:当某时刻相机没有足够路标观测(欠约束)时,该位姿不可估计。一种正则化方法是引入轨迹插值约束

假设我们已知位姿 ,并假定 之间满足常速运动(匀速插值):

其中 。此时 不是独立变量,可用 表达。

处的扰动:,其中 是插值雅可比矩阵(依赖 和工作点)。

插值矩阵:设原扰动状态 ,引入缩减扰动状态

新的费用函数变为

重要结论:插值操作不破坏箭头形稀疏结构—— 的路标-路标块 仍保持块对角,Schur 补方法依然可用。


English

When a pose is underconstrained (too few landmark observations), a constant-velocity interpolation provides regularization. Assume pose for some .

The perturbation at is then (interpolation Jacobian). This reduces the free variables via an interpolation matrix :

Crucially, the landmark-landmark block remains block-diagonal, preserving the arrowhead structure and Schur complement efficiency.


10.2 同步定位与建图(SLAM) / Simultaneous Localization and Mapping

10.2.1 问题描述 / Problem Setup

中文

直觉:BA vs. SLAM

BA 是纯粹的最大似然问题——仅依赖视觉测量,位姿间没有耦合。SLAM 是最大后验问题——除了视觉测量,还引入了运动先验(来自 IMU、轮速计或常速假设),位姿之间通过运动模型相互关联。

另一个关键区别:BA 需要固定某个位姿(规范自由度),SLAM 有运动先验,因此 也可以参与估计

待估状态

与 BA 相比增加了

输入(运动信息)

其中 是初始位姿先验, 是第 步的广义速度输入。

测量 与 BA 相同:


English

SLAM extends BA by incorporating a motion prior (from odometry, IMU, or a constant-velocity model) linking consecutive poses. This adds the initial pose to the estimated state (no gauge freedom needed since the prior provides an absolute reference):

Inputs: .


10.2.2 批量最大后验解 / Batch Maximum a Posteriori Solution

中文

从第 9.2 节的运动先验,定义运动误差:

运动先验代价项:

总代价函数:

矩阵形式:

其中 是第 9.2 节的运动先验块三对角矩阵,

块矩阵展开:

运动先验雅可比(与第 9.2 节一致):

求解 ,然后更新工作点并迭代。


English

SLAM adds motion prior cost terms to the BA objective. The motion error at step is (from §9.2):

The full system matrix:

The block now contains both the motion prior contribution (block-tridiagonal) and the measurement contribution . The block is unchanged from BA (block-diagonal).


10.2.3 利用稀疏结构 / Exploiting Sparsity

中文

引入运动先验不破坏箭头形稀疏结构:

  • :与 BA 完全相同, 仍块对角。
  • :增加了运动先验项 ,但该项是块三对角的,因此 整体仍为块三对角。

两种利用稀疏的策略:

策略利用哪个块的稀疏适用场景
Schur 补 块对角路标数 远大于位姿数
Cholesky 块三对角位姿数 远大于路标数

注意:Schur 补需要构建 ,而 是稠密的,因此当位姿数量很大时,Cholesky 方法更优。

因子图视角

SLAM 的代价函数可以用因子图直观表示:每个测量 和每个运动先验 是图中的一个”因子”(黑点),连接对应的变量节点。因子图清晰展示了变量间的耦合关系,是理解稀疏结构的利器。


English

Adding the motion prior does not destroy the arrowhead sparsity:

  • remains block-diagonal (unchanged).
  • gains the block-tridiagonal prior term .

Two exploitation strategies:

  • Schur complement (eliminating landmarks): preferred when .
  • Cholesky (exploiting tridiagonal ): preferred when (avoids forming the dense ).

10.2.4 SLAM 示例 / SLAM Example

中文

图 10.4 展示了一个简单的 SLAM 问题:3 个路标点、3 个自由位姿( 也参与估计)。

代价函数共 9 项:

与 BA 不同,运动先验确保 始终良条件——即便没有任何测量,也能给出轨迹的先验解。


English

A minimal SLAM example with poses and landmarks has 9 cost terms: 3 motion prior terms (one per step, including the initial prior on ) and 6 measurement terms. Unlike BA, the motion prior guarantees is always well-conditioned.


10.3 本章小结 / Chapter Summary

中文

问题方法结构关键工具
BA最大似然箭头形, 块对角Schur 补 / Cholesky
SLAM最大后验同上 + 块三对角Schur 补 / Cholesky
插值 BA+ 插值约束仍保持箭头形插值矩阵

核心技术共性

  1. 所有问题均用 GN 法迭代;位姿通过指数映射更新,路标通过线性加法更新。
  2. 稀疏结构由问题物理结构决定(路标各自独立 → 块对角;运动先验链 → 块三对角)。
  3. Schur 补将复杂度从 降至

English

ProblemCriterionStructureKey tool
BAMLArrowhead, block-diagSchur/Cholesky
SLAMMAP+ block-tridiagSchur/Cholesky
Interpolated BAML + constraintArrowhead preservedInterpolation matrix

All problems use Gauss-Newton iteration with left perturbations for poses. Sparsity is a consequence of physical structure: independent landmarks give block-diagonal ; motion priors give block-tridiagonal . The Schur complement reduces complexity from to .


下一章将把连续时间 GP 先验引入三维轨迹估计,得到 STEAM 算法。/ The next chapter introduces continuous-time GP priors for 3D trajectory estimation, leading to the STEAM algorithm.