-
Notifications
You must be signed in to change notification settings - Fork 1
/
Retina_no_temporal.m
53 lines (48 loc) · 1.87 KB
/
Retina_no_temporal.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
47
48
49
50
51
52
53
function [Bcon,Bcoff,OPL,OUT]=Retina_no_temporal(originimg,alpha_ph,alpha_h)
dblImageSX=normrange(originimg,0,1);
%--------------------------------------------------------------------------
%--------------------------------------------------------------------------
hh=10;
ww=10;
a1=-0.5:1/hh:0.5-1/hh;
b1=-0.5:1/ww:0.5-1/ww;
fk1=repmat(a1',1,ww);
fk2=repmat(b1,hh,1);
beta_ph=0;
% alpha_ph=7;
fph=1./(1+beta_ph+4*alpha_ph-2*alpha_ph*(cos(2*pi.*fk1))-2*alpha_ph*(cos(2*pi.*fk2)));
beta_h=0;
% alpha_h=0.57;
fh=1./(1+beta_h+4*alpha_h-2*alpha_h*(cos(2*pi.*fk1))-2*alpha_h*(cos(2*pi.*fk2)));
%--------------------------------------------------------------------------
%LC
Lp=conv2(dblImageSX,fh,'same');
%Local adaptation model associated symbol
V0=0.7;
Vmax=1;
% Lp=20;
R0=Lp*V0+Vmax*(1-V0);
% R0=0.1;%0-1
Cp=(dblImageSX./(dblImageSX+R0)).*(Vmax+R0);
BPph=conv2(Cp,fph,'same');
BPph=normrange(BPph,0,1);
%--------------------------------------------------------------------------
% Honzonial Cell
%--------------------------------------------------------------------------
BPr=conv2(Cp,fh,'same');
BPr=normrange(BPr,0,1);
%--------------------------------------------------------------------------
% Bipolar Cell
%--------------------------------------------------------------------------
Lp=BPr;
V00=0.9;
Bcon=BPph-BPr;
Bcon=Bcon./(Bcon+Lp*V00+Vmax*(1-V00)).*(Vmax+Lp*V00+Vmax*(1-V00));
Bcoff=-BPph+BPr;
Bcoff=Bcoff./(Bcoff+Lp*V00+Vmax*(1-V00)).*(Vmax+Lp*V00+Vmax*(1-V00));
%--------------------------------------------------------------------------
% OPL
%--------------------------------------------------------------------------
OPL=Bcon-Bcoff;
OUT=OPL+Cp/1;
end