Azure-kinect-sensor-sdk: Would like depth_point to xyz_point conversion

Created on 14 Mar 2020  路  5Comments  路  Source: microsoft/Azure-Kinect-Sensor-SDK

Is your feature request related to a problem? Please describe.

Would like to convert a singular depth image point to a point cloud point. k4a_transformation_t_get_context is not defined anywhere in the SDK, so I cannot find the xy_tables necessary to do the conversion by myself

Describe the solution you'd like

A function that converts depth to xyz for a single point.

Describe alternatives you've considered

Being able to access the xy_tables or the transformation context by being able to call k4a_transformation_t_get_context in application code.

Additional context

Doing this to map a transformed depth image point to a point cloud point that is being rendered in VTK.

Enhancement

Most helpful comment

Maybe this example will help you:
https://github.com/microsoft/Azure-Kinect-Sensor-SDK/blob/develop/examples/fastpointcloud

It shows how to create a xy-table which you can then use.

All 5 comments

Maybe this example will help you:
https://github.com/microsoft/Azure-Kinect-Sensor-SDK/blob/develop/examples/fastpointcloud

It shows how to create a xy-table which you can then use.

Thank you! However, still not clear about one thing: If my input is a depth image produced by k4a_transformation_depth_image_to_color_camera, what is the proper calibration to use to get those x and y points in the point cloud? I played around with multiple different types of calibration parameters to no avail.

@ameyades if you just want to unproject single point from 2d to 3d using depth, have you tried k4a_calibration_2d_to_3d(). And also, if you are using transformed depth image using k4a_transformation_depth_image_to_color_camera, you should use the color camera intrinsics to do such 2d to 3d unprojection (you can achieve this by setting the k4a_calibration_type_t with color camera). If you are interested to convert the entire depth image to the 3d point cloud, you can use k4a_transformation_depth_image_to_point_cloud(), you can take a look the example: https://github.com/microsoft/Azure-Kinect-Sensor-SDK/blob/bf02b7f5f30265c6e857179910905e1cbb5b4cc7/examples/transformation/main.cpp#L65

@ameyades hope my answer above resolved your question. The SDK should already support you to do any transformation between 2d and 3d, between cameras, and also for both single point or the entire image. Recommend you can read the following docs:

Now, if you for some reason and really want to have access to xytables, the sdk open sourced code can allow you to do that. Take a look this function implementation

Close this issue since 7 days no comments. But if you are still having issue, feel free to comment

Hi,

Thank you for the help!

Very sorry for the late reply - currently working on another project so haven't had a chance to verify. I will test the function implementation when I get the chance.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

RenderHeadsMrT picture RenderHeadsMrT  路  3Comments

devLupin picture devLupin  路  4Comments

Maxim-Zhukov picture Maxim-Zhukov  路  4Comments

Elenaegr picture Elenaegr  路  3Comments

y0ngw00 picture y0ngw00  路  3Comments