Supplemental files and examples for this book can be found at http://examples.oreilly.com/9780735663961-files/. Please use a standard desktop web browser to access these files, as they may not be accessible from all ereader devices.
All code files or examples referenced in the book will be available online. For physical books that ship with an accompanying disc, whenever possible, weve posted all CD/DVD content. Note that while we provide as much of the media content as we are able via free download, we are sometimes limited by licensing restrictions. Please direct any questions or concerns to .
Introduction
The Kinect sensor provides a genuinely new way for a computer to make some sense of the world around it. The fusion of a camera, a directional microphone system, and a depth sensor into a single, mass-market device provides an opportunity for software developers to advance the field of computer interaction in all kinds of exciting ways.
It is now possible to create programs that use the Kinect sensor to create a computer interface with the ability to recognize users and understand their intentions using a natural user interface consisting of gestures and spoken commands. In addition, the devices capabilities have a huge range of possible applications, from burglar alarms to robot controllers.
Start Here! Learn the Kinect API gives you an overview of how the Kinect sensor works and how the Kinect for Windows SDK exposes each of the data sources. The book introduces each of the sensors in the context of solving a well-defined problem. The full source code is provided for each example program. You will also find plenty of ideas for further development of both the sample programs and your own applications.
In addition to an overview of the Kinect for Windows SDK, this book explores the fundamentals of the signals being processed: how video, audio, depth, and 3D skeleton information can be represented in a program. Also included is coverage of specific programming issues that are highly relevant to the creation of programs that deal with large streams of data from sensors, including memory allocation, creating unmanaged code to improve performance, and threading. If you want to learn more about these aspects of program development, you will find good coverage and sample code that works. Although this book doesnt cover every Kinect for Windows SDK, it provides a solid starting point for experimentation and further development.
Who Should Read This Book
This book is intended to be read by C# developers who have a Kinect sensor, either from an Xbox 360 or a Kinect for Windows device, and want to find out how to use the Kinect for Windows SDK to create programs that can process video, sound, and depth views and perform skeleton tracking. If you have an idea for a product based on the Kinect sensor, you can use this book to get a solid grounding in the technologyand you might even be able to use some of the sample code as the basis of your first steps along the road to a working solution.
Assumptions
This book expects that you have a reasonable understanding of .NET development using the C# programming language. You should be familiar with the Visual Studio 2010 development environment and object-oriented programming development.
All the examples are provided in the C# language. It will be helpful (although not required) if you have some experience with Windows Presentation Foundation (WPF) development. In addition, some examples make use of the XNA game development framework. The key development principles important to the development of Kinect software are explained in some detail, so you can use the text to broaden your programming knowledge.
Who Should Not Read This Book
If you have never programmed before, you will not find sufficient background on the C# language to be able to understand the examples. If you want to learn how to use the language, you might consider reading John Muellers Start Here! Learn Microsoft Visual C# 2010 (Microsoft Press, 2011) and/or John Sharps Microsoft Visual C# 2010 Step by Step (Microsoft Press, 2011).
The text of this book provides coverage of the managed code Application Programmer Interface (API) supported by the Kinect for Windows SDK. So if you are a C++ developer who wishes to learn how to interact with the Kinect sensor from unmanaged C++ programs, you will find that the code samples supplied will not provide this information.
Organization of This Book
This book is divided into four sections, each of which builds on the previous section to give you an overview of the Kinect sensor, the Kinect for Windows SDK, and how to create programs that make use of the data. , shows how you can use the Kinect to interact with external devices. This section provides additional programming insight and identifies future directions for exploring this fascinating new sensor.
Conventions and Features in This Book
This book presents information using conventions designed to make the information readable and easy to follow:
Boxed elements with labels such as Note provide additional information or alternative methods for completing a step successfully.
A plus sign (+) between two key names means that you must press those keys at the same time. For example, Press Alt+Tab means that you hold down the Alt key while you press the Tab key.
A vertical bar between two or more menu items (e.g. File | Close), means that you should select the first menu or menu item, then the next, and so on.
System Requirements
You will need the following hardware and software to complete the practice exercises in this book:
Windows 7, 32- or 64-bit version
Visual Studio 2010, any edition (multiple downloads may be required if using Express Edition products)
The Kinect for Windows SDK
Computer that has a 1 GHz or faster processor (2 GHz recommended)
1 GB (32 bit) or 2 GB (64 bit) RAM
3.5 GB of available hard disk space
5,400 RPM hard disk drive
DirectX 9 capable video card running at 1024 x 768 or higher-resolution display
DVD-ROM drive (if installing Visual Studio 2010 from DVD)
Internet connection to download software or chapter examples
Depending on your Windows configuration, you might require local administrator rights to install or configure Visual Studio 2010 and SQL Server 2008 products.
Code Samples
Most of the chapters in this book include exercises that let you interactively try out new material learned in the main text. All the sample projects can be downloaded from the following page:
http://go.microsoft.com/FWLink/?Linkid=252996
Follow the instructions to download the KinectStartHereCompanionContent.zip file.
Installing the Code Samples
Follow these steps to install the code samples on your computer so that you can use them with the exercises in this book:
Unzip the KinectStartHereCompanionContent.zip file that you downloaded from the books website to a directory on your hard drive. Its best to create a directory near the root of your drive, such as C:\KinectExamples.
If prompted, review the displayed end user license agreement. If you accept the terms, select the accept option, and then click Next.