Image Processing Reference
In-Depth Information
1.7 Interpolation based on median filtering
Color interpolation can also be performed by median filtration. Application of the median
filter offered in [8] is carried out in two stages. On the first by bilinear interpolation
components R( ) G(  and B(  are calculated, and then the difference between
channels with the subsequent median filtration. Let
M (  , r M (  designate
differences after a median filtration. For each pixel sampling of missing colors is estimated
as a difference between current value of a component and an appropriate difference after a
median filtration.
Recovery of colors can be performed also by the gradient method offered in [9] and for the
first time used in photocamera of Kodak DCS 200. The method is based on three-stage
process which saves boundaries at interpolation led in a direction, perpendicular their
orientation. In the beginning the G-channel along boundaries is interpolated. For example,
in case of interpolation of "green" pixel in a position (4,4) horizontal and vertical gradients
for "blue" are calculated:
M
(  ,
rg
gb
H( b
b
) / 2
b
,
4,4
4,2
4,6
4,4
Vb

b
/ 2
b
.
4,4
2,4
6.4
4,4
If horizontal gradient Н4,4 greater than vertical gradient V4,4 , it specifies to possible boundary
in a horizontal direction and then interpolation of value of "green" pixel is performed only
in a vertical direction:
G(4,4)
(g
g
)/2
.
3,4
5,4
And on the contrary. If horizontal and vertical gradients are equal, values of pixels of the
"green" channel calculated by averaging four adjacent pixels:
G(4,4)
(g

g
g
g
)/4
.
3,4
4,3
4,5
5,4
Missing R(  and B(  channels are recovered by interpolation on the basis of constant color
tone. For example, the missing blue component of pixels with coordinates (3,4) and (4,4)
according to [10] is interpolated by following expressions:
B(3,4)

b
G(3,3)

b
G(3,5)) / 2
G(3,4)
,
3,3
3,5
B(4,4)
  
(b
G(3,3)
b
G(3,5)

b
G(5,3)

b
G(5,5)) / 4
G(4,4).
3,3
3,5
5 ,3
5 ,5
1.8 Interpolation based on variable threshold gradients
The method on the basis of the variable gradients activated on a threshold (Threshold Based
Variable Number of Gradient) is based on a variable amount of the gradients which usage is
controlled by exceeding of threshold values. In the given primitive possibility to use
gradients on all eight directions, namely in two horizontal, two vertical (N, S, E and W
accordingly) and four diagonal NW, SW, NE and SE are added.
In each direction on a matrix of pixels the gradient for the selected point on the basis of an
array of 5x5 adjacent pixels is calculated. The choice of a configuration of a neighborhood is
Search WWH ::




Custom Search