如何同时保存从Kinect V2颜色和深度设备获取的数据?

时间:2019-05-23 07:36:40

标签: matlab kinect-v2 color-depth

我使用软件手动触发同时并同步地获取了颜色和深度数据:

clc;
clear;
close all;

imaqreset

colorVid = videoinput('kinect',1);
depthVid = videoinput('kinect',2);

depthSource = getselectedsource(depthVid);
depthSource.EnableBodyTracking = 'on';

colorVid.FramesPerTrigger = 1;
depthVid.FramesPerTrigger = 1;

colorVid.TriggerRepeat = 30;
depthVid.TriggerRepeat = 30;

triggerconfig([colorVid depthVid],'manual');

start([colorVid depthVid]);

pause(5);

% Trigger 200 times to get the frames.

for i = 1:30
    % 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

现在我要保存这些颜色和深度框,以便以后使用,该如何做?

有人可以帮助我吗?

谢谢。

0 个答案:

没有答案