-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathlfevalandplot.m
More file actions
44 lines (37 loc) · 1.17 KB
/
Copy pathlfevalandplot.m
File metadata and controls
44 lines (37 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
function ssimval=lfevalandplot
% LFEVALANDPLOT is used to evaluate the performance of the sparse filter using
% PSNR and SSIM and to plot figures of the volumetric focussed LFs.
%
% Inputs:
% lfnm - Light field name
% lfvf - Refocused image from conventional depth filter. Load from
% directory.
% lfvfh - Refocused image from hard thresholded depth
% filter (sparse filter). Load from directory.
%
% Outputs:
% SSIM and PSNR of lfvfh compared to lfvf.
%
% Author - Chamira Edussooriya
% Date - July 23, 2013
% Last modified - May 24, 2018
clc;
close all;
lfnm = 'Mirabelle_Prune_Tree'; % name of the LF
load([lfnm,'_VF.mat']); % LF of conventional filter
load([lfnm,'_VFHT.mat']); % LF of sparse filter
if max(lfvf(:))<256
maxval = 255;
else
maxval = 65535;
end
mse = mean((lfvfh(:)-lfvf(:)).^2);
psnr = 10*log10(maxval^2/mse);
[ssimval,~] = ssim(lfvfh,lfvf);
% Comment out the following when running 'perf_theta_hth'
disp(['PSNR = ',num2str(psnr),' dB']);
disp(['SSIM = ',num2str(ssimval),' units']);
figure;
imshow(lfvf,[0,255]);
figure;
imshow(lfvfh,[0,255]);