How to check if Kinect data streams are already enabled ?

By | August 15, 2013

You can capture the Kinect sensor image data stream either in format of color or depth data. Both the data streams can be capture in parallel as the data is being captured in two different channel.  Sensor start sending the data only when the stream channels are enabled and sensor is running.   You can check the stream channel  if they are already enabled before you re-enabling them by using “IsEnabled” property of stream channel.

For an example,  you can use following code snippet before you enable the depth data stream

KinectSensor sensor;
if (!sensor.DepthStream.IsEnabled)
{
sensor.DepthStream.Enable();
}

KinectSensor class has a property DepthStream of type DepthImageStream. This class also includes the IsEnabled property which return the current status of the depth stream channel. Don’t think you can set the values of this property to true or false, remember, this is a read-only property. Similar to DepthStreamImage, you can use the same for the ColorImageStream channel.

KinectSensor sensor;
if (!sensor.ColorStream.IsEnabled)
{
sensor.ColorStream.Enable();
}

One thought on “How to check if Kinect data streams are already enabled ?

  1. Pingback: .NET Tips and Tricks from Daily .NET Tips – July and August 2013 Links | Abhijit's World of .NET

Comments are closed.