0

我正在使用 Fujitsu Core 2 Duo 2Ghz、2 Gb RAM、Windows7 和 Matlab R2010a 使用这个 Mex-function Code检索 Kinect 图像序列(RGB 和深度) 。它非常慢。我不知道为什么。有什么建议吗?谢谢!

这段youtube 视频显示了它的运行速度有多慢。

下图显示每秒帧数

在此处输入图像描述

------------------sample_niImage.m------------------------------

% sample_niIRImage
% Get IR and DEPTH image via Kinect

close all; clear all;
addpath('./Mex');
%% Create context with xml file
context = mxNiCreateContext('Config/SamplesIR_DepthConfig.xml');

%% Initialise FIGURE
ir_width = 640; ir_height = 480;
depth_width = 640; depth_height = 480;
% IR image
figure, h1 = imagesc(zeros(ir_height,ir_width,'uint16')); colormap('gray');
% depth image
figure, h2 = imagesc(zeros(depth_height,depth_width,'uint16'));

%% LOOP
for k=1:100
    tic
    %Capture IR and Depth image
    mxNiUpdateContext(context);
    [ir, depth]= mxNiIRImage(context);
    % Update FIGURE
    set(h1,'CData',ir); 
    set(h2,'CData',depth); 
    drawnow;
    disp(['itr=' sprintf('%d',k) , ' : FPS=' sprintf('%f',1/toc)]);
end

%% Delete the context object 
mxNiDeleteContext(context);
4

0 回答 0