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

OpenNI class and error handling

We will show how to create and initialize a context object in C++ and how to use the openni::Status datatype to handle errors thrown by OpenNI core. We will use openni::Status very often in the later recipes and it is a very important part of any successful application.

In this recipe, we try to show the version number of the current OpenNI environment and then initialize the OpenNI framework. This will ask OpenNI to search for any connected device and load their modules and drivers.

Getting ready

Create a project in Visual Studio 2010 and prepare it for working with OpenNI using the Creating a project in Visual Studio 2010 recipe in this chapter.

How to do it...

Have a look at the following steps:

  1. Open your project ...

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