Convert device pose to camera pose

我的未来我决定 提交于 2019-12-02 09:46:00

The equation you put together is correct! But it's not finished.


Format

To formalize the terminalogy, let's use a_T_b as a transformation matrix, where a represents the base frame, b represents the target frame. a_T_b is a frame with respect to b frame.


Compute the matrix

Based on your question, the matrices we known are:

start_service_T_device, imu_T_device , imu_T_depth

The matrix we want to get is:

start_service_T_depth

We can just use a "matrix chain" to get the result:

start_service_T_depth = start_service_T_device * 
                        inverse(imu_T_device) * 
                        imu_T_depth;

Now, let's say we have a point P_depth in depth frame. To apply the pose for this point and convert it to start_service frame, we could use:

P_ss = start_service_T_depth * P_depth;

Put it in OpenGL frame

In most of the cases, you might want to convert it to some coordate frame that is easy for graphic library to render out. Let's take OpenGL for example, we can transform this point to the OpenGL world coordinate frame as follow:

Note that start_service_T_opengl_world is a constant matrix that you could compute by hand. Here is a link to the matrix, quoted from Project Tango c++ example.

P_gl = opengl_world_T_start_service * P_ss;

We can expand everything we just wrote and put it in a single equation:

P_gl = opengl_world_T_start_service * 
       start_service_T_device * 
       inverse(imu_T_device) * 
       imu_T_depth * 
       P_depth;

Sample code from Project Tango

Also, in the project tango examples, the point cloud example has a pretty good explanation of these conversions, here are the links(c++, java, unity).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!