title: Capture RGB from Kinnect with Openni and show with OpenCV
body: <p>I need to capture the color RGB image from a Kinnect camera, but I want to show it in OpenCV as this is only a part of a bigger program. I know OpenCV has compatibility with OpenNI if you set the flag, but although I tried hard CMake couldn't find the path to OpenNI2 so I couldn't build OpenCV with OpenNI. Anyway I think it is good to know how to manually convert OpenNI frames to openCV frames, so I decided to follow this way.</p>
  
  <p>For capturing the color frame in OpenNI I tried the following:</p>
  
  <pre><code>openni::Device device;  
  openni::VideoStream  color;
  openni::VideoFrameRef colorFrame;
  
  rc = openni::OpenNI::initialize();
  rc = device.open(openni::ANY_DEVICE);
  rc = color.create(device, openni::SENSOR_COLOR);
  rc = color.start();
  
  color.readFrame(&amp;colorFrame);
  const openni::RGB888Pixel* imageBuffer = (const openni::RGB888Pixel*)colorFrame.getData();
  </code></pre>
  
  <p>But now I don't understand how to do the conversion to cv::Mat. </p>
  
  <p>Does any anybody manged to do this?</p>