cv.Rodrigues - MATLAB File Help |
Converts a rotation matrix to a rotation vector or vice versa
dst = cv.Rodrigues(src)
[dst,jacobian] = cv.Rodrigues(src)
src
.src
.The function transforms a rotation matrix in the following way:
theta <- norm(r)
r <- r/theta
R = cos(theta) * I + (1 - cos(theta)) * r * r^T + sin(theta) * A
A = [0, -rz, ry; rz, 0, -rx; -ry, rx, 0]
Inverse transformation can be also done easily, since
sin(theta) * A = (R - R^T) / 2
A rotation vector is a convenient and most compact representation of a rotation matrix (since any rotation matrix has just 3 degrees of freedom). The representation is used in the global 3D geometry optimization procedures like cv.calibrateCamera, cv.stereoCalibrate, or cv.solvePnP.