Share via


Color Stream

Kinect for Windows 1.5, 1.6, 1.7, 1.8

Color image data is available at different resolutions and formats. The format determines whether the color image data stream is encoded as RGB, YUV, or Bayer. You may use only one resolution and one format at a time.

The sensor uses a USB connection that provides a given amount of bandwidth for passing data. Your choice of resolution allows you to tune how that bandwidth is used. High-resolution images send more data per frame and update less frequently, while lower-resolution images update more frequently, with some loss in image quality due to compression.

Color data is available in the following formats. Color formats are computed from the same camera data, so all data types represent the same image.

Color Format Description
RGB 32-bit, linear X8R8G8B8-formatted color bitmaps, in sRGB color space. To work with RGB data, specify NUI_IMAGE_TYPE_COLOR or NUI_IMAGE_TYPE_COLOR_YUV for C++ and RgbResolution640x480Fps30 or RgbResolution1280x960Fps12 or YuvResolution640x480Fps15 for managed code when you open a color data stream.
YUV 16-bit, gamma-corrected linear UYVY-formatted color bitmaps, where the gamma correction in YUV space is equivalent to sRGB gamma in RGB space. Because the YUV stream uses 16 bits per pixel, this format uses less memory to hold bitmap data and allocates less buffer memory. To work with YUV data, specify NUI_IMAGE_TYPE_COLOR_RAW_YUV for C++ and RawYuvResolution640x480Fps15 for managed code when you open a color data stream. YUV data is available only at the 640x480 resolution and only at 15 fps.
Bayer 32-bit, linear X8R8G8B8-formatted color bitmaps, in sRGB color space. To work with Bayer data, specify NUI_IMAGE_TYPE_COLOR_RAW_BAYER for C++ and RawBayerResolution1280x960Fps12 or RawBayerResolution640x480Fps30 for managed code when you open a color data stream.

The Bayer formats more closely match the physiology of the human eye by including more green pixels values than blue or red. For more information about Bayer encoding, see the description of a Bayer filter. The Bayer color image data that the sensor returns at 1280x960 is compressed and converted to RGB before transmission to the runtime. The runtime then decompresses the data before it passes the data to your application. The use of compression makes it possible to return color data at frame rates as high as 30 fps, but the algorithm that is used leads to some loss of image fidelity.

Important

There is only one color image stream available per sensor. The infrared image stream is provided by the color image stream, therefore, it is impossible to have a color image stream and an infrared image stream open at the same time on the same sensor.

As there is only one color image stream available per sensor, attempting to open a second color image stream on a given sensor does NOT open a second stream but resets the existing color image stream to the parameters specified in the second open call.

Color Camera Settings

SDK 1.6 implements custom camera settings that allow you to optimize the color camera for your environment. This is done using the ColorCameraSettings class (for managed code) and the INuiColorCameraSettings interface (for native code). While the sensor is initialized for a default environment, you can use this new feature to tune the camera to collect more useful color stream data.

Here are a few examples where this new feature might be used:

  • Low light (or brightly lit).
  • Use hue, brightness, or contrast to improve visual clarity.
  • Use gamma to adjust the way the display appears on certain hardware.

This feature allows the color stream data to be useful across a much broader range of environments. Use the programmability to change the settings as the environment changes.

Note

Be aware that Direct3D and OpenGL use different byte orders. Direct3D (and Kinect for Windows) color data uses ARGB order, where alpha is in the highest-order byte and blue is in the lowest-order byte. OpenGL color data uses BGRA order, where blue is the highest-order byte and alpha is the lowest-order byte. To convert color data between the two formats, you will need to shift from one component order to the other to get the same results.

In This Section