I am using Microsoft kinect v1 in MATLAB and want to get depth data on every pixel in meters.
I am not sure how to get that data because I am getting uint16 and as far as I have read is that it provides depth only in 13 bits, So how do I get those 13 bits and do some conversion to get depth exactly in meters.
I have searched a lot about it but could not get to any conclusion.
Kinectinfo = imaqhwinfo('kinect');
colorinfo = Kinectinfo.DeviceInfo(1);
depthinfo = Kinectinfo.DeviceInfo(2);
colorvid = videoinput('kinect',1);
depthvid = videoinput('kinect',2);
srcDepth = getselectedsource(depthvid);
% Set the frames per trigger for both devices to 1.
colorvid.FramesPerTrigger = 1;
depthvid.FramesPerTrigger = 1;
% Set the trigger repeat for both devices to 200, in order to acquire 201 frames from both the color sensor and the depth sensor.
colorvid.TriggerRepeat = 200;
depthvid.TriggerRepeat = 200;
%Configure the camera for manual triggering for both sensors.
triggerconfig([colorvid depthvid],'manual');
% Start both video objects.
start([colorvid depthvid]);
%Trigger the devices, then get the acquired data.
% Trigger 200 times to get the frames.
for i = 1:200
% Trigger both objects.
trigger([colorvid depthvid])
% Get the acquired frames and metadata.
[imgColor, ts_color, metaData_Color] = getdata(colorvid);
[imgDepth, ts_depth, metaData_Depth] = getdata(depthvid);
end
[NYU Depth and RGB image][1]
[Histogram of swaped Raw Depth image][2]
[Histogram of Raw Depth Image][3]
I would like to have some code for conversion or any SDK that provides me with meters in matlab.
Thanks alot.
