0

I have a kinect (v2) that captures the depth image. In the depth image, I have some objects on a table; I want to have the distance from the kinect sensors to the objects on the table.

How can I calculate the distance in (m or cm) of the objects on the table to the kinect sensors?

I don't know if I can do some image processing using the intensity value of the pixels of the image to do so. Any help is appreciated.

enter image description here

EE2017
  • 49
  • 11

1 Answers1

1

Depth images from Kinect v2 can be 8-bit (0-255) or 16-bit (0-65535) PNG images with the depth data in millimetres up to 4500 or 8000 mm, depending on how the data has been saved. (The “Depth Basics” example provided in the Kinect SDK saves the images in a 8-bit PNG format).

Since the 8-bit depth images can only store values upto 0-255, to convert it into grayscale, the values are scaled to 256 parts. So each grayscale pixel value represents 8000/255 = 31.25 mm of depth.

Atif Anwer
  • 450
  • 5
  • 13
  • Does that mean I have to multiply each pixel value of the image by 31.25 to get the distance of the Kinect sensor to the seen object? – EE2017 Feb 29 '20 at 07:50
  • Yes; for eg: a pixel value of 100 would mean 100*31.25 = 3125mm distance in the real world. SImillarly, a pixel value of 8000 would mean the maximum distance that Kinect can measure (which is around 24 ft). – Atif Anwer Feb 29 '20 at 10:25
  • Thanks for this approach, I will try it and compare it to another approach (to measure the distance manually from the Kinect to the target object with a centimeter), based on the result I will check your answer. I will also upload the design of the other approach here... Thanks and stay tuned! – EE2017 Feb 29 '20 at 19:10