# 光束法平差

光束法平差是一种非线性最小二乘优化方法，它联合精化相机参数（位姿，通常还包括标定参数）与三维点坐标，使得这些点重投影到每幅图像后，尽可能接近观测到的特征位置。<sup>[1](https://link.springer.com/chapter/10.1007/3-540-44480-7_21)</sup> 它是大多数运动恢复结构系统的关键组成部分，并且几乎总是作为最终的精化步骤使用，因为在初始猜测良好的情况下，它比任何其他可用的SfM精化方法都更精确。<sup>[2](https://grail.cs.washington.edu/projects/bal/bal.pdf)</sup><sup> • </sup><sup>[3](https://www.cs.purdue.edu/cgvlab/www/resources/papers/Zhang-IEEE-2006-Robust_Bundle_Adjustment_For_Structure_From_Motion.pdf)</sup> 这个名称指的是从每个三维特征发出的、汇聚到每个相机中心的光线束；这些光线相对于特征位置和相机位置都被最优地“调整”。<sup>[1](https://link.springer.com/chapter/10.1007/3-540-44480-7_21)</sup>

| 关键事实 | 详情 |
|---|---|
| 目标函数 | 所有观测上重投影残差的加权平方和，联合优化相机与点<sup>[1](https://link.springer.com/chapter/10.1007/3-540-44480-7_21)</sup> |
| 标准求解器 | 莱文贝格-马夸特算法，配合舒尔补技巧将系统约化为更小的相机块<sup>[4](https://grail.cs.washington.edu/projects/mcba/pba.pdf)</sup> |
| 复杂度 | 朴素LM：\( O((m+n)^{3}) \) 次运算和 \( O(mn(m+n)) \) 内存；使用舒尔补：\( O(m^{3}+mn) \) 次运算和 \( O(mn) \) 内存<sup>[5](https://arxiv.org/pdf/1912.03858)</sup> |
| 鲁棒性 | 通常采用Huber范数；普通最小二乘对离群值高度敏感<sup>[6](https://cvg.cit.tum.de/_media/teaching/ss2023/mvg2023/material/chapter12_bundle_adjustment.pdf)</sup><sup> • </sup><sup>[1](https://link.springer.com/chapter/10.1007/3-540-44480-7_21)</sup> |
| 规模 | 从实时滑动窗口到对118万张真实图像的分布式LM平差<sup>[7](https://link.springer.com/article/10.1007/s11263-025-02505-4)</sup> |
| 软件 | COLMAP默认使用Ceres作为BA后端，但也支持实验性的GPU加速Caspar后端，可通过 --BundleAdjustment.backend (CERES 或 CASPAR) 选择，包括在全局（GLOMAP）建图器中通过 GlobalMapper.ba_backend 选择；而TheiaSfM、OpenMVG和GLOMAP也依赖基于Ceres的平差<sup>[8](https://openaccess.thecvf.com/content/CVPR2025/papers/Safari_Matrix-Free_Shared_Intrinsics_Bundle_Adjustment_CVPR_2025_paper.pdf)</sup> |

## 工作原理

未知量是相机参数和三维点坐标。每个观测——在一幅图像中检测到的二维特征——产生一个残差 \( \boldsymbol{r}_{i}(\boldsymbol{x}) = \boldsymbol{z}_{i} - \hat{\boldsymbol{z}}_{i}(\boldsymbol{x}) \)，即观测值与模型预测值 \( \hat{\boldsymbol{z}}_{i}(\boldsymbol{x}) \) 之间的差，后者通过相机投影该点得到。<sup>[1](https://link.springer.com/chapter/10.1007/3-540-44480-7_21)</sup> 非线性最小二乘取使这些残差的加权平方误差和最小化的参数作为估计值。<sup>[1](https://link.springer.com/chapter/10.1007/3-540-44480-7_21)</sup> 在零均值高斯噪声下，该目标函数在相差一个加性常数的意义下，等于给定所有测量时未知量的负对数似然，即重投影误差的马氏距离平方和。<sup>[9](https://www.cs.cmu.edu/~kaess/vslam_cvpr14/media/VSLAM-Tutorial-CVPR14-A13-BundleAdjustment-handout.pdf)</sup>

重投影误差被视为“黄金标准”误差度量，因为它直接相对于原始输入数据（图像点）计算；而诸如八点法之类的线性方法，虽然在不做归一化时对噪声敏感，但可以通过归一化从含噪点对应中为基础矩阵提供初始估计。<sup>[6](https://cvg.cit.tum.de/_media/teaching/ss2023/mvg2023/material/chapter12_bundle_adjustment.pdf)</sup><sup> • </sup><sup>[22](https://www.cse.unr.edu/~bebis/CS485/Handouts/hartley.pdf)</sup> 该问题是非凸的，因此求解器只能收敛到局部极小值。<sup>[6](https://cvg.cit.tum.de/_media/teaching/ss2023/mvg2023/material/chapter12_bundle_adjustment.pdf)</sup>

**稀疏性是使问题可解的结构。** 每个重投影残差只依赖于恰好一个相机的变量参数（位姿，若优化内参则还包括内参）和一个三维路标点，因此雅可比矩阵是稀疏的；设参数总数为 \( n = 6C + 3P \)（每个相机 \( C \) 有6个自由度，每个点 \( P \) 有3个），仅存储稀疏块可将空间从 \( O(n^{2}) \) 降至 \( O(n) \)。<sup>[10](https://arxiv.org/html/2409.12190v2)</sup> 正规方程 \( \boldsymbol{A}^{\top}\boldsymbol{A}\,\boldsymbol{x} = \boldsymbol{A}^{\top}\boldsymbol{b} \) 继承了这种稀疏性，利用它对于效率至关重要。<sup>[9](https://www.cs.cmu.edu/~kaess/vslam_cvpr14/media/VSLAM-Tutorial-CVPR14-A13-BundleAdjustment-handout.pdf)</sup>

## 实现方法

莱文贝格-马夸特算法是最流行的求解器，也是光束法平差的首选算法。<sup>[4](https://grail.cs.washington.edu/projects/mcba/pba.pdf)</sup> 每次迭代求解一个阻尼线性最小二乘系统 \( (\boldsymbol{J}^{\top}\boldsymbol{J} + \lambda \cdot \boldsymbol{D})\,\boldsymbol{\delta} = -\boldsymbol{J}^{\top}\boldsymbol{f} \)，其中阻尼限制了远离解时的步长。<sup>[4](https://grail.cs.washington.edu/projects/mcba/pba.pdf)</sup><sup> • </sup><sup>[9](https://www.cs.cmu.edu/~kaess/vslam_cvpr14/media/VSLAM-Tutorial-CVPR14-A13-BundleAdjustment-handout.pdf)</sup> 等价地，正则化海森矩阵为 \( \boldsymbol{H}_{\mu}(\boldsymbol{x}) = \boldsymbol{J}(\boldsymbol{x})^{\top}\boldsymbol{J}(\boldsymbol{x}) + \mu\boldsymbol{D}(\boldsymbol{x})^{\top}\boldsymbol{D}(\boldsymbol{x}) \)，当 \( \mu \cdot \boldsymbol{D}(\boldsymbol{x}) > 0 \) 时是对称正定的。<sup>[2](https://grail.cs.washington.edu/projects/bal/bal.pdf)</sup> 朴素的LM算法每次迭代需要 \( O((m+n)^{3}) \) 次运算和约 \( O(mn(m+n)) \) 的内存；利用稀疏性和[舒尔补](https://www.edgepedia.org/zh/schur-complement)可将其降至 \( O(m^{3}+mn) \) 次运算和 \( O(mn) \) 内存。<sup>[5](https://arxiv.org/pdf/1912.03858)</sup>

**舒尔补技巧**将参数分为相机块和点块。由于点块 \( \boldsymbol{V}_{\lambda} \) 是块对角的，首先求解约化的相机系统 \( (\boldsymbol{U}_{\lambda} - \boldsymbol{W}\boldsymbol{V}_{\lambda}^{-1}\boldsymbol{W}^{\top})\,\boldsymbol{\delta}_{c} = -\boldsymbol{J}_{c}^{\top}\boldsymbol{f} + \boldsymbol{W}\boldsymbol{V}_{\lambda}^{-1}\boldsymbol{J}_{p}^{\top}\boldsymbol{f} \)，然后通过回代 \( \boldsymbol{\delta}_{p} = -\boldsymbol{V}_{\lambda}^{-1}(\boldsymbol{J}_{p}^{\top}\boldsymbol{f} + \boldsymbol{W}^{\top}\boldsymbol{\delta}_{c}) \) 恢复点的更新量。<sup>[4](https://grail.cs.washington.edu/projects/mcba/pba.pdf)</sup> 舒尔补 \( \boldsymbol{S} = \boldsymbol{U} - \boldsymbol{W}\boldsymbol{V}^{-1}\boldsymbol{W}^{\top} \) 是对称、正定且具有块结构的；由于相机数量通常远小于点数量，先求解约化的相机系统要廉价得多。<sup>[11](https://cvg.cit.tum.de/_media/teaching/ss2024/mvg2024/material/multiviewgeometry7.pdf)</sup><sup> • </sup><sup>[2](https://grail.cs.washington.edu/projects/bal/bal.pdf)</sup> 由于 \( \boldsymbol{S} \) 是对称正定的，Cholesky分解是首选方法；对于大规模问题，使用廉价预条件子的预条件共轭梯度法，结合非精确步LM方案，可达到最先进的性能；而隐式海森矩阵变体允许完全无矩阵的算法，即时计算雅可比元素。<sup>[4](https://grail.cs.washington.edu/projects/mcba/pba.pdf)</sup> 预条件之所以重要，是因为BA的代价函数通常是病态的，这会减慢一阶方法并导致梯度下降出现之字形振荡。<sup>[12](https://isprs-annals.copernicus.org/articles/III-3/43/2016/isprs-annals-III-3-43-2016.pdf)</sup>

**鲁棒化与规范固定**完善了整个方案。诸如Huber范数之类的鲁棒核函数在典型重投影误差的尺度上引入强非线性；即使使用此类损失函数，问题仍可转化为重加权非线性最小二乘问题。<sup>[1](https://link.springer.com/chapter/10.1007/3-540-44480-7_21)</sup><sup> • </sup><sup>[2](https://grail.cs.washington.edu/projects/bal/bal.pdf)</sup> 解不是唯一确定的：相机可以被任意的7自由度相似变换（在双视图情况下）移动而不影响目标函数，因此需要通过最小无尺度参数化、摄影测量内约束、对第一帧位姿的先验，或与IMU/GPS信息融合来固定规范。<sup>[9](https://www.cs.cmu.edu/~kaess/vslam_cvpr14/media/VSLAM-Tutorial-CVPR14-A13-BundleAdjustment-handout.pdf)</sup>

## 起源

光束法平差起源于摄影测量学和大地测量学领域，其目标是在零均值高斯噪声假设下联合估计三维点坐标和相机参数。<sup>[11](https://cvg.cit.tum.de/_media/teaching/ss2024/mvg2024/material/multiviewgeometry7.pdf)</sup> 历史记载将其发展定位于20世纪50年代末：一份记录称光束法是为美国空军开发的，由阿伯丁试验场弹道研究实验室的赫尔穆特·施密德应用于卫星跟踪；<sup>[13](https://www.isprs.org/society/ksp/PDF/2025_01-Walker_Istanbul.pdf)</sup> 另一份记录则指出当时描述了一种最小化投影误差的最小二乘方法。<sup>[12](https://isprs-annals.copernicus.org/articles/III-3/43/2016/isprs-annals-III-3-43-2016.pdf)</sup>

布朗的第一个算法已经只求解系统的一部分，其余方程通过回代求解，这种方法现在通常称为舒尔补技巧。<sup>[12](https://isprs-annals.copernicus.org/articles/III-3/43/2016/isprs-annals-III-3-43-2016.pdf)</sup> 那篇综述为计算机视觉界收集了这些摄影测量和大地测量的成果，并指出其中大部分早已出现在那些文献中，并正在视觉领域被逐渐重新发明。<sup>[1](https://link.springer.com/chapter/10.1007/3-540-44480-7_21)</sup>

## 变体

**实时与约化变体。** 限制窗口大小可减少优化参数的数量，使实时光束法平差成为可能；仅运动BA通过仅优化相机参数而保持三维路标点固定，进一步降低了复杂度。<sup>[6](https://cvg.cit.tum.de/_media/teaching/ss2023/mvg2023/material/chapter12_bundle_adjustment.pdf)</sup> 该问题也可以重新表述为图优化，节点为参数，边为约束。<sup>[6](https://cvg.cit.tum.de/_media/teaching/ss2023/mvg2023/material/chapter12_bundle_adjustment.pdf)</sup>

**并行与无矩阵求解器。** 多核CPU系统在收敛性相当的情况下比先前的最先进方法快达十倍，GPU系统快达三十倍。<sup>[4](https://grail.cs.washington.edu/projects/mcba/pba.pdf)</sup> 幂光束法平差（PoBA），由西蒙·韦伯及其同事报道（2022年，arXiv），通过仅需矩阵乘法的矩阵幂级数来近似逆舒尔补。<sup>[14](https://doi.org/10.48550/arxiv.2204.12834)</sup> 幂变量投影（PoVar），由西蒙·韦伯、洪济亨和丹尼尔·克雷默斯报道（2024年，arXiv），面向无需初始化的大规模光束法平差。<sup>[15](https://doi.org/10.48550/arxiv.2405.05079)</sup> MegBA，由任杰及其同事报道（2021年，arXiv），是一个基于GPU的分布式库，使用分布式预条件共轭梯度和分布式舒尔消元，API与g2o和Ceres兼容。<sup>[16](https://doi.org/10.48550/arxiv.2112.01349)</sup> CPU-f64、CPU-f32和GPU-f32下的无矩阵共享内参求解器，与Ceres相比峰值内存降低一个数量级，而在双精度下收敛性几乎无法区分。<sup>[8](https://openaccess.thecvf.com/content/CVPR2025/papers/Safari_Matrix-Free_Shared_Intrinsics_Bundle_Adjustment_CVPR_2025_paper.pdf)</sup>

**专门化公式。** RSL-BA，由张永聪及其同事报道（2024年，arXiv），使用线特征将光束法平差扩展到卷帘快门相机。<sup>[17](https://doi.org/10.48550/arxiv.2408.05409)</sup> PLGSLAM，由邓天辰及其同事报道（2023年，arXiv），将渐进式神经场景表示与局部到全局光束法平差相结合。<sup>[18](https://doi.org/10.48550/arxiv.2312.09866)</sup> 具有稀疏感知自动微分的即时模式可微实现，可在PyTorch内于GPU上运行二阶BA。<sup>[10](https://arxiv.org/html/2409.12190v2)</sup>

## 应用

光束法平差通常作为基于特征的结构与运动估计的最后一步来求解，以获得最优估计，涉及非常大量的参数。<sup>[19](https://dl.acm.org/doi/10.1145/1486525.1486527)</sup> 除特征跟踪外，BA通常是基于特征的三维重建算法中最耗时的计算。<sup>[20](http://publications.ics.forth.gr/_publications/0201-P0401-lourakis-levenberg.pdf)</sup> 主要的开源SfM系统——COLMAP、TheiaSfM、OpenMVG和GLOMAP——都使用Ceres作为其BA后端，而由于计算成本，BA在SfM流程中被保守地使用。<sup>[8](https://openaccess.thecvf.com/content/CVPR2025/papers/Safari_Matrix-Free_Shared_Intrinsics_Bundle_Adjustment_CVPR_2025_paper.pdf)</sup> 在视觉SLAM和里程计中，滑动窗口和仅运动BA提供了实时能力。<sup>[6](https://cvg.cit.tum.de/_media/teaching/ss2023/mvg2023/material/chapter12_bundle_adjustment.pdf)</sup> 较新的用途将BA与学习和可微流程相结合：具有稀疏感知自动微分的即时模式GPU实现，相对于GTSAM、g2o和Ceres分别报告了18.5倍、22倍和23倍的平均加速；<sup>[10](https://arxiv.org/html/2409.12190v2)</sup> 神经场景表示SLAM系统在学习得到的地图上使用局部到全局光束法平差。<sup>[18](https://doi.org/10.48550/arxiv.2312.09866)</sup>

## 局限与替代方案

**离群值与初始化。** 普通最小二乘对离群值高度敏感，因为与大多数真实测量误差分布相比，高斯分布的尾部极小；鲁棒化将观测划分为独立的不可约组，整组被接受、降权或拒绝。<sup>[1](https://link.springer.com/chapter/10.1007/3-540-44480-7_21)</sup> 基于BA的SLAM需要对所有变量（包括地图）进行仔细初始化，并且由于估计三维结构需要足够的基线，在慢速运动或纯旋转运动时会遇到困难。<sup>[21](https://ar5iv.labs.arxiv.org/html/1902.03747v2.pdf)</sup> 当点移动到接近图像平面并“穿越”到错误一侧时，高斯-牛顿和LM等局部极小化方法几乎总是收敛到局部极小值。<sup>[9](https://www.cs.cmu.edu/~kaess/vslam_cvpr14/media/VSLAM-Tutorial-CVPR14-A13-BundleAdjustment-handout.pdf)</sup>

**规范与条件数。** 规范自由度（基准亏缺）意味着解不是唯一确定的，需要内约束或规范固定。<sup>[1](https://link.springer.com/chapter/10.1007/3-540-44480-7_21)</sup> 代价函数通常是病态的，减慢一阶方法。<sup>[12](https://isprs-annals.copernicus.org/articles/III-3/43/2016/isprs-annals-III-3-43-2016.pdf)</sup>

**替代方案。** 已知旋转的[L-无穷](https://www.edgepedia.org/zh/l-infinity)公式是准凸的，适合高效的全局求解，而不像非凸的BA问题只能接受局部最优解；在一项已报道的比较中，基于BA的SLAM系统在其离群值去除启发式消除了内点后未能完成一个序列，而L-无穷替代方案完成了它。<sup>[21](https://ar5iv.labs.arxiv.org/html/1902.03747v2.pdf)</sup> 对于仅旋转问题，增量[旋转平均](https://www.edgepedia.org/zh/rotation-averaging)比增量BA快一个数量级。<sup>[21](https://ar5iv.labs.arxiv.org/html/1902.03747v2.pdf)</sup> 子图划分方法用近似解替代精确LM，通常给出次优结果。<sup>[7](https://link.springer.com/article/10.1007/s11263-025-02505-4)</sup>

## References

1. [Bundle Adjustment, A Modern Synthesis (Triggs, McLauchlan, Hartley, Fitzgibbon; Springer published version, merged with author PDF copies)](https://link.springer.com/chapter/10.1007/3-540-44480-7_21)
2. [Bundle Adjustment in the Large (Agarwal et al., ECCV 2010; merged with Springer DOI page)](https://grail.cs.washington.edu/projects/bal/bal.pdf)
3. [Robust Bundle Adjustment for Structure from Motion (Zhang, IEEE 2006)](https://www.cs.purdue.edu/cgvlab/www/resources/papers/Zhang-IEEE-2006-Robust_Bundle_Adjustment_For_Structure_From_Motion.pdf)
4. [Multicore Bundle Adjustment (Wu et al.)](https://grail.cs.washington.edu/projects/mcba/pba.pdf)
5. [Bundle Adjustment Revisited (arXiv 1912.03858; merged with ar5iv copy)](https://arxiv.org/pdf/1912.03858)
6. [Computer Vision II: Multiple View Geometry (IN2228), Chapter 12, Bundle Adjustment (TUM)](https://cvg.cit.tum.de/_media/teaching/ss2023/mvg2023/material/chapter12_bundle_adjustment.pdf)
7. [Implementation and Validation of Distributed Bundle Adjustment for Super Large Scale Datasets (IJCV 2025)](https://link.springer.com/article/10.1007/s11263-025-02505-4)
8. [Matrix-Free Shared Intrinsics Bundle Adjustment (CVPR 2025)](https://openaccess.thecvf.com/content/CVPR2025/papers/Safari_Matrix-Free_Shared_Intrinsics_Bundle_Adjustment_CVPR_2025_paper.pdf)
9. [Visual SLAM Tutorial (CVPR 2014): Bundle Adjustment handout](https://www.cs.cmu.edu/~kaess/vslam_cvpr14/media/VSLAM-Tutorial-CVPR14-A13-BundleAdjustment-handout.pdf)
10. [Bundle Adjustment in the Eager Mode (BAE)](https://arxiv.org/html/2409.12190v2)
11. [Lecture Multiple View Geometry (TUM, 2024), Bundle adjustment (merged with SS2025 edition)](https://cvg.cit.tum.de/_media/teaching/ss2024/mvg2024/material/multiviewgeometry7.pdf)
12. [Modern Methods of Bundle Adjustment on the GPU (ISPRS Annals 2016; merged with aggregator copy)](https://isprs-annals.copernicus.org/articles/III-3/43/2016/isprs-annals-III-3-43-2016.pdf)
13. [The story of bundle adjustment: Karsten Jacobsen's chapter (ISPRS)](https://www.isprs.org/society/ksp/PDF/2025_01-Walker_Istanbul.pdf)
14. [Weber, Simon and colleagues (2022). Power Bundle Adjustment for Large-Scale 3D Reconstruction. arXiv (Cornell University).](https://doi.org/10.48550/arxiv.2204.12834)
15. [Weber, Simon, Hong, Je Hyeong, Cremers, Daniel (2024). Power Variable Projection for Initialization-Free Large-Scale Bundle Adjustment. arXiv (Cornell University).](https://doi.org/10.48550/arxiv.2405.05079)
16. [Ren, Jie and colleagues (2021). MegBA: A GPU-Based Distributed Library for Large-Scale Bundle Adjustment. arXiv (Cornell University).](https://doi.org/10.48550/arxiv.2112.01349)
17. [Zhang, Yongcong and colleagues (2024). RSL-BA: Rolling Shutter Line Bundle Adjustment. arXiv (Cornell University).](https://doi.org/10.48550/arxiv.2408.05409)
18. [Deng, Tianchen and colleagues (2023). PLGSLAM: Progressive Neural Scene Represenation with Local to Global Bundle Adjustment. arXiv (Cornell University).](https://doi.org/10.48550/arxiv.2312.09866)
19. [SBA: A software package for generic sparse bundle adjustment](https://dl.acm.org/doi/10.1145/1486525.1486527)
20. [Is Levenberg-Marquardt the Most Efficient Optimization Algorithm for Implementing Bundle Adjustment?](http://publications.ics.forth.gr/_publications/0201-P0401-lourakis-levenberg.pdf)
21. [Visual SLAM: Why Bundle Adjust?](https://ar5iv.labs.arxiv.org/html/1902.03747v2.pdf)
22. [cse.unr.edu](https://www.cse.unr.edu/~bebis/CS485/Handouts/hartley.pdf)

---
*Initially written Sep 29, 2026 · Reviewed: Sep 30, 2026 · Edited: Oct 15, 2026 · Last review: Sep 30, 2026*

Topic: 技术与人造世界 › 计算技术与数字系统 › 人工智能与数据 › Language and vision AI › Computer vision › Vision methods and geometry › 3D reconstruction and structure from motion

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/bundle-adjustment

English original: https://www.edgepedia.org/bundle-adjustment
