calculate 4x4 matrices from rvec (+cv.Rodrigues) and tvec.
def mat_from_rtvec(rvec, tvec):
T = np.eye(4)
(R, jac) = cv.Rodrigues(rvec)
T[0:3, 0:3] = R
T[0:3, 3] = tvec
return T
then you can multiply and invert those 4x4 matrices.
give them names encoding each frame involved in the transformation. that way, they line up like dominos.
an aruco transform encodes the marker’s pose in the camera frame, or equivalently, a transform from marker space to camera space: T_cam_marker
.
if you had T_cam_refmarker
and T_cam_marker2
from detecting those markers, then T_refmarker_marker2 = T_refmarker_cam @ T_cam_marker2
where T_refmarker_cam = np.linalg.inv(T_cam_refmarker)