Skip to content

ethan-li-coding/PatchMatchStereo

Repository files navigation

PatchMatchStereo

PatchMatch,倾斜窗口经典,效果极佳,OpenMVS&Colmap稠密匹配算法。完整实现,代码规范,注释清晰,博客教学,欢迎star!

CSDN博客

如果你想了解更多代码讲解,下面的博客或许能帮到你:
【码上实战】【立体匹配系列】经典PatchMatch: (1)框架
【码上实战】【立体匹配系列】经典PatchMatch: (2)主类
【码上实战】【立体匹配系列】经典PatchMatch: (3)随机初始化
【码上实战】【立体匹配系列】经典PatchMatch: (4)代价计算
【码上实战】【立体匹配系列】经典PatchMatch: (5)迭代传播
【码上实战】【立体匹配系列】经典PatchMatch: (6)后处理

环境

windows10 / visual studio 2015&2019
代码基本没有使用系统api,你可以非常方便的移植到linux,可能需要做极少量的修改

强烈建议你使用release模式运行代码,强烈不建议使用debug模式运行代码

第三方库

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库读取和显示图像,也可替换成其他图像库

算法引导

算法框架图


代码框架图

备注

算法优点:效果好,内存占用低
算法缺点:效率低,速度比较慢,不建议跑大图,建议跑个小图看看效果(Release模式)。如果设置为前端平行窗口(PatchMatchStereo为倾斜窗口时效果最好),则速度会更快,如下:

pms_option.is_fource_fpw = true;

论文

Bleyer M, Rhemann C, Rother C. PatchMatch Stereo-Stereo Matching with Slanted Support Windows[C]. British Machine Vision Conference 2011. 2011.

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

About

PatchMatchStereo,倾斜窗口经典,效果极佳,OpenMVS&Colmap稠密匹配算法。完整实现,代码规范,注释清晰,博客教学,欢迎star!

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published