我们提出了一种基于超分辨和焦外虚化渲染的光场重聚焦方法。本方法将超分辨和焦外虚化渲染按照场景深度加权整合在一起,同时实现聚焦区域的超分辨以及焦外区域的虚化渲染,从而可以利用多个低质量的摄像头合成单反相机级别的摄影图像。另外,本算法可以后期调节聚焦深度与景深,从而可以根据实际场景渲染出具有美学价值的摄影图像。算法的相关细节请参考论文:
Y. Wang, J. Yang, Y. Guo, C. Xiao, and W. An, Selective light field refocusing for camera arrays using bokeh rendering and superresolution. IEEE Signal Processing Letters, 2018.
代码片段和文件信息
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
....... 2316 2018-12-13 09:06 Wang2018Selectiveokeh_rendering.m
....... 2443 2018-12-13 09:06 Wang2018SelectiveDemo_run.m
....... 1584310 2018-12-13 09:06 Wang2018SelectiveDolls 101.png
....... 1590637 2018-12-13 09:06 Wang2018SelectiveDolls 102.png
....... 1602782 2018-12-13 09:06 Wang2018SelectiveDolls 103.png
....... 1594102 2018-12-13 09:06 Wang2018SelectiveDolls 201.png
....... 1607089 2018-12-13 09:06 Wang2018SelectiveDolls 202.png
....... 1611163 2018-12-13 09:06 Wang2018SelectiveDolls 203.png
....... 1583282 2018-12-13 09:06 Wang2018SelectiveDolls 301.png
....... 1599852 2018-12-13 09:06 Wang2018SelectiveDolls 302.png
....... 1593405 2018-12-13 09:06 Wang2018SelectiveDolls 303.png
....... 319 2018-12-13 09:06 Wang2018SelectivegetD.m
....... 528 2018-12-13 09:06 Wang2018SelectiveGradient_BTV.m
....... 390 2018-12-13 09:06 Wang2018SelectiveImWarp.m
....... 835 2018-12-13 09:06 Wang2018SelectiveL2GradientBackProject.m
....... 1320 2018-12-13 09:06 Wang2018SelectiveL2SD.m
....... 1657 2018-12-13 09:06 Wang2018SelectiveLightfield_SR.m
....... 2210 2018-12-13 09:06 Wang2018Selectivelocal_dispt_estm.m
....... 366 2018-12-13 09:06 Wang2018Selectivemaxfilter.m
....... 707 2018-12-13 09:06 Wang2018Selectivemedianfilter.m
文件 276 2018-12-13 09:12 Wang2018Selective
eadme.txt
....... 2490 2018-12-13 09:06 Wang2018SelectiveRGDP_optm.m
....... 180 2018-12-13 09:06 Wang2018SelectiveScaleAdjust.m
目录 0 2018-12-13 09:06 Wang2018SelectiveDolls
目录 0 2018-12-13 09:07 Wang2018Selective
----------- --------- ---------- ----- ----
14382659 25
%% This function renders the bokeh in out-of-focus regions
function I_bokeh = bokeh_rendering(LF_Image Disparity slope K)
[u v row col ~] = size(LF_Image);
cu = 0.5*(u+1);
cv = 0.5*(v+1);
I_center = squeeze(LF_Image(cu cv : : :));
I_bokeh = I_center; % Set the initial bokeh image as the center-view sub-image
delta_Dis = Disparity - slope*ones(size(Disparity));% Equation (5)
Radius = K*delta_Dis;
Rmax = max(abs(Radius(:))); % maximum radius of CoC in the image.
Patchsize = ceil(2*Rmax); % ensure that Patch radius is larger than Rmax
if (Patchsize/2 == round(Patchsize/2)) % ensure that Patchsize is an odd number
Patchsize = Patchsize + 1;
end
pr = (Patchsize+1)/2; % Patch radius
Patch = zeros(size(Patchsize Patchsize));
ONE = ones(size(Patch));
ZERO = zeros(size(Patch));
% Calculate the weight of the anisotropic filter
for i = 1 : Patchsize
for j = 1 : Patchsize
Patch(i j) = sqrt((pr-i)^2+(pr-j)^2);
end
end
% Render the bokeh with an anisotropic filter
parfor i = pr : row-pr+1
for j = pr : col-pr+1
RPatch = squeeze(Radius(i-pr+1 : i+pr-1 j-pr+1 : j+pr-1));
Mask = ( ONE.*double(abs(RPatch)-Patch>0.5*ONE) + ZERO.*double(Patch-abs(RPatch)>0.5*ONE) ...
+(abs(RPatch)-Patch+0.5*ONE).*double(abs(RPatch)-Patch<=0.5*ONE).*double(Patch-abs(RPatch)<=0.5*ONE) )...
.*((abs(RPatch(prpr)) < K) * double(RPatch - RPatch(prpr)*ONE > -0.2*Rmax*ONE)...
+ double(abs(RPatch(prpr)) >= K) * ONE);
Mask = Mask/sum(Mask(:));
for color = 1 : 3
IPatch = squeeze(I_center(i-pr+1 : i+pr-1 j-pr+1 : j+pr-1 color));
I_bokeh(i j color) = sum(double(IPatch(:)).*Mask(:));
end
end
end
for color = 1 : 3 % Dealing with image boundaries
I_bokeh( : 1:pr-1 color) = repmat(I_bokeh( : pr color) 1 pr-1);
I_bokeh( : col-pr+2:end color) =repmat(I_bokeh( : col-pr+1 color) 1 pr-1);
I_bokeh( 1:pr-1 : color) = repmat(I_bokeh( pr : color) pr-1 1);
I_bokeh( row-pr+2:end : color) = repmat(I_bokeh( row-pr+1 : color) pr-1 1);
end
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
....... 2316 2018-12-13 09:06 Wang2018Selectiveokeh_rendering.m
....... 2443 2018-12-13 09:06 Wang2018SelectiveDemo_run.m
....... 1584310 2018-12-13 09:06 Wang2018SelectiveDolls 101.png
....... 1590637 2018-12-13 09:06 Wang2018SelectiveDolls 102.png
....... 1602782 2018-12-13 09:06 Wang2018SelectiveDolls 103.png
....... 1594102 2018-12-13 09:06 Wang2018SelectiveDolls 201.png
....... 1607089 2018-12-13 09:06 Wang2018SelectiveDolls 202.png
....... 1611163 2018-12-13 09:06 Wang2018SelectiveDolls 203.png
....... 1583282 2018-12-13 09:06 Wang2018SelectiveDolls 301.png
....... 1599852 2018-12-13 09:06 Wang2018SelectiveDolls 302.png
....... 1593405 2018-12-13 09:06 Wang2018SelectiveDolls 303.png
....... 319 2018-12-13 09:06 Wang2018SelectivegetD.m
....... 528 2018-12-13 09:06 Wang2018SelectiveGradient_BTV.m
....... 390 2018-12-13 09:06 Wang2018SelectiveImWarp.m
....... 835 2018-12-13 09:06 Wang2018SelectiveL2GradientBackProject.m
....... 1320 2018-12-13 09:06 Wang2018SelectiveL2SD.m
....... 1657 2018-12-13 09:06 Wang2018SelectiveLightfield_SR.m
....... 2210 2018-12-13 09:06 Wang2018Selectivelocal_dispt_estm.m
....... 366 2018-12-13 09:06 Wang2018Selectivemaxfilter.m
....... 707 2018-12-13 09:06 Wang2018Selectivemedianfilter.m
文件 276 2018-12-13 09:12 Wang2018Selective
eadme.txt
....... 2490 2018-12-13 09:06 Wang2018SelectiveRGDP_optm.m
....... 180 2018-12-13 09:06 Wang2018SelectiveScaleAdjust.m
目录 0 2018-12-13 09:06 Wang2018SelectiveDolls
目录 0 2018-12-13 09:07 Wang2018Selective
----------- --------- ---------- ----- ----
14382659 25
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。
评论列表(条)