> -
> from scipy import linalg
> facearray-=facearray.mean(0) #mean centering
> u, s, vt = linalg.svd(facearray, 0)
> scores = u*s
> facespace = vt.T
> # reconstruction: facearray ~= dot(scores, facespace.T)
> explained_variance = 100*s.cumsum()/s.sum()
hi
i am a newbie in this area o
I found this in my del.icio.us links, sorry I forgot to mention it at the
time:
http://www.owlnet.rice.edu/~elec301/Projects99/faces/code.html
All the best
On Thu, Mar 6, 2008 at 10:39 AM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> ok..I coded everything again from scratch..looks like i was
ok..I coded everything again from scratch..looks like i was having a
problem with matrix class
when i used a matrix for facespace
facespace=sortedeigenvectorsmatrix * adjustedfacematrix
and trying to convert the row to an image (eigenface).
by
make_simple_image(facespace[x],"eigenimage_x.jpg",(im
> This will not work with numpy matrices.* is elementwise mult.
Sorry, disregard that comment
___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion
> i read in some document on the topic of eigenfaces that
> 'Multiplying the sorted eigenvector with face vector results in
> getting the
> face-space vector'
> facespace=sortedeigenvectorsmatrix * adjustedfacematrix
> (when these are numpy.matrices )
This will not work with numpy matrices.
>Arnar wrote
> I dont know if this made anything any clearer. However, a simple
> example may be clearer:
> # X is (a ndarray, *not* matrix) column centered with vectorized images in
> rows
> # method 1:
> XX = dot(X, X.T)
> s, u = linalg.eigh(XX)
> reorder = s.argsort()[::-1]
> facespace = dot(X.
> I dont know if this made anything any clearer. However, a simple
> example may be clearer:
thanks Arnar for the kind response,now things are a lot clearer...will
try out in code ..
D
___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://
On Sat, Mar 1, 2008 at 8:27 AM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> > This example assumes that facearray is an ndarray.(like you described
> > in original post ;-) ) It looks like you are using a matrix.
>
> hi Arnar
> thanks ..
> a few doubts however
>
> 1.when i use say 10 ima
> This example assumes that facearray is an ndarray.(like you described
> in original post ;-) ) It looks like you are using a matrix.
hi Arnar
thanks ..
a few doubts however
1.when i use say 10 images of 4X3 each
u, s, vt = linalg.svd(facearray, 0)
i will get vt of shape (10,12)
can't i take th
On Thu, Feb 28, 2008 at 3:41 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> > Arnar wrote
>
> > from scipy import linalg
> > facearray-=facearray.mean(0) #mean centering
> > u, s, vt = linalg.svd(facearray, 0)
> > scores = u*s
> > facespace = vt.T
>
> hi Arnar
> when i do this i get these
> Arnar wrote
> from scipy import linalg
> facearray-=facearray.mean(0) #mean centering
> u, s, vt = linalg.svd(facearray, 0)
> scores = u*s
> facespace = vt.T
hi Arnar
when i do this i get these
u =< 'numpy.core.defmatrix.matrix'> (4, 4)
that matches the eigenvectors matrix in my previous data
s=
On Thu, Feb 28, 2008 at 8:17 AM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> i all
> I am learning PCA method by reading up Turk&Petland papers etc
> while trying out PCA on a set of greyscale images using python, and
> numpy I tried to create eigenvectors and facespace.
>
> i have
> faces
OK, what you are getting are not the eigenvectors of you data, but the
eigenvectors of the transposition of your data (I suppose).
You have two options :
- either you make an eigen analysis of your data and get 12 eigenvectors
- either you make an eigen analysis of the transposition of your data an
On Feb 28, 1:27 pm, "Matthieu Brucher" wrote
> If your images are 4x3, your eigenvector must be 12 long.
hi
thanx for reply
i am using 4 images each of size 4X3
the covariance matrix obtained from adjfaces*faces_trans is 4X4 in
size and that produces the evalues and eigenvectors given here
eva
Hi,
If your images are 4x3, your eigenvector must be 12 long.
Matthieu
2008/2/28, [EMAIL PROTECTED] <[EMAIL PROTECTED]>:
>
> i all
> I am learning PCA method by reading up Turk&Petland papers etc
> while trying out PCA on a set of greyscale images using python, and
> numpy I tried to create eige
i all
I am learning PCA method by reading up Turk&Petland papers etc
while trying out PCA on a set of greyscale images using python, and
numpy I tried to create eigenvectors and facespace.
i have
facesarray--- an NXP numpy.ndarray that contains data of images
N=numof images,P=pixels in an
16 matches
Mail list logo