Chapter 4. More about Low-level Outputs

In this chapter, we will cover the following recipes:

  • Cropping and mirroring frames right from the buffer
  • Syncing image and depth sensors to read new frames from both streams at the same time
  • Overlaying the depth frame over the image frame
  • Converting the depth unit to millimetre
  • Retrieving the color of the nearest point without depth-over-color registration
  • Enabling/disabling auto exposure and auto white balance

Introduction

Until now we have learned how to request, read, and show outputs of sensors to a user along with how to configure each sensor to give us the desired resolution and pixel format.

But in this chapter, we are going to show you how we can do more customization, including cropping or mirroring the output of an image right from the device or, more importantly, overlaying the depth frame over the image frame.

These enhancements are scattered all over the OpenNI. Here is a list of all the classes with some information about the enhancements that are included with them.

The openni::Device object

This class contains methods to enable and disable depth and image frame syncing and depth-over-image registration. In other words, any enhancements that have an effect on two or more sensors are included with this class.

The openni::VideoStream object

Methods to enable the mirroring of frame data and the cropping of a specific area in frames are part of this class. openni::VideoStream is home to methods that are responsible for customizing each frame of data.

The openni::CoordinateConverter class

If you want to convert the position and value of a depth pixel into the real-world position, distance, or color of that pixel, you need to start using the openni::CoordinateConverter class. This class is a standalone class that contains static methods for these sorts of operations.

The openni::CameraSettings object

openni::CameraSettings can be accessed by the openni::VideoStream object and can only be used with a color sensor. This object lets you activate or deactivate the camera's built-in features, including auto exposure and auto white balance.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.142.194.230