SGM,立体匹配最经典应用最广泛算法,4000+引用,兼顾效率和效果。完整实现,代码规范,注释清晰,博客教学,欢迎star!
【恒叨立码】【码上实战】【立体匹配系列】经典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_310(d).dll,则在OpenCV文件夹里找到对应的dll文件复制到程序exe所在的目录即可(Opencv\dll\opencv_310(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.
下行:一致性检查、唯一性约束+去小连通区、中值滤波、视差填充
修改hosts
C:\Windows\System32\drivers\etc\hosts
在文件末尾添加:
# GitHub Start
140.82.112.4 github.com
140.82.114.4 gist.github.com
185.199.108.153 assets-cdn.github.com
151.101.64.133 raw.githubusercontent.com
151.101.108.133 gist.githubusercontent.com
151.101.108.133 cloud.githubusercontent.com
151.101.108.133 camo.githubusercontent.com
151.101.108.133 avatars0.githubusercontent.com
151.101.108.133 avatars1.githubusercontent.com
151.101.108.133 avatars2.githubusercontent.com
151.101.108.133 avatars3.githubusercontent.com
151.101.108.133 avatars4.githubusercontent.com
151.101.108.133 avatars5.githubusercontent.com
151.101.108.133 avatars6.githubusercontent.com
151.101.108.133 avatars7.githubusercontent.com
151.101.108.133 avatars8.githubusercontent.com
# GitHub End