# Enhancement of Low-Light Images Using Illumination Estimate and Local Steering Kernel
## 3 Proposed Method
### Illumination Estimate  
Low-light footage may show areas in the image that are poorly lit or have an uneven brightness distribution. To accurately estimate the illumination components in these environments, we need information to determine the illumination environment of the low-light images. To determine the illumination environment, the proposed algorithm calculates the mean and distribution constants by obtaining the histogram of each channel in the RGB channel region of the low-light image. Here, the mean constant refers to the basis for judging the overall light level of the image, and the distribution constant refers to the frequency of local bright areas. In this case, a histogram smoothing technique is used to obtain a more natural result than the existing method. The smoothed histogram \(\dot{H}(p)\) can be obtained as follows. \[\dot{H}(p)=G\;*\;H_{m}(p) \tag{4}\]  
\[G=\frac{1}{\sqrt{2\pi}\sigma_{i}}exp\left(-\frac{(p-q)^{2}}{\sigma_{i}^{2}}\right) \tag{5}\]  
\[H_{m}(p)=\left\{H(q)\;|\;p-n\leq q\leq p+n\right\} \tag{6}\]  
Here, \(G\) refers to the Gaussian weight for histogram equalization, \(H_{m}(p)\) represents the bin of the histogram \(H(p)\) of the low-light image, \(p\) represents pixel values, and \(q\) represents pixel values that belong to a histogram bin, the range of which is determined by a constant \(n\) that determines the width of the bin. If \(q\) exceeds the range that can represent the pixel values in the image, the histogram \(H(q)\) does not exist. Therefore, histogram smoothing is performed using the minimum histogram value. The mean constant \(m\) of the image can be calculated from the smoothed histogram \(\dot{H}(p)\) as follows. \[m=\frac{1}{N}\left[\sum_{p=0}^{N}p\dot{H}(p)\Bigg{/}\sum_{p=0}^{N}\dot{H}(p)\right] \tag{7}\]  
Here, \(N\) refers to the maximum number of pixel values that can be represented in an image. The proposed algorithm uses the following conversion formula to convert \(m\) to a gamma value. \[\gamma_{1}=\frac{1}{1+exp(-2m)} \tag{8}\]  
Figure 1: Block diagram of proposed method. \(\gamma_{1}\) is given by Equation (8) as a range of \([0.5,\ 1]\), with darker images being closer to \(\gamma_{1}=0.5\), indicating a lower illumination estimate. The distribution constant is obtained from the smoothed histogram just like the mean constant, but the calculation is performed on only the low-light areas to emphasize the information about the values in the low-light areas. The proposed algorithm considers low-light areas as those with less than half of the pixel values that can be represented in the image, and obtains the distribution constant \(\gamma_{2}\) as follows. \[\gamma_{2}=\frac{1}{RC}\sum_{p=0}^{N/2}\dot{H}(p) \tag{9}\]  
Here, \(R,C\) represents the horizontal and vertical dimensions of the video, respectively. Higher values of the distribution constant indicate images with more dark areas. The gamma value \(\gamma\) for lighting estimation is calculated by weighting the mean and distribution constants as shown in the following formula. \[\gamma=\frac{\tau}{1+exp(-2m)}+\frac{(1-\tau)}{RC}\sum_{p=0}^{N/2}\dot{H}(p) \tag{10}\]  
Here, \(\tau\) is the weighting constant to obtain the gamma value. \(\tau\) is set to a range of \([0,1]\), with lower values improving low-light images more brightly. Conversely, a high value of \(\tau\) will result in a more pronounced color contrast in the resulting image. The estimated illumination component \(\hat{L}(x,y)\) is obtained by applying the gamma value to the input image as follows, and then \(\hat{L}(x,y)\) is substituted into Equation (3) to obtain the enhanced image \(\hat{S}(x,y)\) as follows. \[\hat{L}(x,y)=I(x,y)^{\gamma} \tag{11}\]  
\[\hat{S}(x,y)=exp\big{(}logI(x,y)-log\hat{L}(x,y)\big{)} \tag{12}\]  
Images with enhanced brightness may appear to have less contrast in the enhanced image because the pixel values in the low-light areas have been improved by a larger amount, concentrating them in the range of bright levels.