資源簡介
根據論文Accurate and Efficient Stereo Processing by Semi-Global Matching and Mutual Information寫的雙目立體匹配代碼,matlab編寫方便閱讀,帶測試圖片,注意算法只實現了4個方向,即左右,右左,上下,下上四個方向。然后,互信息沒有用到。測試結果可見效果不錯,對于學習動態規劃,立體匹配的同學有幫助

代碼片段和文件信息
%?Matlab?demo?code?accompanying?the?CVPR11?paper?[C.?Rhemann?A.?Hosni
%?M.?Bleyer?C.?Rother?M.?Gelautz?Fast?Cost-Volume?Filtering?for?Visual
%?Correspondence?and?Beyond?CVPR11]
%?Contributed?by?Christoph?Rhemann?(rhemann@ims.tuwien.ac.at)
%
%?Please?note?that?the?running?time?and?results?reported?in?the?paper?is?from?a?CUDA
%?implementation.?Hence?results?and?running?times?do?not?match?this?Matlab
%?implementation.
UseParallelToolbox?=?false;?%?Set?true?if?you?want?to?take?advantage?of?the?Matlab?parallel?computing?toolbox
ParallelWorkers?=?4;?%?How?many?workers?should?be?used?by?the?parallel?computing?toolbox?(should?be?equal?or?less?the?number?of?available?CPU?cores)
%?Set?up?parallel?computing?toolbox
if?(UseParallelToolbox)
????isOpen?=?matlabpool(‘size‘)?>?0;
????if?(isOpen)
????????matlabpool?close?force?local
????end
????matlabpool(ParallelWorkers)
end
%?Parameter?settings
r?=?129;??????????????????%?filter?kernel?in?eq.?(3)?has?size?r?\times?r
eps?=?0.0001;???????????%?\epsilon?in?eq.?(3)
thresColor?=?7/255;?????%?\tau_1?in?eq.?(5)
thresGrad?=?2/255;??????%?\tau_2?in?eq.?(5)
%?thresColor?=?7;?????%?\tau_1?in?eq.?(5)
%?thresGrad?=?2;??????%?\tau_2?in?eq.?(5)
gamma?=?0.11;???????????%?(1-?\alpha)?in?eq.?(5)
threshBorder?=?3/255;???%?some?threshold?for?border?pixels
%?threshBorder?=?3;???%?some?threshold?for?border?pixels
gamma_c?=?0.1;??????????%?\sigma_c?in?eq.?(6)
gamma_d?=?9;????????????%?\sigma_s?in?eq.?(6)
r_median?=?19;??????????%?filter?kernel?of?weighted?median?in?eq.?(6)?has?size?r_median?\times?r_median
%?Compute?disparity?map?for?middlebury?test?images?(vision.middlebury.edu/stereo/)
%?for?testimage?=?1:4
testimage=1;
tic
%????example_referenceForCVPR11(testimagerepsthresColorthresGradgammathreshBordergamma_cgamma_dr_medianUseParallelToolbox);
%?????v2myexample(testimagerepsthresColorthresGradgammathreshBordergamma_cgamma_dr_medianUseParallelToolbox);
????v2semi(testimagerepsthresColorthresGradgammathreshBordergamma_cgamma_dr_medianUseParallelToolbox);
toc
%?end
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2015-06-14?20:42??SGM\img_stereo\
?????文件??????513968??2010-07-21?11:46??SGM\img_stereo\art_left.ppm
?????文件??????513968??2010-07-21?11:46??SGM\img_stereo\art_right.ppm
?????文件??????506265??2010-07-20?10:08??SGM\img_stereo\cones_left.ppm
?????文件??????506265??2010-07-20?10:08??SGM\img_stereo\cones_right.ppm
?????文件??????506265??2003-06-04?23:11??SGM\img_stereo\im2.ppm
?????文件??????506265??2014-12-10?15:26??SGM\img_stereo\im6.ppm
?????文件??????331791??2010-07-20?09:27??SGM\img_stereo\left.ppm
?????文件??????331791??2010-07-20?09:27??SGM\img_stereo\right.ppm
?????文件??????702129??2013-09-17?17:16??SGM\img_stereo\Rum_000000.png
?????文件??????506265??2010-07-20?10:02??SGM\img_stereo\teddy_left.ppm
?????文件??????506265??2010-07-20?10:02??SGM\img_stereo\teddy_right.ppm
?????文件??????738605??2013-09-17?17:07??SGM\img_stereo\um_000000.png
?????文件??????498681??2010-07-21?11:46??SGM\img_stereo\venus_left.ppm
?????文件??????498681??2010-07-21?11:46??SGM\img_stereo\venus_right.ppm
?????文件?????????162??2015-06-14?20:46??SGM\readme.txt
?????文件????????2105??2015-06-13?23:06??SGM\runStereoMatcher.m
?????文件???????17574??2015-06-13?23:14??SGM\v2semi.m
- 上一篇:圖象紋理分割matlab源代碼
- 下一篇:Simuli
nk發動機建模實戰
評論
共有 條評論