Thread Subject: Is it error when use PCA to recognize trained face image. Why?

Subject: Is it error when use PCA to recognize trained face image. Why?

From: Bo Dai

Date: 7 May, 2008 00:48:06

Message: 1 of 3

Hi, All,

I used the codes in http://www.cs.ait.ac.th/~mdailey to make
pca eigfaces. And the train images are att face database.

[images,w,h]=load_images('AttFace.dat');
[Vecs,Vals,Psi] = pc_evectors(images,30);
Proj = Vecs' * images;

Then I use one of the train image(s1\1.pgm) to calculate the
distance between the eigvectors as follows:


nstr='att_faces\s1\1.pgm';
f=imread(nstr);
f2=reshape(f,m,1);

Vecs=double(Vecs);
f2=double(f2);
Psi=double(Psi);
%get the weights wk of the eigfaces to the new image
npro=Vecs'*(f2-Psi)

%m1 is the size of the image, m2 is the number of the train
%images
[m1,m2]=size(Proj)

for i=1:m2
    
    dist(i)= norm(Proj(:,i)-npro(:));
    
end;
[dist_min2,index2]=min(dist)

If it's right, index2 should be 1, but the result is 22.

I don't know why.
Can you help me ?

Subject: Is it error when use PCA to recognize trained face image. Why?

From: Greg Heath

Date: 7 May, 2008 02:21:39

Message: 2 of 3

On May 6, 8:48=A0pm, "Bo Dai" <db...@163.com> wrote:
> Hi, All,
>
> I used the codes inhttp://www.cs.ait.ac.th/~mdaileyto make
> pca eigfaces. And the train images are att face database.
>
> [images,w,h]=3Dload_images('AttFace.dat');
> [Vecs,Vals,Psi] =3D pc_evectors(images,30);
> Proj =3D Vecs' * images; =A0
>
> Then I use one of the train image(s1\1.pgm) to calculate the
> distance between the eigvectors as follows:
>
> nstr=3D'att_faces\s1\1.pgm';
> f=3Dimread(nstr);
> f2=3Dreshape(f,m,1);
>
> Vecs=3Ddouble(Vecs);
> f2=3Ddouble(f2);
> Psi=3Ddouble(Psi);
> %get the weights wk of the eigfaces to the new image
> npro=3DVecs'*(f2-Psi)
>
> %m1 is the size of the image, m2 is the number of the train
> %images
> [m1,m2]=3Dsize(Proj)
>
> for i=3D1:m2
>
> =A0 =A0 dist(i)=3D norm(Proj(:,i)-npro(:));
>
> end;
> [dist_min2,index2]=3Dmin(dist)
>
> If it's right, index2 should be 1, but the result is 22.
>
> I don't know why.
> Can you help me ?

I didn't read your code. In general, however, PCA is not recommended
for classification. Search the archives
using

greg-heath thin disks

Hope this helps.

Greg

Subject: Is it error when use PCA to recognize trained face image. Why?

From: Ru Bu

Date: 10 May, 2008 12:48:03

Message: 3 of 3

Bo I am using the same code....for PCA and then trying to
archive the same....to do a face recognition using
that....could you please....let me know whether you were
able to do this.....if so...would you be kind enough to
share it with me? (ruwanb(nospam)@gmail.com)

Thanks in advance.....




"Bo Dai" <db804@163.com> wrote in message
<fvqu86$q7r$1@fred.mathworks.com>...
> Hi, All,
>
> I used the codes in http://www.cs.ait.ac.th/~mdailey to make
> pca eigfaces. And the train images are att face database.
>
> [images,w,h]=load_images('AttFace.dat');
> [Vecs,Vals,Psi] = pc_evectors(images,30);
> Proj = Vecs' * images;
>
> Then I use one of the train image(s1\1.pgm) to calculate the
> distance between the eigvectors as follows:
>
>
> nstr='att_faces\s1\1.pgm';
> f=imread(nstr);
> f2=reshape(f,m,1);
>
> Vecs=double(Vecs);
> f2=double(f2);
> Psi=double(Psi);
> %get the weights wk of the eigfaces to the new image
> npro=Vecs'*(f2-Psi)
>
> %m1 is the size of the image, m2 is the number of the train
> %images
> [m1,m2]=size(Proj)
>
> for i=1:m2
>
> dist(i)= norm(Proj(:,i)-npro(:));
>
> end;
> [dist_min2,index2]=min(dist)
>
> If it's right, index2 should be 1, but the result is 22.
>
> I don't know why.
> Can you help me ?
>
>

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread

Contact us at files@mathworks.com