title: RealSense OpenCV Depth Image Too Dark
body: <p>Folks,</p>
  
  <p>I have a realsense SR300, but when I display my depth image in a opencv window, it looks too dark. How can I fix this? When I run the realsense examples the images look good, but the examples use OpenGL. But I need OpenCV for my projects. Here is my code:</p>
  
  <pre><code>int main(int argc, char ** argv)
  {
    // realsense camera setup
    rs::log_to_console(rs::log_severity::warn);
    // Create a context object. This object owns the handles to all connected realsense devices
    rs::context ctx;
    if (ctx.get_device_count() == 0)
    {
      throw std::runtime_error("No device detected. Is it plugged in?");
    }
    // Access the first available RealSense device
    rs::device * dev = ctx.get_device(0);
    // Configure depth to run at VGA resolution at 30 frames per second
    dev-&gt;enable_stream(rs::stream::depth, 640, 480, rs::format::z16, 30);
    rs::intrinsics depth_intrin;
    rs::format depth_format;
    depth_intrin = dev-&gt;get_stream_intrinsics(rs::stream::depth);
    depth_format = dev-&gt;get_stream_format(rs::stream::depth);
    cv::namedWindow("Send Display Image", CV_WINDOW_AUTOSIZE);
  
    /* Set callbacks prior to calling start(). */
    auto depth_callback = [depth_intrin, depth_format](rs::frame f)
    {
      cv::Mat image(cv::Size(640, 480), CV_16UC1,
        (void*)f.get_data(), cv::Mat::AUTO_STEP);
      cv::imshow("Send Display Image", image);
      cv::waitKey(1000/80);
    };
    /* callback to grab depth fream and publish it. */
    dev-&gt;set_frame_callback(rs::stream::depth, depth_callback);
    // Start streaming
    dev-&gt;start();
    While(1)
    {
  
    }
    return 0;
  }
  </code></pre>
  
  <p>I am not sure why my image is so dark. I want it to look something like the kinect or the Xtion when I run openni_launch from ROS</p>