框架


[1]对low-resolution进行上采样,得到大小与原图一样大小的high-resolution 记作:D(0).
[2]迭代模块:基于当前深度图D(i)建立costVolume: Ci.
[3]在costVolume的每个切片中执行双边滤波以产生新的costVolume
[4]D(i+1):基于该costVolume首先选择具有最小成本的深度假设和之后的子像素估计.
1.Construction and refinement of the cost volume

选择平方差作为成本函数,因为我们稍后将使用二次多项式插值用于子像素估计。 该成本函数可以帮助保持输入深度图的子像素精度。
可以通过颜色信息,获得立体空间超分辨率的锐利/真实深度边缘,接下来采用BF:

y, x are the indices of the current pixel in the camera image,
and u, v are two variables.γc and γs are two constants used as the thresholds of the color difference and the filter size.
2.Sub-pixel Estimation
为了减少由深度假设选择过程中的量化引起的不连续性,基于二次多项式插值提出了子像素估计算法。


d is the discrete depth with the minimal cost
d_ = d − 1, and d+ = d + 1.
Xmin的估计值为上式
matlab code:
function Result = LayeredBilateralFilter(color,depth,sigma_w,sigma_c,w,DepthInteval,IterativeTime)
%% Initialization
L=10000;
k=1;
D(:,:,1) = double(depth);
CandidateD = 0:DepthInteval:255;
height = size(color,1);
width = size(color,2);
color = double(color);
CostVolume=zeros(height,width,length(CandidateD));
CostCW=zeros(height,width,length(CandidateD));
%% Iterative Module
while 1
for i=1:length(CandidateD)
CostVolume(:,:,i) = min(L,(CandidateD(i)-D(:,:,k)).^2); %Cost Volume C(i)
CostCW(:,:,i) = BilateralFilter(color,CostVolume(:,:,i),sigma_w,sigma_c,w); %A bilateral filtering is performed throughout each slice of the cost volume to produce the new cost volume
% Compare with the reference, the color space is different
end
[BestCost,BestDepthLocation] = min(CostCW,[],3); %Selecting the depth hypothesis with the minimal cost
% Sub-pixel estimation
CostUpper = zeros(height,width);
CostLower = zeros(height,width);
for i = 1:length(CandidateD)
CostUpper = CostUpper + CostCW(:,:,i).*((BestDepthLocation+1)==i);
CostLower = CostLower + CostCW(:,:,i).*((BestDepthLocation-1)==i);
end
k = k + 1;
D(:,:,k) = CandidateD(BestDepthLocation) - DepthInteval * (CostUpper-CostLower) ./ (2*(CostUpper+CostLower-2*BestCost));
% end of sub-pixel estimation
if IterativeTime==k
break;
end
end
Result = D(:,:,IterativeTime);
end
.
网友评论