coordinate transformation for images.txt when triangulating with known pose
I am trying to use the command “colmap point_triangulator ...” and would like to prepare a correct images.txt file.
My problem is that the camera pose that I have is lied in robot base coordinate system and what I know is extrinsic matrix which converts robot to camera. I need to transform it correctly so that I can express their poses as written in images.txt format (world to camera rotation and translation)
What would be the formula for transformation,
For example, I have x,y,z, roll, pitch, yaw in robot coordinate system and have robot to camera extrinsic matrix. My output should be in the format of qw,qx,qy,qz,tx,ty,tz which are world to camera rotation and translation, respectively.
Convert the roll-pitch-yaw to quaternions using standard equations (see https://en.wikipedia.org/wiki/Conversion_between_quaternions_and_Euler_angles) , and use x,y,z as tx, ty, tz to create images.txt and then proceed as usual.
Hi @jackson2030, in Python you can use
from scipy.spatial.transform import Rotation as R
QX, QY, QZ, QW = R.from_euler([roll, pitch, yaw]).as_quat()
TX, TY, TZ = x, y, z
This will lead to a reconstruction in the robot base coordinate system. I don't think you need the robot to camera transform if you already have the pose in robot base coordinates.