# GS-AGC: An Adaptive Glare Suppression Algorithm Based on Regional Brightness Perception
## 3 An Adaptive Glare Suppression ALGORITHM Based on Regional Brightness Perception
### Regional Brightness Perception
Before the luminance processing of low-illumination images, the limitations of image segmentation algorithms in dividing the luminance range were addressed. This was inspired by the luminance perception function of the human eye [39], which was utilized to assist in selecting the luminance thresholds. This was done by leveraging the fact that the luminance perception function of the human eye covers a wider range of luminance sensations, thus aiding in the selection of appropriate thresholds for brightness division. Due to the existence of two regions with opposite brightness in dark light region brightness and glare region brightness, to select the current most suitable utilization algorithm for the respective region, we made use of the human eye luminance perception function \(R(L)\)[39] for the luminance adjustment of each region, which was defined as follows:  
\[R(L)=\widetilde{L}^{k(L)} \tag{4}\]  
where \(R(L)\) is the retinal responsiveness of the input grayscale image, \(L\) is the original pixel intensity of the grayscale map, \(\widetilde{L}\) is the pixel intensity normalized to [0, 1], and \(k\) is a sensitivity parameter that determines how fast the retinal responsiveness grows with increasing luminance intensity. Since human retinal responsiveness is adaptively determined by background luminance, the sensitivity k can be expressed in the following functional form depending on luminance perception:  
\[k(L)=1-CDF_{G}(L)=1-\sum_{x=0}^{L}p(x) \tag{5}\]  
where \(CDF_{G}(L)\) is the cumulative distribution function of the input histogram and \(p(x)\) denotes the normalized gray-level histogram. In Equation (4), the human eye luminance perception function covers the full dynamic range of the low-illumination image [\(R(L_{\text{min}})\) = 0, \(R(L_{\text{max}})\) = 255], and the value range of \(L\) is [0, 255]; \(\widetilde{L}\) is the pixel intensity normalized to [0, 1], specifically:  
\[\widetilde{L}=\frac{L}{L_{\text{max}}} \tag{6}\]  
where \(L_{\text{max}}\) is the maximum pixel brightness of the grayscale image. To obtain a threshold parameter \(\tau_{t}\) that is suitable for the brightness of the current region, a one-dimensional search algorithm was utilized in the optimization method, specifically, the golden section search algorithm [40,41]. The reason was that the golden section search algorithm is not only fast but also has a wide range of adaptability. Based on the golden section method, the shortening rate of each retention interval was typically considered as 0.618. By calculations and comparisons of the function values of a finite number of points, the original search interval was systematically diminished to meet the allowed inter-cell error. Consequently, the objective was to progressively decrease the interval of the optimal solution until the length of the interval was reduced to 0. In this paper, the iterative process of the algorithm used the initial space [0, 50], [50], [150], [200], and [200, 255] in four iterations. The process continued until it reached the maximum number of iterations, which stopped at 100. The thresholds in the [0, 50], [50], [150], [200], and [200, 255] luminance intervals were then found in turn using just the function values \(\tau_{t1}\), \(\tau_{t2}\), \(\tau_{t3}\), and \(\tau_{t4}\). \(\tau_{t1}\) was derived in the same way as the other three luminance thresholds, and the derivation of \(\tau_{t1}\) was taken as an example. Its luminance threshold acquisition method is shown in Algorithm 1.