Bayer Demosaicing

In literature different algorithms for interpolation of an color image from a Bayer Pattern image (Bayer demosaicing) exist. In this section we give several examples of such algorithms. In the following table they are summarized:

Algorithm Description Example
“Nearest Neighbor filter" according to [Ada95] 'Nearest Neighbor Demosaicing'
“Bayer3x3filter" bilinear interpolation; based on VisualApplets operator BAYER3x3Linear 'Bayer 3x3 Demosaicing'
“Bayer3x3filter" with white balancing bilinear interpolation; based on VisualApplets operator BAYER3x3Linear with additional white balancing 'Bayer 3x3 Demosacing with White Balancing'
“Bayer5x5filter" bilinear interpolation; based on VisualApplets operator BAYER5x5Linear 'Bayer 5x5 Demosaicing'
“Bayer5x5filter" with white balancing bilinear interpolation; based on VisualApplets operator BAYER5x5Linear with additional white balancing 'Bayer 5x5 Demosacing with White Balancing'
"Laplace filter" edge sensitive 'Edge Sensitive Bayer Demosaicing Algorithm'
"Original Laroche filter" according to [Lar94] 'Bayer Demosaicing Algorithm According to Laroche'
"Modified Laroche filter" according to [Lar94]; modified 'Modified Laroche Bayer Demosaicing Algorithm '
"Bilinear Bayer Red/BlueFollowedByGreen GreenFollowedByBlue/Red" according to [Bas13] 'Bayer Demosaicing For Bilinear Line Scan Cameras with Color Pattern Red/BlueFollowedByGreen GreenFollowedByBlue/Red '
"Bilinear Bayer Red/BlueFollowedByBlue/Red GreenFollowedByGreen" 'Bayer Demosaicing For Bilinear Line Scan Cameras with Color Pattern RedFollowedByBlue GreenFollowedByGreen '
"Bayer Demosaicing a Line Scan Camera with 8 Bit BiColor Bayer Pattern" Demosaicing an 8 bit Bayer RAW pattern of a racer 2 L CXP line scan camera with BiColor Bayer pattern: BiColorRGBG, BiColorGRGB, BiColorBGRG and BiColorGBGR 'Bayer Demosaicing a Line Scan Camera with 8 Bit BiColor Bayer Pattern'
"Bayer Demosaicing a Line Scan Camera with 10 Bit BiColor Bayer Pattern)" Demosaicing a 10 bit Bayer RAW pattern of a racer 2 L CXP line scan camera with BiColor Bayer pattern: BiColorRGBG, BiColorGRGB, BiColorBGRG and BiColorGBGR 'Bayer Demosaicing a Line Scan Camera with 10 Bit BiColor Bayer Pattern'
"Bayer Demosaicing a Line Scan Camera with 12 Bit BiColor Bayer Pattern" Demosaicing a 12 bit Bayer RAW pattern of a racer 2 L CXP line scan camera with BiColor Bayer pattern: BiColorRGBG, BiColorGRGB, BiColorBGRG and BiColorGBGR 'Bayer Demosaicing a Line Scan Camera with 12 Bit BiColor Bayer Pattern'

Table 20. List of Bayer Demosaicing Examples


The algorithms named above are explained in detail in the corresponding sections. Here we give a short overview on the qualitative results obtained with the different demosaicing methods for an artificial test image (Figure 275, 'Artificial test image').

Artificial test image

Figure 275. Artificial test image


The following figures show closer details on single structures. From left to right for: a) the "original Laroche filter" [Lar94], b) the "modified Laroche filter", c) the "Laplace filter", d) the “Bayer5x5filter", e) the nearest neighbor interpolation method and for f) the “Bayer3x3filter":

Straight edge

Figure 276. Straight edge


Diagonal edge

Figure 277. Diagonal edge


Curved edge

Figure 278. Curved edge


Periodic structure

Figure 279. Periodic structure


For the artificial test image the "original Laroche filter" shows the best subjective result according to zipper- and false color effects. The "modified Laroche filter" has light zipper effects and is comparable to the "Laplace filter". For the “Laplace filter" in addition many false color pixel appear at curved and diagonal edges. The “Bayer5x5filter" shows strong zipper effects, whereas the “Nearest Neighbor filter" shows strong false color effects. For straight edges strong zipper effects appear here. All edges appear blurry with the "Bayer3x3filter".

Attention: The "original Laroche filter" is not always the best solution for Bayer demosaicing! It has no or very few zipper effects for an artificial test image but may have those for a noisy Bayer RAW image. During research we found, that the filtering algorithm is influenced by the noise.The "modified Laroche" filter" has zipper effects for the artificial test image but only light zipper effects for a noisy Bayer RAW image. Here the filtering algorithm is less than the "original Laroche filter" filter influenced by the noise. Also the "Laplace filter" has zipper effects for the artificial test image but no zipper effects for a noisy Bayer test image. False color effects appear here in addition. In a consequence you have to choose, which Bayer demosaicing algorithm is the best for your special purpose.