1. Introduction
Image magnification is one of the important issues in the fields of image processing, computational medicine, computer graphics, computer vision, and virtual reality. It has a wide range of applications in medical image-aided diagnosis, product defect inspection, and visualization. The purpose of image magnification is to increase the number of pixels in the image so as to increase the details of the image and to make its features clearer, helping doctors better understand the details of the lesions. Image magnification methods can be divided into three categories: fitting-based methods, learning-based methods, and other methods.
In a fitting-based method, a surface is constructed from a low-resolution image. Then, more sampling points are obtained by the surface to generate a high-resolution image. Early fitting methods include bilinear interpolation [
1] and bicubic interpolation [
2,
3]. In these methods, the magnified images produced by bicubic interpolation have higher accuracy, while the least square [
4] is similar to the two types of interpolation methods. Sometimes, there are obvious sawtooth and ringing, and serious distortion in the magnified image [
1,
2,
3,
4]. The common feature of the magnified images by these methods is that the effect is better in flat areas, but it is not ideal in non-flat area (edge and texture). In order to reduce the sawtooth and blur in the magnified image, Zhang et al. proposed a soft decision estimation method [
5]. Compared with other interpolation methods, this method calculates the pixel values of a group of high-resolution images at one time, but the generated high resolution of image has no significant improvement in visual effect. In [
6,
7], an image magnification method based on gradient direction was proposed. The gradient direction of the high-resolution image is estimated by the gradient direction of the low-resolution image. In [
8], images are magnified by optimizing the second-order directional derivative of the edge direction. However, in most cases, the effect of the image magnification is not ideal. Zhang et al. proposed a method for fitting an image using a bicubic polynomial surface generated by combining quadratic polynomial surfaces [
9,
10]. The magnified image has quadratic polynomial precision in the following sense. That is, if a given image is obtained by sampling from a quadratic polynomial function, a quadratic polynomial function is reconstructed by a bicubic polynomial surface, which is generated by combining the quadratic polynomial surfaces. The images by References [
9,
10] can reduce the distortion phenomena such as sawtooth and ringing, but the accuracy and visual quality of the magnified image are not ideal.
The methods of image amplification based on learning can learn the missing high-frequency information from the training set of HR and LR image pairs. These methods can be roughly divided into two categories: the first category relies on an external dictionary constructed by a group of external training images, and the second category uses LR image itself to replace the external training set. For the former, LR image generates an HR image with the help of a training pair. Common methods include regression-based methods [
11], sparse expression-based methods [
12,
13], and so on. These methods using the external data sets usually perform well for certain categories of images, but the amplification effect of some images is not ideal. In [
14], for each LR patch, a linear function needs to be learned to map it to its HR version. However, it is inevitable to generate errors by searching for magnified image block to find LR–HR patch pairs. Reference [
15] proposed a high-resolution image generation method based on self-similarity (SelfExSR). The method expands the internal patch searching space through geometric changes and improves the visual effect. However, if the LR image does not contain enough similar patterns, these methods will produce sharp edges. In addition, Dong et al. [
16,
17] proposed the image super-resolution using deep convolutional networks (SRCNN), which directly learned the end-to-end mapping between HR and LR images. The method improved the quality of magnified images and the amplification speed. Ding et al. [
18] achieved remarkable results by establishing a lightweight database and learning adaptive linear regression to map LR image blocks directly into HR blocks. However, there are some problems with these methods. First, the reconstructing effect of these algorithms depends on a trained image library, which limits the application of them. Second, the algorithm requires a lot of time to train the model. Third, the acquired model can only be used for magnification of a fixed multiple; however, the model needs to be retrained to magnify different multiple.
In other types of image magnification methods, fractal is an effective tool for describing image texture. Therefore, it is widely used for texture description and classification. In [
19], a texture descriptor was proposed, which implicitly combines information from space and frequency domain. Reference [
20] proposed a depth upsampling method based on joint bureau partial analysis and boundary consistency analysis. In [
21], an image magnification method using a special type of orthogonal fractal coding method is proposed. It can produce better details, but it cannot restore sharper edges. In [
22], a texture enhancement method was proposed. Using local fractal analysis to improve image magnification performance, the method can effectively enhance image details. However, it does not provide satisfactory results in random texture regions. Reference [
23] proposed a fractal interpolation method applying the fractal analysis method to image interpolation, which can better preserve the edge structure of the image. Firstly, according to image features, the image is divided into textured regions and non-textured regions. Secondly, a rational fractal interpolation model is used in the texture region, and a rational interpolation model is used in the non-texture region. Finally, the HR image is obtained through pixel mapping. This method can recover more satisfactory details than other interpolation methods. Unlike the learning-based method relying on the source of the training patch, this method obtains competitive performance by using LR image patch information. Based on error minimization, iterative back projection can significantly improve the quality of the image. Reference [
24] proposed an image restoration and amplification method combining nonlocal self-similarity and global structure sparsity. A group of similar image blocks is reconstructed by adaptive regularization techniques based on weighted kernel norms, and a new strategy is used to maintain the global structure. The strategy decomposes the image into smooth components and sparse residuals. The latter uses L1 norm to regularization, which provides a new method for image restoration and magnification. Irani and Peleg [
25] continue to degrade the high resolution, to calculate errors, and to optimize the error until the error is less than a certain threshold. The quality of the reconstructed image is significantly enhanced, but there are obvious sawtooth and ringing in the edge area. In [
26,
27], a nonlocal iterative back projection method was proposed. By searching for similar blocks in a certain area, the average image of the magnified image is filtered and the sawtooth and ringing phenomena can be corrected to improve the correctness of the error image. This method improves the shortcomings of the method [
25] and improves the image quality to a certain extent. If the features of an image can be extracted first and the different edges of the image are segmented [
28,
29], then the surface is fitted based on the features and the edge structure; the accuracy and the visual effect of the magnified image can be significantly improved.
As the image data points are complex, this paper uses a piecewise polynomial surface to fit the given image. A sampling quadratic polynomial patch is constructed on a small adjacent area of each pixel. All the sampling quadratic polynomial patches are weighted averagely to generate the whole sampling surface of the magnified image. In order to improve the quality of the magnified image, this paper generates a magnified image by the whole surface with the correcting surface. The correction surface is constructed by the error image, which is computed by the magnified image. To make the magnified image with higher quality, the constructed quadratic polynomial sampling surface patch is required to satisfy two conditions: high precision and the shape described by the corresponding image block. For satisfying the two conditions, the quadratic polynomial patch is constructed with the edge feature as constraints and it has quadratic polynomial approximation accuracy. A model describing constraint based on the edge feature is proposed. It is inevitable that there are errors in the approximation by the quadratic polynomial patches, especially the approximation effect is not ideal at the complex edge. The correcting surface is constructed to reduce the errors in the magnified image. A method for calculating the error image is proposed. The image magnified twice is compressed twice to obtain a compressed image, and the error image is calculated from the difference between the compressed image and the given image, which provides a new technique for constructing the correcting surface.
The following content of this paper is arranged as follows. The second section is the basic idea and description of the method. The third and fourth sections describe the construction process of our image magnification method. The fifth section compares the results of the magnified image by different methods. The sixth section is the summary of the method and the future work.
2. Basic Idea and Description of the Method
For a given image
P, composed of
pixels
(shown by black dots in
Figure 1), it is obtained by sampling from an original scene [
17,
18] according to the image generation principle. These pixels
can be regarded as the points
in a 3D coordinate system with coordinates
. For the convenience of the following description, the points
,
are regarded as being sampled from a surface
; then, the sampling formula
of
can be written as follows:
where
is the side length of the sampling square area.
Without loss of generality, the side length of the sampling square region of a given pixel
can be taken as 1, so h = 0.5. Then, there is
The essence of image magnification is that more points on the surface are obtained. If the surface can be reconstructed, the image magnification becomes a problem of calculating the point on the surface . Because of the complexity of the scene and sampling mechanism, it is impossible to reconstruct accurately. Therefore, only an approximating surface representing can be constructed. That is, the approximating surface is inevitably subject to errors or noise.
Because the original scene is usually complex, the corresponding surface is complex. Construction of a whole polynomial surface to fit will not only produce large errors but also generate a large amount of calculation. According to approximation theory, if any given complex function is piecewise continuous and differentiable, it can be approximated with arbitrary precision by piecewise surfaces. Therefore, we construct a sampling patch in a small neighborhood of each pixel, and all patches are weighted to form a whole approximation surface . approximates the sampling surface of . Because polynomials has a good mathematical basis, is simple, and is easy to calculate, the polynomial function is widely used in numerical fitting. This paper uses polynomial surfaces to construct surface patches. Based on the above discussion, the process of image magnification in this paper can be described as the following three parts:
(a) For each pixel
, its coordinate in 3D coordinate system is
. In order to simplify the complexity of the problem and to reduce the amount of calculation, the approximate surface patch corresponding to
is constructed with a quadratic polynomial patch on the small area where the pixel
is located. Another reason for constructing approximate patches using quadratic polynomials is that, although biquadratic polynomials can be constructed uniquely from
and the 8 adjacent points, our computation results show that the biquadratic polynomials surface interpolating 9 pixels are often difficult to have the shape represented by the 9 data points. The approximate quadratic polynomial surface patch
of the original scene corresponding to
can be written as follows:
where
.
and
are the undetermined coefficients.
(b) Note that the sampling surface patch of on the square area with side length is approximated by a quadratic polynomial patch . The whole sampling surface is generated by the weighted average of . Since has an approximation error, correcting surface patches , are constructed by the approximation errors. The sampling surface patch is corrected by so as to improve the accuracy and shape of .
(c) The magnified image is obtained by calculating the sampling points of .
The discussion above showed that the accuracy and shape of the whole sampling surface is determined by the quadratic polynomial patch , ; hence, the key point is to construct . Following, we will discuss how to construct the quadratic polynomial sampling patches .
3. Constructing Quadratic Sampling Patches
Firstly, we construct a quadratic polynomial sampling patch
to approximate the pixels on the small neighborhood with the edge features as constraints. Considering the symmetry, we construct
(Equation (
3)) with
and 8 pixel points adjacent to
(as shown in
Figure 1, where
is the center of 9 points) for
. That is,
is determined by 9 pixels
. The constructed
should have the quadratic polynomial precision and the shape described by 9 pixels. Ideally,
passes
and 8 adjacent points, i.e., passes
. Replace
in Equation (
1) with
in Equation (
3) and integrate to get the sampling surface patch
on the square area with side length
as follows:
where
and where
and
are the undetermined coefficients.
In Equation (
4), taking h = 0.5 and
gets the following 9 equations:
Equation (
5) is the integral of Equation (
2) over the 9 unit squares as shown in
Figure 1.
The accuracy and shape of the sampling surface
is completely determined by the sampling patch
(
4). In order to improve the accuracy of
, the technology of balancing polynomial coefficients is put forward. Next, we will discuss how to calculate the 6 undetermined coefficients
and
using the 9 equations in Eqauation (
5).
In Equation (
5), there are 9 equations and 6 unknowns. The common method is to determine 6 unknowns by the least square method. Because 9 points in the neighborhood of
may belong to different surfaces in the original scene, the role of 9 points should be different in the construction of
. To make
closer to 9 pixels, we use the weighted least squares to determine 6 unknowns. Different weights are used to make each pixel have different effects on determining 6 unknowns. In order to determine the 6 unknowns better, we first analyze the coefficient influence of
on the shape of the surface. Because
,
are local surface patches, they form a whole sampling surface
by the weighted average.
only plays a large role on the
in its adjacent area. According to the characteristics of Taylor expansion, in the local area, the influence of constant term, line term, and quadratic term of
on the shape of
decrease in turn. Therefore, we will use different strategies to determine these unknowns. The six coefficients are divided into three groups according to the constant term, the first term, and the quadratic term. The calculation of the three groups of coefficients will be discussed below.
Let us firstly discuss the calculation of the coefficients and ; then discuss the calculation of and ; and finally calculate . The process of calculating , and is divided into three steps, which not only reduces the amount of calculation but also improves the accuracy of the patches. The following discusses how to calculate the coefficients and .
3.1. Calculating the Coefficients of First Term
Based on Equation (
5), the following four equations can be obtained [
18]:
where,
Equation (
6) has four equations with two unknowns
and
. Using the weighted least squares method,
and
are determined by minimizing the objective function
defined by
where
is the weight function.
Let us consider how to define the weight function in Equation (
7). If 9 pixels
are sampling points on the same object, we could set
, considering the relative positions of the other 8 pixels and
.
and
take smaller weights because their corresponding first-order differences
and
are on the diagonal (as shown in
Figure 1). The points relatively far away from
should be assigned a smaller weight. If the 9 pixels are sampling points on the different objects, there are edges in the 9 pixels; that is, at least three pixels are on an edge. To simplify the complexity of the problem, we assume that there are up to four edges in a block of 9 pixels, which are on the horizontal, vertical, and diagonal lines of
Figure 1. For ensuring the edge features of the magnified image, the pixels on an edge should play a relatively large role in the determination of
and
, which is equivalent to assigning a relatively large value to the corresponding weight in Equation (
7). For example, if
,
, and
are on the diagonal edge,
should give a relatively large weight. Note
is a second-order difference along four directions.
The feature of
,
, and
on the edge is that
in Equation (
8) has a relatively small value. Therefore, assigning a relatively large weight to
is equivalent to
being inversely proportional to
. If
,
, and
are on the edge, the corresponding
in Equation (
8) of the edge’s normal direction is usually relatively large, and then, giving a relatively large weight to
is equivalent to
being proportional to
. Based on the above discussion, the weight
can be defined as follows:
where
are defined in Equation (
8). Experimental results show that
is preferable in Equation (
9).
3.2. Calculating the Coefficients of Quadratic Term
Since
and
are computed, there are 9 equations with four unknowns in Equation (
5):
,
,
, and
. The third group of coefficients for
and
can be determined based on 9 equations. In order to improve the accuracy of interpolation, two sets of values of
and
are determined. The final values of
and
are calculated using the weighted averages of the two sets of values.
The following discusses how to determine the first set of values for
,
and
. Using the 9 equations in Equation (
5), we have the following 8 difference equations:
In these 8 equations, there are 3 unknowns:
,
, and
. Using the weighted least squares method, the 3 unknowns are determined by minimizing the objective function
defined by the following:
where
,
,
is the weight function.
How to determine the weight function in Equation (
10) is discussed below. Edge features and distance play an important role in determining
and
and should also play an important role in determining
, and
. Therefore, based on the discussion of Equation (
9), the weight function can be defined as follows:
where
,
are defined by Equation (
9).
The 9 pixels shown in
Figure 1 are in horizontal, vertical, and two diagonal directions. For each pixel, it is unreasonable to simply assign the same weight to the two pixels on an edge in the same direction. For example, for horizontal
and
, if
and
are sampling points on the same object and
is sampling point on another object, it is reasonable to assign relatively large weights to
and
and to assign a relatively small weight to
, while according to Equation (
11),
and
are assigned the same weight. For this reason, the new weights are defined as follows:
where
on the right side of Equation (
12) is defined by Equation (
11).
For the convenience of the following discussion, the first set of values for
,
, and
computed by Equations (
10)–(
12) are denoted as
and
.
In the following, we discuss how to determine the second set of values for
and
. From Equation (
5), one gets the following three equations:
These three equations correspond to the four pixels,
and
, which form a square in
Figure 1. When
and
are determined,
can be calculated from Equation (
13) and denoted as
. Similarly, the other three sets of values for
,
, and
can be calculated from the pixels forming the other three square in
Figure 1, which are denoted as
and
, respectively.
Let us consider how to determine the second set of values for
by
,
. In order to make the quadratic polynomial as simple as possible,
and
should be as small as possible. According to the approximation theory, the interpolation function should be as simple as possible on the premise of satisfying the approximation accuracy. Therefore,
is determined by weighted average of
, and the weight corresponding to
should be inversely proportional to
. Now, the second set of values for
, denoted as
and
, is defined by
where
),
are weight functions,
is a very small positive value.
We do not simply use Equation (
15) to compute the second set of values for
. Equation (
15) is a simple weighted average. The experiment results and the following discussion also showed that the magnified image is not good using Equation (
15) to compute the second set of values for
,
, and
.
Experimental results also show that the quadratic polynomial defined by Equation (
14) does integrate the advantages of the four quadratic polynomials, and its surface shape is closer to the shape represented by the 9 pixels in
Figure 1. From
,
, and
,
and Equation (
14), we can define 6 patches, respectively, denoted as
and
, which are all approximation to the 9 pixels in
Figure 1. The approximation errors of six patches to 9 pixels are denoted as
, respectively, and hence, 6 error images
can be obtained by
. Using Baboon and Kod in the 12 typical images in
Section 5, two error images can be generated with the 6 patches.
Figure 2 is a histogram of two error images, where the top-down histograms correspond to Baboon and Kod images, respectively. In
Figure 2,
denotes the number of pixels with value
n in the error image
. For the sake of clarity, each histogram is divided into two parts. Since the number of pixels with value 0 is too small compared with the number of pixels with value 1, the former is not displayed to make the histogram visually clear. In
Figure 2, the left figures are the histograms of pixels with error values of 1–20 and the right figures are the histograms of the rest error pixels. It is obvious from the curve
in
Figure 2 that, in the error image
generated using
by Equation (
14), the pixels with small error value are the most and the pixels with large error value are the least, while it is also obvious from the curve
that, compared with the error images
, the pixels with large error value in the error image
generated using
by Equation (
15) are relatively larger and the pixels with small error value are small.
From Equations (
10) and (
12), the first set of values
, and
are computed. From Equations (
13) and (
14), the second set of values
, and
are computed. The final values of
, and
, are computed by the weighted average of the two sets of values
,
, and
,
. Similar to the discussion of Equation (
14), the coefficient with small absolute value is assigned a large weight. That is, the coefficients
and
are defined by
where
is weight function,
,
is a very small positive value.
3.3. Calculating the Constant Term
Now, how to compute
is discussed.
and
are obtained above, so that only one unknown
is left in Equation (
5).
is determined by the weighted least squares method from the 9 equations in Equation (
5). That is,
is determined by minimizing the objective function
defined by
where
The weight
is defined by Equation (
11). Since the pixel
is located at the center of a pixel block consisting of 9 pixels, the corresponding weight
should be given a larger value.
is defined as follows:
6. Conclusions
It is an effective method to construct a surface to approximate the image and then sampling the surface to generate the magnified image, especially when magnifying medical images. The key problem is how to construct the approximation surface. Based on the complexity of image shape, it is an effective strategy to construct local surfaces and to generate a whole sampling surface by the weighted combination of the local surfaces. In this paper, the second-order difference quotient is used to describe the characteristics of the pixels at the edge, which better distinguishes the characteristics difference between the pixels at the edge and the pixels at the non-edge. In the process of local surface construction, we use the edge features of the image as constraints to construct a quadratic polynomial surface patch on the adjacent area of each pixel. Four adjacent quadratic polynomial patches are weighted to form a bicubic surface. All the bicubic surfaces are put together to form the whole sampling surface. The constructed bicubic surface has quadratic polynomial precision. It is inevitable that there are errors in the magnified image obtained from the whole sampling surface. The correction surface can be formed by the approximation error, so as to correct the errors and to improve the approximation accuracy of the whole sampling surface. Due to the use of edge feature constraints to construct local surfaces, each local surface can better maintain the edge features or texture features near the pixels. Experiment results showed that it is an effective method to magnify the image by constructing local surface patches with edge feature constraints, especially for medical image.
Although the magnified image keeps information such as the edge texture of the image well, there is still a lack of edge and texture information. Moreover, the bicubic surface should have bicubic polynomial precision, but the method in this paper has only quadratic polynomial precision. Therefore, our future research work is to improve the retention of edge and texture information and the interpolation accuracy, so that the magnified image has higher image quality and better visual effect.
In addition,
Table 2 and
Figure 8 show that, for the aliasing images in AIS, the eight methods are not ideal for enlarging the images. It is necessary to study a new image magnification method according to the characteristics of the aliasing images. Because in the aliasing images, there are many edges and the difference of pixel values at the edge is large. One idea to consider is to magnify the aliasing image by the combination of segmentation and fitting. Firstly, the image is segmented, and then, the piecewise fitting patches are constructed based on the segmentation results so as to reduce the oscillation of the patchs as much as possible. This is our second research work we will do next.