top of page

Color Image Acquisition

Sam Liebo - Lead Applications Engineer

February 2019

 

A common misconception about color image acquisition is that each pixel sees every color (red, green, and blue). This is not the case with standard color sensors. A common technique to give color sensitivity to a black & white image sensor is the application of a color mosaic filter on top of the sensor. This has some negative effects on image quality. All else equal, your effective resolution and edge quality will be lower with a color image when compared to a monochrome image.

Bayer Pattern The most common mosaic filter is a Bayer pattern. With the Bayer pattern, each pixel is covered by a specific color filter, in a specific pattern. Half of the total number of pixels are green (G), while a quarter of the total number is assigned to both red (R) and blue (B).


 

Each color pixel is composed of three separate color components: red, green and blue. The missing colors, for each pixel, are interpolated using the surrounding pixels at each location. For example, if a pixel is filtered for green, the value for the green component is known, but the values of the red and the blue components must be calculated from the average value of surrounding red-filtered and blue-filtered pixels. Through software interpolation, each pixel is assigned a value from 0 to 255 for the two unknown color components. The following are examples (courtesy of Cognex) of how the values fo