## 3 Methodology
### Quantitative Methods for Environmental Indicators  
This paper utilizes the depth camera and sensors in CARLA to sample eight driving weather conditions, and performs image analysis and quantitative processing on the quantified metrics for each environment. By using CARLA's depth camera and sensors, we are able to capture rich information in various driving weather conditions, including rainy, foggy, and sunny conditions, among others. Through analyzing these sampled data, we can understand the variations in driving scenarios under different weather conditions and extract key quantitative metrics. In the image analysis stage, this study employs computer vision techniques to analyze the sampled images, extracting various visual features and attributes, such as visibility, road conditions, and lighting intensity, to obtain important information about the driving environment. The sampling results are illustrated in Figure 4. Finally, a quantitative processing approach is adopted to convert the information in the images into measurable numerical metrics. By comparing and analyzing these quantitative metrics, we can evaluate different driving weather conditions. Next, this paper will discuss the quantification process of three quantitative indicators. 1. Visual brightness. Visual brightness refers to the degree of brightness perceived by the visual sensory system [29], which is influenced by factors such as cloud cover, sun altitude, and azimuth angle. In RGB images, brightness is manifested by the magnitude of pixel values at each point, where higher pixel values indicate higher luminance. In grayscale images, higher grayscale values correspond to higher brightness levels. In this paper, a method combining RMS pixel height and perceived brightness is used to quantify field-of-view brightness. The pixel height can reflect the reflection (projection) density information of the image, that is, it reflects the brightness information. RMS obtains the root mean square value of the pixel value of each channel in the image, and its calculation formula can be written as:  
\[X_{rms}=\sqrt{\frac{1}{N}\sum_{i=1}^{n}x_{i}^{2}}=\sqrt{\frac{x_{1}^{2}+x_{2}^ {2}+\cdots+x_{n}^{2}}{N}} \tag{2}\]  
where \(X_{rms}\) represents RMS pixel height value. \(\{x_{1},x_{2},x_{3},\cdots,x_{n}\}\) represents the pixel height of each channel. Due to variations in human perception and response to different colors of light when acquiring visual information, researchers have proposed a formula to calculate the \"perceived brightness\" of individuals based on the relative intensities of three primary colors of light: red, green, and blue. This formula takes into account the differing sensitivities of the human eye to these colors and converts the pixel values of a color image into brightness values that align with human perception [30]. This conversion allows for a more accurate reflection of the human visual system's perception of the image, enabling more precise and rational image processing and analysis. The formula for this calculation can be expressed as:  
\[X_{rms-p}=\sqrt{0.241\times R^{2}+0.691\times G^{2}+0.068\times B^{2}} \tag{3}\]  
where \(X_{rms-p}\) represents the driver's perceived brightness, \(R\), \(G\), and \(B\) represent the three channel colors of red, green, and blue in the image, respectively. The image brightness is quantified by the above method, and the quantified results are shown in the following Table 3.  
2. Visual clarity. Visual clarity is a measure of the level of clarity in a driver's vision [31], which is influenced by factors such as fog density in the driving environment. When drivers encounter dense fog while driving, higher fog density in the external environment leads to lower visual clarity. In such circumstances, the fog scatters light, preventing drivers from clearly seeing the road conditions, obstacles, and other vehicles ahead. Insufficient visual clarity reduces the driver's perception of the road and increases the risk of accidents.