我在MATLAB中使用微软kinect v1,想要得到每一个像素的深度数据,单位是米。
我不确定如何获得这些数据,因为我得到的是uint16,而据我所知,它只提供13位的深度,那么我如何获得这13位并进行一些转换,以精确地获得以米为单位的深度。
我已经搜索了很多,但没有得到任何结论。
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]我想有一些代码转换或任何SDK,为我提供了matlab的仪表。
非常感谢。
发布于 2019-05-30 10:30:03

中的真实距离
因此,你不需要在matlab中对数据进行位移位。您需要执行此操作的唯一原因是,如果您从kinect驱动程序(?)获取原始深度流在C++/C#中,16位数据将包括3个LSB位。
https://stackoverflow.com/questions/56353278
复制相似问题