Rodrigues Function in Python Version Opencv Not Working
I Want to Use Python Version Opencv Function Rodrigues() to Convert Rotation Matrix to the Rotation Vector. the rotMat to Be Converted Is [[ 0.59966056...
I want to use python version opencv function Rodrigues() to convert rotation matrix to the rotation vector. The rotMat to be converted is
[[ 0.59966056 -0.59966056 0.52991926]
[ 0.70710678 0.70710678 0. ]
[-0.37470951 0.37470951 0.8480481 ]]
and the code I wrote is something like
rotVec = np.zeros((1, 3), np.float32)
cv2.Rodrigues(rotMat, rotVec)
Which follows the documentation like But it turns out that the result is all 0 and the function is not working. I am very new to python and I am appreciated if someone could point out error.
1 Answer
Your function call isn't quite correct; you do need to handle both return arguments, even if you ignore one. These calls should work for you: rotVec,_ = cv2.Rodrigues(rotMat) or cv2.Rodrigues2(rotMat,rotVec, jacb)