This Kinect for Windows v2 tutorial series will help you build an interactive Kinect app using Visual Studio and C#. You are expected to have basic experience with C# and know your way around Visual Studio. Throughout the series, you will learn how to set up your Kinect for Windows v2 sensor and dev environment, how to track skeletons and hand positions, how to manipulate the data from the colour and infrared sensors and the microphone array, how to recognize hand gestures, and how to put it all together in a deployable Windows app.
Level: Beginner to Intermediate
Welcome to part one of the Kinect With Me Kinect for Windows v2 Development series! In this first post I will introduce the Kinect v2 sensor and show you how to set up your development environment to get you started developing for Kinect for Windows v2.
First things first: Why Kinect v2?
You may recognize this sensor as the eyes and ears of the Xbox One, and you're right: Kinect for Windows v2 offers the same skeletal tracking quality and recognition as Kinect for Xbox One. In fact, the recently-announced Kinect Adapter for Windows allows you to use your Xbox One sensor with the Windows SDK! The sensor consists of a colour camera, infrared sensor, and microphone array, and can track up to six bodies with 25 skeletal joints each, including up to two bodies with recognized hand state. This is a significant improvement upon the capabilities of the original Kinect for Windows sensor, but we're not going to discuss the evolution of Kinect in this series. If you are interested in how v2 improves upon v1, you can read about it in this post.
Let's Get Started! You'll need…
- Visual Studio 2013
- Kinect for Windows v2 sensor (or Xbox One Kinect sensor with adapter)
Installing the SDK
- To start, ensure your Kinect sensor is unplugged from your computer.
- Download and install the Kinect for Windows v2 SDK from the Kinect site.
- Remove any other drivers for the Kinect sensor.
- Close Visual Studio. You must close Visual Studio before installing the SDK and then restart it after installation to pick up environment variables that the SDK requires.
- From the download location, double-click on KinectSDK-v2.0-PublicPreview1409-Setup.exe. This single installer works for both 32-bit and 64-bit Windows.
- Once the SDK has completed installing successfully, ensure the Kinect sensor is plugged into an external power source and then plug the Kinect sensor into the PC's USB port. The drivers will load automatically.
- The Kinect sensor should now be working correctly.
- Run the SDK Browser, which contains source code samples, tools, and other valuable development resources that simplify developing Kinect for Windows applications.
Preparing Your Dev Environment
Once the Kinect SDK is installed and the SDK Browser is working, your system is ready to start producing apps. For this series we'll be we'll start off with a blank C#/XAML app for Windows.
The first thing you want to do before getting into the code is prepare the app so it can use the sensor. There are three things you need to do:
1. Change the platform from "Any Platform" to x86
Build > Configuration Manager > Platform > x86
2.Allow the app to use the computer's webcam and microphone
Package.appxmanifest > Capabilities > Check boxes for Microphone and Webcam
3.Add a reference to WindowsPreview.Kinect
Right click on References > Add Reference > Windows 8.1 > Extensions > WindowsPreview.Kinect
And that's it! You're now ready to start developing with Kinect. Next week we'll start with skeletal tracking and overlaying shapes on the body in real time. If you can't wait to start developing, Ben Lower and Rob Relyea have a great introductory course on MVA: Programming Kinect for Windows v2 Jump Start.
Thanks for Kinecting with me! See you next week for Part 2 of this tutorial series.