You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
895 B
Matlab

function Im=image_gilbert_simple(spacing)
size=5+8*spacing;
cent=ceil(size/2);
hlen=spacing;%3;
vgap=spacing;%3;
hgap=spacing;%3;
hwidth=0;
I=zeros(size)+0.5;
%central bar
Im{1}=I;
Im{1}(cent-hwidth:cent+hwidth,cent-hlen:cent+hlen)=1;
%colinear flankers
Im{3}=I;
Im{3}(cent-hwidth:cent+hwidth,cent-3*hlen-hgap:cent-hlen-hgap)=1;
Im{3}(cent-hwidth:cent+hwidth,cent+hlen+hgap:cent+3*hlen+hgap)=1;
%parallel flankers
%Im{5}=I;
%Im{5}(cent-vgap-hwidth:cent-vgap+hwidth,cent-hlen:cent+hlen)=1;
%Im{5}(cent+vgap-hwidth:cent+vgap+hwidth,cent-hlen:cent+hlen)=1;
%centre + colinear
Im{2}=max(Im{1},Im{3});
%centre + parallel
%Im{4}=max(Im{1},Im{5});
%from Das and Gilbert
%one colinear flanker
Itmp=I;
Itmp(cent-hwidth:cent+hwidth,cent-3*hlen-hgap:cent-hlen-hgap)=1;
Im{4}=max(Im{1},Itmp);
%one perpendicular flanker
Itmp=I;
Itmp(cent-hlen:cent+hlen,cent-hlen-hgap)=1;
Im{5}=max(Im{4},Itmp);