Top Banner
Using Kinect for Windows in MATLAB
3
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Kinectfor Windows in Matlab

Using Kinect for Windows in MATLAB

Page 2: Kinectfor Windows in Matlab

Installing software

● You need Matlab R2013a or higher.● Write command “targetinstaller” to command window.● Select “from Internet” option to get support packages.

Click Next● From list find and select “Kinect for Windows Runtime”.

Note: You need Image Acquisition Toolbox for this.● Click Next. Log In to your MathWorks Account.● Continue and finish installing.Link For Support Package: http://www.mathworks.com/hardware-support/kinect-windows.html

Page 3: Kinectfor Windows in Matlab

Code for Getting the Datahttp://alpx.io/wp-content/uploads/2014/03/kinectExample.m.txtutilpath = fullfile(matlabroot, 'toolbox', 'imaq', 'imaqdemos', ...

'html', 'KinectForWindows');

addpath(utilpath);

vid1 = videoinput('kinect',1); % RGB camera

vid2 = videoinput('kinect',2); % Depth camera

srcColor = getselectedsource(vid1);

srcDepth = getselectedsource(vid2);

vid1.FramesPerTrigger = 1;

vid2.FramesPerTrigger = 1;

vid1.TriggerRepeat = fnum;

vid2.TriggerRepeat = fnum;

triggerconfig([vid1 vid2],'manual');

start([vid1 vid2]);

% Trigger both objects. trigger([vid1 vid2]) % Get the acquired frames and metadata. [imgColorAll, ts_colorAll, metaData_ColorAll] = getdata(vid1); [imgDepthAll, ts_depthAll, metaData_DepthAll ] = getdata(vid2);