3
votes

So I used Kinect to obtain some depth images and they are now saved. So if I want to process this depth image to get the Z value (i.e. the distance from the object to the Kinect) how should I do that?

I have been doing some research online and found out that I need to be saving the image as a 16bit depth image for the depth values to be stored instead of an 8 bit depth image which can only store up to 256 values. based on: Save Kinect depth image in Matlab?

But I still do not quite understand the image I am getting. When I use imread and uses the data cursor to look at the individual pixels, I only obtain the XY coordinates and an Index value. the index value does not seem to represent the distance in mm.

Can anyone clear this part for me please. Thanks.

1
Have a look at Depth Image to Point Cloud (MATLAB). Is seems like that is what you need. - Evgeny Timoshenko

1 Answers

0
votes

looks like your are reading an indexed image with imread()

try this:

[idx, map] = imread('yourImage');
RGB = ind2rgb(idx, map);

and see if RGB contains the correct value.