1 Star 0 Fork 0

Harry/LFToolbox

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
LFDemoRefocusSuperres.m 1.53 KB
一键复制 编辑 原始数据 按行查看 历史
Donald Dansereau 提交于 2020-04-23 23:31 . adding demo of refocus super-res
% LFDemoRefocusSuperres - Demonstrate super-resolution using LFFiltShiftSum's UpsampRate parameter
%
% User guide: <a href="matlab:which LFToolbox.pdf; open('LFToolbox.pdf')">LFToolbox.pdf</a>
% Copyright (c) 2013-2020 Donald G. Dansereau
clearvars
%---Tweakables---
InputFname = fullfile('Images','ESLF','Plant.eslf.jpg');
CropRegion = [247, 288, 220, 261, 4, 11];
Slope = -0.15;
UpsampRate = 10;
%---Read file---
LF = LFReadESLF(InputFname);
LFFigure(1);
clf
LFDisp(LFHistEqualize(LFDisp(LF)))
axis image
axis off
hold on
plot(CropRegion([1,2,2,1,1]), CropRegion([4,4,3,3,4]), 'r-');
%---Crop---
LF = LF(CropRegion(5):CropRegion(6), CropRegion(5):CropRegion(6), ...
CropRegion(3):CropRegion(4), CropRegion(1):CropRegion(2), :);
LFFigure(2);
clf
subplot(221);
LFDisp(LFHistEqualize(LFDisp(LF)));
axis image
axis off
title('Input');
%---Focus---
t1 = LFFiltShiftSum(LF,Slope);
subplot(222);
LFDisp(LFHistEqualize(LFDisp(t1)));
axis image
axis off
title('Focused');
%---2D cubic interpolation for comparison---
Interpolant = griddedInterpolant( t1 );
Interpolant.Method = 'cubic';
UVec = linspace(1,size(t1,2), size(t1,2)*UpsampRate);
VVec = linspace(1,size(t1,1), size(t1,1)*UpsampRate);
t1r = Interpolant( {VVec, UVec, 1:3} );
subplot(223);
LFDisp(LFHistEqualize(LFDisp(t1r)));
axis image
axis off
title('2D Cubic Interpolation');
%---Focus with super-res---
t2 = LFFiltShiftSum(LF,Slope,struct('UpsampRate',UpsampRate,'InterpMethod','cubic'));
subplot(224);
LFDisp(LFHistEqualize(LFDisp(t2)));
axis image
axis off
title('Focused with super-resolution');
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/harry56/LFToolbox.git
git@gitee.com:harry56/LFToolbox.git
harry56
LFToolbox
LFToolbox
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385