Opening an already recorded file (ONI file) instead of a device
Prior to the Selecting a specific device for accessing depth stream recipe of this chapter we used ANY_DEVICE
as the parameter of the openni::Device::open()
method to open the first device and access its sensors. In the Selecting a specific device for accessing depth stream recipe of this chapter we learned that we can select what device to open by sending its hardware Uri to the openni::OpenNI::open()
method. And in this recipe, we will learn another use of the openni::OpenNI::open()
method.
You will find out how to record data from different sensors of a device to a file in the later sections of the chapter, but now we want to show how to re-open them as an individual device (just like when we open a physical device) and access saved data streams).
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.
You can find a...