Need help in recognition



Hi everyone, i have some problems here when doing object recognition. I
first do some preprocessing to crop the images to size which tightly
enclose the object of interest. Subsequently i perform PCA/LDA on the
datas before sending to the classifier.

Problem 1) PCA/MLP gives a bad recognition rate of only about 50+%. Did
i do something wrong or is it because the PCA removes some of the
variance between classes? here is the segment of my PCA

A is the feature vectors where each row is 1 feature vector.

L=A*A';

[vv d]=eig(L);


v=(A')*vv*(abs(d))^-0.5;

KLCoef = A*v;
pcol=size(KLCoef,2);

%eliminate those eigenvectors whose eigenvalues are zero
d=[];
for i=1:size(d,2)
if(abs((d(i,i))*20)>0.005)
d=[d d(i,i)];
end
end


disp('Removing smaller eigenvalues...');
eigentotal1=sum(d);
eigentotal1=0.75*eigentotal1;
for eigencount=length(d):-1:1
if (sum(d(eigencount:length(d)))>=eigentotal1)
break;
end
end

eigencount=eigencount-1;

transformeddata= KLCoef(:,pcol-eigencount:pcol);
transformeddata=transformeddata';


Problem 2. For LDA, it keeps getting hang when i run this code at the
part where Performing eigen-decomposition


==================================================================
disp('Finding Sb...');% find between-class matrix Sb

%==================================================================
%mean of all images
meanimage=mean(trainingpics,2);

%finding the means of each class
classMeans=[];
for nPersonCount=1:no_of_handsign
npicsofclass=(nPersonCount-1)*no_of_train_pics_pax;

classmean=mean(trainingpics(:,(npicsofclass+1):(npicsofclass+no_of_train_pics_pax)),2);
% find mean of various classes
classMeans=[classMeans (classmean-meanimage)];
end

%computing Sb=Nc*c*classMeans*classMeans'
%Nc has no effect on the results
Sb=classMeans*classMeans'; %ok done


%==================================================================
disp('Finding Sw...');% find within-class matrix Sw

%==================================================================
tempmatrix=[];
for nPersonCount=1:no_of_handsign
for j=1:no_of_train_pics_pax

temp=double(trainingpics(:,((nPersonCount-1)*no_of_train_pics_pax)+j))-classMeans(:,nPersonCount);
tempmatrix=[tempmatrix temp];
end
end
Sw=tempmatrix*tempmatrix'; %ok done


disp('Performing eigen-decomposition...');
[V,D]=eig((Sw)\Sb,'nobalance');

if loop~=5
V=V(:,1:15);
else
V=V(:,1:(no_of_handsign-1));
end

Any comments are welcome. Thanks

.



Relevant Pages