The sensor used in color models of the camera is equipped with an additive color separation filter
known as a Bayer filter. The pixel data output formats available on color cameras are related to the
Bayer pattern, so you need a basic knowledge of the Bayer filter to understand the pixel formats.
With the Bayer filter, each individual pixel is covered by a micro-lens that allows light of only one
color to strike the pixel. The pattern of the Bayer filter used on the camera is as shown in Figure 37
(the alignment of the Bayer filter with repect to the sensor is shown as an example only; the figure
shows the "BG" filter alignment). Asthe figure illustrates, within each square of four pixels, one pixel
sees only red light, one sees onlyblue light, and two pixels see only green light. (This combination
mimics the human eye’s sensitivity to color.)
(不知道怎么把图片传上来,图片在空间的博客文章用图 - BayerBG.jpg)
Bayer GB alignment means that pixel zero and pixel one of the first line in each image transmitted
will be green and blue respectively. And for the second linetransmitted, pixel zero and pixel one will
be red and green respectively. Since the pattern ofthe Bayer filter is fixed, you can use this
information to determine the color of all of the other pixels in the image.
Bayer BG alignment means that pixel zero and pixel one of the first line in each image transmitted
will be blue and green respectively. And for the second linetransmitted, pixel zero and pixel one will
be green and red respectively. Since the pattern ofthe Bayer filter is fixed, you can use this
information to determine the color of all of the other pixels in the image.