Recently I used RGBD-Slam to obtain kinect camera trajectory. Each frame will have this:
timestamp tx ty tz qx qy qz qw
tx ty tz give the position of the optical center of the color camera with respect to the world origin as defined by the motion capture system.
qx qy qz qw give the orientation of the optical center of the color camera in form of a unit quaternion with respect to the world origin as defined by the motion capture system.
I need to convert it to 4x4 homogeneous transformation matrix. Any hints to solve this?. Let's say the example as follows:
1421307756.191874 0.004530 0.050319 0.003332 0.003734 0.023578 -0.054199 0.998245
so,
timestamp: 1421307756.191874 ; tx: 0.004530
ty: 0.050319 ; tz: 0.003332
qx: 0.003734 ; qy: 0.023578
qz: -0.054199 ; qw: 0.998245
and, fx = 525.0; fy = 525.0; // default focal length
cx = 319.5; cy = 239.5; // default optical center
Kind assistance would be greatly appreciated.
Thanks.
extracting angle and axis of the quaternion shouldn't be hard right ? then you, can find the general expression of a rotation matrix with a given axis
then just combining the obtained matrix with the translation matrix in the right order should do the trick
it's my first post plz be indulgent if I'm saying shit :-P