I need to create dictionaries of my image dataset to run an implementation of a research paper. But I have no ideo how to.
I'm including the snippets of code
load('AR_1260_occu')
for n=1:1
trainDict= AR_1260_neutral;
train_faces=igo(trainDict,u,v); train_facesL2=igo2(trainDict,u,v); train_facesL3=igo3(trainDict,u,v);
alpha = 100;
people=100;
M=size(train_faces,1);
trainsize=size(train_faces,2); testsize=size(r,2);
factor_train=trainsize/people;
count=0; countS1=0; countS2=0; countS3=0;
a1=1; a2=1e-6;
end
In the function called igo,
function y=igo(x,a,c)
[s1,s2]=size(x);
y=zeros(s1,s2);
if s1==1260
nn=[42 30];
end
for i=1:s2
t1=reshape(x(:,i),nn);
fh=[-1 0 1;-2 0 2;-1 0 1]; fv=[-1 -2 -1;0 0 0;1 2 1];
Gh=filter2(fh,t1); Gv=filter2(fv,t1);
t2=tanh(a*(Gv./Gh-c));
y(:,i)=reshape(t2,[s1,1]);
y(find(isnan(y)==1))=0;
end
end
I hope this information is enough. The dictionaries, as I think, are AR_1260_occu, AR_1260_neutral and AR_1260_neutral12.