blender中:world = R * camera + T; colmap中:camera = R * world + T
# 因此转换公式为
# R’ = R^-1
# t’ = -R^-1 * t
colmap的坐标系和opencv一致,blender坐标系和opengl一致。
要将blender坐标系c2w转换到colmap中w2c:
blender2opencv = np.array([[1, 0, 0, 0], [0, -1, 0, 0], [0, 0, -1, 0], [0, 0, 0, 1]])
#先把blender坐标系转换为colmap
pose = pose @ blender2opencv
#然后将c2w转换为w2c,然后
R = np.linalg.inv(pose[:3, :3])
T = -np.matmul(R, pose[:3, 3])