## 2 Materials and Methods
### Image Quality Enhancement Strategy
#### 2.2.2 Image Color Enhancement Processing  
In this study, the three methods described below will be tested for color enhancement of images: Contrast Limited Adaptive Histogram Equalization (CLAHE), Multi-Scale Retinex with Color Restoration (MSRCR), and Multi-Scale Retinex with chromaticity preservation (MSRCP).  
First, we evaluate the CLAHE [13] method to perform the image quality tests. The histogram equalization method is different from the traditional image processing technology; it calculates the image histogram, then crops the histogram and perform equalization. Increasing the overall contrast of the image during equalization will also increase the noise contrast in the input image. Through the adaptive histogram equalization method, the input image is divided into small image fragments, which are enhanced by applying CLAHE to the regional fragments instead of the entire image; the mathematical formation for the histogram limit of each region is given as:  
\[\beta=\frac{M}{N}\Big{(}1+\frac{\alpha}{100}(S_{max}-1)\Big{)} \tag{2}\]  
where \(M\) is the pixels in each region, \(N\) is the dynamic range in region, \(S_{max}\) is the maximum allowable slope, and \(\alpha\) is the clip factor set between 0 to 100. Using this formula, we can obtain the clip limit, \(\beta\), which limits the change in image contrast.  
Next, we use the bilinear interpolation to seamlessly stitch the generated adjacent image blocks to limit the contrast of the uniform area, thereby avoiding an increase in noise to produce better image quality output. It can be seen from Figure 6 that the light, shadow, and contrast of the forest image have been improved after CLAHE correction, and it is easier to recognize with the human eye.  
Figure 5: (**a**) Original image. (**b**) Improved image using fastNMeansDenoisingColored.  
Then, we assess the MSRCR; this method is based on the Multi-Scale Retinex (MSR) [14]. In the MSR enhancement process, the image may be distorted due to the increase of noise, and the color of the local details of the image may be distorted. Hence, the true color of the object cannot be shown, and the overall visual effect will be worse. To deal with this problem, [PERSON] et al. [15] proposed to complete the algorithm with color restoration steps. When adding the color restoration step into the MSR method, the color restoration factor is used to adjust the defect of the color distortion caused by the contrast enhancement of the local area of the image. They proposed modifying the MSR output by multiplying the MSR output by the color restoration function of the chroma to adjust the difference between the three-color channels in the original image. We highlight the information in the relatively dark area and eliminate the defect of the image color distortion. After processing, the local contrast of the image is improved, and the brightness will be similar to the actual scenery; the algorithm for the MSRCR method can be is given below:  
\[R_{MSCRi}(x,y)=C_{i}(x,y)R_{MSRi}(x,y) \tag{3}\]  
\[C_{i}(x,y)=f\big{[}I_{i}^{\prime}(x,y)\big{]} \tag{4}\]  
The function that provides best overall color restoration is below, where \(\beta\) is a gain constant, \(\alpha\) controls the strength of the nonlinearity:  
\[C_{i}(x,y)=\beta\log\big{[}\alpha I_{i}^{\prime}(x,y)\big{]} \tag{5}\]  
When we review the image with our visual perception, the image appears more realistic. Figure 7 displays the original image and the image of the industrial area corrected by MSRCR. It can be found that the MSRCR method corrected the white balance and color problems in the original image. In addition, this study will simultaneously test the MSRCP without color restoration but only retain the chromaticity.  
Figure 6: (a) Original image. (b) Improved image using CLAHE.