-
Notifications
You must be signed in to change notification settings - Fork 0
/
fig2.m
40 lines (29 loc) · 1.15 KB
/
fig2.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
function fig2()
figure();
subplot(1,2,1);
hmrds = imread('hmrds.png');
image(flipud(hmrds));
set(gca,'xtick',[],'ytick',[],'ydir','norm','box','off','visible','off',...
'ydir','norm');
title('Half-matched stereogram');
text(10,-30,'Left eye image','fontsize',16);
text(260,-30,'Right eye image','fontsize',16);
text(60,300,'Half matched stereogram','fontsize',18)
subplot(1,2,2); hold on;
x = linspace(-1,1,501);
a = 1; b = 5; theta = 0;
matching_computation = sigmoid(x,a,b,theta)*0.5+0.5;
correlation_computation = sigmoid(x,a,b,theta);
plot(x,matching_computation,'-','linewidth',4,'color',[0.2,0.8,0.2]);
plot(x,correlation_computation,'-','linewidth',4,'color',[0.2,0.2,0.8]);
legend('Matching','Correlation','location','southeast');
set(gca,'xtick',-1:0.5:1,'xticklabel',0:0.25:1,'ytick',0:0.25:1);
xlabel('Dot match level');
ylabel('Proportion correct');
set_plot_params(gcf)
plot([-1,1],[0.5,0.5],'k --','linewidth',2);
plot([0,0],[0,1],'k --','linewidth',2);
end
function y = sigmoid(x,a,b,theta);
y = 1./(1+a*exp(-(x-theta)*b));
end