Enabling/disabling auto exposure and auto white balance
Image sensor has built-in auto exposure and auto white balance. In this recipe, we are going to show you how we can change the image sensor's settings to change the active state of these features.
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 of Chapter 2, OpenNI and C++.
Then, copy the code from the Reading and showing a frame from the image sensor (color/IR) recipe of Chapter 3, Using Low-level Data, to this project.
How to do it...
Locate the following lines of code:
void gl_KeyboardCallback(unsigned char key, int x, int y) {
Replace any code inside this function with the following code snippet:
if (key == 27) // ESC Key { selectedSensor.destroy(); device.close(); OpenNI::shutdown(); exit(0); } else if (key == 'C' || key == 'c') { if (device.isValid()) { printf("\r\n-->Setting active sensor to...