Let's say we want to retrieve the color of a pixel from its depth position but don't want to register the whole depth frame to the color frame. In this case, we can use the
openni::CoordinateConverter class to get the position of the related depth pixel in the color frame; then, using the returned coordinates, we can get the color of this pixel. In this recipe, we try to find the nearest pixel in the depth frame and then show the color of this pixel from the color frame.
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++.