1 Star 0 Fork 1

cmjia / Depth-Estimation-Matlab

forked from luofl / Depth-Estimation-Matlab 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
match_cost.m 788 Bytes
一键复制 编辑 原始数据 按行查看 历史
Karthik Uppuluri 提交于 2014-01-17 00:24 . Initial Commit
function [M_score] = match_cost(leftpixel,rw,clm,R1)
%[l m] =size(R1);
M_score = [];
%for j=1:15
% for j=1:m
% %loc = clm+j;
% leftpixel=cast(leftpixel,'double');
% Rightpixel = R1(rw,j);
% Rightpixel = cast(Rightpixel,'double');
% diff = (leftpixel - Rightpixel).^2;
% diff = cast(diff,'double');
% M_score(1,j) = diff;
% end
[m n] = size(R1);
patch_L1 = leftpixel;
%M_score = [];
in = 1;
for k=2:n-1
patch_L1=cast(patch_L1,'double');
patch_R1 = R1(rw-1:rw+1,k-1:k+1);
patch_R1 = cast(patch_R1,'double');
diff = (patch_L1 - patch_R1).^2;
diff = cast(diff,'double');
M_score(1,in) = sum(sum(diff)); %sum(sum(patch_L1-patch_R1).^2)
in = in+1;
end
size(M_score);
1
https://gitee.com/sadis/Depth-Estimation.git
git@gitee.com:sadis/Depth-Estimation.git
sadis
Depth-Estimation
Depth-Estimation-Matlab
master

搜索帮助