# 立体视觉重建

立体视觉重建是一种计算机视觉方法，它通过寻找对应像素并计算视差，从标定相机在不同视点拍摄的一对图像中估计场景深度。在经极线校正的对极几何中，每个像素的视差是水平的，且与它到观察者的距离成反比，因此估计视差图就足以恢复场景的相对深度；而借助相机标定，视差预测值可以转换为深度值。<sup>[1](http://www.ipol.im/pub/art/2014/97/)</sup><sup> • </sup><sup>[2](https://visionbook.mit.edu/3d_scene_understanding_stereo.html)</sup><sup> • </sup><sup>[3](https://github.com/princeton-vl/RAFT-Stereo)</sup> 从立体像对进行精确深度估计仍是一个未解决的问题，大多数精确的三维重建仍然依赖多幅图像和多视图几何。<sup>[2](https://visionbook.mit.edu/3d_scene_understanding_stereo.html)</sup>

| 关键事实 | 详情 |
|---|---|
| 输出 | 稠密视差图（逐像素的水平像素位移），可转换为深度值<sup>[1](http://www.ipol.im/pub/art/2014/97/)</sup><sup> • </sup><sup>[3](https://github.com/princeton-vl/RAFT-Stereo)</sup> |
| 深度公式 | \( Z = \frac{f \cdot B}{d} \)，其中焦距为 \( f \)，基线为 \( B \)，视差为 \( d \)<sup>[4](https://people.cs.rutgers.edu/~elgammal/classes/cs534/lectures/stereoimaging.pdf)</sup> |
| 典型流程 | 匹配代价计算、代价聚合、视差计算/优化、视差精化<sup>[5](https://vision.middlebury.edu/stereo/taxonomy-IJCV.pdf)</sup> |
| 主力算法 | 半全局匹配（SGM），沿图像中8条或16条路径聚合代价<sup>[6](https://engineering.purdue.edu/kak/Tutorials/SemiGlobalMatching.pdf)</sup> |
| 深度学习转向 | MC-CNN用训练好的卷积网络取代手工设计的匹配代价<sup>[7](https://jmlr2020.csail.mit.edu/papers/volume17/15-535/15-535.pdf)</sup> |
| 主要基准 | KITTI立体视觉（194对训练图像和195对测试图像）、Middlebury、ETH3D<sup>[8](https://www.cvlibs.net/datasets/kitti/eval_stereo_flow.php?benchmark=stereo)</sup> |

## 工作原理

[立体匹配](https://www.edgepedia.org/zh/stereo-matching)利用对极几何：一旦相机完成标定，左图中某个像素的对应搜索就被限制在右图的一条直线上。极线校正通过相对左相机旋转和缩放右相机，使两个图像平面共面，并使共轭极线共线且平行于图像水平轴，从而将对应搜索简化为沿水平方向的一维搜索。<sup>[9](https://miasgroup.tongji.edu.cn/_upload/tpl/06/23/1571/template1571/pdf/snbc2023_liu.pdf)</sup> 视差便是左右图像中一对对应像素之间的水平位移，通过在极线上滑动窗口匹配构建的代价体积上计算得到。<sup>[10](https://virtualhumans.mpi-inf.mpg.de/3DVision25/slides25/pdf/Lecture_4_0_Stereo_Vision_and_Depth_Estimation.pdf)</sup>

深度由三角测量得出。对于经校正的平行相机对，\( Z = \frac{f \cdot B}{x_{L} - x_{R}} \)，<sup>[2](https://visionbook.mit.edu/3d_scene_understanding_stereo.html)</sup> 通常写作 \( Z = \frac{f \cdot B}{d} \)，其中基线为 \( B \)，视差为 \( d \)。<sup>[4](https://people.cs.rutgers.edu/~elgammal/classes/cs534/lectures/stereoimaging.pdf)</sup> 深度与视差成反比，视差为0对应无穷远处的点。视差与基线成正比：较大的 \( B \) 可以扩展精确测距范围，但会缩小相机的共同视场；而基线较短时，微小的视差误差会产生较大的深度误差。<sup>[4](https://people.cs.rutgers.edu/~elgammal/classes/cs534/lectures/stereoimaging.pdf)</sup>

## 实现方法

实践者的工作流程是：标定相机、校正图像、计算视差、估计深度。<sup>[4](https://people.cs.rutgers.edu/~elgammal/classes/cs534/lectures/stereoimaging.pdf)</sup> 在视差阶段，标准分类法列出了立体算法全部或部分执行的四个步骤：匹配代价计算、代价（支持）聚合、视差计算或优化，以及视差精化。<sup>[5](https://vision.middlebury.edu/stereo/taxonomy-IJCV.pdf)</sup>

匹配代价比较像素邻域；Census变换将局部窗口（例如9×7像素）编码为比特向量，并用[汉明距离](https://www.edgepedia.org/zh/hamming-distance)进行比较，2009年的一项研究将其认定为最稳健的匹配代价。<sup>[11](https://phowo.ifp.uni-stuttgart.de/publications/phowo11/180Hirschmueller.pdf)</sup> 在半全局匹配中，像素 \( p \) 和视差 \( d \) 处的聚合代价为 \( S(p,d) = \sum_{i} C_{r_{i}}(p,d) \)，即对来自多个方向的路径代价求和，并以赢家通吃方式选择代价最小的视差；常用实现沿8个或16个方向聚合，代价体积大小为 \( H \times W \times (d_{max} - d_{min}) \)。<sup>[6](https://engineering.purdue.edu/kak/Tutorials/SemiGlobalMatching.pdf)</sup> 最后，精化步骤利用左右一致性检查、中值滤波和遮挡填充来纠正由遮挡和噪声引起的异常值；一个小的3×3中值滤波器即可剔除许多剩余的异常值。<sup>[12](https://jeos.edpsciences.org/articles/jeos/full_html/2026/02/jeos20260055/jeos20260055.html)</sup>

## 起源

受人类立体视觉计算模型启发的协作式算法是最早提出的视差计算方法之一；D. Marr和T. Poggio于1979年发表在《英国皇家学会学报B辑》上的论文《人类立体视觉的计算理论》提出了一种基于滤波、零交叉和协作匹配的匹配算法。<sup>[13](https://doi.org/10.1098/rspb.1979.0029)</sup> 2002年，Scharstein和Szeliski系统综述了该领域，将传统方法分为全局和局部立体匹配算法。<sup>[12](https://jeos.edpsciences.org/articles/jeos/full_html/2026/02/jeos20260055/jeos20260055.html)</sup>

半全局匹配结合了全局和局部方法的概念，以较低运行时间实现精确的逐像素匹配；其期刊版本H. Hirschmuller的《基于半全局匹配与互信息的立体处理》于2007年发表在《[IEEE模式分析与机器智能汇刊](https://www.edgepedia.org/zh/ieee-transactions-on-pattern-analysis-and-machine-intelligence)》上。<sup>[14](https://doi.org/10.1109/tpami.2007.1166)</sup> SGM受到G. Van Meerbergen及其同事早期分层动态规划立体视觉工作的启发，该工作于2002年发表在《[国际计算机视觉杂志](https://www.edgepedia.org/zh/international-journal-of-computer-vision)》上，表明逐扫描线进行代价最小化时具有多项式复杂度。<sup>[15](https://doi.org/10.1023/a:1014562312225)</sup> 深度学习转向始于Jure Žbontar和[Yann LeCun](https://www.edgepedia.org/zh/yann-lecun)训练卷积神经网络比较图像块并初始化匹配代价，于2015年在arXiv上发表，<sup>[7](https://jmlr2020.csail.mit.edu/papers/volume17/15-535/15-535.pdf)</sup> 随后是Alex Kendall及其同事的GC-Net（2017年，arXiv），<sup>[16](https://doi.org/10.48550/arxiv.1703.04309)</sup> 以及Jia-Ren Chang和Yong-Sheng Chen的PSMNet（2018年，arXiv）。<sup>[17](https://doi.org/10.48550/arxiv.1803.08669)</sup>

## 变体

**局部方法**在支持窗口上聚合匹配代价，并为每个像素选择最佳视差，但在无纹理区域表现不佳。<sup>[6](https://engineering.purdue.edu/kak/Tutorials/SemiGlobalMatching.pdf)</sup> **全局方法**在整个视差图上最小化全局能量 \( E(d) = E_{data}(d) + \lambda E_{smooth}(d) \)；<sup>[5](https://vision.middlebury.edu/stereo/taxonomy-IJCV.pdf)</sup> 它们能很好地处理遮挡和无纹理区域，但内存占用大、计算复杂度高、执行速度慢，限制了实时应用。<sup>[12](https://jeos.edpsciences.org/articles/jeos/full_html/2026/02/jeos20260055/jeos20260055.html)</sup> SGM介于两者之间，通过沿图像中所有方向聚合代价来近似[马尔可夫随机场](https://www.edgepedia.org/zh/markov-random-field)推断，大大改善了精度与效率之间的权衡。<sup>[9](https://miasgroup.tongji.edu.cn/_upload/tpl/06/23/1571/template1571/pdf/snbc2023_liu.pdf)</sup>

**深度网络**目前在该领域占主导地位。<sup>[2](https://visionbook.mit.edu/3d_scene_understanding_stereo.html)</sup> 端到端架构计算代价体积并在其上应用三维卷积，以真实视差为监督信号，使用L1损失进行训练；<sup>[10](https://virtualhumans.mpi-inf.mpg.de/3DVision25/slides25/pdf/Lecture_4_0_Stereo_Vision_and_Depth_Estimation.pdf)</sup> PSMNet增加了空间金字塔池化和三维CNN模块，以利用病态区域中的上下文信息。<sup>[17](https://doi.org/10.48550/arxiv.1803.08669)</sup> 迭代方法绕过显式代价聚合：它们计算一次代价体积，然后迭代更新视差估计，通过迭代次数实现灵活的精度—速度权衡。<sup>[18](https://link.springer.com/article/10.1007/s11263-024-02331-0)</sup> RAFT-Stereo（Lipson、Teed和Deng，3DV 2021，最佳学生论文奖）仅使用二维卷积，搭配轻量级代价体积和循环ConvGRU更新，避免了昂贵的三维滤波。<sup>[19](https://doi.org/10.48550/arxiv.2109.07547)</sup>

在精度方面，KITTI立体视觉基准包含194对训练图像和195对测试图像，均为无损PNG格式，并按指定视差阈值下非遮挡区域（Out-Noc）中错误像素的百分比对方法进行排名。<sup>[8](https://www.cvlibs.net/datasets/kitti/eval_stereo_flow.php?benchmark=stereo)</sup> Middlebury 2014基准的真实值来自结构光，在大多数观测表面上达到0.2像素的视差精度，包括半遮挡区域。<sup>[9](https://miasgroup.tongji.edu.cn/_upload/tpl/06/23/1571/template1571/pdf/snbc2023_liu.pdf)</sup> MC-CNN在发表时于KITTI 2012、KITTI 2015和Middlebury上优于其他方法，<sup>[7](https://jmlr2020.csail.mit.edu/papers/volume17/15-535/15-535.pdf)</sup> RAFT-Stereo后来在Middlebury排行榜上排名第一，在1像素误差指标上比次优方法降低了29%。<sup>[19](https://doi.org/10.48550/arxiv.2109.07547)</sup>

Transformer架构通过STTR进入立体匹配领域，STTR沿极线交替进行自注意力与左右图像间的交叉注意力，并放宽了代价体积固定视差范围的约束。<sup>[18](https://link.springer.com/article/10.1007/s11263-024-02331-0)</sup> 此后，基础模型浪潮强调零样本泛化：FoundationStereo（Wen及其同事，2025年，arXiv）结合单目和立体先验，并在包括Scene Flow、Sintel、CREStereo、TartanAir、Virtual KITTI 2和Dynamic Replica在内的合成数据上训练。<sup>[20](https://doi.org/10.48550/arxiv.2501.09898)</sup> 仅用合成数据训练现在就能产生强大的跨数据集泛化能力，正如RAFT-Stereo在KITTI、ETH3D和Middlebury上所展示的那样。<sup>[19](https://doi.org/10.48550/arxiv.2109.07547)</sup>

## 应用

视差图是深度图像的基础。<sup>[11](https://phowo.ifp.uni-stuttgart.de/publications/phowo11/180Hirschmueller.pdf)</sup> 已记录的部署包括[德国航空航天中心](https://www.edgepedia.org/zh/german-aerospace-center)的履带式机器人，它以5 Hz进行立体匹配和视觉里程计，用于崎岖地形导航；以及戴姆勒股份公司的驾驶员辅助系统，它使用SGM的低功耗FPGA实现实时计算深度图像。<sup>[11](https://phowo.ifp.uni-stuttgart.de/publications/phowo11/180Hirschmueller.pdf)</sup>

## 局限与替代方案

稠密对应搜索在低对比度或无纹理的图像区域、相机标定误差下，以及亮度恒常性被违反时（例如镜面高光）会失败。<sup>[21](https://www.vision.rwth-aachen.de/media/course/SS/2019/computer-vision/cv19-part15-reconstruction1.pdf)</sup> 该领域的核心假设每条都只是部分成立：亮度恒常性、顺序性和平滑性在常见场景中都会失效。<sup>[22](http://www.cs.umd.edu/~djacobs/CMSC733/stereo.pdf)</sup> 遮挡会在视差图中留下空隙，重复纹理会造成误匹配。<sup>[6](https://engineering.purdue.edu/kak/Tutorials/SemiGlobalMatching.pdf)</sup>

在与主动传感器的直接对比测试中，立体相机对光强变化非常敏感，室内表现较弱但室外表现更好，而激光雷达在近距离暗表面和超出其范围的物体上表现不佳。<sup>[23](https://reference-global.com/article/10.2478/aei-2025-0007)</sup> 目前尚无已发表的直接对比基准来量化立体视觉与单目深度估计、结构光或基于SLAM的深度之间的优劣。

## References

1. [IPOL Journal · Kolmogorov and Zabih's Graph Cuts Stereo Matching Algorithm](http://www.ipol.im/pub/art/2014/97/)
2. [Stereo Vision – Foundations of Computer Vision (MIT)](https://visionbook.mit.edu/3d_scene_understanding_stereo.html)
3. [princeton-vl/RAFT-Stereo, official code repository](https://github.com/princeton-vl/RAFT-Stereo)
4. [CS 534: Computer Vision, Stereo Imaging (Rutgers lecture notes)](https://people.cs.rutgers.edu/~elgammal/classes/cs534/lectures/stereoimaging.pdf)
5. [A Taxonomy and Evaluation of Dense Two-Frame Stereo Correspondence Algorithms (Scharstein & Szeliski)](https://vision.middlebury.edu/stereo/taxonomy-IJCV.pdf)
6. [An Introduction to the SGM Algorithm for Dense Matching in Binocular Stereo (RVL Tutorial, Avi Kak)](https://engineering.purdue.edu/kak/Tutorials/SemiGlobalMatching.pdf)
7. [Stereo Matching by Training a Convolutional Neural Network to Compare Image Patches (MC-CNN, Žbontar & LeCun, JMLR 2016)](https://jmlr2020.csail.mit.edu/papers/volume17/15-535/15-535.pdf)
8. [The KITTI Vision Benchmark Suite, stereo/flow benchmark](https://www.cvlibs.net/datasets/kitti/eval_stereo_flow.php?benchmark=stereo)
9. [Stereo Matching: Fundamentals, State-of-the-Art, and Existing Challenges (Springer book chapter, 2023)](https://miasgroup.tongji.edu.cn/_upload/tpl/06/23/1571/template1571/pdf/snbc2023_liu.pdf)
10. [Hands-on AI based 3D Vision SS25, Stereo Vision and Depth Estimation (MPI lecture slides)](https://virtualhumans.mpi-inf.mpg.de/3DVision25/slides25/pdf/Lecture_4_0_Stereo_Vision_and_Depth_Estimation.pdf)
11. [Semi-Global Matching – Motivation, Developments and Applications (Hirschmüller, 2011)](https://phowo.ifp.uni-stuttgart.de/publications/phowo11/180Hirschmueller.pdf)
12. [A review of binocular vision stereo matching algorithms (Journal of the European Optical Society, 2026)](https://jeos.edpsciences.org/articles/jeos/full_html/2026/02/jeos20260055/jeos20260055.html)
13. [D. Marr, T. Poggio (1979). A computational theory of human stereo vision. Proceedings of the Royal Society B Biological Sciences.](https://doi.org/10.1098/rspb.1979.0029)
14. [H. Hirschmuller (2007). Stereo Processing by Semiglobal Matching and Mutual Information. IEEE Transactions on Pattern Analysis and Machine Intelligence.](https://doi.org/10.1109/tpami.2007.1166)
15. [G. Van Meerbergen and colleagues (2002). A Hierarchical Symmetric Stereo Algorithm Using Dynamic Programming. International Journal of Computer Vision.](https://doi.org/10.1023/a:1014562312225)
16. [Kendall, Alex and colleagues (2017). End-to-End Learning of Geometry and Context for Deep Stereo Regression. arXiv (Cornell University).](https://doi.org/10.48550/arxiv.1703.04309)
17. [Chang, Jia-Ren, Chen, Yong-Sheng (2018). Pyramid Stereo Matching Network. arXiv (Cornell University).](https://doi.org/10.48550/arxiv.1803.08669)
18. [A Survey on Deep Stereo Matching in the Twenties (IJCV 2024)](https://link.springer.com/article/10.1007/s11263-024-02331-0)
19. [Lipson, Lahav, Teed, Zachary, Deng, Jia (2021). RAFT-Stereo: Multilevel Recurrent Field Transforms for Stereo Matching. arXiv (Cornell University).](https://doi.org/10.48550/arxiv.2109.07547)
20. [Wen, Bowen and colleagues (2025). FoundationStereo: Zero-Shot Stereo Matching. arXiv (Cornell University).](https://doi.org/10.48550/arxiv.2501.09898)
21. [Computer Vision, Reconstruction 1 (RWTH Aachen lecture slides)](https://www.vision.rwth-aachen.de/media/course/SS/2019/computer-vision/cv19-part15-reconstruction1.pdf)
22. [Matching, CMSC733 stereo slides (UMD)](http://www.cs.umd.edu/~djacobs/CMSC733/stereo.pdf)
23. [Comparison of 3D Sensing Devices (stereo camera vs LiDAR)](https://reference-global.com/article/10.2478/aei-2025-0007)

---
*Initially written Sep 29, 2026 · Edited: Oct 15, 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/stereo-reconstruction

English original: https://www.edgepedia.org/stereo-reconstruction
