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...
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 = getchar(); } while ((newChar != '\n') && (newChar != EOF)); return (char)lastChar; } bool HandleStatus(nite::Status status) { if (status == nite::STATUS_OK) return true; printf("ERROR: #%d...