Pixel Data Formats
Basler pilot 127
9.3.7 Bayer BG 12 Packed Format
When a color camera is set for the Bayer BG 12 Packed pixel dataformat, it outputs 12 bits of data
per pixel. Every three bytes transmitted by the camera contain data for two pixels.
With the Bayer BG 12 Packed coding, the pixel data is not processed or interpolated in any way.
So, for each pixel covered with a red lens in the sensor’s Bayer filter, you get 12 bits of red data.
For each pixel covered with a green lens in the filter, you get 12 bits of green data. And for each
pixel covered with a blue lens in the filter, you get 12 bits of blue data. (This type of pixel data is
sometimes referred to as "raw" output.)
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 BG12 Packed
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
Byte Data
B
0
Blue value for P
0
bits 11 ... 4
B
1
Green value for P
1
bits 3 ... 0 Blue value for P
0
bits 3 ... 0
B
2
Green value for P
1
bits 11 ... 4
B
3
Blue value for P
2
bits 11 ... 4
B
4
Green value for P
3
bits 3 ... 0 Blue value for P
2
bits 3 ... 0
B
5
Green value for P
3
bits 11 ... 4
B
6
Blue value for P
4
bits 11 ... 4
B
7
Green value for P
5
bits 3 ... 0 Blue value for P
4
bits 3 ... 0
B
8
Green value for P
5
bits 11 ... 4
• •
• ••
• •
B
m-5
Blue value for P
n-3
bits 11 ... 4
B
m-4
Green value for P
n-2
bits 3 ... 0 Blue value for P
n-3
bits 3 ... 0
B
m-3
Green value for P
n-2
bits 11 ... 4
B
m-2
Blue value for P
n-1
bits 11 ... 4
B
m-1
Green value for P
n
bits 3 ... 0 Blue value for P
n-1
bits 3 ... 0
B
m
Green value for P
n
bits 11 ... 4