-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtutorial.m
More file actions
65 lines (57 loc) · 1.17 KB
/
tutorial.m
File metadata and controls
65 lines (57 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
% tutorial for image processing using
% scattering toolbox
% author : laurent sifre laurent.sifre@polytechnique.edu
%%
clear;
addpath('common')
addpath('combined')
addpath('display')
addpath('2d')
%%
%load an image
x = im2double(imread('Lena512.png'));
[Sx,meta] = scatt(x);
%%
% display all paths successively
for p = 1:size(Sx,3)
imagesc(Sx(:,:,p));
pause(0.1);
end
%%
% look at the meta
subplot(311);
plot(meta.order);
subplot(312);
plot(meta.scale);
subplot(313);
plot(meta.orientation);
%%
% compute scattering with non-default parameters
options.J = 5;
options.L = 8;
[Sx,meta] = scatt(x,options);
%%
% look at the filters
options.J = 5;
options.L = 6;
filters = gabor_filter_bank_2d([128,128],options);
resolution = 1;
j = 4;
theta = 3;
filt = ifft2(filters.psi{resolution}{j}{theta});
clf;
imagesc([real(fftshift(filt)),imag(fftshift(filt))]);
%%
% look at all the filter at once
imagesc(display_filter_spatial_all(filters,32));
%%
% scattering display
clear options;
% retrieve some additional meta information
options.renorm_study = 1;
[Sx,meta] = scatt(x,options);
disp = fulldisplay2d(squeeze(Sx(16,16,:)),meta);
figure(1);
imagesc(disp{1});
figure(2);
imagesc(disp{2});