METR4202 Kinect 360 Setup for Matlab R2014a

METR4202
Kinect 360 Setup for Matlab R2014a
Patrick Mahoney
August 2014
1. Download and install the Kinect For Windows SDK V1.8 from http:
//www.microsoft.com/en-au/download/details.aspx?id=40278
2. Download the Kinect IMAQ Adapter from the course website downloads
page. Links are available under the Kinect for Windows header on the
Software page of the course website.
3. Unzip the Adapter package and files contained to a permanent directory.
For example purposes the directory used is ’H:/metr4202/kinectimaq/’.
4. To install the adapter in Matlab use the ’imaqregister’ command, i.e.
>> imaqregister(’H:/metr4202/kinectimaq/mwkinectimaq.dll’)
ans =
’H:/metr4202/kinectimaq/mwkinectimaq.dll’
5. This should install the kinect adapter in matlab. To test this run the
imaqhwinfo function, output should be similar to below.
>> imaqhwinfo
ans =
InstalledAdaptors:
MATLABVersion:
ToolboxName:
ToolboxVersion:
{’mwkinectimaq’}
’8.3 (R2014a)’
’Image Acquisition Toolbox’
’4.7 (R2014a)’
6. Information for the kinect adapter can be shown by providing the adapter
name (’mwkinectimaq’) to the ’imaqhwinfo’ function. This will list the
available devices, there should be two, one color device and one depth
device.
>> imaqhwinfo(’mwkinectimaq’)
1
ans =
AdaptorDllName:
AdaptorDllVersion:
AdaptorName:
DeviceIDs:
DeviceInfo:
’H:/metr4202/kinectimaq/mwkinectimaq.dll’
’4.7 (R2014a)’
’mwkinectimaq’
{[1] [2]}
[1x2 struct]
7. To find information about each of the devices, select the device from the
’imaqhwinfo’ function.
>> imaqhwinfo(’mwkinectimaq’, 1)
ans =
DefaultFormat:
DeviceFileSupported:
DeviceName:
DeviceID:
VideoInputConstructor:
VideoDeviceConstructor:
SupportedFormats:
’RGB_640x480’
0
’Kinect Color Sensor’
1
’videoinput(’mwkinectimaq’, 1)’
’imaq.VideoDevice(’mwkinectimaq’, 1)’
{1x7 cell}
>> imaqhwinfo(’mwkinectimaq’, 2)
ans =
DefaultFormat:
DeviceFileSupported:
DeviceName:
DeviceID:
VideoInputConstructor:
VideoDeviceConstructor:
SupportedFormats:
’Depth_640x480’
0
’Kinect Depth Sensor’
2
’videoinput(’mwkinectimaq’, 2)’
’imaq.VideoDevice(’mwkinectimaq’, 2)’
{’Depth_320x240’ ’Depth_640x480’ ’Depth_80x60’}
8. To test input from the kinect and ensure data can be received use the
’videoinput’ function, specifing both the adapter and device as done for
’imaqhwinfo’. The object returned from this can then be provided to the
’preview’ function to get a live display from the device.
>> vid = videoinput(’mwkinectimaq’, 1)
Summary of Video Input Object Using ’Kinect Color Sensor’.
Acquisition Source(s):
Acquisition Parameters:
Color Source is available.
’Color Source’ is the current selected source.
10 frames per trigger using the selected source.
’RGB_640x480’ video data to be logged upon START.
2
Grabbing first of every 1 frame(s).
Log data to ’memory’ on trigger.
Trigger Parameters:
Status:
1 ’immediate’ trigger(s) on START.
Waiting for START.
0 frames acquired since starting.
0 frames available for GETDATA.
>> preview(vid)
Note: Further documentation on how to interact with the kinect through
the Matlab Kinect IMAQ Adapter can be found in the Matlab documentation
(http://www.mathworks.com.au/help/imaq/examples/using-the-kinect-rfor-windows-r-from-image-acquisition-toolbox-tm.html). Along with this
is the general documentation for the Image Acquisition Toolbox (http://www.
mathworks.com.au/help/imaq/index.html). Finally Matlab includes demonstration code for the Kinect (run ’open KinectForWindowsExample’) detailing
unique features of the kinect adapter. To run the code however it is necessary
to change all references to the adapter name from ’kinect’ to ’mwkinectimaq’.
3
Open as PDF
Similar pages