-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfig_fth.m
executable file
·46 lines (43 loc) · 1.2 KB
/
fig_fth.m
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
% Draws images for FTH illustration showing effect of the reference
addpath('helper');
input=imread('reconstruction/input/input_klein-tu.png');
outpath='Tex/images/src/';
saveimage=@(filename) save_image(fullfile(outpath,filename));
input=padarray(double(squeeze(input(:,:,1)))./255,[256,256]);
refoff=700;
refsize=10;
[xx,yy]=meshgrid(1:size(input,1),1:size(input,2));
ref=(xx-refoff).^2+(yy-refoff).^2<refsize^2;
inputHolo=input+double(ref);
scatterHolo=(abs(ft2(inputHolo))).^2;
scatter=(abs(ft2(input))).^2;
reconHolo=ift2(scatterHolo);
recon=ift2(scatter);
cross=reconHolo(1:280,1:280);
figure(1);
imagesc(inputHolo);
colormap(flipud(colormap(gray)));
saveimage('fth_inputHolo.png');
figure(2);
imagesc(scatterHolo);
colormap(flipud(colormap(gray)));
caxis([0,1e6]);
saveimage('fth_scatterHolo.png');
figure(3);
imagesc(reconHolo);
colormap(flipud(colormap(gray)));
caxis([min(cross(:)),max(cross(:))])
saveimage('fth_reconHolo.png');
figure(4);
imagesc(input);
colormap(flipud(colormap(gray)));
saveimage('fth_input.png');
figure(5);
imagesc(scatter);
colormap(flipud(colormap(gray)));
caxis([0,1e6]);
saveimage('fth_scatter.png');
figure(6);
imagesc(recon);
colormap(flipud(colormap(gray)));
saveimage('fth_recon.png');