-
Notifications
You must be signed in to change notification settings - Fork 0
/
edge_power_demo.m
40 lines (32 loc) · 1.25 KB
/
edge_power_demo.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
%% edge power of a specific pink noise stimulus
ml=0.5; % mean luminance
cont=0.15; % contrast
target_radius=64;
seed=1; % specifies the random seed, so it generates a specific stimulus
stim=lib.stimulus('seed',seed,'ml_b',ml,'cont_b',cont,'target_radius',target_radius);
% this function is inside the +lib folder.
% type 'doc lib.stimulus' for more help
figure(1);
subplot(2,1,1); vis.show_image(stim);
% compute edge vector and edge power
[edge_vector,edge_power]=lib.edge(stim);
% this function is also inside the +lib folder.
% type 'doc lib.edge' for more help
subplot(2,1,2); plot(edge_vector);
title(edge_power);
%% edge power of random pink noise stimulus
stim=lib.stimulus('ml_b',ml,'cont_b',cont,'target_radius',target_radius);
figure(2);
subplot(2,1,1); vis.show_image(stim);
[edge_vector,edge_power]=lib.edge(stim);
subplot(2,1,2); plot(edge_vector);
title(edge_power);
%% edge power of random brown noise stimulus
texture.type='pink_noise'; % here pink noise means the entire f^(-a) noise family
texture.exponent=2; % f^(-2)
stim=lib.stimulus('texture',texture,'ml_b',ml,'cont_b',cont,'target_radius',target_radius);
figure(3);
subplot(2,1,1); vis.show_image(stim);
[edge_vector,edge_power]=lib.edge(stim);
subplot(2,1,2); plot(edge_vector);
title(edge_power);