Depth stream
The process, and the relating code for getting our depth stream data displayed, is very similar to the one we detailed for the color stream data.
In this section, we will list and document the essential steps for working with the depth stream data. The example attached to this chapter will provide all the additional details.
In order to process the depth stream data obtained by the connected KinectSensor
, sensor
we need to enable the KinectSensor.DepthStream
using the KinectSensor.DepthStream.Enable(ColorImageFormat colorImageFormat)
API.
The KinectSensor.DepthFrameReady
is the event that the sensor fires when a new frame from the depth stream data is ready. The Kinect sensor streams data out continuously, one frame at a time, till the sensor is stopped or the depth stream is disabled. To stop the sensor, you can use the KinectSensor.Stop()
method, and to disable the depth stream, use the KinectSensor.DepthStream.Disable()
method.
We can register to the KinectSensor.DepthFrameReady...