I am trying to find eigen values for a syymetric matrix as follows:-
Mat t(2, 2, CV_32F);
t.at<float>(0, 0) = 1;
t.at<float>(0, 1) = 0;
t.at<float>(1, 0) = 0;
t.at<float>(1, 1) = 128;
Mat eigVal,eigVec;
eigen(t,eigVal,eigVec);
When I am printing the eigen values for this matrix it gives me correct answer.
cout << eigVal.at<float>(0) << "," << eigVal.at<float>(1) << "\n";
The output which I get is 128,1. But when I am changing my matrix as follows:-
t.at<float>(0, 0) = 4;
t.at<float>(0, 1) = 2;
t.at<float>(1, 0) = 1;
t.at<float>(1, 1) = 3;
I am not getting correct response. The output which I am expecting is 5,2. But instead I am getting output as 5.56155 and 1.43845. Can anyone tell me where I did mistake