## 3 Image-Enhancement-Related Algorithms
### Improved Adaptive Contrast Enhancement(IACE)
This can be expressed by the below equation:  
\[N=\sum_{i=1}^{3}w_{i}n_{i} \tag{21}\]  
where, \(n_{i}\) denotes the number of edge points in the \(i\) th gradient interval, and \(w_{i}\) denotes the relative weight of the edge points in the \(i\) th gradient interval. Lastly, the number of edge points at each grey level within different gradient intervals is statistically analyzed to obtain the distribution of edge points at each grey level within each gradient interval. It can be written as:  
\[num(i,j)=\sum_{r=1}^{M}\sum_{c=1}^{n}\delta(g(r,c)-g)\cdot\delta(f(r,c)-f) \tag{22}\]  
Assuming the size of the image is \(M*N\) and the position of pixels is \(x\left(r,\ c\right)\). \(num(i,j)\) denotes the total number of edge points in the \(j\) th grey level and the \(i\) th gradient level. \(g(r,c)\) denotes the gradient value at pixel point \(x(r,c)\). As shown in Equation (10), \(f(r,c)\) denotes the gray level at pixel point \(x(r,c)\). For each pixel point, \(\delta(g(r,c)-g)\) is used to determine whether the gradient level is equal to \(g\), and \(\delta(f(r,c)-f)\) is used to determine whether the grey level is equal to \(f\). When both the gradient value and gray level satisfy the condition, the value of the item is 1; otherwise, it is 0. Due to the use of the Canny edge detection algorithm to set the gradient value of non-edge pixels to zero, by summing up all the pixel points that satisfy the condition, the number of edge points in the \(j\) th grey level and the \(i\) th gradient interval can be obtained. In the GTIE-IACE process, the number of edge points in each gradient interval is used as the relative weight and then multiplied by the number of edge points at each grey level in each gradient interval. This aims to emphasize the edges in each gradient interval in order to better preserve and enhance these features. It can be written as:  
\[H_{j}=\sum_{i=1}^{3}w_{i}\cdot num_{ij} \tag{23}\]  
\[H= \begin{bmatrix}w_{1}&w_{2}&w_{3}\end{bmatrix}\begin{bmatrix}num_{1,1}&num_{1, 2}&\cdots&num_{1,256}\\ num_{2,1}&num_{2,2}&\cdots&num_{2,256}\\ num_{3,1}&num_{3,2}&\cdots&num_{3,256}\end{bmatrix}  \tag{24}\]  
where, \(w_{i}\) is a row vector, in which each element represents the ratio of the number of edge points in the corresponding gradient level relative to the total number of edge points, and  
Figure 9: (**a**) Histograms of edge point pixels at each gray level in the low gradient interval after processing; (**b**) Histograms of edge point pixels at each gray level in the moderate gradient interval after processing; (**c**) Histograms of edge point pixels at each gray level in the high gradient interval after processing. \(num_{ij}\) is a \(3\times 256\) vector, where each row corresponds to a gradient level and each column corresponds to a grey level. As shown in Equation (22), in the \(num_{ij}\) matrix, the element represents the number of edge points in the \(i\) th gradient interval and the \(j\) th grey level. \(num_{ij}\) can be expressed more intuitively using a histogram (Figure 8). Each element of \(H_{j}\) represents the degree of contribution of the different gradient levels to the image details. This vector serves as a comprehensive representation of the edge point information at all different gradient levels. Based on this, the relative frequency of gradient level occurrences is further defined as follows:  
\[p_{r}(j)=\frac{H_{j}}{N}\qquad j=0,1,2,\ldots,L-1 \tag{25}\]  
Finally, the cumulative distribution function of the normalized image is computed. The original gradient levels are mapped to the new gradient levels through transformation, and the gradient levels in the original image are replaced by the new ones. The GTIE-IACE algorithm is illustrated in Figure 10.