Advanced Bayer Conversion
Albeit simple in computation, the bi-linear interpolation described above is prone to image blur and spurious hue corruption where abrupt color changes occur in the image. The images in Figure 7 illustrate this effect.
Figure 7. Bi-linear Interpolation of Bayer Image
In order to improve the resulting image quality an adaptive interpolation algorithm must be employed. Here, a 5×5 grid is used to estimate the missing pixel colors. Consider the Bayer pattern in Figure 8.
Figure 8. 5×5 Bayer Pattern Grid
First, a horizontal laplacian is determined using the following equation.

Secondly, a corresponding vertical laplacian is determined using the following equation.

Using these horizontal and vertical metrics the interpolation algorithm is adapted according to the following rules.

A similar algorithm is applied to the remaining mosaic colors. These rules determine a pixel location in which a color change has taken place and adapts the interpolation accordingly. The result of this adaptation on the output image quality can be seen below in Figures 9(a), (b) and (c). The adaptive algorithm greatly reduces the blur and hue effect.
Figure 9. Comparison of Bi-linear and Adaptive Algorithms
In order to execute the algorithm efficiently in an FPGA, careful computation pipelining is necessary. This is achieved to balance device resources with computation time. The resulting algorithm produces excellent image quality results while using minimum on-chip memory and logic elements.
NEXT:A Camera Front-End IP
Page 4: next page






