Items with no label
3338 Discussions

How can we get translation and rotation matrix for each image(left&right) from Intel RealSense T265 camera ?

SBald8
Beginner
3,352 Views

I am been using Intel RealSense T265 camera, also I have calibrated it. Now I have translation and rotation matrix for checkerboard images and I want to get translation and rotation matrix for each image captured by camera (non- checkerboard images) doing a project on Odometry.

How to configure each image(left+right) as the camera is in motion and have set of 30 images so how to get translation and rotation matrix for all those 30 images(non- checkerboard images).

Can anybody help me solve this problem ?

0 Kudos
4 Replies
MartyG
Honored Contributor III
3,074 Views

The RealSense GitHub forum is the best place to get expert T265 advice. You can post a question there by visiting the link below and clicking the New Issue button.

https://github.com/IntelRealSense/librealsense/issues

​The example program in the link below also has information on getting the rotation and translation and then calculating a matrix from them.

https://dev.intelrealsense.com/docs/rs-trajectory

0 Kudos
SBald8
Beginner
3,074 Views
Thankyou for reply, But after running this code https://dev.intelrealsense.com/docs/rs-trajectory I only get trajectory how to obtain rotation and translation matrix from them ? Please elaborate it would really help me to proceed further in my work. I have attached a picture of working code, but I need to get matrix value of each image . Regards Shivani Baldwa Ming Chi University Of Technology - 84 Gungjuan Rd, Taishan Dist, New Taipei City 24301
0 Kudos
MartyG
Honored Contributor III
3,074 Views

The code below from the linked-to page shows how the matrix is calculated with calc_transform using translation and rotation data gathered with the instructions pose_data.translation and pose_data.rotation

 

void calc_transform(rs2_pose& pose_data, float mat[16])

{

  auto q = pose_data.rotation;

  auto t = pose_data.translation;

  // Set the matrix as column-major for convenient work with OpenGL and rotate by 180 degrees (by negating 1st and 3rd columns)

  mat[0] = -(1 - 2 * q.y*q.y - 2 * q.z*q.z); mat[4] = 2 * q.x*q.y - 2 * q.z*q.w;   mat[8] = -(2 * q.x*q.z + 2 * q.y*q.w);   mat[12] = t.x;

  mat[1] = -(2 * q.x*q.y + 2 * q.z*q.w);   mat[5] = 1 - 2 * q.x*q.x - 2 * q.z*q.z; mat[9] = -(2 * q.y*q.z - 2 * q.x*q.w);   mat[13] = t.y;

  mat[2] = -(2 * q.x*q.z - 2 * q.y*q.w);   mat[6] = 2 * q.y*q.z + 2 * q.x*q.w;   mat[10] = -(1 - 2 * q.x*q.x - 2 * q.y*q.y); mat[14] = t.z;

  mat[3] = 0.0f;               mat[7] = 0.0f;             mat[11] = 0.0f;               mat[15] = 1.0f;

}

 

I am not a T265 specialist though, so the RealSense GitHub is the best place to ask detailed questions about the T265. Thanks!

0 Kudos
SBald8
Beginner
3,074 Views

I was not able to solve above problem, but get x,y,z cordinate so how to change given x-y-z- cordinate's of camera to pose file (which is translation and rotation vector). Ultimately I need pose file for my dataset by realsenseT265 camera , your help would be appreciated.

 

 

0 Kudos
Reply