# Low-Light Mine Image Enhancement Algorithm Based on Improved Retinex
## 3 Proposed Method
### Extraction and Enhancement of Illumination Component  
In this article, the improved guided filtering algorithm is combined with the Retinex algorithm, and at the same time, different scales are used to weigh it for the extraction of illumination components, which can not only effectively avoid the halo blur phenomenon, but also retain the edge features and particulars of the initial input image to a greater extent. The expression can be presented in the following form:  
\[L_{I(x,y)}=\sum_{n=1}^{N}w_{n}(q_{n}(x,y)*I(x,y)), \tag{13}\]  
where \(q_{n}(x,y)\) is the improved guided filtering for the nth scale \((n=1,2,\ldots N,N=3\) in this paper), and \(w_{n}\) is its weight, for which the three weight values in this article are \(w_{1}=w_{2}=w_{3}=1/3\). The Weber-Fechner Law is a psychophysical expression that illustrates the correlation between the sensory intensity of human perception and the sensory intensity of external environmental stimulation [19]. In terms of light intensity changes, it can be used to indicate the logarithmic linear relationship between the way the human eye perceives changes in light intensity \(L_{out}\) and the initial light intensity \(L_{in}\). After obtaining the estimated illumination component, to enhance the visual quality and perceptual impact, the illumination component is enhanced. Referring to the above principle, a brightness enhancement method is proposed, which can boost the overall quality of the unevenly illuminated image \begin{table}
\begin{tabular}{c c c c c} \hline \hline  & **GIF** & **WGIF** & **GDGIF** & **WWGIF** \\ \hline PSNR & 23.0908 & 27.3744 & 29.2473 & 34.9946 \\ SSIM & 0.9501 & 0.9529 & 0.9893 & 0.9973 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Performance comparison of different filtering algorithms. Figure 4: Results of different filtering algorithms. (**a**) GIF algorithm; (**b**) WGIF algorithm; (**c**) GDGIF algorithm; (**d**) WWGIF algorithm. by adaptively adjusting the bright and dark regions and can maintain the details of the initial image [20]. The expression of its linear relationship is  
\[L_{out}=\lambda lg(L_{in})+\lambda_{o}, \tag{14}\]  
where \(\lambda\) and \(\lambda_{o}\) are constants. In order to make the algorithm more applicable and to reduce the amount of computation, a new function is used to fit the curve of the function of Equation (14). The expression is as follows:  
\[L_{out}=\frac{L_{in}(255+k)}{(\max(L_{in},L_{\text{in,g}})+k)}, \tag{15}\]  
where \(L_{in}\) refers to the image for enhancement, \(L_{\text{in,g}}\) refers to the estimated reflection component, and \(k\) is the adaptive adjustment parameter. ### Extraction and Enhancement of Illumination Component  
CLAHE is based on histogram equalization [21], which introduces interpolation operations to obtain smoother images. The flow of the algorithm is shown in Figure 5. CLAHE preserves the details and restricts the contrast amplification in the locally smoothed areas [22], but it cannot completely suppress the noise. The WWGIF filtering algorithm can restore details and reduces the appearance of noise. Therefore, the CLAHE-WWGIF algorithm is proposed for the reflection component to further diminish the impact of noise while increasing the image contrast to maintain the details. The formula of CLAHE algorithm is  
\[R^{\prime}(x,y)=CLAHE(R(x,y)). \tag{16}\]  
For the reason that most of the noise is presented in the reflection component, the noise still exists after CLAHE processing, so WWGIF is performed on the CLAHE-processed image to improve the contrast while suppressing the noise to improve the quality of the image [23]. The formula for denoising is  
\[\hat{R}(i)=\overline{a}_{i}R^{\prime}(i)+\overline{b}_{i}, \tag{17}\]  
where \(\hat{R}(i)\) is the contrast-enhanced image after CLAHE processing. In Figure 6, the initial image is a low-light image with Gaussian white noise in the LIME dataset, while b, c, and d are the images processed by CLAHE, WWGIF, and CLAHE-WWGIF, respectively.