首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在matlab中处理kinect的原始数据

在matlab中处理kinect的原始数据
EN

Stack Overflow用户
提问于 2019-05-29 12:48:12
回答 1查看 297关注 0票数 0

我在MATLAB中使用微软kinect v1,想要得到每一个像素的深度数据,单位是米。

我不确定如何获得这些数据,因为我得到的是uint16,而据我所知,它只提供13位的深度,那么我如何获得这13位并进行一些转换,以精确地获得以米为单位的深度。

我已经搜索了很多,但没有得到任何结论。

代码语言:javascript
复制
    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
代码语言:javascript
复制
[NYU Depth and RGB image][1]
[Histogram of swaped Raw Depth image][2]
[Histogram of Raw Depth Image][3]

我想有一些代码转换或任何SDK,为我提供了matlab的仪表。

非常感谢。

EN

回答 1

Stack Overflow用户

发布于 2019-05-30 10:30:03

  1. 根据几篇文章,例如。例如herehere,前三位是设备识别的播放器的代码,但只有在启用骨架跟踪时才会激活。如果未启用骨架跟踪,则这三个位将设置为zero.

  1. 如果您使用matlab,则深度图像是16位双图像,并且包含已从13位提取的数据(很可能是因为骨架跟踪已被禁用,因此3 MSB为零)。因此你不需要在matlab或libfreenect等中转换/提取13位数据因为这些位已经zero.
  2. According到Matlab help page,matlab ImAq工具箱需要安装Kinect for Windows Runtime;因为它使用Kinect SDK Kinect驱动程序来获取数据。根据这个SO answer,“使用Microsoft SDK的,所以从kinect传感器返回的值已经是mm."

中的真实距离

因此,你不需要在matlab中对数据进行位移位。您需要执行此操作的唯一原因是,如果您从kinect驱动程序(?)获取原始深度流在C++/C#中,16位数据将包括3个LSB位。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/56353278

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档