Content uploaded by Romen Taiyenjam

Author content

All content in this area was uploaded by Romen Taiyenjam on Sep 11, 2015

Content may be subject to copyright.

Image Magnification based on Directed Linear Interpolation

T. Romen Singh

1

, O. Imocha Singh

1

, Kh. Manglem Singh

2

, Th. Rupachandra Singh

1

and Tejmani Sinam

1

1

Department of Computer Science, Manipur University, Canchipur, India

2

DOEACC Centre, Imphal, Manipur, India.

Abstract

The technology of computer graphics and digital cameras

are prevalent. High-resolution display and printer are

available. High-resolution images are needed in order to

produce high quality display images and high quality prints

for use in desktop publishing, large artistic printing, mobile

phone etc. However, since high-resolution images are not

usually provided, there is a need to magnify the original

images. This paper proposes an algorithm for image

magnification by linear interpolation, which is better than

some of the prevalent methods such as pixel replication,

bilinear interpolation and bicubic interpolation. The

proposed algorithm uses linear interpolation method to

magnify pixels that lie in the perimeter, whereas it uses

directed bilinear interpolation method to magnify the

interior region inside the magnified blocks. Determination

of the right direction for interpolation is the key for

achieving better performance of the proposed algorithm.

1. Introduction

Image magnification is a process of obtaining an image at

resolution higher than taken from the image sensor. Image

magnification synonyms are interpolation, enlargement,

zooming, etc. Until now, a large number of interpolation

techniques for magnifying images have been proposed. The

simplest method to magnify images is the pixel replication,

where the color of the nearest pixel of the original image is

replicated, resulting the magnified images with aliasing

effect in the form of jagged edges to the new image. The

color of the pixel in the nearest neighbor method is the

color of the nearest pixel in the image [1]. Most editing

software uses nearest neighbor method. It increases the

visibility of jaggies in the magnified images, however it

does not introduce aliasing effect. Bilinear Interpolation

determines the value of a new pixel based on a weighted

average of the 4 pixels in the nearest 2 × 2 neighborhood of

the pixel in the original image [1]. It gives less jaggies with

relatively smooth edges and the weighted average has an

antialiasing effect. Bicubic interpolation method is

commonly used by editing software, printer drivers and

many digital cameras for resampling images. It is more

sophisticated and produces smoother edges than bilinear

interpolation method. A new image magnification

technique is bicubic function that uses sixteen pixels in the

nearest 4 × 4 neighboring pixels in the original image [1,2].

Other methods such as B-spline interpolators [3,4] and the

cubic convolution methods [5] have also been proposed.

However, these methods tend to blur the edges and cause

them to be jagged.

Allebach and Wong [6] proposed a method that searches for

edges in the image so that the interpolation does not cross

them. The main difficulty is to find out the important edges.

Other edge-adaptive methods have been proposed by

Jensen and Anastassious [7], Li and Orchard [8] and

Muresan and Parks [9]. The methods presented in [8] and

[9] are the most widely used known edge-adaptive methods.

They can avoid jagged edges, but these methods introduce

visible artifacts in the magnified images. Yu et. al proposed

triangulation method [10], however this method fails to

give curved edges specially at large scaling factor. Morse

and Schwartzwald [11] proposed a level-set reconstruction

method to solve the problem of jagged edges. This method

does not overcome the problem of blurring effect in the

bicubic interpolation method. Hertzmann et al [12] and

Freeman et al [13] proposed methods that learn the

correspondences between low and high resolution images

from a set of training data. The main drawback of these

methods is that they fail if the input image is different from

the training data and the computational cost is also very

high. Malgouyres and Guichard [14] proposed variation

based approach for image magnification. Their method

gives better-magnified images than the bicubic interpolation

method, but the computational cost is very high. Johan and

Nishita proposed progressive refinement approach for

image magnification. Their method gives sharp magnified

image without generating distinct artifacts, however it

produces sometimes jaggies in the magnified images.

Muneeb et al [16] proposed an adaptive approach for image

magnification, which produces a high quality magnified

image while preserving the content of the original image.

Their method has some defect.

The main contribution of this paper is to produce a

magnified image that produces high visual quality of the

original image with linear interpolation, which is very

simple as compared with other techniques such as bilinear,

bicubic, B-spline etc. The basic idea of the proposed

technique is to select the direction of linear interpolation

method based on the 2×2 pixel values, and then the

interpolator assigns proper intensity values to the

undefined pixels along the directed line.

The paper is organized as follows. Section 2 is on the proposed

algorithm., Section 3 explains various methods of interpolation.

Section 4 gives experimental results followed by Section 5 on

conclusions.

2.

Proposed Algorithm

Intensity surface can be viewed as a landscape with hills

and hollows, rides and valleys and curve surfaces. Any

NCC 2009, January 16-18, IIT Guwahati 367

three-dimensional (3-D) surface, with some approximation

can be created from directed linear interpolation like the

triangular plane, which is very similar with the triangular

based image magnification, square plane and twisted curve

surface based on the pixel intensities of 2×2 block. Look at

the image intensity as 3-D surface built from directed linear

interpolation, where vertices are image pixels with intensity

along z-axis as shown in Fig. 1.

To magnify an image, new image must be complemented

with new pixels, added necessary columns and rows of

pixels, and calculated new pixels intensity. In this work

assumption is made that new pixels intensity is situated on

suitable line along the diagonals, horizontal, or vertical

according to the direction chosen. During image

magnification, edges are blurred because of reduction in

slope sharpness. This is the main problem for all known

magnification methods. So edges must be located at

distinctive points on intensity surface for different

magnification algorithm applied. There are two things that

must be solved: choose the best arrangement of the pixel by

selecting the right direction of interpolation and interpolate

the new pixel intensity.

This proposed system called as directed linear interpolation

(DLI) proceeds in three phases for magnification of the

original image.

Phase I:

The image of M×N size is divided into many non-

overlapping and square blocks of equal dimension, each of

2×2 size. We consider one block at a time for magnification

of the original image and pixel values from a block are

assigned as corner pixel values in the magnified block as

shown in Fig. 2(a). The coordinates (x, y) of pixels in the

magnified image in the term of top-left pixel coordinates

(i,j) in the square block of unmagnified image and

magnified block of p×p size, where p is the magnification

factor is given by Eq. (1) below.

( 1)

( 1)

x p i m

y p j n

= − +

= − +

(1)

where (m, n) is the coordinates of pixel in the magnified

block such that m=1, 2,…, p and n=1,2,…, p.

The size of the magnified image is (pM – p + 1) × (pN –p +

1), short by (p – 1)×(p – 1) size from pM×pN size, the

apparent size of the magnified image.

After assigning pixel values at the four corners that are top-

left, top-right, bottom-left and bottom-right locations in the

magnified blocks with the respective pixel values from the

unmagnified block of the original image, the unfilled

perimeter pixel values of the square block are interpolated

linearly using the filled corner pixel values as shown in

Fig.2(b) by using Eq. (2).

( )( ( ,

1 2 1) ( , )

1 1

1 1 1 2 1

( )( ( ,

1 2 2) ( , )

1 2

2 1 2 2 1

( )( ( ,

1 1 2) ( , )

1 1

1 1 1 2 1

(

2 2 1

( , ) ( , ) for left edge

( , ) ( , ) for right edge

( , ) ( , ) for top edge

( , ) ( , )

x x I x y I x y

x x

x x I x y I x y

x x

y y I x y I x y

y y

y

I x y I x y

I x y I x y

I x y I x y

I x y I x y

−−

−

−−

−

−−

−

−

= +

= +

= +

= +

)( ( ,

1 2 2) ( , )

2 1

2 1

for bottom edge

y I x y I x y

y y

−

−

(2)

where

1 1 1 2 2 1 2 2

( , ), ( , ), ( , ) and ( , )

I x y I x y I x y I x y

are the

pixel values at top-left, top-right, bottom-left and bottom-

right corners respectively of the magnified blocks.

Phase II:

In this phase, interpolation direction is determined. Detail is

discussed in the next sub-section.

Phase III:

In this phase, interpolation is performed along the

determined direction to fill up the unfilled inner pixel

values of the square block other than the perimeter, which

is filled during Phase I. The possible directions are along

left diagonal, right diagonal, horizontal or vertical direction.

More detail is discussed in the next section. After

completely filling up of all the pixel values of the square

block, then comes to the next

2 2

×

block of the original

image for next mapping to the magnified image. The

processing from Phase I to Phase III is repeated until the

last block of the original image is processed.

The proposed algorithm can be applied the proposed

algorithm both in gray-scale and color images. In the case

of color images, the process is performed for each color

channel separately.

2.1 Determination of interpolation direction

The selection of right interpolation direction will result the

high quality magnified images. To determine the direction,

the absolutes of the diagonal pixel differences of two

diagonals are used. In Fig.2 white small square marks are

new pixel values that are inserted to magnify the image

while gray-circled marks are the original pixel value. The

unfilled intensity of the new pixels is calculated from the

four original pixel values at the corners of the magnified

block by interpolating along the suitable direction linearly.

There will be two cases to determine directions of

interpolation.

Case I

Unequal absolute diagonal intensity differences: If

the absolute differences of the diagonal pixel intensities are

not equal, and there is no two pixels having same intensity

in the 2×2 block, either along horizontal or vertical line

with the nearest intensity outside the 2×2 block, along the

line, the direction of the linear interpolation is along the

diagonal having less intensity difference. Otherwise it will

Fig 1: Image intensity surface.

NCC 2009, January 16-18, IIT Guwahati 368

be along vertical/horizontal direction. Its possible states are

shown in the Fig.8 and Fig.9.

All possible states of vertical and horizontal edges that have

equal intensity with the adjacent blocks are shown in Fig. 8.

To identify whether any three pixel intensities are equal or

not, we can take standard deviation of the three pixel

intensities. If the standard deviation is 0, it can be

concluded that the three pixels are of same intensity value.

We can check for presence of edge within the 2×2 pixel

block by taking standard deviation of the relevant

consecutive three pixels along vertical and horizontal

directions with other pixels other than the pixels in the 2×2

block, or within the 2×2 block itself. Fig 9 shows the

presence of three equal intensity pixels within the 2×2

block. In this case, interpolation is along diagonal and it is

considered even for three pixels along vertical or horizontal

having the same intensity. The method of interpolation is

shown in Fig.3 and Fig.4 according to the determined

direction. Diagonal directed interpolation gives two

triangular planes joining at the selected diagonal, where

vertical and horizontal directed interpolations give either

square plane or twisted curve.

Case II

Equal absolute differences:

In this case, the equal

absolute differences condition is considered and all possible

conditions are shown in Fig.5. We can consider two sub-

conditions here such as:

(a) Equal absolute differences and average diagonal pixel

values (Fig. 5(a)): The interpolation technique will be linear

along horizontal/vertical direction by using either Eq. (3) or

(4), resulting a square plane surface, being four diagonal

pixels as vertices. Its surface looks like roof as shown in

Fig. 4(a).

(b) Equal absolute differences, but different average

diagonal pixel values: This condition is shown in Fig.5(b).

If the averages of the diagonal pixels are not equal, it is

further required to determine the direction of interpolation.

It may be along vertical/horizontal or diagonal direction. It

is not sufficient to determine the direction by the current

concerned block C shown in Fig.6(a). Neighboring blocks

such as T (top), R (right) and B (bottom) are required to

support the determination of interpolation direction. Their

individual direction is determined and if one of the three

blocks gives the direction, then the interpolation takes place

along the determined direction, say right diagonal direction

in the Fig.6(b). If it still fails to determine the direction

even with the help of the three blocks, its direction should

be same as condition I, that is, linear along

vertical/horizontal resulting a twisted curve surface, which

is shown in Fig. 4(b).

Fig. 2: 2×2 pixel mapped to magnified image

(a). 6x6 mapped square block

1 1

( , )

x y

2 2

( , )

x y

1 2

( , )

x y

2 1

( , )

x y

2x2

(b). 6x6 perimeter filled square block

1 1

( , )

x y

2 2

( , )

x y

1 2

( , )

x y

2 1

( , )

x y

(i,j)

(a)

I(x

1

,y

1

)

I(x

1

,y

2

)

I(x

2

,y

1

)

I(x

2

,y

2

)

2x2 pixel

(b)

Fig.3: Diagonal interpolation –

(a) Left linear diagonal interpolation

and (b) Right linear diagonal interpolation.

Fig.4.: Linear interpolation –

(a) Linear plane surface (b) Linear

twisted curved surface

f

(i,j)

f

(i,j+1)

f

(i+1,j

)

f

(I+1,j+1)

I

(x1,y1)

I

(x1,y2)

I

(x2,y1)

I

(x2,y2)

I

(x1,y1)

I

(x1,y2)

I

(x2,y1)

I

(x2,y2)

f

(i,j)

f

(i,j+1)

f

(i+1,j

)

f

(I+1,j+1)

(a) 4x4 magnified square plane surface

(b) 4x4 magnified square twisted surface

(a) Equal absolute difference and average

diagonal pixels

Fig. 5: Equal absolute diagonal pixel differences

(b) Equal absolute difference but

unequal average diagonal pixels

Fig.6: Direction determination: (a) 2x2 pixel block

C

with

neighboring pixels (b) Interpolated along right diagonal.

(a) (b)

(a) (b)

Fig.7: Diagonal interpolation. (a). Right diagonal directional

interpolation. (b). Left diagonal directional interpolation.

NCC 2009, January 16-18, IIT Guwahati 369

3. Methods of interpolation

3.1 Boundary interpolation:

Magnification is done by taking blocks sequentially from

the original image. The four pixel values from a block are

assigned to the magnified block as shown in Fig.2(a). The

unfilled pixels along the perimeter of the square block in

the magnified image are filled by interpolating between two

corresponding intensities at the vertices of the coordinates

from (x

1

, y

1

), (x

2

, y

1

), (x

1

, y

2

) and (x

2

, y

2

) by using Eq. (2).

3.2. Inner pixels interpolation

3.2.1 Vertical/Horizontal linear interpolation

In Phase II,

C

ase II, Condition (a), unfilled pixels are filled

by interpolating linearly by using Eq. (3) or Eq. (4) along

horizontal/vertical direction as follows.

1 2 2 1

2 1

( , ) ( ) ( , )( )

( , ) ( )

I x y y y I x y y y

I x y y y

− + −

=−

(3)

1 2 2 1

2 1

( , ) ( ) ( , ) ( )

( , ) ( )

I x y x x I x y x x

I x y x x

− + −

=−

(4)

3.2.2. Diagonal directed interpolation

In diagonal direction interpolation, there are a pair of

equations for the upper and lower triangular regions of the

square block. Each triangular region is filled separately

during filling up of unfilled pixels diagonally. Direction

may be either left or right direction as shown in Fig.7.

Equations for right diagonal interpolation are given below:

1 1 1

1

1

( ( , ) ( , ))( )

( , ) ( , )

I x q I p y y y

I x y I p y p x

− −

= + −

1 1 1 1

1

( , )( ) ( , )( )

I p y x x I x q y y

p x

− + −

=−

(5)

where p= x+y-y

1

and q= x+y-x

1

for x

1

+y-x

1

≤

y

2

2 2 2

2

2

( ( , ) ( , ))( )

( , ) ( , )

I x q I p y y y

I x y I p y x p

− −

= + −

2 2 2 2

2

( , )( ) ( , )( )

I p y x x I x q y y

x p

− + −

=−

(6)

where

p= x+y-y

2

and q =x+y-x

2

for x+y-x

1

> y

2

Equations for left diagonal interpolation are given below:

2 1 1

1

2

( ( , ) ( , ))( )

( , ) ( , )

I x q I p y y y

I x y I p y x p

− −

= + −

1 2 2 1

2

( , )( ) ( , )( )

I p y x x I x q y y

x p

− + −

=−

(7)

where p= x-y+y

1

and q= x

2

-x+y for x

2

+y-x

≤

y

2

2

1

( ( 1, ) ( , 2))( )

( , ) ( , 2)

I x q I p y y y

I x y I p y p x

− −

= + −

2 1 1 2

1

( , )( ) ( , )( )

I p y x x I x q y y

p x

− + −

=−

(8)

where p= x+y+y

2

and q= x

1

-x+y for x

2

+y-x>y

2

(a) Right diagonal direction:

In Right diagonal direction, unfilled pixels can be

interpolated by using Eqs. (5) and (6). Eq (5) is for upper

triangular region and Eq. (6) is for lower triangular region.

It is also shown in Fig.3(b) and Fig. 7(a).

(b) Left diagonal direction

Here in this case, it is almost similar to right diagonal

direction and the only difference is its direction. It can be

interpolated using Eqs. (7) and (8) for the upper and lower

triangular region. Fig.3(a) and Fig.7(b) show the way of

interpolation.

4. Experimental Results

Proposed Interpolation technique was tested and compared

with several common magnification techniques like Pixel

Replication (PR), Bilinear Interpolation (BL), and Bicubic

Interpolation (BC). Qualitative analysis provides a set of

image comparisons to the readers for visual analysis. A

quantitative analysis is done by utilizing root mean squared

error (RMSE), peak-signal-to-noise-ratio (PSNR) in dB,

cross-correlation coefficient (CCC) and. These are given in

Eqs. (9), (10) and (11).

2

1

1 1

( ( , ) ( , ))

M N

M N

i j

R M S E F i j I i j

= =

= −

∑ ∑

(9)

2

1

1 0 g 1 0P S N R lo

R M S E

=

(10)

1 1

2 2 2

1 1 1 1

( , ) ( , )

( , ) ( , )

M N

i j

M N M N

i j i j

I i j F i j MNab

CCC

I i j MNa F i j MNb

= =

= = = =

−

=

− −

∑∑

∑∑ ∑∑

(11)

where I is the magnified image, F is the original image, M

and N

are the image dimension, a and b are the

corresponding average pixel values in each image.

Fig.8: Unequal pixel difference, but horizontal/vertical edge presence

states of concerned 2x2 ma

rked block. (a) & (c) are left and right

vertical edge where (b) & (d) are top and bottom horizontal edge

presence state .

Fig.9: Unequal diagonal pixel difference and no horizontal/vertical

edge presence stat

es of concerned 2x2 marked block. (a) No edge

presence right directed. (b) Right directed diagonal edge presence

state. (c) Left directed, one pixel contrast (d No edge presence right

directed . They will be interpolated along diagonal direction.

NCC 2009, January 16-18, IIT Guwahati 370

Three different quantitative analysis measurements were

used on ten images such as camera stand (CS) of 41×36,

Arial view (AV) of 72×55, Lena (LN) of 100×100, Lena

eye (LE) of 61×47, Flower (FL) of 348×376, Mandrill (CP)

of 295×297, Rose (RS) of 132×135, Human eye (HE) of

110×44, Veronam (VM) of 242×141 and Moon (MN) of

267×471 size respectively.

Table 1 gives numerical results in PSNR (dB) on various

images under consideration for comparison of different

techniques. It was found from Table 1 that the values of

PSNR of the proposed algorithm were the largest. Fig. 10

shows the comparison of the proposed algorithm for a

magnification factor p = 4. The result of the proposed

algorithm contains no jag at all and it gives very smooth

regions, where there are no edge.

5. Conclusions

The paper proposes a new technique for image

magnification. The experimental results show the

effectiveness of the algorithm in comparison with pixel

replication, bilinear and bicubic interpolation methods.

Conventional linear interpolation is used to magnify the

pixels that lie at the perimeter of the square block of the

magnified blocks and directed bilinear interpolation is used

to magnify pixels for the pixels in the interior region of the

magnified blocks. Magnification direction is decided for

horizontal, vertical and diagonal directions and it even

considers pixels from adjacent blocks when necessary.

Determination of the right direction for interpolation is

critical for achieving better performance of the proposed

algorithm.

PSNR

Algorithms

Images

PR BL BC DLI

CS 19.9023 21.115 21.743 24.2505

AV 18.5428 20.809 21.54 23.8827

LN 22.2941 24.748 25.692 27.6253

LE 19.6902 22.384 22.819 24.8637

FL 42.7779 33.706 33.739 48.7289

CP 31.0924 33.548 34.576 39.2707

RS 24.4595 27.19 28.315 29.2844

HE 15.8697 18.572 18.723 18.7702

VM 20.6525 22.901 23.714 23.7745

MN 29.9477 35.579 37.741 37.289

References

[1] ‘Digital Photography Review’ http://www.dpreview.com/

[2] Adobe Photoshop. Adobe Systems.

[3] K. Jensen and D. Anastassiou. Subpixel edge localization and

the interpolation of still images. IEEE Transactions on Image

Processing, 4(3):285–295, 1995.

[4] S. W. Lee and J. K. Paik. Image interpolation using adaptive

fast Bspline filtering. In Proceedings of IEEE International

Conference onAcoustics, Speech, and Signal Processing Vol. 5,

pages 177–179, 1993.

[5] R. Keys. Cubic convolution interpolation for digital image

processing. IEEE Transactions on Acoustics, Speech, Signal

Processing, 29(6):1153–1160, 1981.

[6] J. Allebach and P.W. Wong, Edge-directed interpolation, Proc.

IEEE ICIP, Vol. 3, pp. 707-710, 1996.

[6] V. Vyšniauskas. Triangle based Image Magnification.

Electronics and Electrical Engineering, ISSN 1392-1215- 2006.

Nr. 6(70) elektronika ir elektrotechnika

[7] K. Jenson and D. Anastassiou, Subpixel edge localization and

the interpolation of still images, IEEE Trans. on Image Processing,

4(3), pp. 285-295, 1995.

[8] X. Li and M.T. Orchard, New edge-directed interpolation,

IEEE Trans. on Image Processing, 10(10), pp. 1521-1527, 2001.

[9] D.D. Muresan and T.W. Parks, Aaptive quadratic (AQUA)

image interpolation, IEEE Trans. on Image Processing, 13(5), pp.

690-698, 2004.

[10] X. Yu, B.S. Morse, and T.W. Sederberg, Image

reconstruction using data-dependent triangulation, IEEE Computer

Graphics and Applications, 21(3), pp. 62-68, 2001.

[11] B.S. Morse and D. Schwatzwald, Image magnification using

level-set reconstruction, Proc. IEEE on Computer Vision, pp. 333-

341, 2001.

[12] A. Hertzmann, C.E. Jacobs, N. Oliver, B. Curless and D.H.

Salesin, Image Analysis, Proc. SIGGRAPH, pp. 327-340, 2001.

[13] W.T. Freeman, T.R. Jones, E.C. pasztor, Example based

superresolution, IEEE Computer Graphics and Applications,

22(2), pp. 56-65, 2002.

[14] F. Malgouyres and F. Guichard, Edge direction preserving

image zooming:A mathematical and numerical analysis, SIAM

Journal on Computer Analysis, 39(1), 1-37, 2001.

[15] H. Johan and T. Nishita, A progressive refinement approach

for image magnification, IEEE Proc. 12

th

Pacific Conference

Graphics and Applications, 1550-4085/04.

[16] Muneeb and N. Khattak, An edge preserving locally adaptive

antialiasing zooming algorithm with diffused interpolation, IEEE

Proc, CRN, Vol. 00, p. 49, F1 33189-23-24, March 2006.

Fig.10: Result comparison on the 4

×

Lena image: : (a) Original image,

(b), (c), (d) and (e) are results of PR, BL, BC and proposed method.

(a)

(b)

(c)

(d)

(e)

NCC 2009, January 16-18, IIT Guwahati 371