-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.m
More file actions
executable file
·49 lines (42 loc) · 1.39 KB
/
example.m
File metadata and controls
executable file
·49 lines (42 loc) · 1.39 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
45
46
47
48
49
%==========================================================================
% EXAMPLE OF USE OF ACQUIRE
%==========================================================================
%
% Authors:
% Daniela di Serafino (daniela.diserafino [at] unicampania.it)
% Germana Landi (germana.landi [at] unibo.it )
% Marco Viola (marco.viola [at] unicampania.it)
%
% Version: 1.0
% Last Update: 1 November 2019
%
%==========================================================================
%% Select the problem
pbind = 1; % 1 - PHANTOM with Gaussian blur and SNR approx 40
% 2 - CAMERAMAN with motion blur and SNR approx 40
if pbind==1
load TEST_phantom_gauss.mat
else
load TEST_cameraman_motion.mat
end
%% Run ACQUIRE with default settings and tolerance 1e-3 on the relative distance between consecutive iterates
options = struct('StopCrit',1,'Tolerance',1e-3);
[xk,flag,i,errvect,fvect,times] = acquire(psf,true,gn,bg,lambda,false,[],obj,options);
%% Plot relative error and objective function values versus elapsed time
figure()
semilogy(times,errvect,'LineWidth',2)
title('RELATIVE ERROR vs TIME')
figure()
semilogy(times,fvect,'LineWidth',2)
title('OBJ FUNCTION VALUE vs TIME')
%% Plot corrupted and restored image
figure()
imagesc(gn)
colormap gray
axis square
title('Corrupted image')
figure()
imagesc(xk)
colormap gray
axis square
title('Restored image')