Acquire Images with Kinect V2

Acquire image and skeletal data from Kinect for Windows V2

The Kinect adaptor lets you acquire images using a Kinect® for Windows® V1 or V2 device. The Kinect V2 Sensor runs on Windows 8 and above.

Functions

imaqtoolLaunch Image Acquisition Tool
videoinputCreate video input object
imaq.VideoDeviceAcquire one frame at a time from video device
getdataAcquired image frames to MATLAB workspace
peekdataMost recently acquired image data
getsnapshotImmediately return single image frame
startObtain exclusive use of image acquisition device
isloggingDetermine whether video input object is logging
isrunningDetermine whether video input object is running
isvalidDetermine whether image acquisition object is associated with image acquisition device
waitWait until image acquisition object stops running or logging
stopStop video input object
clearClear image acquisition object from MATLAB workspace
deleteRemove image acquisition object from memory
flushdataRemove data from memory buffer used to store acquired image frames
obj2mfileConvert video input objects to MATLAB code
imaqmontageSequence of image frames as montage
loadLoad image acquisition object into MATLAB workspace
saveSave image acquisition objects to MAT-file
triggerInitiate data logging
triggerconfigConfigure video input object trigger properties
triggerinfoProvide information about available trigger configurations

Examples and How To

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 two DeviceIDs. Use imaqhwinfo on the adaptor to display the two device IDs.

Acquire Image and Body Data Using Kinect V2

This example shows how to create a videoinput 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.

Plot colored point cloud from Kinect for Windows

This example shows how to plot color point cloud using the Kinect for Windows v2.

Preview color and depth streams from the Kinect for Windows v2 simultaneously

This example shows how to preview color and depth streams using the Kinect for Windows v2.

Skeleton Viewer for Kinect V2 Skeletal Data

This example shows how to view an RGB image taken with the Kinect V2 with the skeleton joint locations overlaid on the image.

Concepts

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.

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.