Book Image

Augmented Reality with Kinect

By : Rui Wang
Book Image

Augmented Reality with Kinect

By: Rui Wang

Overview of this book

Microsoft Kinect changes the notion of user interface design. It differs from most other user input controllers as it enables users to interact with the program without touching the mouse or a trackpad. It utilizes motion sensing technology and all it needs is a real-time cameras, tracked skeletons, and gestures. Augmented Reality with Kinect will help you get into the world of Microsoft Kinect programming with the C/C++ language. The book will cover the installation, image streaming, skeleton and face tracking, multi-touch cursors and gesture emulation. Finally, you will end up with a complete Kinect-based game. Augmented Reality with Kinect will help you get into the world of Kinect programming, with a few interesting recipes and a relatively complete example. The book will introduce the following topics: the installation and initialization of Kinect applications; capturing color and depth images; obtaining skeleton and face tracking data; emulating multi-touch cursors and gestures; and developing a complete game using Kinect features. The book is divided in such a way so as to ensure that each topic is given the right amount of focus. Beginners will start from the first chapter and build up to developing their own applications.
Table of Contents (14 chapters)
Augmented Reality with Kinect
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Detecting a face from the camera


Before we start to detect a face in front of the Kinect camera, we should set up the include and library files of the face tracking library. For Visual Studio users, first add ${FTSDK_DIR}/inc to the current include directories of your project, and add ${FTSDK_DIR}/Lib/x86/FaceTrackLib.lib to the additional dependencies. You may also have to manually copy all the files in ${FTSDK_DIR}/Redist/x86 to your executable folder to help find these dynamic library files smoothly.

Now we will work on a Kinect example we have done before, which has already initialized the Kinect context for the new face tracking library that is ready to use.

Detecting and drawing the face rectangle

In this example, we will first detect the position and size of the face.

  1. Include the face tracking library header, and declare some global variables for recording necessary face tracking data.

    #include <FaceTrackLib.h>
    
    IFTFaceTracker* tracker = NULL;
    IFTResult* faceResult = NULL;
    FT_SENSOR_DATA...