# Image Interpolation with Regional Gradient Estimation
## 2 Fundamental Issues and Ideas
Point C in Figure 3b is located on the edge considered by the standard nonlinear image interpolation method, and the nonlinear interpolation method can ensure that the pixels on the edge appear clearly in the HR image. Because points A and B in Figure 3b are considered non-edge pixels, linear interpolation is used for them. However, the interpolation neighborhood for pixel B crosses the edge, and if the gray values on both sides of the edge change abruptly, the image edges will be blurred after nonlinear interpolation. To ensure the integrity of the interpolation effect, non-edge pixels within a specific range from the edge should be considered separately; thus, in this work, different interpolation strategies were employed for them. Figure 3c depicts the edge after edge diffusion. Because the edge after diffusion covers pixel B, a nonlinear interpolation method is employed to process it. The variational method of image diffusion is used in the CGI method to achieve edge diffusion [19]. This paper focuses solely on images after gradient edge diffusion has already been performed. Let us consider image interpolation at the pixel level. An image is made up of discrete pixel points. In Figure 4, the solid squares represent known pixels, and the hollow squares represent unknown pixels. After copying the pixels from the LR image into the HR image, there are three unknown pixels around \(I_{\text{HR}}\) (\(2i-1\), \(2j-1\)), namely the diagonal pixel at (\(2i\), \(2j\)), the column pixel at (\(2i\), \(2j-1\)), and the row pixel at (\(2i-1\), \(2j\)). Image edges can only be formed along these four directions in the discrete state; we have simplified the possible edge directions to four cases, that is, \(\theta=0^{\circ}\), \(\theta=45^{\circ}\), \(\theta=90^{\circ}\), and \(\theta=135^{\circ}\), as shown in Figure 4.  
It has been observed that variations in pixel intensity values along the tangent direction of the contrast boundary are always much smaller than those of the direction normal to the boundary. So, we can calculate the pixel gradient along two orthogonal directions to determine whether the pixel is located on the edge; if so, we need to determine the edge direction. Furthermore, if there is a significant difference between the two orthogonal directions, the pixel is classified as an edge pixel. To calculate the gradient difference, we must select a set of orthogonal edge directions. Let us choose \(45^{\circ}\) and \(135^{\circ}\) orthogonal  
Figure 4: Illustration of edge directions in a digital image. The orange arrows represent the \(45^{\circ}\) and \(135^{\circ}\) directions to form a set of orthogonal groups, and the blue arrows represent the \(90^{\circ}\) and \(0^{\circ}\) directions to form a set of orthogonal groups. Figure 3: Two different ways of interpreting the edges of an image. (**a**) test image; (**b**) canny edge; (**c**) edge using the CGI method. directions to determine whether the pixel is on a diagonal edge and \(0^{\circ}\) and \(90^{\circ}\) orthogonal directions to determine whether the pixel is on a horizontal or vertical edge. We use four \(3\times 3\) convolution masks to calculate the gradient approximations in these four directions, as shown in the following formula, where \(U_{0}\) denotes the value of the gradient value of \(I_{\text{LR}}\left(i,j\right)\) in the \(\theta\) direction. \[U_{0}(i,j)=\left| \begin{bmatrix}1&0&1\\ 1&0&1\\ 1&0&1\end{bmatrix} *I_{\text{LR}}(i,j)\right| \tag{2}\]  
\[U_{45}(i,j)=\left| \begin{bmatrix}0&0&1\\ -1&0&1\\ -1&-1&0\end{bmatrix} *I_{\text{LR}}(i,j)\right| \tag{3}\]  
\[U_{90}(i,j)=\left| \begin{bmatrix}1&1&1\\ 0&0&0\\ -1&-1&-1\end{bmatrix} *I_{\text{LR}}(i,j)\right| \tag{4}\]  
\[U_{135}(i,j)=\left| \begin{bmatrix}1&1&0\\ 1&0&-1\\ 0&-1&-1\end{bmatrix} *I_{\text{LR}}(i,j)\right| \tag{5}\]  
Secondly, we need to assess the properties of the pixel in the LR image. Specifically, we need to judge whether a pixel is an edge pixel. If so, what is the direction of the edge on which it is located?