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 enter image description here 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)

2

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.