Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

help in reconstructing from eigenfaces

0 views
Skip to first unread message

royG

unread,
Mar 27, 2008, 5:28:57 PM3/27/08
to
hi
i am trying to reconstruct face images from eigenfaces derrived from
original set of face images.
I coded it in python and represented orig images by an numpy.ndarray
with each row for each image and each column for pixel intensity.I
sorted the eigenvectors such that each row of
sortedeigenvectors_rowwise is an eigenvector(first row being the most
significant).
Thus my facespace has each row correspond to an eigenface image.

facespace=dot(sortedeigenvectors_rowwise,adjfaces) where

adjfaces=origfaces-averageface

also i calculated the weights matrix by
wk=dot(facespace[:selectednumberofEVectors,:],adjfaces.transpose() ).transpose()
weights=abs(wk)

Now I am trying to reconstruct the face images from this data.Since i
am still learning this technique i couldn't figure out how to do the
reconstruction
can someone help/advise?
RG

Jonathan Campbell

unread,
Mar 29, 2008, 9:43:35 AM3/29/08
to
royG wrote:
> hi
> i am trying to reconstruct face images from eigenfaces derrived from
> original set of face images.
> I coded it in python and represented orig images by an numpy.ndarray
> with each row for each image and each column for pixel intensity.I
> sorted the eigenvectors such that each row of
> sortedeigenvectors_rowwise is an eigenvector(first row being the most
> significant).

You may not understand how difficult it is to understand the previous
two sentences, i.e. mathematics written in natural language.

Moreover, the intersection of those who understand (a) Python and that
package you mention and (b) eigenfaces, is probably a very small set indeed.

> Thus my facespace has each row correspond to an eigenface image.
>

> facespace=dot(sortedeigenvectors_rowwise,adjfaces) (1)


where
>
> adjfaces=origfaces-averageface

Have you got the Turk-Pentland paper? Does (1) correspond to eqn. (7) of
the paper?

>
> also i calculated the weights matrix by
> wk=dot(facespace[:selectednumberofEVectors,:],adjfaces.transpose() ).transpose()
> weights=abs(wk)
>

What is the purpose of the previous few lines? Maybe it corresponds to
eqn. (7) of Pentland-Turk?


> Now I am trying to reconstruct the face images from this data.Since i
> am still learning this technique i couldn't figure out how to do the
> reconstruction

What do you mean?

Have you got M eigenfaces somewhere? These are ul in eqn. 6 of
Turk-Pentland. M = number of images used to construct the eigenspace.

The components in 'face-space' of a face image I (N^2 x 1 vector) are

wk = uk o (I - Psi), where Psi is the average over the M face images; o
denotes scalar product, uk is eigenface k.

Incidentally, you should display the uk, k = 1 ... M as images and
ensure that they make sense, see Figure 2 of Turk-Pentland.

To synthesise the face image I using the wk (and the eigenfaces uk) what
you need is:

I'm = sum{i = 1, m} wk uk + Psi, for reconstruction using the first m
eigenfaces, note the + Psi.

Obviously, if m = M, I'm = I (the original); check that this is the case.

Best regards,

Jon C.

royG

unread,
Mar 30, 2008, 10:16:39 AM3/30/08
to
hi Jon
thanks for the reply..as i said i am a beginner in this and really
taking first toddling lessons.Also am not good with maths notations so
have to depend on natural language to make description clear...sorry

> Have you got the Turk-Pentland paper?

i have read 'Eigenfaces for Recognition' by T&P and also read
Pissarenko's 'eigenface based facial recognition'


i used M images to create the 2d arrays and calculate covariance
matrix.So my eigenvector 2d array is MxM
I transposed the eigenvectors( which i got from the covariance matrix)
after sorting them .Now the first row of sortedeigenvectors_rowwise
has the most significant eigenvector


>Does (1) correspond to eqn. (7) of the paper?

i think (1) corresponds to eqn (6).in T&P .this yields the
eigenfaces(or facespace as i called here)
after finding the facespace by dot product of
sortedeigenvectors_rowwise and the
adjfaces ,i think each row of this facespace corresponds to an
eigenface image

> > wk=dot(facespace[:selectednumberofEVectors,:],adjfaces.transpose() ).transpose()
> > weights=abs(wk)
> What is the purpose of the previous few lines? Maybe it corresponds to
> eqn. (7) of Pentland-Turk?

yes ,i am trying to find the weight space as mentioned in eqn (7) and
i am using only M' < M eigenfaces.I think the choice of name
'selectednumberofEVectors' was confusing and wrong .sorry


> To synthesise the face image I using the wk (and the eigenfaces uk) what
> you need is:
> I'm = sum{i = 1, m} wk uk + Psi, for reconstruction using the first m
> eigenfaces, note the + Psi.
>
> Obviously, if m = M, I'm = I (the original); check that this is the case.


thanks for the guidance there Jon,will try in code..
regards
RG

0 new messages