Azure-Kinect-Sensor-SDK icon indicating copy to clipboard operation
Azure-Kinect-Sensor-SDK copied to clipboard

Support mapping image other than the depth map from depth space to color space

Open yijiew opened this issue 7 years ago • 9 comments

The instance map in the K4ABT SDK is a map in depth space. But currently there is no way for them to map the instance map from the depth space to color space. It would be useful to have an API to help map the image other than the depth map from depth space to color space.

yijiew avatar Apr 19 '19 18:04 yijiew

@yijiew Is this a BT issue rather than an SDK issue?

wes-b avatar Apr 19 '19 21:04 wes-b

It is an SDK issue. Because the SDK is the one having the nice algorithm to map the depth space to color space. It is a natural extend for the transformation API to support transforming images other than the depth map from depth space to color space.

In terms of the use case, It is a general problem, too. I imagine other people might also run some fancy DNN algoirthm directly on the depth map. Then mapping from the depth map to color map will be a need.

yijiew avatar Apr 19 '19 22:04 yijiew

You can already pass a modified or new image to k4a_transformation_depth_image_to_color_camera, but it requires that it match the resolution and pixel format of the depth camera.

Do you need to transform an image of a different resolution or pixel format? If so, what formats would be useful?

Brent-A avatar Apr 26 '19 14:04 Brent-A

No. I don't need to transform an image with a different resolution.

Do you mean passing in a modified image as the "depth_image" to get the "transformed_depth_image"? It won't work because the transformation algorithm relies on the depth value to transform the depth pixel to color camera space. If we pass in some other random values, the transformation will be incorrect.

yijiew avatar Apr 27 '19 01:04 yijiew

I see, so the pixel format is not depth data. Is it color data in an existing format or some custom format?

I would think we would need to know not just the depth but also the format of the data. I believe we can extrapolate or interpolate depth or color data right now, but if the data is in an unknown format that couldn't be done.

You may want to look at the fastpointcloud example which shows how to pre-compute a lookup table between the two camera spaces.

Brent-A avatar Apr 29 '19 21:04 Brent-A

Wes will follow up with @yijiew to work out a set of requirements.

Brent-A avatar May 07 '19 22:05 Brent-A

It is some custom format. Basically it will be a 8-bit image covers the same resolution as the depth/IR image.

The fast point cloud example is a very good way to generate point cloud in 3d. But projecting the point cloud in 3d back to other camera space is not that trivial by the following reasons:

  1. the naïve method won't handle the occlusion
  2. the 3d point cloud is not dense enough to cover every pixels in the new camera view.

Our transformation algorithm handles both cases by creating mesh out of the point cloud to fill in the missing pixels. I guess it will be hard for our users to implement this algorithm by themselves. I will further chat with Wes about this then. Thanks!

yijiew avatar May 07 '19 23:05 yijiew

I'm sorry to crash in, but is this Kinect Fusion-like API, or producing mesh from a depth map? If so when please, will this come? Open sourced, or...? TIA P.S. I was gonna open an issue, that fastpointcloud's missing triangle faces mesh data, but if this issue addresses it would be redundant.

dimitrijevic avatar May 16 '19 07:05 dimitrijevic

It is not related to produce mesh from a depth map. We create a simple mesh internally for us to transform between coordinates in GPU. But I don't think we will ever expose that mesh out. Please feel free to create this separate issue if you think the mesh data is important.

yijiew avatar May 16 '19 17:05 yijiew