Documente Academic
Documente Profesional
Documente Cultură
Demosaicing of Bayer-sampled
color images
Problem: Most digital color cameras,
capture only one color component at
each spatial location. The remaining
components must be reconstructed by
interpolation from the captured samples.
Objective: Develop algorithms to
interpolate each color plane (called
demosaicing) with best quality
reconstruction, and with minimal
computational complexity.
Lighthouse
original
Lighthouse
red original
Lighthouse
green original
Lighthouse
blue original
Lighthouse
red subsampled
Lighthouse
green subsampled
Lighthouse
blue subsampled
Lighthouse
Bayer CFA image
GA
GL
GR
GI
GB
GI =
1
(GL + GR + GB + G A )
4
RNW
RSW
RC =
RNE
RC
RS
RSE
1
( RNW + RNE + RSW + RSE )
4
RS =
1
(RSW + RSE )
2
Lighthouse
red interpolated
Lighthouse
green interpolated
Lighthouse
blue interpolated
Lighthouse
Interpolated
color image
Lighthouse
original
Can we do better?
Color planes have severe aliasing.
Better interpolation of the individual
planes has little effect.
10
Lighthouse
red interpolated
with bilinear
interpolator
Lighthouse
red interpolated
with bicubic
interpolator
11
Can we do better?
Color planes have severe aliasing.
Better interpolation of the individual
planes has little effect.
We could optically prefilter the image
(blur it) so that aliasing is less
severe.
Lighthouse
red interpolated
with bilinear
interpolator
12
Lighthouse
prefiltered red
interpolated
with bilinear interpolator
Lighthouse
Interpolated
color image
13
Lighthouse
Prefiltered
Interpolated
color image
Lighthouse
original
14
Demosaicing Approaches
Non-Adaptive Single-Channel Interpolation:
Interpolate each color channel separately using
a standard technique, such as nearest-neighbor
interpolation, bilinear interpolation, etc.
Edge-Directed Interpolation: Estimate potential
edges, avoid interpolating across the edges.
Edge-directed interpolation
1.Calculate horizontal gradient H = |G1 G2|
2.Calculate vertical gradient V = |G3 G4|
3.If H > V,
Gx = (G3 + G4)/2
Else if H < V,
Gx = (G1 + G2)/2
Else
Gx = (G1 + G2 + G3 + G4)/4
3
1
Demosaicing Approaches
Edge-Directed Interpolation: Based on the
assumption that color channels have similar
texture, various edge detectors can be used.
Edge-directed interpolation
1
2
3
5
8
9
1.
2.
3.
15
Demosaicing Approaches
Constant-Hue-Based Interpolation: Hue does not
change abruptly within a small neighborhood.
Interpolate green channel first.
Interpolate hue (defined as either color differences or color
ratios).
Estimate the missing (red/blue) from the interpolated hue.
Red
Green
Interpolate
Interpolate
d Red
Interpolate
Demosaicing Approaches
Edge-Directed Interpolation of Hue: It is a
combination of edge-directed interpolation and
constant-hue-based interpolation. Hue is
interpolated as in constant-hue-based
interpolation approach, but this time, hue is
interpolated based on the edge directions (as in
the edge-directed interpolation algorithm).
16
Demosaicing Approaches
Using Laplacian For Enhancement: Use the
second-order gradients of red/blue channels to
enhance green channel.
1
2
3
5
8
9
1.
2.
3.
Demosaicing CFAs
bilinear interpolation
Interpolation of green pixels
G8 = (G3+G7+G9+G13) / 4
Interpolation of red/blue pixels :
* Interpolation of a red/blue pixel at a green position:
B7 = (B6+B8) / 2
R7 = (R2+R12) / 2
* Interpolation of a red/blue pixel at a blue/red position:
R8 = (R2+R4+R12+R14) / 4
B12 = (B6+B8+B16+B18) / 4
17
Demosaicing CFAs
Constant hue-based
interpolation (Cok)
Hue:
Interpolate G first
Demosaicing CFAs
Median-based interpolation
(Freeman)
1. Linear interpolation
2. Median filter on color
differences
18
Demosaicing CFAs
Gradient-based interpolation
(LaRoche-Prescott)
1. Interpolation on G
Demosaicing CFAs
Gradient-based interpolation
(LaRoche-Prescott)
2. Interpolation of color
differences
19
Demosaicing CFAs
bilinear
Cok
Freeman
LaRoche
Demosaicking CFAs
20
A Valuable Resource:
A Study of Spatial Color
Interpolation Algorithms for
Single-Detector Digital Cameras
http://scien.stanford.edu/class/psych22
1/projects/99/tingchen/
URL on Resources page
21