首页 文章

如何使用MATLAB同步Kinect for Windows的颜色和深度传感器?

提问于
浏览
0

我正在使用MATLAB和官方Kinect SDK从Kinect for Windows捕获颜色和深度图像 . 我希望两个传感器同步,以便每个传感器的图像是同一时刻 . 不幸的是,我目前的实现在两个传感器之间存在滞后(差不多1秒!) . 请帮我找到一种同步传感器的方法 . 这是我目前的代码:

colorVid = videoinput('kinect',1,'RGB_640x480');
depthVid = videoinput('kinect',2,'Depth_640x480');
triggerconfig([colorVid depthVid],'Manual');
set([colorVid depthVid], 'FramesPerTrigger', 300);
start([colorVid depthVid]);
trigger([colorVid depthVid]);
pause(10);
[imgColor, ts_color, metaData_Color] = getdata(colorVid);
[imgDepth, ts_depth, metaData_Depth] = getdata(depthVid);
stop([colorVid depthVid]);
delete([colorVid depthVid]);
clear colorVid depthVid;

1 回答

  • 1

    我已经玩了一段时间了,似乎在start()和trigger()函数之间添加一个暂停来解决这个问题!

    start([colorVid depthVid],'FramesPerTrigger',300);
    pause(1);
    trigger([colorVid depthVid]);
    

相关问题