# A Study of Digital Image Enlargement and Enhancement

Authors: Hsueh-Yi Lin; Chi-Yuan Lin; Cheng-Jian Lin; Sheng-Chih Yang; Cheng-Yi Yu
Journal: Mathematical Problems in Engineering
 (2014)

---

## Abstract

Most image enlargement techniques suffer the problem of zigzagged edges and jagged images following enlargement. Humans are sensitive to the edges of objects; if the edges in the image are sharp, the visual is considered to be high quality. To solve this problem, this paper presents a new and effective method for image enlargement and enhancement based on adaptive inverse hyperbolic tangent  (AIHT) algorithm. Conventional image enlargement and enhancement methods enlarge the image using interpolation, and subsequently enhance the image without considering image features. However, this study presents the method based on Adaptive Inverse Hyperbolic Tangent algorithm to enhance images according to image features before enlarging the image. Experimental results indicate that the proposed algorithm is capable of adaptively enhancing the image and extruding object details, thereby improving enlargements by smoothing the edge of the objects in the image.


---

## Body

## 1. Introduction

The digital images are affordable and easy to preserve, transmit, and modify; they are widely used across different fields. Since digital image sampling is nonsequential and incomplete, digital image resolution is often limited. Therefore, it is necessary to employ image enlargement technologies when viewing portions of an image in detail.The quality of an image is commonly determined by factors in the natural environment. Factors present in the natural environment usually relate to light. If light distribution is extreme, the target object in the picture becomes hard to identify. This study proposes an image enlargement method that combines image enhancement with image enlargement. The proposed image enhancement process employs AIHT algorithm to enhance the image and smooth its edges. The enlargement process uses a bilinear enlargement algorithm to enlarge the enhanced image. This method adaptively enhances images while simultaneously extruding details in the target image, in order to smooth the edges created by enlargement. Image quality is often reduced when images are enlarged. The proposed method can improve image quality following enlargement. The most significant advantage of this method is the ability to reduce rough edges and image distortion even after image enlargement.This paper is structured as follows: Section2 discusses related image enlargement technology algorithms; Section 3 introduces the AIHT algorithm; Section 4 describes the proposed algorithm; Section 5 presents the test and simulation results; the conclusion provides a closing discussion of the proposed algorithm and suggests future research directions and applications.


## 2. Review of Image Enlargement Algorithms

Images are enlarged to enhance image resolution, increase image quality, and improve identification. The goal of this approach is to maintain image quality while eliminating image distortion, such as blurring and rough edges, upon image enlargement.Traditional interpolation methods are commonly employed in image enlargement due to their simplicity and efficiency. Interpolation generally comprises two methods:(1) nearest-neighbor interpolation [1] and (2) bilinear interpolation [2]. When the continuous function passes through, the interpolation function can be used to calculate the sampling points. In theory, higher order interpolation functions are similar to continuous functions. However, this is not the case in practice [3].


### 2.1. Nearest Neighbor Interpolation

Nearest-neighbor interpolation, otherwise known as the substitution method, uses the gray value of neighboring pixels to interpolate the gray value of new pixel points [4, 5]. This method’s approach is to find the neighboring integer pixel points nearest to the noninteger pixel points. The gray value of these integer pixel points is then used to interpolate the gray value of new pixel points (shown in Figure 1).Figure 1
Nearest-neighbor interpolation method.In Figure1 we can see the enlarged image (x′,y′) of the pixel P; then, with conversion back to the original image I(x,y), P is interposed between the pixel e and f. Nearest-neighbor interpolation algorithm is to calculate the P point in the image I(x,y) and its surrounding pixels e, f, h, and i the distance and then choose the shortest distance between the gray values of the pixels, as their gray values. The enlargement process using the nearest-neighbor interpolation algorithm will be encounter with the problem of blocking the effect.The nearest-neighbor interpolation function is the simplest and most efficient interpolation algorithm. However, since it is easier to calculate its results in lower image quality, enlarged images usually display jagged and blocked features. The mathematical function is(1)hr(t)={1,-12<t<120,otherwise.


### 2.2. Bilinear Interpolation

In mathematics, bilinear interpolation is an extension of linear interpolation for interpolating functions of two variables on a regular 2D grid image. The key idea is to perform linear interpolation first in one direction and then again in the other direction. Although each step is linear in the sampled values and in the position, the interpolation as a whole is not linear but rather quadratic in the sample location.In computer vision and image processing, bilinear interpolation is one of the basic resampling techniques. When an image needs to be scaled up, each pixel of the original image needs to be moved in a certain direction based on the scale constant. However, when scaling up an image by a nonintegral scale factor, there are pixels that are not assigned appropriate pixel values. In this case, those holes should be assigned appropriate RGB or grayscale values so that the output image does not have nonvalued pixels. Bilinear interpolation can be used where perfect image transformation with pixel matching is impossible, so that one can calculate and assign appropriate intensity values to pixels. Unlike other interpolation techniques such as nearest neighbor interpolation, bilinear interpolation uses only the 4 nearest pixel values which are located in diagonal directions from a given pixel in order to find the appropriate color intensity values of that pixel.Bilinear interpolation considers the closest 2 × 2 neighborhood of known pixel values surrounding the unknown pixel’s computed location. It then takes a weighted average of these 4 pixels to arrive at its final, interpolated value. The weight on each of the 4 pixel values is based on the computed pixel’s distance from each of the known points (shown in Figure2).Figure 2
Bilinear interpolation method.Similar to nearest-neighbor interpolation, this method calculates new values based on four neighboring integer pixels [6, 7]. Interpolation is calculated as follows:
(2)f(x,y)=(1-dx)(1-dy)p1+dx(1-dy)p2+(1-dx)dyp3+dxdyp4.Thef(x,y) refers to the pixels of the new position point after image enlargement and p1, p2, p3, and p4 indicate the four vertices of the interpolation pixel p. The closer these vertices are to f(x,y), the greater their contribution to f(x,y) will be and vice versa. The neighboring pixels in images enlarged using bilinear interpolation are more continuous, or smoother, than when the integer points are acquired directly.


## 2.1. Nearest Neighbor Interpolation

Nearest-neighbor interpolation, otherwise known as the substitution method, uses the gray value of neighboring pixels to interpolate the gray value of new pixel points [4, 5]. This method’s approach is to find the neighboring integer pixel points nearest to the noninteger pixel points. The gray value of these integer pixel points is then used to interpolate the gray value of new pixel points (shown in Figure 1).Figure 1
Nearest-neighbor interpolation method.In Figure1 we can see the enlarged image (x′,y′) of the pixel P; then, with conversion back to the original image I(x,y), P is interposed between the pixel e and f. Nearest-neighbor interpolation algorithm is to calculate the P point in the image I(x,y) and its surrounding pixels e, f, h, and i the distance and then choose the shortest distance between the gray values of the pixels, as their gray values. The enlargement process using the nearest-neighbor interpolation algorithm will be encounter with the problem of blocking the effect.The nearest-neighbor interpolation function is the simplest and most efficient interpolation algorithm. However, since it is easier to calculate its results in lower image quality, enlarged images usually display jagged and blocked features. The mathematical function is(1)hr(t)={1,-12<t<120,otherwise.


## 2.2. Bilinear Interpolation

In mathematics, bilinear interpolation is an extension of linear interpolation for interpolating functions of two variables on a regular 2D grid image. The key idea is to perform linear interpolation first in one direction and then again in the other direction. Although each step is linear in the sampled values and in the position, the interpolation as a whole is not linear but rather quadratic in the sample location.In computer vision and image processing, bilinear interpolation is one of the basic resampling techniques. When an image needs to be scaled up, each pixel of the original image needs to be moved in a certain direction based on the scale constant. However, when scaling up an image by a nonintegral scale factor, there are pixels that are not assigned appropriate pixel values. In this case, those holes should be assigned appropriate RGB or grayscale values so that the output image does not have nonvalued pixels. Bilinear interpolation can be used where perfect image transformation with pixel matching is impossible, so that one can calculate and assign appropriate intensity values to pixels. Unlike other interpolation techniques such as nearest neighbor interpolation, bilinear interpolation uses only the 4 nearest pixel values which are located in diagonal directions from a given pixel in order to find the appropriate color intensity values of that pixel.Bilinear interpolation considers the closest 2 × 2 neighborhood of known pixel values surrounding the unknown pixel’s computed location. It then takes a weighted average of these 4 pixels to arrive at its final, interpolated value. The weight on each of the 4 pixel values is based on the computed pixel’s distance from each of the known points (shown in Figure2).Figure 2
Bilinear interpolation method.Similar to nearest-neighbor interpolation, this method calculates new values based on four neighboring integer pixels [6, 7]. Interpolation is calculated as follows:
(2)f(x,y)=(1-dx)(1-dy)p1+dx(1-dy)p2+(1-dx)dyp3+dxdyp4.Thef(x,y) refers to the pixels of the new position point after image enlargement and p1, p2, p3, and p4 indicate the four vertices of the interpolation pixel p. The closer these vertices are to f(x,y), the greater their contribution to f(x,y) will be and vice versa. The neighboring pixels in images enlarged using bilinear interpolation are more continuous, or smoother, than when the integer points are acquired directly.


## 3. Adaptive Inverse Hyperbolic Tangent (AIHT) Algorithm

The world is filled with various images, which are representations of objects and scenes in the real world. Images are represented by a matrix of pixels, which can represent the gray levels or colors of the image. There are many aspects of images that are ambiguous and uncertain. Examples of these vague aspects include determining the border of a blurred object and determining which gray values of pixels are bright and which are dark [8]. If an image containing both objects and scenery gets too dark or blurred, it would be hardly recognized. Thus, the image enhancement technique is used to improve the appearance of an image for analysis and interpretation [9]. The objective of image enhancement is dependent on the application context; criteria for enhancement are often subjective or too complex to be easily converted to useful objective measures. The range of brightness values within an image is referred to as contrast. The contrast enhancement is a process that makes the image features stand out more clearly by optimizing the colors available on the display or an output device.Figure3 displays image enhancement using AIHT algorithm. In this method, the color image is first reformatted. The most distinctive feature of this algorithm is the use of AIHT function to modify the pixels based on their individual traits. The shape of the inverse hyperbolic tangent is controlled based on the bias and gain of light distribution in the original image [10, 11]. The AIHT algorithm has several desirable properties. For very small and very large luminance values, its logarithmic function enhances the contrast in both dark and bright areas of an image [12]. Because this function is an asymptote, the output mapping is always bounded between 0 and 1. Another advantage of this function is that it supports an approximately inverse hyperbolic tangent mapping for intermediate luminance, or luminance distributed between dark and bright values. [13–15].Figure 3
AIHT function image enhancement algorithm procedures.The calculation fortanh-1(x) can be derived either algebraically from the definition of tanh-1(x) or by converting the derivative to a series and then integrating. The contrast of an image can be enhanced using inverse hyperbolic tangent function by (3). Adding the bias and gain parameters to control the shape of the inverse hyperbolic tangent curve leads to (4). Consider
(3)tanh-1(x)=12log⁡(1+x1-x),(4)Enhance(xij)=(log⁡(1+xijbias(x)1-xijbias(x))-1)×gain(x),
where bias(x) refers to bias power function and gain(x) refers to gain function.Wherexij is the image gray level of the ith row and jth column, the bias(x) is a power of xij to speed up the changing. The gain function is a weighting function which is used to determine the steepness of the AIHT curve. A steeper slope narrows a smaller range of input values to the display range. The gain function is used to help shape how fast the midrange of objects in a soft region goes from 0 to 1. A higher gain value means a higher rate in change. Therefore the steepness of the inverse hyperbolic tangent curve can be further dynamically adjusted. The following section describes the method we will use, which is similar to the proposed algorithm.


### 3.1. Bias and Gain Parameters

The bias function is a power function defined over the unit interval which remapsx according to the bias transfer function [16]. The bias function is used to bend the density function either upwards or downwards over the [0,1] interval.The bias power function is defined by(5)bias(x)=(mean(x)0.5)0.25=((1/m×n)∑i=1m∑j=1nxij0.5)0.25.The gain function determines the steepness of the AIHT curve. A steeper slope maps a smaller range of input values to the display range. The gain function is used to help reshape the object’s midrange from 0 to 1 of its soft region. The gain function is defined by(6)gain(x)=0.1×(variance(x))0.5=0.1×(1m×n∑i=1m∑j=1n(xij-μ))0.5,whereμ=1m×n∑i=1m∑j=1nxij.Decreasing the gain value increases the contrast of the remapped image. Shifting the distribution toward lower levels of light (i.e., decreasing bias) decreases the highlights. By adjusting the bias and gain, it is possible to tailor a remapping function with appropriate amounts of image contrast enhancement. Figure4 shows a block diagram of AIHT parameters evaluate, including bias and gain parameters.Figure 4
A block diagram of AIHT parameters evaluates.The gain function determines the steepness of the curve. Steeper slopes map a smaller range of input values to the display range. The value of bias controls the centring of the inverse hyperbolic tangent. As seen in Figure5, bias(x) can be used to confirm the turning point and curve shape of the inverse hyperbolic tangent function. Figure 6 shows the different mapping curves at different gain value processing.Figure 5
Constantgain(x) parameters and changed bias(x) parameters.Figure 6
Constantbias(x) parameters and changed gain(x) parameters.


## 3.1. Bias and Gain Parameters

The bias function is a power function defined over the unit interval which remapsx according to the bias transfer function [16]. The bias function is used to bend the density function either upwards or downwards over the [0,1] interval.The bias power function is defined by(5)bias(x)=(mean(x)0.5)0.25=((1/m×n)∑i=1m∑j=1nxij0.5)0.25.The gain function determines the steepness of the AIHT curve. A steeper slope maps a smaller range of input values to the display range. The gain function is used to help reshape the object’s midrange from 0 to 1 of its soft region. The gain function is defined by(6)gain(x)=0.1×(variance(x))0.5=0.1×(1m×n∑i=1m∑j=1n(xij-μ))0.5,whereμ=1m×n∑i=1m∑j=1nxij.Decreasing the gain value increases the contrast of the remapped image. Shifting the distribution toward lower levels of light (i.e., decreasing bias) decreases the highlights. By adjusting the bias and gain, it is possible to tailor a remapping function with appropriate amounts of image contrast enhancement. Figure4 shows a block diagram of AIHT parameters evaluate, including bias and gain parameters.Figure 4
A block diagram of AIHT parameters evaluates.The gain function determines the steepness of the curve. Steeper slopes map a smaller range of input values to the display range. The value of bias controls the centring of the inverse hyperbolic tangent. As seen in Figure5, bias(x) can be used to confirm the turning point and curve shape of the inverse hyperbolic tangent function. Figure 6 shows the different mapping curves at different gain value processing.Figure 5
Constantgain(x) parameters and changed bias(x) parameters.Figure 6
Constantbias(x) parameters and changed gain(x) parameters.


## 4. Image Enlargement and Enhancement Using AIHT Algorithm

Figure7 illustrates an effective method of image enlargement and enhancement using AIHT algorithm. Most image enlargement and enhancement methods enlarge images via interpolation before conducting enhancement. The processing operations are performed and shown in Figure 7(a). Conversely, the proposed method conducts image enhancement using AIHT algorithm before enlarging the image, combining image enhancement and enlargement technologies. Steps to complete the processing are performed as in Figure 7(b).Image enlargement and enhancement using AIHT algorithm.
(a)
Enlargement before enhancement
(b)
Enhancement before enlargementIn the image enhancement stage, AIHT algorithm is used to enhance images and soften edges. In the image enlargement stage, the bilinear interpolation enlargement algorithm is used to enlarge the enhanced images. The proposed method adaptively enhances images and extrudes image details to solve the problem of jagged edges common in image enlargements.


## 5. Results and Discussion

The test images used in this study represent three extremes: overly dark images, overly bright images, and back-lighted images. Figure8 shows the results of image enlargement and enhancement using AIHT algorithm and compares images that were enlarged then enhanced to those that were enhanced before they were enlarged.Figure 8
Enlargement and enhancement of various images using AIHT algorithm and a comparison between enlarging before enhancing and enhancing before enlarging.In this study, low-resolution images were enlarged 16 times, and the results of images that were enlarged before being enhanced were compared with those of images that were enhanced before being enlarged. Figure8 compares the processing of images that were enlarged before being enhanced with the processing of images that were enhanced before being enlarged. The results showed that images that were enlarged before being enhanced had blurry and jagged edges, while enhancing before enlarging the images, as proposed in this study, improved these problems.Table1 compares the mean square error (MSE), signal-to-noise ratio (SNR), and peak signal-to-noise ratio (PSNR) values of images that were enlarged before being enhanced with images that were enhanced before being enlarged. The MSE, SNR, and PSNR values of back-lighted images, overly dark images, and overly bright images produced better results when enlarged before being enhanced, while normal images produced better results when enhanced before being enlarged. However, MSE, SNR, and PSNR values are not the only factors that determine image quality and therefore can only be used as a reference. Image quality can only be assessed accurately via manual inspection, and, as such, the image processing algorithm should conform to human visual reactions.Table 1
MSE, SNR, and PSNR values.
Image type
Enlarging before enhancing
Enhancing before enlarging
MSE
SNR
PSNR
MSE
SNR
PSNR
Back-lighted image
0.0276
15.9371
36.1769
0.0303
14.5373
32.9995
Overly dark image
0.0703
0.1906
14.2231
0.0694
0.1931
14.4061
Overly bright image
0.0289
29.3762
34.6451
0.0293
28.9550
34.1483
Normal image (1)
0.0183
13.9743
54.5193
0.0168
15.2157
59.3623
Normal image (2)
0.0137
36.2847
72.7440
0.0126
39.6825
79.5560


## 6. Conclusions

The quality of digital images typically decreases when they are enlarged. Most image enlargement and enhancement methods increase image size using interpolation before enhancement. Conversely, this paper suggests enhancing images using AIHT algorithm before enlarging them. Unlike other studies that do not consider the unique features of the original images during enhancement, this study’s proposed method conducts adaptive image enhancement and enlargement to optimize the quality of the enlarged images. The proposed algorithm(1) optimizes image quality by adaptively enhancing different types of images and extruding object details, and (2) increases the resolution of processed images to enhance image quality and reduce image distortion, such as blurring and jagged edges, resulting from image enlargement.



---

*Source: 825169-2014-04-28.xml*