summaryrefslogtreecommitdiffstats
path: root/SD-VBS/benchmarks/disparity/src/matlab/refineDisparity.m
diff options
context:
space:
mode:
Diffstat (limited to 'SD-VBS/benchmarks/disparity/src/matlab/refineDisparity.m')
-rwxr-xr-xSD-VBS/benchmarks/disparity/src/matlab/refineDisparity.m31
1 files changed, 0 insertions, 31 deletions
diff --git a/SD-VBS/benchmarks/disparity/src/matlab/refineDisparity.m b/SD-VBS/benchmarks/disparity/src/matlab/refineDisparity.m
deleted file mode 100755
index f303236..0000000
--- a/SD-VBS/benchmarks/disparity/src/matlab/refineDisparity.m
+++ /dev/null
@@ -1,31 +0,0 @@
1function retDisparity=refineDisparity(Idisp, DispSAD, Ileft, Iright)
2[nr nc ndist]=size(DispSAD);
3retDisparity=zeros(nr, nc);
4
5IdispNext=padarray(Idisp, [0 1], 'replicate', 'post');
6IdispNext=IdispNext(:,2:end);
7
8
9IdispDiff=abs(Idisp-IdispNext);
10idx=find(IdispDiff>1);
11[idxI idxJ]=ind2sub([nr, nc], idx);
12
13%if(Idisp(idx)
14%sideFlag=
15checkedResult= (abs( DispSAD(sub2ind( [nr, nc, ndist], idxI, idxJ, Idisp(idx))) - ...
16DispSAD(sub2ind( [nr, nc, ndist], idxI, idxJ+1, Idisp(idx))) ) < 1 )+1;
17checkedResult= checkedResult + (abs( DispSAD(sub2ind( [nr, nc, ndist], idxI, idxJ, Idisp(idx+nr))) - ...
18DispSAD(sub2ind( [nr, nc, ndist], idxI, idxJ+1, Idisp(idx+nr))) ) < 1 );
19retDisparity(idx)=checkedResult;
20
21
22% IdispDiff=(Idisp-IdispNext);
23% idx=find(IdispDiff<-1);
24% [idxI idxJ]=ind2sub([nr, nc], idx);
25%
26% checkedResult= abs( DispSAD(sub2ind( [nr, nc, ndist], idxI, idxJ, Idisp(idx+nr))) - ...
27% DispSAD(sub2ind( [nr, nc, ndist], idxI, idxJ+1, Idisp(idx+nr))) ) < 0.5;
28% retDisparity(idx)=checkedResult;
29
30
31