Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

Detecting the Kinect Devices

Typically in the Image Acquisition Toolbox™, each camera or image device has one DeviceID. Because the Kinect® for Windows® camera has two separate sensors, the color sensor and the depth sensor, the toolbox lists two DeviceIDs. If you use imaqhwinfo on the adaptor, you can see this.

info = imaqhwinfo('kinect');
info

info = 
 
       AdaptorDllName: '<matlabroot>\toolbox\imaq\imaqadaptors\win64\mwkinectimaq.dll'
    AdaptorDllVersion: '4.6 (R2013b)'
          AdaptorName: 'kinect'
            DeviceIDs: {[1]  [2]}
           DeviceInfo: [1x2 struct]

You can see the two device IDs in the output.

If you look at each device, you can see that they represent the color sensor and the depth sensor. The following shows the color sensor.

info.DeviceInfo(1)

ans = 

             DefaultFormat: 'RGB_640x480'
       DeviceFileSupported: 0
                DeviceName: 'Kinect Color Sensor'
                  DeviceID: 1
     VideoInputConstructor: 'videoinput('kinect', 1)'
    VideoDeviceConstructor: 'imaq.VideoDevice('kinect', 1)'
          SupportedFormats: {'RGB_1280x960'  'RGB_640x480'  'RawYUV_640x480'  'YUV_640x480'
                               'Infrared_640x480'  'RawBayer_1280x960'  'RawBayer_640x480'}
 

In the output, you can see that Device 1 is the color sensor.

The following shows the depth sensor, which is Device 2.

info.DeviceInfo(2)

ans = 

             DefaultFormat: 'Depth_640x480'
       DeviceFileSupported: 0
                DeviceName: 'Kinect Depth Sensor'
                  DeviceID: 2
     VideoInputConstructor: 'videoinput('kinect', 2)'
    VideoDeviceConstructor: 'imaq.VideoDevice('kinect', 2)'
          SupportedFormats: {'Depth_640x480'  'Depth_320x240'  'Depth_80x60'}
  

You can use multiple Kinect cameras together. Multiple Kinect sensors are enumerated as DeviceIDs [1] [2] [3] [4] and so on. For example, if you had two Kinect cameras, the first one would have Kinect Color Sensor with DeviceID 1 and Kinect Depth Sensor with DeviceID 2 and the second Kinect camera would have Kinect Color Sensor with DeviceID 3 and Kinect Depth Sensor with DeviceID 4.

Note

To understand the differences in using the Kinect adaptor compared to other toolbox adaptors, see Important Information About the Kinect Adaptor. For more information on the Kinect streams, see Data Streams Returned by the Kinect. For an example that shows how to access the skeletal metadata, see Acquiring Image and Skeletal Data Using Kinect.

Was this topic helpful?