How to turning off the Kinect IR light forcefully ?

You can turn off the IR Emitter using KinectSensor.ForceInfraredEmitterOff property. By default, this property is set to false. To turn the IR light off, set the property to true.

ForceInfraredEmitterOff  will only work with Kinect for Windows Sensor. Not Kinect for Xbox Sensor.

If you are using Kinect for xBox Sensor you will get an InvalidOperationException with message “The feature is not supported by this version of the hardware”.

You can test this functionalities by performing the following steps:

  • Once the sensor is started, a red light is turned on in the IR emitter.
  • Set KinectSensor.ForceInfraredEmitterOff  to true, this will stop the IR, you will find IR red light is also stopped.
  • Set KinectSensor.ForceInfraredEmitterOff  to false, to turn on the IR emitter.

As for as example, if you are controlling the IR emitter using a check box control, you can use the following code block, where ControlIR is an event handler for the checkbox checked/unchecked event.

private void ControlIR(object sender, RoutedEventArgs e)
        {
            CheckBox chkbox = sender as CheckBox;
 
            if (chkbox.IsChecked == true)
            {
                this.sensor.ForceInfraredEmitterOff = false;
            }
            else if (chkbox.IsChecked == false)
            {
                this.sensor.ForceInfraredEmitterOff = true;
            }
        }

You can use this features to reduce the interference when multiple Kinect sensor are in used.

Abhijit Jana

Abhijit runs the Daily .NET Tips. He started this site with a vision to have a single knowledge base of .NET tips and tricks and share post that can quickly help any developers . He is a Former Microsoft ASP.NET MVP, CodeProject MVP, Mentor, Speaker, Author, Technology Evangelist and presently working as a .NET Consultant. He blogs at http://abhijitjana.net , you can follow him @AbhijitJana . He is the author of book Kinect for Windows SDK Programming Guide.