使用cv2.Rodrigues函数即可实现
import cv2
import numpy as np
# 相机标定
ret, rvec, tvec, idx, std_dev = cv2.calibrateCamera(...)
# 将rvec转换为旋转矩阵
R = cv2.Rodrigues(rvec)
# 将旋转矩阵转换为欧拉角
roll, pitch, yaw = cv2.decomposeHomographyMat(R)
使用cv2.Rodrigues函数即可实现
import cv2
import numpy as np
# 相机标定
ret, rvec, tvec, idx, std_dev = cv2.calibrateCamera(...)
# 将rvec转换为旋转矩阵
R = cv2.Rodrigues(rvec)
# 将旋转矩阵转换为欧拉角
roll, pitch, yaw = cv2.decomposeHomographyMat(R)