# Investigations into Picture Defogging Techniques Based on Dark Channel Prior and Retinex Theory
## 2 Theoretical Foundations and Key Components
### Dark Channel Prior for Image Defogging  
The atmospheric scattering model for foggy images is frequently employed in image processing. This model describes the degradation of images under haze conditions, where ambient light is scattered by atmospheric particles, while object-reflected light is attenuated. Its mathematical formulation is expressed as follows:  
\[I(x)=J(x)\cdot t(x)+A(1-t(x)) \tag{8}\]  
where \(I(x)\) denotes the foggy image, denoted in this paper as an enhanced image \(I_{E}(x)\); \(J(x)\) denotes the recovered image; \(A\) denotes the global atmospheric light intensity; and \(t(x)\) denotes the medium transmission map, as in Equation (9):  
\[t(x)=e^{-\beta d(x)} \tag{9}\]  
where \(d(x)\) denotes the scene depth, and \(\beta\) denotes the atmospheric scattering coefficient with a value of 1.  
By counting and analyzing more than 5000 high-definition fog-free images of outdoor environments with the sky excluded, [PERSON] et al. [19] found that in most images of natural scenes, if there are occluded, low-brightness, or colorful areas, at least one of the pixel values in these areas has a low value in the RGB color channel whose value is close to 0. Then for an arbitrary input image, the dark channel image \(J^{dark}(x)\) is convergent to 0, as in Equation (10):  
\[J^{dark}(x)=\min_{y\in\Omega(x)}\left(\min_{c\in(R,G,B)}(J^{c}(x))\right)\approx 0 \tag{10}\]  
where \(\Omega(x)\) denotes the local filter region centered on the x pixel point, \(J^{c}(x)\) denotes the values of the three RGB color channels in a foggy image, and \(J^{dark}(x)\) denotes the dark channel image.  
To relate the DCP to the scattering model, we assume the following:  
1. Known atmospheric light \(A\): \(A\) is estimated separately.
2. Locally constant transmission: Within a small patch \(\Omega(x)\), \(t(x)\) is approximately constant, denoted as \(\widetilde{t}(x)\).  
Under assumption 1, we divide both sides of Equation (4) by \(A\):  
\[\frac{I^{c}(x)}{A}=\frac{J^{c}(x)}{A}\cdot t(x)+(1-t(x)) \tag{11}\]  
where \(I^{c}(x)\) denotes the fogged image in the RGB channel, and \(J^{c}(x)\) denotes the clear fog-free image in the RGB channel.  
Under assumption 2, minimum gray value and minimum value filtering is performed on both sides of Equation (11) simultaneously, as in Equation (12):  
\[\min_{y\in\Omega(x)}\biggl{(}\min_{c\in\{R,G,B\}}\frac{I^{c}(x)}{A}\biggr{)}= \widetilde{t}(x)\cdot\min_{y\in\Omega(x)}\biggl{(}\min_{c\in\{R,G,B\}}\frac{I^ {c}(x)}{A}\biggr{)}+(1-\widetilde{t}(x)) \tag{12}\]  
According to the dark channel a priori theory of clear and fog-free images, the dark channel value tends to 0, and \(\widetilde{t}(x)\) can be estimated, as in Equation (13):  
\[\widetilde{t}(x)\approx 1-\min_{y\in\Omega(x)}\biggl{(}\min_{c\in\{R,G,B\}} \frac{I^{c}(x)}{A}\biggr{)} \tag{13}\]  
Atmospheric Light Estimation: Atmospheric light is estimated by selecting the brightest 0.1% pixels in the dark channel image \(I^{dark}(x)\) and then mapping these pixels to the original hazy image \(I_{E}(x)\) and taking the maximum intensity of each RGB channel as the atmospheric light \(A\).  
Finally, the fog-free image \(J(x)\) is recovered by inversely solving the atmospheric scattering model (Equation (8)) using the estimated values \(\widetilde{t}(x)\) and \(A\). The fog-free image is then used as the first image, as in Equation (14):  
\[J(x)=\frac{I(x)-A}{\max\bigl{(}\widetilde{t}(x),t_{0}\bigr{)}}+A \tag{14}\]  
where \(t_{0}\) (typically 0.1) denotes a lower bound that prevents division by zero and noise amplification in low-transmission regions.