Hi.
Below is my python code, which calculates eigenvectors and values.
import cv2
import numpy as np
#mat=np.array([-6,3,4,5],np.float32).reshape((2,2))
mat = np.array([[-6, 3],
[ 4, 5]], np.float32)
ret,eVals,eVecs=cv2.eigen(mat, True)
print("Eigenvectors:\n",eVecs)
print("Eigenvalues:\n", eVals)
It prints:
Eigenvectors: [[ 0.24708746 0.9689932 ] [ 0.9689932 -0.24708746]]
Eigenvalues: [[ 5.764982] [-6.764982]]
Eigenvalues are wrong, it should be 6 and -7.
Matlab also calculates 6 and -7.
So, my question is, what’s wrong with this function?
Thanks.