O'Reilly logo

OpenNI Cookbook by Soroush Falahati

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Recognizing predefined hand gestures

In this recipe, we are going to request a search for all the three predefined hand gestures and wait for new data. These predefined hand gestures are the Hand Raise Gesture, Click Gesture, and Wave Gesture. Check whether any of these three hand gestures are recognized in the scene and write this info to the console.

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 these lines to the top of your source code (just below the #include lines):
    #include<conio.h> char ReadLastCharOfLine() { int newChar = 0; int lastChar; fflush(stdout); do { lastChar = newChar; newChar ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required