Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
OpenNI Cookbook

You're reading from   OpenNI Cookbook Learn how to write NIUI-based applications and motion-controlled games

Arrow left icon
Product type Paperback
Published in Jul 2013
Publisher Packt
ISBN-13 9781849518468
Length 324 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Soroush Falahati Soroush Falahati
Author Profile Icon Soroush Falahati
Soroush Falahati
Arrow right icon
View More author details
Toc

Table of Contents (14) Chapters Close

OpenNI Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
1. Getting Started FREE CHAPTER 2. OpenNI and C++ 3. Using Low-level Data 4. More about Low-level Outputs 5. NiTE and User Tracking 6. NiTE and Hand Tracking 7. NiTE and Skeleton Tracking Index

Getting a list of all the active users


In this recipe, we are going to cover one of the most basic features of NiTE—recognizing users in the scene based on the depth sensor's data.

Our main goal in this recipe is to present the nite::UserTracker and nite::UserTrackerFrameRef objects and to show you a basic way to retrieve and use them.

Getting ready

Create a project in Visual Studio and prepare it for working with OpenNI and NiTE using the Create a project in Visual Studio 2010 recipe in Chapter 2, OpenNI and C++.

How to do it...

  1. Add the following line to the top of your source code (just below the #include lines):

    #include<conio.h>
  2. Add the ReadLastCharOfLine() and HandleStatus() functions from previous recipes next to the preceding line.

  3. Add the following lines next to the definition of the ReadLastCharOfLine() and HandleStatus() functions:

    bool HandleStatus(nite::Status status)
    {
      return HandleStatus((openni::Status)status);
    }
  4. Then locate this line:

    int _tmain(int argc, _TCHAR* argv[])
    {
  5. Then...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image