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 and then you must get the 4 eignevectors into your original space (I don't remember the exact equations to do thge latter).

Matthieu

2008/2/28, devnew@gmail.com <devnew@gmail.com>:


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
evalues,evect=eigh(covarmat)
 

i will give the data i used

facemat (ndarray from data of 4 images each4X3)
[[ 173.   87.   88.  163.  167.   72.   75.  159.  170.  101.   88.
165.]
  [ 158.  103.  115.  152.  138.   58.   81.  153.  126.   68.   73.
143.]
  [ 180.   87.  107.  180.  167.   65.   86.  182.  113.   41.   55.
143.]
  [ 155.  117.  128.  147.  147.   70.   93.  146.  153.   65.   93.
155.]]
avgvals
[ 166.5    98.5   109.5   160.5   154.75   66.25   83.75  160.
140.5
   68.75   77.25  151.5 ]

adjfaces=matrix(facemat-avgvals)
[[  6.5  -11.5  -21.5    2.5   12.25   5.75  -8.75  -1.    29.5
32.25
   10.75  13.5 ]
  [ -8.5    4.5    5.5   -8.5  -16.75  -8.25  -2.75  -7.   -14.5
-0.75
   -4.25  -8.5 ]
  [ 13.5  -11.5   -2.5   19.5   12.25  -1.25   2.25  22.   -27.5
-27.75
  -22.25  -8.5 ]
  [-11.5   18.5   18.5  -13.5   -7.75   3.75   9.25 -14.    12.5
-3.75
   15.75   3.5 ]]

faces_trans =adjfaces.transpose()
[[  6.5   -8.5   13.5  -11.5 ]
  [-11.5    4.5  -11.5   18.5 ]
  [-21.5    5.5   -2.5   18.5 ]
  [  2.5   -8.5   19.5  -13.5 ]
  [ 12.25 -16.75  12.25  -7.75]
  [  5.75  -8.25  -1.25   3.75]
  [ -8.75  -2.75   2.25   9.25]
  [ -1.    -7.    22.   -14.  ]
  [ 29.5  -14.5  -27.5   12.5 ]
  [ 32.25  -0.75 -27.75  -3.75]
  [ 10.75  -4.25 -22.25  15.75]
  [ 13.5   -8.5   -8.5    3.5 ]]
covarmat =adjfaces * faces_trans
[[ 3111.8125 -1080.4375 -1636.4375  -394.9375]
  [-1080.4375   901.3125  -114.6875   293.8125]
  [-1636.4375  -114.6875  3435.3125 -1684.1875]
  [ -394.9375   293.8125 -1684.1875  1785.3125]]

evalues,evectors=eigh(covarmat)

evalues
[ -1.85852801e-13   6.31143639e+02   3.31182765e+03   5.29077871e+03]

evectors

[[ 0.5        -0.06727772  0.6496399  -0.56871936]
  [ 0.5        -0.77317718 -0.37697426  0.10043632]
  [ 0.5         0.27108233  0.31014514  0.76179023]
  [ 0.5         0.56937257 -0.58281078 -0.29350719]]

newevectmatrix

[[-0.56871936  0.6496399  -0.06727772  0.5       ]
  [ 0.10043632 -0.37697426 -0.77317718  0.5       ]
  [ 0.76179023  0.31014514  0.27108233  0.5       ]
  [-0.29350719 -0.58281078  0.56937257  0.5       ]]


i am not getting the eigenvector of length 12 as you said
pls tell me if i am doing sthing wrong

D
_______________________________________________
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion



--
French PhD student
Website : http://matthieu-brucher.developpez.com/
Blogs : http://matt.eifelle.com and http://blog.developpez.com/?blog=92
LinkedIn : http://www.linkedin.com/in/matthieubrucher