
HIGH-QUALITY LINEAR INTERPOLATION
FOR DEMOSAICING OF BAYER-PATTERNED COLOR IMAGES
Henrique S. Malvar, Li-wei He, and Ross Cutler
Microsoft Research
One Microsoft Way, Redmond, WA 98052, USA
ABSTRACT
This paper introduces a new interpolation technique for demo-
saicing of color images produced by single-CCD digital cameras.
We show that the proposed simple linear filter can lead to an
improvement in PSNR of over 5.5 dB when compared to bilinear
demosaicing, and about 0.7 dB improvement in R and B interpo-
lation when compared to a recently introduced linear interpola-
tor. The proposed filter also outperforms most nonlinear demo-
saicing algorithms, without the artifacts due to nonlinear process-
ing, and a much reduced computational complexity.
1. INTRODUCTION
Digital cameras are quite popular today; many users are switch-
ing away from regular film photography. For cost reduction,
most digital cameras use a single charge-coupled device (CCD)
sensor, with the CCD pixels preceded in the optical path by a
color filter array (CFA) in a Bayer mosaic pattern, as shown in
Fig. 1. For each 2×2 set of pixels, two diagonally opposed pixels
have green filters, and the other two have red and blue filters.
Since G carries most of the luminance information for humans,
its sampling rate is twice that of R and B.
We call demosaicing the problem of interpolating back the
image captured with a CFA, so that for every CCD pixel we can
associate a full RGB value. The simplest approach to demo-
saicing is bilinear interpolation [1]–0, in which the three color
planes are independently interpolated using symmetric bilinear
interpolation from the nearest neighbors of the same color. As
expected, bilinear interpolation generates significant artifacts,
especially across edges and other high-frequency content, since it
doesn’t take into account the correlation among the RGB values.
Practical demosaicing algorithms take such correlation into ac-
count, either with better linear filters [4], or with nonlinear filters
that adapt interpolation smoothness to a measure of image activ-
ity or edginess [1]–0.
In this paper we present a simple linear demosaicing filter,
with better performance and lower complexity than that in [4].
Our filter also outperforms many nonlinear algorithms. In Sec-
tion 2 we quickly review some of the techniques proposed for
improved demosaicing performance, and in Section 3 we present
our new linear filter. Performance comparisons and conclusions
are presented in Sections 4 and 5, respectively.
2. BEYOND BILINEAR DEMOSAICING
Referring to Fig. 1, in bilinear demosaicing the green value g(i,j)
at a pixel position (i,j) that falls in a red or blue pixel, is com-
puted by the average of the neighboring green values in a cross
pattern:
( , ) {(0, 1), (0,1), ( 1,0), (1,0)}
1
ˆ
(, ) ( , )
4
mn
ij gi mj n
=− −
=++
∑
(1)
which corresponds to estimating the green value at the pixel
marked ‘+’ in Fig. 1 as the average of the observed green values
marked ‘
·’. At image boundaries, only pixels that fall within the
image are included, and the scaling adjusted. For the R and B
colors the same equation applies (with a diagonal cross pattern),
except that for pixel positions (i,j) that fall in a green pixel only
two red neighboring values are averaged to produce an interpo-
lated red value; the same holds for blue. Besides the computa-
tional simplicity of (1), its output value is guaranteed to have the
same dynamic range of the input value, so no overflow logic is
needed on the output value.
Exploiting the correlation among the RGB channels is the
main idea for improving demosaicing performance. Specifically,
we can assume that in a luminance/chrominance decomposition,
the chrominance components don’t vary much across pixels. In
the constant-hue approach of Freeman [2],[5], the green channel
is bilinearly interpolated, and then the R and B channels are in-
terpolated such as to maintain a constant hue, defined as the R/G
and B/G ratios. Even at the expense of computing those divi-
sions, it still produces visible artifacts [2]. Better results can be
obtained by starting with bilinearly interpolated G pixels, and
G
G B
R
▪
▪ ▪
▪
+
Figure 1. Typical Bayer mosaic for color image cap-
ture in single-CCD digital cameras; the G subimage
has twice as many pixels as the R and B subimages.