ethan-li-coding/SemiGlobalMatching
ethan-li-coding/SemiGlobalMatching has 1,202 GitHub stars and 229 forks. GitHot measured 0 stars in 24 hours. Last checked 2026-11-09 08:28 UTC. Last push 2021-04-20.
SGM,立体匹配StereoMatching最经典应用最广泛算法,4000+引用,兼顾效率和效果。完整实现,代码规范,注释清晰,博客教学!
Measured star growth
- in 24h
- 0
- in 7 days
- Update delayed
- in 15 days
- Update delayed
- in 1 month
- Update delayed
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
README.md
OriginalSemiGlobalMatching
SGM,立体匹配最经典应用最广泛算法,4000+引用,兼顾效率和效果。完整实现,代码规范,注释清晰,博客教学,欢迎star!
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
CSDN博客
【恒叨立码】【码上实战】【立体匹配系列】经典SGM:(1)框架与类设计
【恒叨立码】【码上实战】【立体匹配系列】经典SGM:(2)代价计算
【恒叨立码】【码上实战】【立体匹配系列】经典SGM:(3)代价聚合
【恒叨立码】【码上实战】【立体匹配系列】经典SGM:(4)代价聚合2
【恒叨立码】【码上实战】【立体匹配系列】经典SGM:(5)视差优化
【恒叨立码】【码上实战】【立体匹配系列】经典SGM:(6)视差填充
【恒叨立码】【码上实战】【立体匹配系列】经典SGM:(7)弱纹理优化
环境
windows10 / visual studio 2015&2019
代码基本没有使用系统api,你可以非常方便的移植到linux,可能需要做极少量的修改
第三方库
opencv310
百度网盘连接:https://pan.baidu.com/s/1_WD-KdPyDBazEIim7NU3jA
提取码:aab4
解压后放将名称为OpenCV的文件夹复制到到3rdparty文件夹下
若运行时提示缺少opencv_world310(d).dll,则在OpenCV文件夹里找到对应的dll文件复制到程序exe所在的目录即可(Opencv\dll\opencv_world310(d).dll),带d为debug库,不带d为release库。
为便于移植,算法是不依赖任何图像库的,只在算法实验部分调用opencv库读取和显示图像,也可替换成其他图像库
算法引导
SGM步骤图
SGM类设计图
备注
算法优点:效果好,效率高,且可高度并行
算法缺点:效果非SOTA、内存占用高(可优化)、对弱纹理、重复纹理支持不太好
论文
- Heiko Hirschmüller. Hirschmüller, H: Stereo processing by semiglobal matching and mutual information. IEEE PAMI 30(2), 328-341[J]. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2008, 30(2):328-341.
- Humenberger M , Engelke T , Kubinger W . A census-based stereo vision algorithm using modified Semi-Global Matching and plane fitting to improve matching quality[C]// IEEE Computer Society Conference on Computer Vision & Pattern Recognition-workshops. IEEE, 2010.
实验图
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
下行:一致性检查、唯一性约束+去小连通区、中值滤波、视差填充
Github图片不显示的解决办法
修改hosts
C:\Windows\System32\drivers\etc\hosts
在文件末尾添加:
# GitHub Start
192.30.253.119 gist.github.com
151.101.184.133 assets-cdn.github.com
151.101.184.133 raw.githubusercontent.com
151.101.184.133 gist.githubusercontent.com
151.101.184.133 cloud.githubusercontent.com
151.101.184.133 camo.githubusercontent.com
151.101.184.133 avatars0.githubusercontent.com
151.101.184.133 avatars1.githubusercontent.com
151.101.184.133 avatars2.githubusercontent.com
151.101.184.133 avatars3.githubusercontent.com
151.101.184.133 avatars4.githubusercontent.com
151.101.184.133 avatars5.githubusercontent.com
151.101.184.133 avatars6.githubusercontent.com
151.101.184.133 avatars7.githubusercontent.com
151.101.184.133 avatars8.githubusercontent.com
# GitHub End
Explore related projects
codecrafters-io/build-your-own-x
Master programming by recreating your favorite technologies from scratch.
561,343 starspublic-apis/public-apis
A collective list of free APIs
497,588 starsmorluto/rea
Reverse engineer anything with agents, from app behavior down to native binaries.
446,687 starsopenclaw/openclaw
The AI that really does things. Any OS. Any Platform. The lobster way. 🦞
394,252 stars
















