Infrared Basics-WPF C# Sample
Kinect for Windows 1.6, 1.7, 1.8
Overview
Demonstrates how to enable the depth camera to transmit invisible infrared light and displays a real-time image of the resulting Infrared Stream.
For more information about the code used in the sample, see Getting and Displaying Infrared Data in C#.
The Sample Uses the Following APIs | To Do This |
---|---|
KinectSensor.KinectSensors Property | Get the Kinect sensors that are plugged in and ready for use. |
ColorImageFormat.InfraredResolution640x480Fps30 enumeration value | Choose the color stream format including the data type, resolution and frame rate of the data. |
ColorImageStream.Enable Method | Enable the color stream, which enables the infrared stream. |
ImageStream.FramePixelDataLength Property | Specify the length of the pixel data buffer when you allocate memory to store the infrared stream data from the Kinect. |
ImageStream.FrameWidth Property and ImageStream.FrameHeight Property | Specify the width and height of the frame data to use a WriteableBitmap to store/render the infrared data. |
KinectSensor.Start Method and KinectSensor.Stop Method | Start or stop streaming data. |
KinectSensor.ColorFrameReady Event | Add an event handler for the infrared data. The sensor will signal the event handler when each new frame of infrared data is ready. |
ColorImageFrameReadyEventArgs.OpenColorImageFrame Method | Get a frame of infrared data, in the event handler. |
ColorImageFrame.CopyPixelDataTo Method | Copy a frame of infrared data to a pre-allocated array, so it can then be written to an optional WriteableBitmap. |
To run a sample you must have the Kinect for Windows SDK installed. To compile a sample, you must have the developer toolkit installed. The latest SDK and developer toolkit are available on the developer download page. If you need help installing the toolkit, look on this page: To Install the SDK and Toolkit. The toolkit includes a sample browser, which you can use to launch a sample or download it to your machine. To open the sample browser, click Start > All Programs > Kinect for Windows SDK [version number] > Developer Toolkit Browser.
If you need help loading a sample in Visual Studio or using Visual Studio to compile, run, or debug, see Opening, Building, and Running Samples in Visual Studio.