-1

I'm trying to figure out how to use eigenVV, but no luck so far. The following is my code and could anyone of you point out what I'm doing wrong? Thanks.

CvMat* A2;
A2 = cvCreateMat(3, 3, CV_32FC1);
cvmSet(A2, 0, 0, 1);
cvmSet(A2, 0, 1, 3);
cvmSet(A2, 0, 2, -3);
cvmSet(A2, 1, 0, -3);
cvmSet(A2, 1, 1, 7);
cvmSet(A2, 1, 2, -3);
cvmSet(A2, 2, 0, -6);
cvmSet(A2, 2, 1, 6);
cvmSet(A2, 2, 1, -2);

CvMat* transp_A2;
CvMat* ATA2;
CvMat* eigenVal2;
CvMat* eigenVec2;

transp_A2 = cvCreateMat(3, 3, CV_32FC1);
ATA2 = cvCreateMat(3, 3, CV_32FC1);
eigenVal2 = cvCreateMat(3, 1, CV_32FC1);
eigenVec2 = cvCreateMat(3, 3, CV_32FC1);

cvTranspose(A2, transp_A2);
cvMatMul(transp_A2, A2, ATA2);
cvEigenVV(ATA2, eigenVec2, eigenVal2);

Edit : This is output of eigenVec2 variable

-0.236854,0.862897,-0.446442,

0.969565,0.239264,-0.0519332,

-0.0620046,0.445154,0.893304,
user3273345
  • 127
  • 2
  • 9

1 Answers1

0

I wanted to use that EigenVector EigenValue to create projection matrix and comparing it against with projection matrix I have. I thought my answer was wrong when it doesn't match with the one I have. But I figured out the resulting projection matrix is not exactly the same. It is differed by scale factor. So the way I use eigenvv is correct.

user3273345
  • 127
  • 2
  • 9