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
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.
> 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