# Image Interpolation with Regional Gradient Estimation
## 3 Image Interpolation with Regional Gradient Estimation  
### Regional Gradient Estimation  
We introduced a bicubic interpolation method to calculate the gradient value of unknown pixels. Bicubic interpolation uses the gradient values of 16 points around the point to be interpolated for cubic interpolation; this approach not only considers the influence of the gradient of the four directly adjacent points but also considers the influence of the gradient value change rate between adjacent points. However, if bicubic interpolation is performed on all unknown pixels in an image, the image's local characteristics are ignored, resulting in a large computational burden. In reality, images have both flat areas and areas with rich texture details. The image gradient changes smoothly in the flat area. For such areas, the effect obtained by a complex method is the same as that obtained by a simple method, but the calculation requirements increase significantly. Therefore, by using an interpolation method with lower computational requirements for flat areas and using bicubic interpolation in areas with intricate details, the amount of computation can be reduced while maintaining the quality of the enlarged image. Based on this consideration, we need to improve the bicubic interpolation method according to the region.  
To obtain an HR image, as shown in Equation (8), we first copied the pixel values and properties at the \((i,j)\) position in the LR image to the \((2i-1,\,2j-1)\) position in the HR image. Next, we proposed a gradient estimation strategy. As shown in Figure 6, for the pixel at position \((i+v,j+u)\), we calculated the gradient variance \(Var\) of the four-pixel in the \((i+v,j+u)\) position neighborhood in the original image. If the variance was less than the threshold T, the average of these four gradient values was taken as the gradient value of the pixel at \((i+v,j+u)\); otherwise, we used bicubic interpolation to calculate the gradient. Equation (10) is the formula for calculating the variance Var.  
\[Var=(U-u_{11})^{2}+(U-u_{12})^{2}+(U-u_{21})^{2}+(U-u_{22})^{2} \tag{10}\]  
In Equation (11), \(u_{11}\), \(u_{12}\), \(u_{21}\), and \(u_{22}\) are the gradient values of the four pixels around position \((i+u,j+v)\) in the LR image, and \(U\) is the mean value of the gradient of the four pixels. Calculating U requires one multiplication and three additions. From Equation (10), we need four multiplications and seven additions to calculate the variance. In total, five multiplications and ten additions are required, much less than the 70 multiplications and 45 additions required to calculate the pixel gradients by bicubic  
Figure 5: Comparison of local gradient calculation results. The red arrow represents the direction in which the pixel intensity value changes the most, which can also be called the gradient value. (a) the gradient of pixel a and pixel b in the original image; (b) the gradient calculation result of the CGI method.  
interpolation. According to the experiments, the reduction in computation and the maintenance of image quality remain relatively reasonable when the threshold T = 18 [30]. Although the variance is calculated once for each image point, the total number of operations is still significantly reduced compared to bicubic interpolation.  
Figure 7 shows the visualization results of gradient calculations for the same test image, using both the method in this paper and the CGI method. Figure 7a shows the test image, and Figure 7b shows the result of the gradient visualization of the test image. The gradient visualization of the HR image that was estimated from the LR image using the CGI method is shown in Figure 7c. The result of the GEI method is shown in Figure 7d. The gradient calculated by the CGI method produced significant artifacts, especially at edge intersections, with significant errors when compared to the original image gradient, as shown in the yellow box in Figure 7c. In contrast, the gradient visualization estimated by the proposed method was close to the original image.