Page 149 - Algorithm Collections for Digital Signal Processing Applications using MATLAB
P. 149
138 Chapter 4
1.2 M-program for Ear Pattern Recognition
___________________________________________________________
earpatgv.m
clear all
close all
k=1;
md=117;
vd=139;
for i=1:1:4
for j=1:1:1
s=strcat('ear',num2str(i),num2str(j),'.bmp');
temp=imread(s);
temp=rgb2gray(temp);
temp1=reshape(temp,1,size(temp,1)*size(temp,2));
temp1=double(temp1);
temp1=meanvarnorm(temp1,md,vd);
final{k}=temp1;
k=k+1;
end
end
f=cell2mat(final');
f=double(f);
c=cov(f);
[E,V]=eigs(c);
for i=1:1:6
F=reshape(E(:,i),85,60);
subplot(2,3,i)
colormap(gray)
imagesc(F)
end
%Feature vector
for i=1:1:4
s=strcat('ear',num2str(i),num2str(1),'.bmp');
s=imread(s);
s=rgb2gray(s);
s=double(s);
s1=reshape(s,1,size(s,1)*size(s,2));
s1=meanvarnorm(s1,md,vd);