Pixel Data Formats
Basler pilot 119
9.3.3 Bayer BG 8 Format (Equivalent to DCAM Raw 8)
When a color camera is set for the Bayer BG 8 pixel data format, it outputs 8 bits of data per pixel
and the pixel data is not processed or interpolated in any way. So, for each pixel covered with a red
lens, you get 8 bits of red data. For each pixel covered with a green lens, you get 8 bits of green
data. And for each pixel covered with a blue lens, you get 8 bits of blue data. (This type of pixel data
is sometimes referred to as "raw" output.)
The "BG" in the name Bayer BG 8 refers to the alignment of the colors in the Bayer filter to the pixels
in the acquired images. For even lines in the images, pixel one will be blue, pixel two will be green,
pixel three will be blue, pixel four will be green, etc. For odd lines in the images, pixel one will be
green, pixel two will be red, pixel three will be green, pixel four will be red, etc.
The tables below describe how the data for the even lines and for the odd lines of a received frame
will be ordered in the image buffer in your PC when the camera is set for Bayer BG 8 output.
The following standards are used in the tables:
P
0
= the first pixel transmitted by the camera for a line
P
n
= the last pixel transmitted by the camera for a line
B
0
= the first byte of data for a line
B
m
= the last byte of data for a line
Even Lines Odd Lines
Byte Data Byte Data
B
0
Blue value for P
0
B
0
Green value for P
0
B
1
Green value for P
1
B
1
Red value for P
1
B
2
Blue value for P
2
B
2
Green value for P
2
B
3
Green value for P
3
B
3
Red value for P
3
B
4
Blue value for P
4
B
4
Green value for P
4
B
5
Green value for P
5
B
5
Red value for P
5
² • ² •
² • ² •
² • ² •
B
m-5
Blue value for P
n-5
B
m-5
Green value for P
n-5
B
m-4
Green value for P
n-4
B
m-4
Red value for P
n-4
B
m-3
Blue value for P
n-3
B
m-3
Green value for P
n-3
B
m-2
Green value for P
n-2
B
m-2
Red value for P
n-2
B
m-1
Blue value for P
n-1
B
m-1
Green value for P
n-1
B
m
Green value for P
n
B
m
Red value for P
n