Instruction manual
Description of the data path
MARLIN Technical Manua
l
Page 53
8.8 Color interpolation and correction
In the sensors, used color information is captured via the primary color filters placed over the
individual pixels in a ”BAYER mosaic” layout. An effective Bayer -> RGB color interpolation
already takes place in all Marlin color version cameras. Before converting to the YUV format, color
correction is done after Bayer demosaicing.
8.8.1 Interpolation (BAYER demosaicing)
In interpolation a red, green or blue value is determined for each pixel. Only two lines are
needed for this interpolation:
R1 G1 R2 G2
G3
B1
G4
B2
P1 P2 P3
Input:
Output:
Figure 35: Bayer demosaicing (interpolation)
11
2
31
1
11
BP
GG
P
RP
blue
green
red
=
+
=
=
12
2
41
2
22
BP
GG
P
RP
blue
green
red
=
+
=
=
23
2
42
3
23
BP
GG
P
RP
blue
green
red
=
+
=
=
Color cameras begin outputting the image in line two and finish in line Y (maximum image
height minus two). This is a side effect of BAYER demosaicing. The adjustable maximum image
height is also two lines less than in the b/w variant.
Please note that on the color camera, a black border one pixel wide forms on the left and
right image borders. This is also a consequence of BAYER demosaicing as the image width
displayed on the color camera is not
scaled down.