Ali P
Ali P

Reputation: 519

Processing Kinect Depth data in MATLAB

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.

Upvotes: 3

Views: 1410

Answers (1)

lanpa
lanpa

Reputation: 1349

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.

Upvotes: 0

Related Questions