You are on page 1of 7

European Journal of Scientific Research

ISSN 1450-216X Vol.57 No.3 (2011), pp.447-453


© EuroJournals Publishing, Inc. 2011
http://www.eurojournals.com/ejsr.htm

Image Zooming using Segmented Polynomial


Interpolation in R2 Space

S. Anantha Padmanabhan
Asst. Professor (ECE), S.E.A College of Engineering & Technology
K.R. Puram, Virgonagar post, Bangalore: 560049, India
E-mail: ananthu.padmanabhan@gmail.com

S. Chandramathi
Professor & Head, Dept. of Electronics and Communication
Sri Krishna College of Engineering & Technology
Sugunapuram, Coimbatore: 641008, India
E-mail: chandrasrajan@gmail.com

Abstract

Image Zooming has always been an essential ingredient in image processing


activities. Zooming-In is normally employed when the image under consideration is large
and doesn’t fit into the visible area of the display device. This is a typical situation with
astronomical images from the visible part of the spectrum acquired through telescopes
located in deep space. Zooming-Out is employed in order to display images that are small
in size and the details in the original image are not clearly visible. In applications such as
Digital TV and Multimedia, streaming images need to get adjusted to the size of the display
device in real-time. This is the case with DTV systems implementing MPEG profiles.
When dealing with zooming activities, it becomes necessary to insert extra pixel
information when zooming-out and remove pixel information when zooming-in. In general,
zooming-in isn’t a very difficult task, except when dealing with non-integer reduction
ratios. Zooming-Out is definitely a difficult task, as introduction of extra information into
the image should be consistent with the existing texture of the image without the generation
of blocking artifacts. Several techniques have been hitherto employed in zooming-out
operations with varying degrees of visual effects – pixel replication, bilinear interpolation,
bicubic interpolation, spline interpolation and interpolation techniques based on PDEs
(Partial Differential Equations). The problem that we encounter in zooming-out is that as
the ratio of magnification increases, blocking artifacts become noticeable, impairing the
visual quality of the zoomed image. Other related problems such as aliasing and unnatural
bleeding of colors resulting from ineffective interpolation also come into effect. In fact,
zooming-out factor and the resulting visual quality share a somewhat reciprocal
relationship. One is achieved at the expense of the other. In our research activity in this
direction, we try to achieve the goal of narrowing the gap between these two aspects by
employing high order 2D filters for interpolation. We also take into account the fact that the
complexity of the algorithms employed should not in any way impair the performance in
real-time activities such as Digital TV and Multimedia applications where image-resizing
has to take place on the fly in order to accommodate the resolution capabilities of the
display at the receiver end.
Image Zooming using Segmented Polynomial Interpolation in R2 Space 448

2. Introduction
Before we proceed with our researched image resizing techniques, we would like to briefly introduce
the methods employed hitherto for the sake of completeness.

2.1. Pixel Replication


It is a crude method of adding or eliminating pixel rows and columns. Since the introduction or
elimination of rows and columns has to be perfectly periodic in order to avoid distortion or change of
aspect ratio, this method works only for zoom-out factors that are integral multiples of 1. Then again,
the zoom factor cannot be large as the blocking artifacts and aliasing effect become apparent even for
small magnification factors.

2.2. Bilinear Interpolation


Bilinear Interpolation is not linear by any reckoning. It is an interpolation technique involving
functions of 2 variables (in our case, the X and Y spatial coordinates of the image) over a rectangular
grid. The interpolating function does not use squared terms such as x 2 and y 2 but xy which is the
bilinear representation of x and y . Although the interpolation performed in either of the two
directions is linear, the interpolation as a whole is quadratic in nature.
If we wish to find the value of a function f at a point P = ( x, y ) and assume that we know the
value of f at the four points Q11 = ( x1 , y1 ) , Q12 = ( x1 , y2 ) , Q21 = ( x2 , y1 ) and Q22 = ( x2 , y2 ) then we have:
f ( Q11 ) f ( Q21 )
f ( x, y ) ≈ ( x2 − x )( y2 − y ) + ( x − x1 )( y2 − y ) +
( x2 − x1 )( y2 − y1 ) ( x2 − x1 ) ( y2 − y1 )
(2.2.1)
f ( Q12 ) f ( Q22 )
( x − x )( y − y1 ) + ( x − x1 )( y − y1 )
( x2 − x1 ) ( y2 − y1 ) 2 ( x2 − x1 ) ( y2 − y1 )
If we choose the 2D Cartesian coordinate system with the 4 points as: ( 0, 0 ) , ( 0,1) , (1, 0 ) , (1,1)
the interpolation boils down to:
f ( x, y ) ≈ f ( 0, 0 )(1 − x )(1 − y ) + f (1, 0 ) x (1 − y ) + f ( 0,1)(1 − x ) y + f (1,1) xy
(2.2.2)
which reduces to the matrix form:
 f (0, 0) f (0,1)  1 − y 
f ( x , y ) ≈ [1 − x x ] 
 f (1, 0) f (1,1)   y  (2.2.3)

2.3. Bicubic Interpolation


Bicubic interpolation is an extended modification of cubic interpolation on a 2 dimensional grid of
points. The interpolated surface is smoother than what is obtained by bilinear interpolation, Bicubic
interpolation is achieved by employing Cubic splines, Lagrange polynomials or cubic convolution
algorithms. Bicubic interpolation generally exhibits better performance than bilinear interpolation in
terms of artifacts – specifically when magnification ratios are large.
Assume that an image-function f ( x, y ) and its derivatives f x , f y and f xy are known at the 4
corners ( 0, 0 ) , ( 0,1) , (1, 0 ) , (1,1) of the unit square. The interpolated surface turns out to be:
3 3
p ( x , y ) = ∑∑aij x i y j
i =0 j =0
(2.3.1)
Solving the interpolation problem involves determination of the 16 coefficients aij . Applying
the initial conditions of p ( x, y ) yields:
449 S. Anantha Padmanabhan and S. Chandramathi

f ( 0, 0 ) = p ( 0, 0 ) = a00
(2.3.2)
f (1, 0 ) = p (1, 0 ) = a00 + a10 + a20 + a30
(2.3.3)
f ( 0,1) = p ( 0,1) = a00 + a01 + a02 + a03
(2.3.4)
3 3
f (1,1) = p (1,1) = ∑∑aij
i =0 j =0
(2.3.5)
Generating similar equations for the derivatives in the x, y directions and the cross derivatives
in the xy direction, the system of equations can be solved to obtain the aij values, using the following
identities:
3 3
p x ( x , y ) = ∑∑aij ix i −1 y j
i =1 j = 0
(2.3.6)
3 3
p y ( x , y ) = ∑∑aij jx i y j −1
i =1 j = 0
(2.3.7)
3 3
p xy ( x , y ) = ∑∑aij ix i −1 jy j −1
i =1 j =1
(2.3.8)
The solution yields a surface p ( x, y ) over a unit square with continuous derivatives. Bicubic
interpolation generates good quality zooming with minimum artifacts and aliasing of edges. Bicubic
interpolation is quite popular in image processing programs like Photoshop, Paint and ImageReady.

2.4. Spline Interpolation


Spline interpolation is a form of interpolation where the interpolant is a special type of piecewise
polynomial called a spline. Spline interpolation is preferred over polynomial interpolation because the
interpolation error can be made small even when using low degree polynomials for the spline. Spline
interpolation avoids the problem of Runge's phenomenon which occurs when interpolating between
equidistant points with high degree polynomials.
Our interpolation scheme follows the design philosophy of bilinear and bicubic interpolation
mechanism. Therefore, we will not cover the theory of splines in this paper.

Comparison of Bilinear and Bicubic Interpolation Schemes


While it is difficult to quantify the performance of the bilinear and bicubic interpolation in absolute
terms, a few observations and image comparisons are in order:

Table 2.4.1:

Property Bilinear Interpolation Bicubic Interpolation


Artifacts Appear at high zoom rates Comparatively less
Aliasing Effects Appear at high zoom rates Comparatively less
Color Channel Diffusion Not so good Very good. Hue is preserved
Edge Strength Acceptable Edge strength preserved
Visual Quality Good Very Good
Image Zooming using Segmented Polynomial Interpolation in R2 Space 450
Figure 2.4.1: Figure 2.4.2:

Bilinear Zooming Bicubic Zooming

Close inspection of the above images reveals that bicubic performs better than bilinear in image
zooming.
Our objective is to invent and design a zooming scheme that performs better than bicubic in
visual inspection and at the same time does not involve heavy computational overheads.

2.5. Segmented Polynomial Interpolation


While it is theoretically possible to fit a polynomial through a large number of points, it is inefficient
and impractical. The amount of time involved in such an implementation will be too prohibitive to be
of any practical use. A more important issue concerns the fact that there is correlation only over small
areas of the data points – in our case the image. It would therefore be more appropriate to think of
interpolation over small areas where the fitted curve will lend itself better to the local characteristics of
the image. We will call this procedure as segmented polynomial fitting. The basic idea is to fit a
polynomial segment over a block of data and resample the polynomial over more number of points for
zooming-out and less number of points for zooming-in.
Let ( xi , yi ) i = 0,1, 2,3…., n be the set of data over which we need to interpolate and zoom. Let
the polynomials y = qi ( x ) i = 1, 2,3,…, n designate all the segments with which to interpolate.
y''
The curvature of the curve y = f ( x ) is given by: (2.5.1)
(1 + y' 2 )3/2
In order to maintain the continuity of the first and second order derivative, the following
conditions apply.
As an elastic ruler will take a shape that minimizes the bending under the constraint of passing
through all "knots" (points), both y' and y'' will be continuous everywhere, also at the "knots". To
achieve this one must have:
q'i ( xi ) = q'i +1 ( xi ) q'' x = q'' x
and i ( i ) i +1 ( i ) (2.5.2)
451 S. Anantha Padmanabhan and S. Chandramathi

for all i , 1 ≤ i ≤ n . This can only be achieved if polynomials of degree 3 or higher are used. The
classical approach is to use polynomials of degree 3, this is the case of "Cubic splines". A 3rd order
polynomial segment q( x) for which
q ( x1 ) = y1, q ( x2 ) = y2, q' ( x1 ) = k1 , q' ( x2 ) = k2
(2.5.3)
can be written in the symmetrical form:
q = (1 − t ) y1 + ty2 + t (1 − t ) (a (1 − t ) + bt )
(2.5.4)
x − x1
t=
x2 − x1 a = k x − x − y − y b = −k x − x − y − y
1( 2 1) ( 2 1) 2( 2 1) ( 2 1) (2.5.4)
Computing the derivatives one finds that:
y −y a (1 − t ) + bt b−a
q ' = 2 1 + (1 − 2t ) + t (1 − t ) (2.5.5)
x2 − x1 x2 − x1 x2 − x
b − 2 a + (a − b )3t
q '' = 2 (2.5.6)Setting x = x1 and x = x2 in (4) one gets
( x 2 − x1 ) 2
that
b − 2 a
q ' '( x 1 ) = 2 (2.5.7)
( x 2 − x1 ) 2
a − 2 b
q ''( x 2 ) = 2 (2.5.8)Solving the above equations for a polynomial
( x 2 − x1 ) 2
segment of order 3, we have all the analytical solution given below:
Equation Set: 2.5.9
2
a11 =
x1 − x 0
1
a12 =
x1 − x 0
1
a 21 =
x1 − x 0
1 1
a 22 = 2 ( + )
x1 − x 0 x 2 − x1
1
a 23 =
x 2 − x1
1
a 32 =
x 2 − x1
2
a 33 =
x 2 − x1
y1 − y 0
b1 = 3
( x1 − x 0 ) 2
y1 − y 0 y 2 − y1
b2 = 3( 2
+ )
( x1 − x 0 ) ( x 2 − x1 ) 2
y 2 − y1
b3 = 3
( x 2 − x1 ) 2
Image Zooming using Segmented Polynomial Interpolation in R2 Space 452

In actual implementations of zooming on RGB images, the following set of procedures


applies:
• Convert the RGB to YCbCr color space (luma and chroma separated).
• Select macro-blocks of size 8x8 and apply the interpolation in the X and Y directions
• Insert the interpolated pixels into the macro-block and write to output
• Repeat the above procedures until the entire image is covered

3. Results of Experimentation
Figure 3.1: Bilinear Sampling (Photoshop) Figure 3.2: Bicubic Sampling (Photoshop)

Figure 3.3: Poly-Segment Sampling

4. Conclusions
The results obtained with various RGB and grayscale images have been very encouraging. On the
whole, the visual observations indicate that the Poly-Segment sampling outperforms the bilinear and
cubic interpolation on various tested images in terms of absence of artifacts and line aliasing. The
execution time for zooming was also comparable to that of bicubic zooming.

References and Bibliography


[1] R. Lukac, B. Smolka, K. Martin, K. N. Plataniotis, and A. N. Venetsanopulos, “Vector filtering
for color imaging,” IEEE Signal Process. Mag., vol. 22, no. 1, pp. 74–86, Jan. 2005.
[2] A. Bosco, K. Findlater, S. Battiato, and A. Castorina, “A noise reduction filter for full-frame
data imaging devices,” IEEE Trans. Consumer Electron., vol. 49, no. 3, pp. 676–682, Aug.
2003.
453 S. Anantha Padmanabhan and S. Chandramathi

[3] B. Gunturk,Y. Altunbasak, and R. Mersereau, “Color plane interpolation using alternating
projections,” IEEE Trans. Image Process., vol. 11, no. 9, pp. 997–1013, Sep. 2002.
[4] R. Lukac, K. N. Plataniotis, D. Hatzinakos, and M. Aleksic, “A novel cost effective
demosaicing approach,” IEEE Trans. Consumer Electron., vol. 50, no. 1, pp. 256–261, Feb.
2004.
[5] W. Lu and Y. P. Tang, “Color filter array demosaicking: new method and performance
measures,” IEEE Trans. Image Process., vol. 12, no. 10, pp. 1194–1210, Oct. 2003.
[6] L. Chang and Y. P. Tang, “Effective use of spatial and spectral correlations for color filter array
demosaicking,” IEEE Trans. Consumer Electron., vol. 50, no. 1, pp. 355–365, May 2004.
[7] R. Lukac and K. N. Plataniotis, “Data adaptive filters for demosaicking: a framework,” IEEE
Trans. Consumer Electron., vol. 51, no. 2, pp. 560–570, May 2005.
[8] R. Lukac, K. Martin, and K. N. Plataniotis, “Demosaicked image postprocessing using local
color ratios,” IEEE Trans. Circuits Syst. Video Technol., vol. 14, no. 6, pp. 914–920, Jun. 2004.
[9] T. Toi and M. Ohita, “A subband coding technique for image compression in single CCD
cameras with Bayer color filter arrays,” IEEE Trans. Consumer Electron., vol. 45, no. 1, pp.
176–180, Feb. 1999.
[10] S. Y. Lee and A. Ortega, “A novel approach of image compression in digital cameras with a
Bayer color filter array,” in Proc. Int. Conf. Image Processing, vol. 3, Oct. 2001, pp. 482–485.
[11] C. C. Koh, J. Mukherjee, and S. K. Mitra, “New efficient methods of image compression in
digital cameras with color filter array,” IEEE Trans. Consumer Electron., vol. 49, no. 4, pp.
1448–1456, Nov. 2003.
[12] S. Battiato, G. Gallo, and F. Stanco, “A locally adaptive zooming algorithm for digital images,”
Image Vis. Comput., vol. 20, no. 11, pp. 805–812, Sep. 2002.
[13] R. Lukac and K. N. Plataniotis, “Digital camera zooming on the color filter array,” Electron.
Lett., vol. 39, no. 25, pp. 1806–1807, Dec. 2003.
[14] , “Digital zooming for color filter array based image sensors,” Real-Time Imaging, vol. 11, no.
2, pp. 129–138, Apr. 2005.
[15] G. Sharma, Digital Color Imaging Handbook. Boca Raton, FL: CRC Press, 2002.
[16] K. N. Plataniotis and A. N. Venetsanopoulos, Color Image Processing and Applications.
Berlin, Germany: Springer-Verlag, 2000.
[17] B. E. Bayer, “Color Imaging Array,” U.S. Patent 3 971 065, Jul. 20, 1976.
[18] J. F. Hamilton and J. E. Adams, “Adaptive Color Plane Interpolation in Single Sensor Color
Electronic Camera,” U.S. Patent 5 629 734, May 13, 1997.
[19] S. C. Pei and I. K. Tam, “Effective color interpolation in CCD color filter arrays using signal
correlation,” IEEE Trans. Circuits Syst. Video Technol., vol. 13, no. 6, pp. 503–513, Jun. 2003.
[20] H. J. Trussell and R. E. Hartwig, “Mathematics for demosaicking,” IEEE Trans. Image
Process., vol. 11, no. 4, pp. 485–492, Apr. 2002.

You might also like