Academic Company Events Community Support Solutions Products & Services Contact NI MyNI
1 ratings:
 3 out of 5   

Archived: Color Camera Shows Black and White Images in Measurement & Automation Explorer (MAX)

This document has been archived and is no longer updated by National Instruments

Primary Software:
Primary Software Version: 2.0
Primary Software Fixed Version: N/A
Secondary Software: N/A

I have a color camera. I try to acquire images in Measurement & Automation Explorer (MAX) and can do so, however, the image is a black and white image. I try to change the video mode on the acquisition, but the only options I have are 8-bit monochrome and 16-bit monochrome. Why can I not acquire color images in MAX?

Although the camera does in fact have a color sensor, it may be returning the images in a Bayer-encoded format. To determine if the image is encoded, zoom in on the image. Generally, the image will appear as though it has a checkerboard pattern. The example images below illustrate this.

Original image
Original image

Magnified view of the lower-right corner exhibiting checkerboard pattern
Zoomed In

Original image after Bayer decoding
Bayer decoded image

Bayer encoding allows cameras to transmit color data in a 8-bit or 16-bit monochrome format. This is why these are the only modes that are available in MAX.

Bayer decoding for NI-IMAQ framegrabbers (Analog, CameraLink, and Parallel Digital) is not supported in MAX. The decode process must be performed using the IMAQ Bayer functions in LabVIEW, C++, or Visual Basic. The following example programs illustrate how to accomplish Bayer decoding:

Developer Zone Example: Bayer Examples
Developer Zone Example: IMAQ Snap Examples

If you are using a Firewire camera, starting with version 2.0 of IMAQ for IEEE 1394, the driver will be able to Bayer decode the image in MAX internally and just return a color image with no additional programming.

NOTE: Some Bayer cameras will translate the monochrome data to color RGB on-camera, and therefore MAX will read the images in color.  This option depends on the camera itself.

For more information on Bayer encoding, please refer to the Related Links section.

Related Links:
Developer Zone Tutorial: Bayer Encoding for Color Images
Developer Zone Example: Bayer Examples
Developer Zone Example: IMAQ Snap Examples


Report Date: 01/05/2005
Last Updated: 06/10/2009
Document ID: 3H4F8GL6

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
  1 2 3 4 5
Please Contact NI for all product and support inquiries.submit