# AEA-RDCP: An Optimized Real-Time Algorithm for Sea Fog Intensity and Visibility Estimation
## 3 Approximating and Eliminating the Airlight--Reduced DCP (AEA-RDCP)
### Example of Setting and Applying Ambient Light Estimation Thresholds  
To accurately estimate the atmospheric light, it is essential that we adhere to the estimation process as outlined in the DCP algorithm. The DCP algorithm employs an atmospheric scattering model to determine both the atmospheric light and the transmission map, which are fundamental for restoring images compromised by fog and for the removal of haze. This model serves as a physical representation that aids in reconstructing images captured under foggy conditions. It does so by delineating the relationship between the observed pixel values in the image, the actual scene radiance (i.e., the true scene without fog), the atmospheric light, and the transmission map. The equation for the atmospheric scattering model is expressed as follows in Equation (3) [30]:  
\[\mathbf{I}(\mathbf{x})=\mathbf{J}(\mathbf{x})\mathbf{t}(\mathbf{x})+\mathbf{A}(1-\mathbf{t}(\mathbf{x})) \tag{3}\]  
I(x) is the observed pixel value of the image;  
J(x) is the actual pixel value of the scene without fog;  
t(x) is the transmission map, which is related to the depth of the scene and indicates how much the pixel has been attenuated by atmospheric particles;  
A is the atmospheric light, representing the brightest part of the scene;  
In the DCP algorithm, to estimate the atmospheric light (A), the pixels that correspond to the top 0.1% in the DC image are selected and designated as the atmospheric light (A). The rationale behind selecting the top 0.1% of pixels is based on the fact that these brightest pixels are significantly influenced by atmospheric scattering, which enables a precise estimation of the atmospheric light value [31]. This selection method is not arbitrary; it is derived from both empirical studies and experimental observations. The choice of the top 0.1% has been validated in multiple studies, including the work by [PERSON] et al. [32], where they discuss effective methods for local airlight estimation in image dehazing. These methods balance accuracy and computational efficiency, ensuring that the estimation of  
Figure 5: Processing of the proposed fog intensity measurement algorithm. atmospheric light is both reliable and robust. The consistent application of this criterion across various research studies further enhances the trustworthiness and effectiveness of this methodology in the field of image restoration under foggy conditions [33]. This detailed description and approach ensure that the atmospheric light is accurately determined, thus allowing for better image restoration and clarity in conditions where visibility is compromised due to fog or haze. To estimate atmospheric light based on the well-established criterion of using the top 0.1% of pixels in the DC image, this study calculates the threshold value following a structured process, as shown in the pseudocode in Algorithm 1. The steps are as follows:  
1. Dataset Selection: A dataset of 100 images with a resolution of 3840 \(\times\) 2160 pixels was selected for threshold estimation, as illustrated in Figure 6. These images were taken under strong sunlight conditions and were carefully curated from the AI Hub dataset, focusing on days with abundant sunlight across various times of the day [34]. 2. DC Image Creation: For each image, the minimum value among the R, G, and B channels of every pixel was chosen to generate the DC image, which captures the impact of fog. 3. Brightest Pixel Selection: The top 0.1% brightest pixels in the DC image were identified. 4. Patch Extraction: Patches of 301 \(\times\) 301 pixels surrounding these brightest pixels were extracted to ensure accurate estimation by excluding pixels affected by atmospheric light. 5. Threshold Calculation: The average values of the R, G, and B channels within these patches were calculated [35]. These averages were then used as the threshold for atmospheric light estimation. **1. Prepare Sunlight Images: 100 images**  
- Load up to 100 images from the image folder. **2.