Acquisition Using Kinect for Windows Hardware
The Image Acquisition Toolbox™ Support Package for Kinect For Windows Sensor enables you to acquire image sensor data directly into MATLAB® and Simulink®. You can acquire images using a Kinect for Windows V1 or V2 device. The Kinect V1 sensor runs on Windows 7 and above, and the Kinect V2 Sensor runs on Windows 8 and above.
Note: The functionality for all supported hardware is now available via the Support Package Installer. Starting with R2014a, each adaptor is available separately through the Support Package Installer, and you must install the appropriate support packages to use the toolbox with your hardware. For more information, see Image Acquisition Support Packages for Hardware Adaptors.
Functions
imaqhwinfo | Information about available image acquisition hardware |
videoinput | Create video input object |
imaq.VideoDevice | Acquire one frame at a time from video device |
getselectedsource | Return currently selected video source object |
preview | Preview of live video data |
closepreview | Close Video Preview window |
Topics
Setup and Configuration
- Installing the Kinect for Windows Sensor Support Package
With previous versions of the Image Acquisition Toolbox, the files for all of the adaptors were included in your installation. - Key Features and Differences in the Kinect V2 Support
Doing image acquisition with a Kinect for Windows camera is similar to using other cameras and adaptors, but has some key differences. This section also outlines the requirements and supported hardware for Kinect V2. - Detect the Kinect V2 Devices
Because the Kinect for Windows camera has two separate sensors, the color sensor and the depth sensor, the toolbox lists twoDeviceIDs
. Useimaqhwinfo
on the adaptor to display the two device IDs.
Acquire Images with Kinect V2
- Data Streams Returned by the Kinect V2 Adaptor in MATLAB
The Kinect for Windows V2 device returns these data streams in MATLAB. The formats of the image and depth streams are outlined here. - Acquire Image and Body Data Using Kinect V2
This example shows how to create avideoinput
object for the color sensor to acquire RGB images and then for the depth sensor to acquire body data. It also outlines the properties of each sensor, and the skeletal metadata. - Acquire Data from Kinect V2 Color and Depth Devices Simultaneously
You can synchronize the data from the Kinect for Windows color stream and the depth stream using software manual triggering.
Acquire Images with Kinect V1
- Key Features and Differences in the Kinect V1 Support
Doing image acquisition with a Kinect for Windows camera is similar to using other cameras and adaptors, but has some key differences. - Detect the Kinect V1 Devices
Because the Kinect for Windows camera has two separate sensors, the color sensor and the depth sensor, the toolbox lists twoDeviceIDs
. Useimaqhwinfo
on the adaptor to display the two device IDs. - Data Streams Returned by the Kinect V1 Adaptor in MATLAB
The Kinect for Windows V1 device returns these data streams in MATLAB. The formats of the image and depth streams are outlined here. - Acquire Image and Skeletal Data Using Kinect V1
This example shows how to create avideoinput
object for the color sensor to acquire RGB images and then for the depth sensor to acquire skeletal data. It also outlines the properties of each sensor, and the skeletal metadata. - Acquire Data from Kinect V1 Color and Depth Devices Simultaneously
You can synchronize the data from the Kinect for Windows color stream and the depth stream using software manual triggering. - Use Skeleton Viewer for Kinect V1 Skeletal Data
You can acquire skeletal data and view the skeleton joints in a viewer. This example uses the viewer function to display the RGB image with skeleton joint locations overlaid on the image.
Troubleshooting
Try these tips if you have problems using the toolbox with the Kinect for Windows sensor.