User`s guide
14 Using the VideoDevice System Object
14-8
To create a System object using the Color sensor:
vidobjcolor = imaq.VideoDevice('kinect', 1);
To create a System object using the Depth sensor:
vidobjdepth = imaq.VideoDevice('kinect', 2);
The Depth sensor returns skeleton metadata. To access this, you need to add a second
output argument for the step function. The Color sensor works the same way as other
devices. So acquiring a frame using the Kinect Color sensor is done as shown here:
imageData = step(vidobjcolor);
where imageData is the frame acquired if vidobjcolor is a System object created with
Device 1, the Kinect Color sensor.
The Kinect Depth sensor requires a second output argument, as shown here:
[depthData metadata] = step(vidobjdepth);
where depthData is the frame acquired if vidobjdepth is a System object created with
Device 2, the Kinect Depth sensor, and metadata is the skeleton metadata returned
with the frame.
These metadata fields are related to tracking the skeletons. The metadata is returned as
a structure that contains these parameters:
IsPositionTracked
IsSkeletonTracked
JointDepthIndices
JointImageIndices
JointTrackingState
JointWorldCoordinates
PositionDepthIndices
PositionImageIndices
PositionWorldCoordinates
SegmentationData
SkeletonTrackingID