Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Augmented Reality with Kinect
Augmented Reality with Kinect

Augmented Reality with Kinect: If you know C/C++ programming, then this book will give you the ability to develop augmented reality applications with Microsoft's Kinect. By the end of the course you will have created a complete game.

By Rui Wang
$18.99 $12.99
Book Jul 2013 122 pages 1st Edition
eBook
$18.99 $12.99
Print
$38.99
Subscription
$15.99 Monthly
eBook
$18.99 $12.99
Print
$38.99
Subscription
$15.99 Monthly

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Buy Now

Product Details


Publication date : Jul 11, 2013
Length 122 pages
Edition : 1st Edition
Language : English
ISBN-13 : 9781849694384
Vendor :
Microsoft
Category :
Table of content icon View table of contents Preview book icon Preview Book

Augmented Reality with Kinect

Chapter 1. Getting Started with Kinect

Before the birth of Microsoft Kinect, few people were familiar with the technology of motion sensing. Similar devices have been invented and developed originally for monitoring aerial and undersea aggressors in wars. Then in the non-military cases, motion sensors are widely used in alarm systems, lighting systems and so on, which could detect if someone or something disrupts the waves throughout a room and trigger predefined events. Although radar sensors and modern infrared motion sensors are used more popularly in our life, we seldom notice their existence, and can hardly make use of these devices in our own applications.

But Kinect changed everything from the time it was launched in North America at the end of 2010. Different from most other user input controllers, Kinect enables users to interact with programs without really touching a mouse or a pad, but only through gestures. In a top-level view, a Kinect sensor is made up of an RGB camera, a depth sensor, an IR emitter, and a microphone array, which consists of several microphones for sound and voice recognition. A standard Kinect (for Windows) equipment is shown as follows:

The Kinect device

The Kinect drivers and software, which are either from Microsoft or from third-party companies, can even track and analyze advanced gestures and skeletons of multiple players. All these features make it possible to design brilliant and exciting applications with handsfree user inputs. And until now, Kinect had already brought a lot of games and software to an entirely new level. It is believed to be the bridge between the physical world we exist in and the virtual reality we create, and a completely new way of interacting with arts and a profitable business opportunity for individuals and companies.

In this book, we will try to make an interesting game with the popular Kinect technology for user inputs, with the major components explained gradually in each chapter. As Kinect captures the camera and depth images as video streams, we can also merge this view of our real-world environment with virtual elements, which is called Augmented Reality (AR). This enables users to feel as if they appear and live in a nonexistent world, or something unbelievable exists in the physical earth.

In this chapter, we will first introduce the installation of Kinect hardware and software on personal computers, and then consider a good enough idea compounded of Kinect and augmented reality elements, which will be explained in more detail and implemented in the following chapters.

Note

Before installing the Kinect device on your PCs, obviously you should buy Kinect equipment first. In this book, we will depend on Kinect for Windows or Kinect for Xbox 360, which can be learned about and bought at:

http://www.microsoft.com/en-us/kinectforwindows/

http://www.xbox.com/en-US/kinect

Please note that you don't need to buy an Xbox 360 at all. Kinect will be connected to PCs so that we can make custom programs for it. An alternative choice is Kinect for Windows, which is located at:

http://www.microsoft.com/en-us/kinectforwindows/purchase/

The uses and developments of both will be of no difference for our cases.

Installation of Kinect


It is strongly suggested that you have a Windows 7 operating system or higher. It can be either 32-bit or 64-bit and with dual-core or faster processors.

Note

Linux developers can also benefit from third-party drivers and SDKs to manipulate Kinect components, which will be introduced in the Appendix, Where to Go from Here, of this book.

Before we start to discuss the software installation, you can download both the Microsoft Kinect SDK and the Developer Toolkit from:

http://www.microsoft.com/en-us/kinectforwindows/develop/developer-downloads.aspx

In this book, we prefer to develop Kinect-based applications using Kinect SDK Version 1.5 (or higher versions) and the C++ language. Later versions should be backward compatible so that the source code provided in this book doesn't need to be changed.

Setting up your Kinect software on PCs

After we have downloaded the SDK and the Developer Toolkit, it's time for us to install them on the PC and ensure that they can work with the Kinect hardware. Let's perform the following steps:

  1. Run the setup executable with administrator permissions. Select I agree to the license terms and conditions after reading the License Agreement.

    The Kinect SDK setup dialog

  2. Follow the steps until the SDK installation has finished. And then, install the toolkit following similar instructions.

  3. The hardware installation is easy: plug the ends of the cable into the USB port and a power point, and plug the USB into your PC. Wait for the drivers to be found automatically.

  4. Now, start the Developer Toolkit Browser, choose Samples: C++ from the tabs, and find and run the sample with the name Skeletal Viewer.

  5. You should be able to see a new window demonstrating the depth/skeleton/color images of the current physical scene, which is similar to the following image:

    The depth (left), skeleton (middle), and color (right) images read from Kinect

Why did I do that?

We chose to set up the SDK software at first so that it will install the motor and camera drivers, the APIs, and the documentations, as well as the toolkit including resources and samples onto the PC. If the operation steps are inversed, that is, the hardware is connected before installing the SDK, your Windows OS may not be able to recognize the device. Just start the SDK setup at this time and the device should be identified again during the installation process.

But before actually using Kinect, you still have to ensure there is nothing between the device and you (the player). And it's best to keep the play space at least 1.8 m wide and about 1.8 m to 3.6 m long from the sensor. If you have more than one Kinect device, don't keep them face-to-face as there may be infrared interference between them.

Note

If you have multiple Kinects to install on the same PC, please note that one USB root hub can have one and only one Kinect connected. The problem happens because Kinect takes over 50 percent of the USB bandwidth, and it needs an individual USB controller to run. So plugging more than one device on the same USB hub means only one of them will work.

The depth image at the left in the preceding image shows a human (in fact, the author) standing in front of the camera. Some parts may be totally black if they are too near (often less than 80 cm), or too far (often more than 4 m).

Note

If you are using Kinect for Windows, you can turn on Near Mode to show objects that are near the camera; however, Kinect for Xbox 360 doesn't have such features.

You can read more about the software and hardware setup at:

http://www.microsoft.com/en-us/kinectforwindows/purchase/sensor_setup.aspx

The idea of the AR-based Fruit Ninja game


Now it's time for us to define the goal we are going to achieve in this book. As a quick but practical guide for Kinect and augmented reality, we should be able to make use of the depth detection, video streaming, and motion tracking functionalities in our project. 3D graphics APIs are also important here because virtual elements should also be included and interacted with irregular user inputs (not common mouse or keyboard inputs).

A fine example is the Fruit Ninja game, which is already a very popular game all over the world. Especially on mobile devices like smartphones and pads, you can see people destroy different kinds of fruits by touching and swiping their fingers on the screen.

With the help of Kinect, our arms can act as blades to cut off flying fruits, and our images can also be shown along with the virtual environment so that we can determine the posture of our bodies and position of our arms through the screen display.

Unfortunately, this idea is not fresh enough for now. Already, there are commercial products with similar purposes available in the market; for example:

http://marketplace.xbox.com/en-US/Product/Fruit-Ninja-Kinect/66acd000-77fe-1000-9115-d80258410b79

But please note that we are not going to design a completely different product here, or even bring it to the market after finishing this book. We will only learn how to develop Kinect-based applications, work in our own way from the very beginning, and benefit from the experience in our professional work or as an amateur. So it is okay to reinvent the wheel this time, and have fun in the process and the results.

Summary


Kinect, which is a portmanteau of the words "kinetic" and "connect", is a motion sensor developed and released by Microsoft. It provides a natural user interface (NUI) for tracking and manipulating handsfree user inputs such as gestures and skeleton motions. It can be considered as one of the most successful consumer electronics device in recent years, and we will be using this novel device to build the Fruit Ninja game in this book.

We will focus on developing Kinect and AR-based applications on Windows 7 or higher using the Microsoft Kinect SDK 1.5 (or higher) and the C++ programming language. Mainly, we have introduced how to install Kinect for Windows SDK in this chapter. Linux and Mac OS X users can first read the Appendix, Where to Go from Here, which provides an alternative method to call Kinect functionalities on other systems. Developers of .NET, processing, or other language tools may also find useful resources in the last chapter of this book.

In the next chapter, we will learn how to start and shut down the Kinect device in our applications, and prepare a basic framework for further development.

Left arrow icon Right arrow icon

Key benefits

  • Understand all major Kinect API features including image streaming, skeleton tracking and face tracking
  • Understand the Kinect APIs with the help of small examples
  • Develop a comparatively complete Fruit Ninja game using Kinect and augmented Reality techniques

Description

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.

What you will learn

Install a Kinect device and SDK packages on your computer Initialize Kinect with C++ APIs in your own application Obtain image streaming data from color and depth cameras Acquire skeleton data and face tracking results for use Use hand positions to emulate multi-touch cursors and gestures Develop a Fruit Ninja game with different Kinect functionalities Study with simple and interesting examples using a uniform OpenGL framework Find more open source and commercial resource on the Web

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Buy Now

Product Details


Publication date : Jul 11, 2013
Length 122 pages
Edition : 1st Edition
Language : English
ISBN-13 : 9781849694384
Vendor :
Microsoft
Category :

Table of Contents

14 Chapters
Augmented Reality with Kinect Chevron down icon Chevron up icon
Credits Chevron down icon Chevron up icon
About the Author Chevron down icon Chevron up icon
About the Reviewers Chevron down icon Chevron up icon
www.PacktPub.com Chevron down icon Chevron up icon
Preface Chevron down icon Chevron up icon
Getting Started with Kinect Chevron down icon Chevron up icon
Creating Your First Program Chevron down icon Chevron up icon
Rendering the Player Chevron down icon Chevron up icon
Skeletal Motion and Face Tracking Chevron down icon Chevron up icon
Designing a Touchable User Interface Chevron down icon Chevron up icon
Implementing the Scene and Gameplay Chevron down icon Chevron up icon
Where to Go from Here Chevron down icon Chevron up icon
Index Chevron down icon Chevron up icon

Customer reviews

Filter icon Filter
Top Reviews
Rating distribution
Empty star icon Empty star icon Empty star icon Empty star icon Empty star icon 0
(0 Ratings)
5 star 0%
4 star 0%
3 star 0%
2 star 0%
1 star 0%

Filter reviews by


No reviews found
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.