Академический Документы
Профессиональный Документы
Культура Документы
Interpolation
Mirko Guarnera
STMicroelectronics
gross dataflow
1
Ideal Interpolation
Color Interpolation
2
CFA
Bayer CFA
CFA image
Images suffer from color artifacts when the samples are not
estimated correctly.
Bilinearly interpolated
Original image from CFA-filtered samples
Color Interpolation Mirko Guarnera
3
Color artifacts
Zipper Effect
4
Aliasing
f2
fm f1
f1 f1
Implementation
5
Models
Processing
6
SM = interchannel correlation
Color correlation
7
Color Correlation
Color Correlation
8
Color correlation
9
Data adaptive
10
Color Interpolation - Nearest Neighbor Replication
Each interpolated output pixel is assigned the value of the nearest pixel
in the input image
The nearest neighbor can be any one of the upper, lower, left and right
pixels
For example, for a 3x3 block in green plane, we assume the left
neighboring pixel value is used to fill the missing ones
11
Color Interpolation - Bilinear Interpolation
12
Bilinear
Adaptive schemes
13
Edge sensing mechanism (ESM)
ESM
14
ESM
Edge Sensing
Interpolation of green pixels :
First, define two gradients, one in horizontal direction, the other
in vertical direction, for each blue/red position. For instance,
consider B8 : define two gradients as
15
Demosaicking Approaches
1 Edge-directed interpolation
2
1. Calculate horizontal gradient H = | (R3 + R7)/2 R5 |
3 4 5 6 7
2. Calculate vertical gradient V = | (R1 + R9)/2 R5 |
8 3. If H > V,
9 G5 = (G2 + G8)/2
Else if H < V,
G5 = (G4 + G6)/2
Else
G5 = (G2 + G8 + G4 + G6)/4
Edge-Directed Interpolation
16
Edge-Directed Interpolation
example
Edge-Directed Interpolation
17
Demosaicking Approaches
Adaptive interpolation
Using Laplacian For Enhancement: Use the second-order
gradients of red/blue channels to enhance green channel.
18
Adaptive interpolation
Demosaicking Approaches
Green Interpolate
19
Constant Hue
we define blue "hue value" as : B/G. red "hue value" can be analogously
defined.
Considering the interpolation of blue pixel values : there are three different
cases of blue pixel value interpolations.
Color Interpolation Mirko Guarnera
Vector SM
20
Directional filtering
The idea behind
Directional Filtering
n different 5x5 filter kernels are used to
follow gradient orientation
~ x2
~2
filter(x, y, ) = K exp
y
22x 22y
where
x = x cos( ) y sin( ) x = 8
~
Freq.
Freq. Response at /2
Response at /2
y = x sin( ) + y cos( ) y = 0 . 38
~
21
DF
(x,y)
Dilatation
Dilatation
Neighborhood
Neighborhood
input
input max
max dilatation
dilatation
To find a more precise orientation the
statistical weighted mode, on 3x3
neighborhood of the point (x,y), is
achieved. = mode ( ' ) ( x +i , y + j )
i = 1..1
j = 1..1
The max wrong values (underlined in
red) have been removed.
mode
mode dilatation
dilatation
Color Interpolation Mirko Guarnera
DF: peaking
The Directional Filtering on the know value has been used to obtain
the color correlations. For instance, on a known central Green value :
Peak = G GLPF _ DF
G B G B G
R G R G R
G B G B G
H = H LPF _ DF + Peak
Correlated
CorrelatedColor
Color
Components
ComponentsRetrieval
Retrieval
Color Interpolation Mirko Guarnera
22
Peak no Peak
The differences between
the first release and the
second release are
drastically visible.
A further enhancement
has been introduced by
considering the cross-
correlation among the
Bayer channels.
No
No peak
peak peak
peak
Color Interpolation Mirko Guarnera
Block Scheme
HF
Color Correlation
Frame
Filtering R,G,B Peaking
Buffer
Mag
SobelX 5x5 DF
Moda
SobelY Luts
Dir
23
Results
Original
Original Image
Image DF
DF Color
Color Interpolation
Interpolation IGP
IGP
Results (1/6)
24
Results (2/6)
Original
Color Interpolation Edge Sensing
Mirko Guarnera
D.F. Color Interpolation
Results (3/6)
Original
Color Interpolation Edge Sensing
Mirko Guarnera
D.F. Color Interpolation
25
Results (4/6)
Original
Color Interpolation Edge Sensing
Mirko Guarnera
D.F. Color Interpolation
Results (5/6)
26
Results (6/6)
VARIANCE
DIRECTIONAL FILTER
HIGH
THRESHOLD
DIRECTIONAL FILTER /
3X3 Edge Sensing
LOW
THRESHOLD
5X5 LPF
FLAT EDGE OR
REGION HIGLY
TEXTURED
REGION
VAR3X3
VAR5X5
Color Interpolation Mirko Guarnera
27
Color-processing sideshows
Aliasing
Resolution of sensor
< spatial frequency of scene
False color
Aliasing occurs only in one or two of the color planes
Moire patterns
Overlapped patterns with near frequency
Post processing
28
Post processing
Aliasing
29
Aliasing Cancelling
30
Alias Cancellation Results
Standard Interpolation
Color Interpolation
Alias Cancellation
Mirko Guarnera
ColorStandard Interpolation
Interpolation Mirko Guarnera
Alias Cancellation
31
Aliasing
1 2 3 4 5 6 7 8 91 1 1 1 1 1 1 1 2 3 4 5 6 7 8 91 1 1 1 1 1 1 1 2 3 4 5 6 7 8 91 1 1 1 1 1 1
0 1 2 3 4 5 6 0 1 2 3 4 5 6 0 1 2 3 4 5 6
Distribution of light intensity Illumination incident to the image Distribution of linearly interpolated
incident to an image sensing array sensing array in which alternate color light intensity values for the
pixels are overlapped by different pixels of the image sensing array
colored filters
Inter-channel differences
COLOR
A
COLOR
B
1 2 3 4 5 6 7 8 91 1 1 1 1 1 1 1 2 3 4 5 6 7 8 91 1 1 1 1 1 1
0 1 2 3 4 5 6 0 1 2 3 4 5 6
Information signal corresponding Difference between colors A and B
to colors A and B for each pixel
32
Median filter
SHARP
SPIKE
REMOVED
1 2 3 4 5 6 7 8 91 1 1 1 1 1 1
0 1 2 3 4 5 6
Color A minus color B, median filtered with a
support of 5 pixels
BCENTER = BBayer
Pixels which
receive only Blue G CENTER = B CENTER vBG
light: RCENTER = B CENTER v BG + vRG
Color Interpolation Mirko Guarnera
33
Block scheme
The rules presented in the previous slide are schematically
represented by the block diagram below:
R
Pixels which
G* receive only
R-G vRG B* Red light
MEDIAN -
- FILTER
+
R*
R + Pixels which
IMAGE INTERPO G G receive only
SENSOR LATOR B B* Green light
B-G
+
MEDIAN vBG
+
- FILTER
- R* Pixels which
G* receive only
B Blue light
34
Variance of inter-channel differences
e (k , l ) A kl
Expectation
[ ]
E Aij = k , l h
e (k , l )
value k ,l h
A2 (i , j ) = k , lh
k , lh
e (k , l )
e (k , l ) = 1 (Aij Akl )
Weight 2
function
Color Interpolation Mirko Guarnera
35
Flat color differences region
[ ]
E G ij R ij (G ij R ij ) < MeanThresh old
E [G ij B ij ] (G ij B ij ) < MeanThresh old
2. Low Variance value
Map
Map of
of homogeneous
homogeneous vs.
vs.
Processed
Processed image
image inhomogeneous
inhomogeneous regions
regions
Color Interpolation Mirko Guarnera
36
Variance Antialiasing:
adaptive application
Map
Map of
of variance
variance with
with Map
Map of
of variance
variance with
with
one
one threshold
threshold two
two thresholds
thresholds
Color Interpolation Mirko Guarnera
37
Variance Antialiasing:
Color Correction algorithm (1/3)
First Step: Two updated values for the green channel are
calculated using each color difference domain:
GijR = Rij + GR
GijB = Bij + GB
Where
Variance Antialiasing:
Color Correction algorithm (2/3)
{
G ij = (1 ) Gij + (1 a ) GijR + a GijB }
The weight a is expressed as:
(2G R )
a= ,0 < a <1
2
(G R )+ (2G B )
38
Variance Antialiasing:
Color Correction algorithm (3/3)
R ij = G ij GR
B ij = G ij GB
Results (1/2)
Interpolated
Interpolated
image
image
Our
Our previous
previous Variance
Variance
Antialiasing
Antialiasing Antialiasing
Antialiasing
Map
Map of
of variance
variance
Color Interpolation Mirko Guarnera
39
Results (2/2)
Interpolated
Interpolated
image
image
Our
Our previous
previous Variance
Variance
Antialiasing
Antialiasing Antialiasing
Antialiasing
Map
Map of
of variance
variance
Color Interpolation Mirko Guarnera
Bibliography
Adams, James E. "Interactions between color plane interpolation and other image processing functions
in electronic photography" Proceedings of SPIE Vol. 2416 P.144-151
Sakamoto,Tadashi. et.al., "Software pixel interpolation for digital still cameras suitable for a 32-bit
MCU" IEEE Transactions on Consumer Electronics. Vol.44, No.4, P.1342-1352, November 1998
Zen,Hidemori. et.al., "A New digital signal processor for progressive scan CCD" IEEE Transactions on
Consumer Electronics. Vol.44, No.2, P.289-295, May 1998
Parulski,Kenneth A. "Color Filters and Processing Alternatives for one-chip cameras" IEEE
Transactions on Electron Devices. Vol.ED-32, NO.8, August 1985
Chan,Wen-Hsin. et.al., "A Mega-Pixel resolution PC Digital Still Camera" Proceedings of SPIE
Vol.2654. P.164-171
Tsai, Y.Tim. et.al., "Optimized Image Processing Algorithms for a Single Sensor Camera" 1997 IEEE
Pacific Rim Conference on Communications, Computers and Signal Processing, Vol.2, P.1010-1013
Adams,James E. et.al., "Design of practical color filter array interpolation algorithms for digital
cameras" Proceedings of SPIE Vol.3028 P.117-125
Chang, Ed. et.al., "Color Filter Array Recovery Using a Threshold-based Variable Number of
Gradients" to be published in Proceedings of SPIE, January, 1999
Keys, Robert.G. et.al., "Cubic Convolution Interpolation for Digital Image Processing" IEEE
Transactions on Acoustic, Speech and Signal Processing, Vol ASSP-29, P1153-1160, 1981
Simons, K.W. "Digital Image Reconstructon and Resampling for Geometric Manipulation" Proceedings
of IEEE Symp. on Machine Processing of Remotely Sensed Data P.3A-1--3A-11,1975
Mitchell, Don P. et.al., "Reconstruction Filters in Computer Graphics" Computer Graphics,
(SIGGRAPH'88 Proceedings), Vol.22, No.4, P.221-228, August 1988
Schreiber, William F. et.al., "Transformation between Continuous and Discrete Representations of
Image: A Perceptual Approach" IEEE Transactions on Pattern Analysis and Machine Intelligence
Vol.PAMI-7 No.2, P.178-186 March 1985
40
Quality evaluation
Metrics
41
Metrics
255
PSRN = 20 log 10
N M
(A Bi )
1 2
N M
i
i =1
Higher values (expressed in decibel) of the PSNR generally imply
better quality.
42