Book Image

Kinect for Windows SDK Programming Guide

By : Abhijit Jana
Book Image

Kinect for Windows SDK Programming Guide

By: Abhijit Jana

Overview of this book

Kinect has been a game-changer in the world of motion games and applications since its first release. It has been touted as a controller for Microsoft Xbox but is much more than that. The developer version of Kinect, Kinect for Windows SDK, provides developers with the tools to develop applications that run on Windows. You can use this to develop applications that make interaction with your computer hands-free. This book focuses on developing applications using the Kinect for Windows SDK. It is a complete end to end solution using different features of Kinect for Windows SDK with step by step guidance. The book will also help you develop motion sensitive and speech recognition enabled applications. You will also learn about building application using multiple Kinects.The book begins with explaining the different components of Kinect and then moves into to the setting up the device and getting thedevelopment environment ready. You will be surprised at how quickly the book takes you through the details of Kinect APIs. You will use NUI to use the Kinect for Natural Inputs like skeleton tracking, sensing, speech recognizing. You will capture different types of stream, and images, handle stream event, and capture frame. Kinect device contains a motorized tilt to control sensor angles, you will learn how to adjust it automatically. The last part of the book teaches you how to build application using multiple Kinects and discuss how Kinect can be used to integrate with other devices such as Windows Phone and microcontroller.
Table of Contents (19 chapters)
Kinect for Windows SDK Programming Guide
Credits
About the Author
Acknowledgement
About the Reviewers
www.PacktPub.com
Preface
Index

Create your own joints data point


As we discussed, JointCollection is limited to a maximum of 20 joints as the Kinect for Windows SDK can support a maximum of 20 joints tracks. But if you want to create your own data point (not new joint) for a skeleton joint you can use the following approach where you can first create a skeleton point with respective positions for the x, y, and z axis:

SkeletonPoint position; 
position.X = 1.1f;
position.Y = -1.1f;
position.Z = 1.8f;

Once the position is defined, create a joint point and assign the joint position with the previously created joint point:

Joint joint;
joint.Position = position;
joint.JointType= JointType.Head;
joint.TrackingState = JointTrackingState.Tracked;

In the end assign the joint the value of the respective joint type. As per this example we have assigned the position for the Head joint within collection:

JointCollection collection = new JointCollection();
collection[JointType.Head] = joint;

You can use this approach to set a joint point...