Quick viewing(Text Mode)

Tech Note: RGB Primary Color Mosaic Filters

Tech Note: RGB Primary Color Mosaic Filters

Tech Note: RGB Primary Mosaic Filters

A common technique to give color sensitivity to a & is the application of a color mosaic filter on top of the sensor. In most cases a three-color -- (RGB) pattern is used. The In-Sight 1000C color sensor uses a Bayer pattern as its RGB color mosaic filter pattern. With the Bayer pattern, each is covered by a specific color filter, in a specific pattern. Half of the total number of are green (G), while a quarter of the total number is assigned to both red (R) and blue (B), as follows:

Figure 1: Bayer Pattern Example

Each color pixel is composed of three separate color components: red, green and blue. The missing , 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. Following are examples of how the values for all three color components are calculated for a single pixel.

R 1 (78)

B1 G1 B2 (42) (218) (48) R 2 (82)

Figure 2: Color Component Calculation – Example 1

The values for each color component of pixel G1 are: + RR + 8278 § Red component value = 21 = = 80 2 2

§ Green component value = the value of G1 = 218 + BB + 4842 § Blue component value = 21 = = 45 2 2

In this example, the values of the RGB components for the above pixel are (80,218,45).

R G R 1 2 3 (236) (218) (242)

G1 B2 G3 B1 (218) (60) (222) R G R 2 4 4 (238) (222) (244)

Figure 3: Color Component Calculation – Example 2

If output values were given to each pixel, then the values for each color component of pixel B2 are: +++ RRRR +++ 244242238236 § Red component value = 4321 = = 240 4 4 +++ GGGG +++ 222222218218 § Green component value = 4321 = = 220 4 4

§ Blue component value = the value of B2 = 60 In this example, the values of the RGB components for the above pixel are (240,220,60).