microsoft / Azure-Kinect-Sensor-SDK

A cross platform (Linux and Windows) user mode SDK to read data from your Azure Kinect device.
https://Azure.com/Kinect
MIT License
1.5k stars 619 forks source link

Depth image correction in NFOV unbinned mode #688

Closed ivaandrey closed 5 years ago

ivaandrey commented 5 years ago

Hello, How can I correct the distortion of depth image in NFOV unbinned mode? Does 3D cloud data contain the undistorted depth data. How can I extract the undistorted depth image from 3D cloud data? Thanks

rabbitdaxi commented 5 years ago

@ivaandrey

ivaandrey commented 5 years ago

Ok, thank you for the quick answer. What function should I run to get 3d data from 2d data? Does the transformation from 2d to 3d perform the same undistortion logic you sent me in example?Or it other undistorion method? Thanks

rabbitdaxi commented 5 years ago

@ivaandrey k4a_transformation_depth_image_to_point_cloud(). From 2d to 3d, we unproject each depth image pixel with the depth value to a 3d (x,y,z) point, it is in space, geometrically correct. And yes, the unproject function internally taken care of the distortion with the intrinsics parameters.

The undistort example is just simply find the correspondence between the distorted camera space and the pinhole camera space, therefore, you can convert the distorted depth image to a undistorted depth image in the pinhole.

ivaandrey commented 5 years ago

I see, is there any way to extract the undistorted depth image from 3d data?

rabbitdaxi commented 5 years ago

@ivaandrey , theoretically, you can project 3d data to a pinhole camera model (but the resolution of the 3d points are correspondent to the distorted image, the common way is you want to loop pixel indices in your pinhole camera model - undistorted and back-project to distorted domain to find correspondence, also there are many other things such as interpolation and so on need to consider). If your goal is get undistorted depth image, I would strongly recommend you take a look the undistort example I shared.

rabbitdaxi commented 5 years ago

@ivaandrey have we answered your questions? If yes, please close this issue :) Thank you for the feedback.

ivaandrey commented 5 years ago

Yes, thank you a lot