# Adaptive Tolerance Dehazing Algorithm Based on Dark Channel Prior
## 2 Related Work
### Tolerance Mechanism to Correct Transmission and Its Defects  
As described in Section 2.3, the dark channel prior is ineffective in bright areas. This causes the transmission rate to be underestimated and results in color distortion in the restored image. If you want to eliminate color distortion, you must adjust the transmission of the bright area so that the estimated \(t(x)\) more closely matches the actual transmission \(t_{actual}(x)\). To solve this problem, a tolerance coefficient \(K\) is introduced to determine the difference between the haze image \(I(x)\) and the atmospheric light factor A. If the absolute value of the difference is less than \(K\), the area is a bright area. The corresponding transmittance of this area needs to be recalculated. If the absolute value of the difference is greater than or equal to \(K\), the area is a non-bright area and the transmission of this area is kept constant. Formulated as follows:  
\[t^{\prime}(x)=\min(\max(\frac{K}{\left|I(x)-A\right|},1)\bullet\max(t(x),t_{0 }),1) \tag{10}\]  
The recovery formula for a haze-free image is:  
\[J^{\prime}(x)=\frac{I(x)-A}{t^{\prime}(x)}+A \tag{11}\]  
Equation (10) is actually a supplement and improvement to the dark channel prior. The tolerance mechanism is introduced to ensure that the calculated transmission of the bright region does not have a large deviation from the actual transmission. After the simulation, for most images with sky regions, the dehazing effect after introducing the tolerance mechanism is better than the algorithm using only the dark channel prior. Many pieces of literature have done related experiments and found that most of the haze images can obtain better dehazing effects when the tolerance K is 50. However, it is found that there are two defects in introducing tolerance mechanism after analyzing Equation (10).  
**a).** The value of the tolerance \(K\) directly affects the correction of the transmittance and the dehazing effect. The fixed tolerance value does not effectively correct the transmittance of different image features. As shown in Figure 2, the first image has the best dehazing effect when \(K=80\), and the sky region appears distorted when \(K=20\). In the second image, the branches above the center lost considerable detail when \(K=80\), and the image details were the best when \(K=45\). Observe the area at the end of the road in the third image. The dehazing effect is best when \(K=20\).  
**b).** If we only use the ratio of the fixed tolerance \(K\) to \(\left|I(x)-A\right|\) to determine whether the pixel point \(I(x)\) belongs to the bright region, so as to determine whether tolerance is introduced in the restoration of the pixel. It is easy to misjudge whether the pixel belongs to the bright region, and the dehazing effect becomes worse due to the wrong adjustment of the transmission. Figure 3a shows an image with a dense fog but no large-area sky area. Figure 3b shows the recovery result after the processing of Figure 3a by the He's algorithm without tolerance. Figure 3c is a restored image obtained by processing Figure 3a after using the fixed tolerance value 50 to correct the transmittance based on the He algorithm. It can be seen from Figure 3c that the tolerance mechanism is used to make the region lose a lot of image details.