-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_testAlgorithms.m
More file actions
48 lines (37 loc) · 1.27 KB
/
Copy pathrun_testAlgorithms.m
File metadata and controls
48 lines (37 loc) · 1.27 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
function run_testAlgorithms
clear; close all;
addpath(genpath('.'));
% Reconstruction parameters
method = 'LADMM'; % Options: GD, PC, LADMM
inputMatrix = 'deblur'; % Options: rand (random matrix), deblur (image
% deblurring function
cx = 0; nCols=50;
cy = 0; nRows=30;
pixSize = 0.001; % meters / pixel
detSize = 0.001;
dTheta = 2 * pi/180;
thetas = 0:dTheta:pi-dTheta;
nThetas = numel(thetas);
nDetectors = nCols*2;
% maxVerticalShift = 0.01; % in meters
% maxHorizontalShift = 0.02; % in meters
maxVerticalShift = 0; % in meters
maxHorizontalShift = 0; % in meters
translations = zeros( nThetas, 2 );
%translations(:,1) = linspace(0,maxVerticalShift,nThetas);
%translations(:,2) = linspace(0,maxHorizontalShift,nThetas);
%profile on
tic;
[recon,costs] = testAlgorithms( nDetectors, detSize, ...
thetas, translations, nCols, nRows, pixSize, 'method', method, ...
'inputMatrix',inputMatrix);
timeTaken = toc;
%profile off
%profile viewer
disp(['Time taken: ', num2str(timeTaken)]);
% figure; imshow( imresize(recon,10,'nearest'), [] );
figure; imshow( recon, [] );
title('Reconstructed image');
figure; plot( costs, 'LineWidth', 2 );
xlabel('Iteration'); ylabel('Cost Function');
end