This is machine translation

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

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Detect the Kinect V1 Devices

Typically, each camera or image device in the Image Acquisition Toolbox™ 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. Use imaqhwinfo on the adaptor to display the two device IDs.

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]

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'}
 

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

For more information on the Kinect streams, see Data Streams Returned by the Kinect V1 Adaptor in MATLAB. For an example that shows how to access the skeletal metadata, see Use Skeleton Viewer for Kinect V1 Skeletal Data.