# Visibility Detection Algorithm of Single Fog Image Based on the Ratio of Wavelength Residual Energy

Authors: Zhixiang Chen; Binna Ou
Journal: Mathematical Problems in Engineering
 (2021)

---

## Abstract

Different visibilities and different wavelength attenuations can cause color deviation problem in some dehazing algorithms. A visibility detection algorithm based on a single fog image is proposed. First, the visibility range of the image is preliminarily determined according to the transmissivity; then, the normalized differences between the residual energy ratios of different wavelengths of RGB channels are calculated, and the pixels with large gray deviation of a single channel are filtered to improve the calculation accuracy; finally, the image visibility detection value is calculated. The experimental results show that the proposed algorithm not only effectively reflects the fog image visibility but is also well suited for evaluating the effectiveness of the image defogging algorithms and the restoration degree of the defogging color difference.


---

## Body

## 1. Introduction

Visibility, also known as meteorological optical range [1], refers to the maximum horizontal distance that a normal person with a contrast threshold of 0.05 can distinguish a moderately sized black target from the background. Visibility reflects the transparency of the atmosphere. In severe weather, such as rainstorms, haze, and sandstorms, the transparency of the atmosphere will be reduced, and the visibility will be greatly reduced. When the visibility is less than 100 m, it is considered zero. Hazy weather conditions may reduce the visibility to zero. This will have a negative impact on transportation, navigation, aviation, and human daily life. Therefore, it is of great significance for environmental protection and traffic management to accurately detect visibility in fog.Since Koschmieder put forward the visibility measurement theory based on the sky in 1924 [2], researchers have never stopped the research of visibility measurement. Currently, visual inspection, visibility meter measurement, and visibility detection based on image processing can be used for visibility detection. The first visual inspection method relies on human subjective consciousness and lacks scientificity, standardization, and stability. Nowadays, the widely used instrument measurement methods are mainly transmission visibility meter, scattering visibility meter, lidar visibility meter, and so on, but, in practical application, a measurement instrument needs to be installed at an interval of about 50 km, and the cost of purchase and maintenance is expensive, which is difficult to meet the needs of large-scale coverage [3]. However, the visibility detection method based on image processing can use the existing camera monitoring system to obtain pictures and detect the visibility, which is the main research direction of researchers at present. In 2013, Kim proposed a new method of obtaining coarse transmittance, which is not based on the dark channel prior principle, nor does it focus on the study of transmittance, but focuses on enhancing contrast [4]. Negru [5] and others proposed an algorithm based on inflection points to detect the occurrence and concentration of fog, but the algorithm is inefficient and prone to block effects. In 2014, Mao et al. [6] proposed the visibility evaluation index and classification algorithm of foggy images. This method is based on the atmospheric scattering model and data analysis theory of dark channel and light channels, but it is not suitable for the case of monochromatic light sources. In 2015, Zhu et al. [7] observed the HSV color channel and found that the difference between brightness and saturation increased with the increase of fog concentration, so a prior algorithm of color attenuation was proposed. In 2016, to improve the visibility of sea fog images of the unmanned surface vessel visual system, Ma et al. [8] presented a novel defogging algorithm based on a fusion strategy. Feature fusion attention (FFA) [9] verifies the effectiveness of using different weights for thick fog and mist when designing a network. It has a good performance on the Benchmarking Single Image Dehazing and Beyond (RESIDE) dataset [10], but when dealing with real-world foggy images, the defogging effect is not obvious, and it even destroys the image. To sum up, the visibility detection algorithm based on image processing has achieved some results, but it is still in the stage of theory and experiment, and there are still great challenges with a large development space.The higher the visibility is, the higher the human eye can distinguish objects. When the visibility is reduced, the ability of human eyes to distinguish objects is reduced, and it is more difficult to distinguish different scenes on the image obtained by the camera. Therefore, the visibility can be used as the evaluation index of the effectiveness of the image defogging algorithm. Image quality evaluation is of great significance for the subsequent application of object detection, recognition, and analysis, so researchers also attach great importance to and put forward many quality evaluation indexes for defogged images. Currently, there are two kinds of methods: subjective evaluation and objective evaluation. The subjective evaluation method has a strong individual subjective difference and a large error and is not reliable. For the objective evaluation method, the most widely used and basic evaluation indexes, such as peak signal-to-noise-to-ratio (PSNR), information entropy (IE), structural similarity (SSIM), as well as some researchers’ new visible edge ratio, visible edge normalized gradient mean, and saturated pixel ratio, are only comparing the defog image with the original image, there is no visibility index, and these indexes do not take into account the color offset caused by different defog algorithms.At present, there are few researches on visibility measurement and quantitative evaluation of visibility based on a single image. In this paper, a visibility detection algorithm based on the ratio of wavelength residual energy in the image is proposed. It includes four parts, haze weather judgment, filter pixels, color bias, and visibility calculation. First, in the stage of judging whether there is haze or not, the range of fog concentration is determined by the atmospheric transmittance obtained by the statistical guided filtering algorithm. Second, the pixels with larger fading are filtered to improve the accuracy of the calculation results. Finally, in the phase of visibility calculation, the residual energy ratio of three channels of each image is calculated, respectively, and then, the visibility is calculated according to the difference value between each pixel point of the three channels. The visibility value obtained from the experiment can be used as the evaluation index of the effectiveness of the demisting algorithm, and the different transmittance obtained from different wavelength residual energy ratio can also be used as the evaluation index of the color offset restoration of the demisting image of different demisting algorithms. This algorithm does not need to set the measurement target manually, so it is convenient to measure and has a broad application prospect.


## 2. Visibility Detection

### 2.1. Solution of Transmissivity

Kaiming He et al. [11] put forward a priori theory of dark channels, which holds that, in most outdoor nonfog images, there are always pixels with low luminance values and close to 0 in a certain color channel. Wang et al. [12] used a weight map to optimize the transmission image in the dark channel prior algorithm and overcome the challenges of the dark channel prior-based algorithm, such as block effect and color distortion. In fog and other bad weather conditions, before the light reaches the camera, it is absorbed, scattered, and refracted by the larger diameter particles in the air, which makes the outdoor scene image degraded. The process is described by the atmospheric scattering model [13]:(1)Ix=tx⋅Jx+1−tx⋅A,where x is the coordinate of the pixel, I (x) is the input image with fog, J (x) is the restored image without fog, A is the atmospheric light value, and t (x) is the transmittance of the scene light. Defogging based on this model is to recover the original fog-free image J (x) from the observed image I (x).For fog-free imageJ, the dark primary color of outdoor fog-free image Jdark is expressed as(2)Jdarkx=minc∈R,G,Bminy∈ΩxJcy,where c is the three channels of red, green, and blue, Jc (y) is the channel c image of the restored clear image J, and Ω (x) is the local area centered on the pixel point x. According to the prior theory of dark primary color, the intensity value of Jdark is always very low and close to 0 in the nonsky part of most outdoor nonfog images.Given that the atmospheric light valueA is constant in the local region of Ω (x), A is uniform, and the transmittance is fixed. On taking the minimum value of (1), which is calculated independently in three color channels and normalized by A, the following is obtained:(3)miny∈ΩxIcyAc=tx⋅miny∈ΩxJcyAc+1−tx,where Ic (y) is the channel c image of the input image I and Ac is the atmospheric light value of channel c. Then, we take the minimum value operation in the three color channels and combine the prior theory of dark primary color, Jdark (x) = 0, and get(4)tx=1−minc∈R,G,Bminy∈ΩxIcyAc.According to the transmissivity calculated by (4), the fog of the image with fog will be completely removed, which may cause the processed image to lack the sense of hierarchy and reality. To maintain the subjective visual effect of the image without fog after processing, the spatial perspective, retention factor ω (0 < ω ≤ 1) is introduced to take the value according to the actual situation. A certain proportion of fog is retained, and ω is usually taken as 0.90∼0.97.(5)tx=1−ϖminc∈R,G,Bminy∈ΩxIcyAc.


### 2.2. Visibility Detection Based on Transmissivity

With the sky as the background, Koschmieder established the relationship between the luminanceL0 of the scene and the distance d [2]:(6)L=L0e−μd+Lf1−e−μd,where L is the received brightness, Lf is the sky brightness, and μ is the extinction coefficient.Duntley proposed the attenuation law of contrast with distance change [2]:(7)C=C0e−μd,where C is the visual brightness contrast of the scene at a distance of d, and C0 is the brightness contrast of the scene and the background. C/C0 = ε is the contrast threshold corresponding to the transmittance:(8)t=ε=e−μd.Under the maximum visibility of the image, the transmissivity is close to 0, which is shared by all scenes of the image.(9)tx⟶0,dx=−lntxμ≥Vx.Each point in the image may have differentd (x) and different t (x). When t (x) is close to 1, d (x) is close to 0, which means that there is no fog in the point x. However, when the transmissivity of point x is close to 0, point x is the farthest point in the image, and d (x) is the largest. V (x) is the visibility of the image, and it must be less than or equal to this maximum distance d (x)t⟶0. Koschmieder recommends using the distance when the contrast threshold is 0.02 as the visibility:(10)V=−1μln0.02≈3.912μ.The World Meteorological Organization uses the distance when the contrast threshold is 0.05 as the meteorological optical range [14]:(11)V=−1μln0.05≈3.0μ.


### 2.3. Residual Energy Ratio of Different Wavelengths

According to the Yandel effect [15], the scattering degree of suspended particles in the atmosphere is different for different wavelengths. The longer the wavelength is, the less obvious the scattering effect is. Therefore, the transmittance of different wavelengths of light is different and cannot be regarded as the same t. Taking RGB color channels as an example, the transmittance of RGB three channels should be different [16].(12)tR≠tG≠tB.Kruse [17] gives the relationship between extinction coefficient and visibility when the propagation contrast threshold is 0.02 in fog. The spectral distribution characteristics of different wavelengths are clearly different, so the extinction coefficient is monochromatic at this time. In this paper, the relationship between extinction coefficient and visibility when the contrast threshold is 0.05 is used:(13)μ=3.0V0.55λqkm−1,where λ is the wavelength of light, 0.55 μm is the central wavelength of visible light, and q is the wavelength correction factor, which is expressed as(14)q=0.585V1/3,V<6km,1.3,6km<V<50km,1.6,V≥50km.Kim et al. [18] made a more accurate division of the relationship between the values of visibility less than 6 km. The visibility with V greater than 6 km is better, and there is no need to remove fog. In this paper, the following formula is adopted:(15)q=0,V<500m,V−0.5,500m≤V<1km,0.16V+0.34,1km≤V<6km.According to (8) and (15), the transmissivity is as follows:(16)tλx=e−3.0/V0.55/λq⋅dx.The dark channel algorithm is used to calculate the different transmissivity corresponding to different wavelengths of the three channels, and the obtained transmissivity is modified by median filtering, as shown in Figure1.Figure 1
Three channels transmittances of images. (a) Foggy image. (b) ChannelR. (c) Channel G. (d) Channel B.
(a)(b)(c)(d)Figure2 is the histogram corresponding to the three-channel transmissivities diagram in Figure 1. It can be seen from Figures 1 and 2 that the transmissivities of the three channels of the original images vary to different degrees. Theoretically, the transmittance values of RGB three channels should be the same, but the transmittance of RGB three channels are not the same, because of the differences of light energy attenuation rates of different wavelengths. If the difference between the transmittances of the three channels of the images is smaller, it indicates that the smaller the difference of the light attenuation, the smaller the fog concentration and the less the color shift of the image. If the difference between the transmissivities of the three channels of the image is larger, it indicates that the greater the difference between the light attenuation, the greater the fog concentration and the more the color shift of the image.Figure 2
The corresponding histogram of transmissivities in Figure1. (a) Channel R. (b) Channel G. (c) Channel B.
(a)(b)(c)The transmissivityt of light is also called the residual energy ratio of light [19]. The ratio of the initial energy Eλix of a light beam with wavelength λ to the residual energy Eλrx after propagating a distance d (x) is expressed as follows:(17)tλx=EλrxEλix=Nrerλdx,where μ (λ) is the scattering coefficient of light with wavelength λ and Nrer (λ) is the standard residual energy ratio, which can be obtained from (16) and (17):(18)Nrerλ=e−3.0/V0.55/λq.


## 2.1. Solution of Transmissivity

Kaiming He et al. [11] put forward a priori theory of dark channels, which holds that, in most outdoor nonfog images, there are always pixels with low luminance values and close to 0 in a certain color channel. Wang et al. [12] used a weight map to optimize the transmission image in the dark channel prior algorithm and overcome the challenges of the dark channel prior-based algorithm, such as block effect and color distortion. In fog and other bad weather conditions, before the light reaches the camera, it is absorbed, scattered, and refracted by the larger diameter particles in the air, which makes the outdoor scene image degraded. The process is described by the atmospheric scattering model [13]:(1)Ix=tx⋅Jx+1−tx⋅A,where x is the coordinate of the pixel, I (x) is the input image with fog, J (x) is the restored image without fog, A is the atmospheric light value, and t (x) is the transmittance of the scene light. Defogging based on this model is to recover the original fog-free image J (x) from the observed image I (x).For fog-free imageJ, the dark primary color of outdoor fog-free image Jdark is expressed as(2)Jdarkx=minc∈R,G,Bminy∈ΩxJcy,where c is the three channels of red, green, and blue, Jc (y) is the channel c image of the restored clear image J, and Ω (x) is the local area centered on the pixel point x. According to the prior theory of dark primary color, the intensity value of Jdark is always very low and close to 0 in the nonsky part of most outdoor nonfog images.Given that the atmospheric light valueA is constant in the local region of Ω (x), A is uniform, and the transmittance is fixed. On taking the minimum value of (1), which is calculated independently in three color channels and normalized by A, the following is obtained:(3)miny∈ΩxIcyAc=tx⋅miny∈ΩxJcyAc+1−tx,where Ic (y) is the channel c image of the input image I and Ac is the atmospheric light value of channel c. Then, we take the minimum value operation in the three color channels and combine the prior theory of dark primary color, Jdark (x) = 0, and get(4)tx=1−minc∈R,G,Bminy∈ΩxIcyAc.According to the transmissivity calculated by (4), the fog of the image with fog will be completely removed, which may cause the processed image to lack the sense of hierarchy and reality. To maintain the subjective visual effect of the image without fog after processing, the spatial perspective, retention factor ω (0 < ω ≤ 1) is introduced to take the value according to the actual situation. A certain proportion of fog is retained, and ω is usually taken as 0.90∼0.97.(5)tx=1−ϖminc∈R,G,Bminy∈ΩxIcyAc.


## 2.2. Visibility Detection Based on Transmissivity

With the sky as the background, Koschmieder established the relationship between the luminanceL0 of the scene and the distance d [2]:(6)L=L0e−μd+Lf1−e−μd,where L is the received brightness, Lf is the sky brightness, and μ is the extinction coefficient.Duntley proposed the attenuation law of contrast with distance change [2]:(7)C=C0e−μd,where C is the visual brightness contrast of the scene at a distance of d, and C0 is the brightness contrast of the scene and the background. C/C0 = ε is the contrast threshold corresponding to the transmittance:(8)t=ε=e−μd.Under the maximum visibility of the image, the transmissivity is close to 0, which is shared by all scenes of the image.(9)tx⟶0,dx=−lntxμ≥Vx.Each point in the image may have differentd (x) and different t (x). When t (x) is close to 1, d (x) is close to 0, which means that there is no fog in the point x. However, when the transmissivity of point x is close to 0, point x is the farthest point in the image, and d (x) is the largest. V (x) is the visibility of the image, and it must be less than or equal to this maximum distance d (x)t⟶0. Koschmieder recommends using the distance when the contrast threshold is 0.02 as the visibility:(10)V=−1μln0.02≈3.912μ.The World Meteorological Organization uses the distance when the contrast threshold is 0.05 as the meteorological optical range [14]:(11)V=−1μln0.05≈3.0μ.


## 2.3. Residual Energy Ratio of Different Wavelengths

According to the Yandel effect [15], the scattering degree of suspended particles in the atmosphere is different for different wavelengths. The longer the wavelength is, the less obvious the scattering effect is. Therefore, the transmittance of different wavelengths of light is different and cannot be regarded as the same t. Taking RGB color channels as an example, the transmittance of RGB three channels should be different [16].(12)tR≠tG≠tB.Kruse [17] gives the relationship between extinction coefficient and visibility when the propagation contrast threshold is 0.02 in fog. The spectral distribution characteristics of different wavelengths are clearly different, so the extinction coefficient is monochromatic at this time. In this paper, the relationship between extinction coefficient and visibility when the contrast threshold is 0.05 is used:(13)μ=3.0V0.55λqkm−1,where λ is the wavelength of light, 0.55 μm is the central wavelength of visible light, and q is the wavelength correction factor, which is expressed as(14)q=0.585V1/3,V<6km,1.3,6km<V<50km,1.6,V≥50km.Kim et al. [18] made a more accurate division of the relationship between the values of visibility less than 6 km. The visibility with V greater than 6 km is better, and there is no need to remove fog. In this paper, the following formula is adopted:(15)q=0,V<500m,V−0.5,500m≤V<1km,0.16V+0.34,1km≤V<6km.According to (8) and (15), the transmissivity is as follows:(16)tλx=e−3.0/V0.55/λq⋅dx.The dark channel algorithm is used to calculate the different transmissivity corresponding to different wavelengths of the three channels, and the obtained transmissivity is modified by median filtering, as shown in Figure1.Figure 1
Three channels transmittances of images. (a) Foggy image. (b) ChannelR. (c) Channel G. (d) Channel B.
(a)(b)(c)(d)Figure2 is the histogram corresponding to the three-channel transmissivities diagram in Figure 1. It can be seen from Figures 1 and 2 that the transmissivities of the three channels of the original images vary to different degrees. Theoretically, the transmittance values of RGB three channels should be the same, but the transmittance of RGB three channels are not the same, because of the differences of light energy attenuation rates of different wavelengths. If the difference between the transmittances of the three channels of the images is smaller, it indicates that the smaller the difference of the light attenuation, the smaller the fog concentration and the less the color shift of the image. If the difference between the transmissivities of the three channels of the image is larger, it indicates that the greater the difference between the light attenuation, the greater the fog concentration and the more the color shift of the image.Figure 2
The corresponding histogram of transmissivities in Figure1. (a) Channel R. (b) Channel G. (c) Channel B.
(a)(b)(c)The transmissivityt of light is also called the residual energy ratio of light [19]. The ratio of the initial energy Eλix of a light beam with wavelength λ to the residual energy Eλrx after propagating a distance d (x) is expressed as follows:(17)tλx=EλrxEλix=Nrerλdx,where μ (λ) is the scattering coefficient of light with wavelength λ and Nrer (λ) is the standard residual energy ratio, which can be obtained from (16) and (17):(18)Nrerλ=e−3.0/V0.55/λq.


## 3. Visibility Detection Based on Residual Energy Ratio

### 3.1. Rough Estimation of Fog Concentration

In the transmissivity map, the higher the fog concentration in the original image, the lower the transmissivity, and the lower the visibility. If there is no fog or the area has a smaller fog concentration, the transmissivity is higher and visibility is greater. According to [18], it is generally considered that the visual effect is better when visibility is greater than 1 km. First, Kaiming’s guide filtering algorithm [20] is used to obtain the transmittance map of each image in Figure 3.Figure 3
Transmittance maps of fog images. (a) Image 1. (b) Image 2. (c) Image 3. (d) Image 4.
(a)(b)(c)(d)When the transmittance is less than 0.5,γ is the ratio of transmittance less than 0.5. According to the calculation results, the visibility is roughly divided by 1 km. When γ is more than 30%, it can be considered that the image has low transmittance, high fog concentration, and low visibility. In practical applications, it is necessary to defog the image to improve the visibility of the image. When γ is less than 30%, it can be considered that the image has high transmittance, low fog concentration, and high visibility. According to the calculations of the images shown in Figure 4, the values of γ in images (a) and (b) are less than 30%, and the visibility is greater than 1 km, whereas the values of γ in images (c) and (d) are greater than 30%, and the visibility is less than 1 km (Table 1). The calculation results are also in line with human visual judgment.Figure 4
Images of different visibilities.
(a)(b)(c)(d)Table 1
Classification of foggy weather.
Figure4γ (%)Visibility (km)(a)3.06>1(b)16.31>1(c)47.20<1(d)63.86<1


### 3.2. Residual Energy Ratio Detection Visibility

The residual energy ratio of different wavelengths of light passing through the propagation distanced (x) is different. Under different visibility, after each unit distance attenuation, the residual energy ratio of three color channels is constant [16]. Taking 1 km as an example, the residual energy of three channels in the range of 0–6 km visibility is shown in Figure 5.Figure 5
Residual energy ratio of three channels per 1 km under different visibility.It can be seen from Figure6 that, under the same visibility, after the attenuation of light for 1 km, there are differences in the residual energy ratio of the three channels. The channel R has the most residual energy, channel G is less than channel R, and channel B has the least residual energy ratio. With the increase of propagation distance, the residual energy ratio of each channel is less and less, and the differences among the three channels are increasing. Therefore, calculate the difference between the residual energy ratios of the three channels with 1 km as the unit distance under the same visibility, and the calculation results are shown in Figure 6.Figure 6
The difference of residual energy ratio of three channels.It can be seen that the difference between channelR and channel B is the largest and between channel G and channel B is the smallest. On taking 1 km as the dividing line, each difference on each line has a corresponding visibility. Due to the fastest attenuation of the blue channel, to avoid large error, the value of (R − G)/G is selected, and the more accurate image visibility can be calculated by combining with the weather judgment of fog in Section 3.1.


### 3.3. Filter Pixels

In the outdoor image, there may be pixels with too large values in one of the three channels, such as green tree and red brick. The values of the other two color channels of these pixels are relatively low. After attenuation, the two channels will not change significantly. In order to improve the accuracy of visibility estimation, these pixels are removed. Through experiments, the selection of the normalized removal threshold can be obtained by the following:(19)σ=0.4−0.4×0.1×γ,γ is the ratio of transmittance less than 0.5. When the gray value of at least one of the three channels of a pixel exceeds σ, the pixel is filtered out. The images are calculated, and the results are shown in Figure 7. Black pixels are the filtered pixels, and the white areas are the pixels that will be used for calculation after being filtered. This method can effectively remove the pixels with great influence, and at the same time, it can reduce the amount of computation.Figure 7
Pixel selection of fog images.
(a)(b)(c)(d)


## 3.1. Rough Estimation of Fog Concentration

In the transmissivity map, the higher the fog concentration in the original image, the lower the transmissivity, and the lower the visibility. If there is no fog or the area has a smaller fog concentration, the transmissivity is higher and visibility is greater. According to [18], it is generally considered that the visual effect is better when visibility is greater than 1 km. First, Kaiming’s guide filtering algorithm [20] is used to obtain the transmittance map of each image in Figure 3.Figure 3
Transmittance maps of fog images. (a) Image 1. (b) Image 2. (c) Image 3. (d) Image 4.
(a)(b)(c)(d)When the transmittance is less than 0.5,γ is the ratio of transmittance less than 0.5. According to the calculation results, the visibility is roughly divided by 1 km. When γ is more than 30%, it can be considered that the image has low transmittance, high fog concentration, and low visibility. In practical applications, it is necessary to defog the image to improve the visibility of the image. When γ is less than 30%, it can be considered that the image has high transmittance, low fog concentration, and high visibility. According to the calculations of the images shown in Figure 4, the values of γ in images (a) and (b) are less than 30%, and the visibility is greater than 1 km, whereas the values of γ in images (c) and (d) are greater than 30%, and the visibility is less than 1 km (Table 1). The calculation results are also in line with human visual judgment.Figure 4
Images of different visibilities.
(a)(b)(c)(d)Table 1
Classification of foggy weather.
Figure4γ (%)Visibility (km)(a)3.06>1(b)16.31>1(c)47.20<1(d)63.86<1


## 3.2. Residual Energy Ratio Detection Visibility

The residual energy ratio of different wavelengths of light passing through the propagation distanced (x) is different. Under different visibility, after each unit distance attenuation, the residual energy ratio of three color channels is constant [16]. Taking 1 km as an example, the residual energy of three channels in the range of 0–6 km visibility is shown in Figure 5.Figure 5
Residual energy ratio of three channels per 1 km under different visibility.It can be seen from Figure6 that, under the same visibility, after the attenuation of light for 1 km, there are differences in the residual energy ratio of the three channels. The channel R has the most residual energy, channel G is less than channel R, and channel B has the least residual energy ratio. With the increase of propagation distance, the residual energy ratio of each channel is less and less, and the differences among the three channels are increasing. Therefore, calculate the difference between the residual energy ratios of the three channels with 1 km as the unit distance under the same visibility, and the calculation results are shown in Figure 6.Figure 6
The difference of residual energy ratio of three channels.It can be seen that the difference between channelR and channel B is the largest and between channel G and channel B is the smallest. On taking 1 km as the dividing line, each difference on each line has a corresponding visibility. Due to the fastest attenuation of the blue channel, to avoid large error, the value of (R − G)/G is selected, and the more accurate image visibility can be calculated by combining with the weather judgment of fog in Section 3.1.


## 3.3. Filter Pixels

In the outdoor image, there may be pixels with too large values in one of the three channels, such as green tree and red brick. The values of the other two color channels of these pixels are relatively low. After attenuation, the two channels will not change significantly. In order to improve the accuracy of visibility estimation, these pixels are removed. Through experiments, the selection of the normalized removal threshold can be obtained by the following:(19)σ=0.4−0.4×0.1×γ,γ is the ratio of transmittance less than 0.5. When the gray value of at least one of the three channels of a pixel exceeds σ, the pixel is filtered out. The images are calculated, and the results are shown in Figure 7. Black pixels are the filtered pixels, and the white areas are the pixels that will be used for calculation after being filtered. This method can effectively remove the pixels with great influence, and at the same time, it can reduce the amount of computation.Figure 7
Pixel selection of fog images.
(a)(b)(c)(d)


## 4. Experimental Results and Evaluation Application

### 4.1. Visibility Measurement Results

We select some images with different fog concentrations in Figure8, and the experimental results are shown in Table 2. The visibilities of Figures 8(a)–8(d) are more than 1 km, and those in Figures 8(e)–8(h) are less than 1 km. To improve the computing speed, the pixels with gray values greater than σ in any channels of the image should be removed. Then, we calculated (R − G)/G of the remaining pixels and determined the corresponding visibility value V in Figure 8. The experimental results are in line with the subjective judgment of human eyes.Figure 8
(a–h) Original images.
(a)(b)(c)(d)(e)(f)(g)(h)Table 2
Visibility calculation results and comparison with FADE.
Figure8γ (%)(R − G)/GV (km)FADE(a)16.30.02132.790.4547(b)25.60.02472.050.4250(c)28.80.01734.760.4532(d)24.50.02591.881.0730(e)46.10.01640.641.3509(f)63.90.03030.821.4030(g)91.30.03110.841.5353(h)48.80.03630.951.5041To verify the effectiveness of this algorithm for image visibility estimation, we compared it with the fog aware density evaluator (FADE) model [21], based on natural scene statistics and fog sensing statistical characteristics. FADE evaluates the fog density quantitatively. The lower the index value is, the lower the fog density is. The comparison results are also shown in Table 2. It can be seen that the visibilities of the images in Figures 8(a)–8(d) are higher than 1 km, and the corresponding FADE values are smaller, indicating that the fog concentrations of the images are lower. The visibilities of the images in Figures 8(e)–8(h) are lower than 1 km, and the corresponding FADE values are larger, which indicate that the fog concentrations of the images are higher. However, for images which do not have the same scene, the values of FADE cannot reflect the fog concentrations without the same scene reference images, and the visibility estimated by this algorithm has significant consistency in different scenes.To objectively evaluate the effect of several algorithms, we also compared Figures8(e) and 8(f) with the peak signal-to-noise ratio (PSNR), information entropy (IE), effective detail intensity ratio (EDIR), histogram similarity (HS), and structure similarity (SSIM). The two images are restored by the algorithms of dark channel, Tarel, guided filtering, and Chen. The comparison results are shown in Figure 9 and Table 3.Figure 9
Comparison of defogging results. (a) Foggy image. (b) Dark channel. (c) Tarel. (d) Guided filtering. (e) Chen.
(a)(b)(c)(d)(e)Table 3
Objective evaluation.
Figure8Fog removal algorithmPSNRIEEDIRHSSSIMImage eDark channel11.91936.47880.27810.79010.8226Guided filtering14.21316.65680.27720.91190.9054Tarel13.84697.05860.32880.81320.8475Chen14.89587.01140.30450.89850.9044Image fDark channel7.58226.92180.14790.73320.7269Guided filtering10.61087.47740.15300.92760.9272Tarel15.29837.14500.16360.61820.6337Chen11.28347.53180.15140.94650.9438From the objective evaluation data in Table3, it can be seen that the PSNR and IE of Chen’s algorithm are higher, which shows that the image quality of the algorithm is better after fog removal. EDIR, HS, and SSIM show that the matching degree between the Chen’s algorithm and the original image features is higher, and the ability to maintain the original image structure information is stronger.Figure10 shows the four scenes in different weather conditions of the K277 + 749 down section of Beijing Kunshitai expressway. Table 4 shows the comparison of observed visibilities calculated by the PTZ algorithm [22], curve response fitting algorithm [23], and our algorithm at that time. It can be seen that the error between the actual observation value and calculated results by the algorithm in this paper is smaller. Therefore, our algorithm is suitable for the detection of visibility in fog.Figure 10
Images in different weather conditions. (a) Scene 1. (b) Scene 2. (c) Scene 3. (d) Scene 4.
(a)(b)(c)(d)Table 4
The ratio of observed visibility.
Actual observation value (km)PTZ algorithm (km)Curve response fitting algorithm (km)Algorithm of this paper (km)Scene 10.720.800.750.69Scene 21.291.411.351.31Scene 33.483.083.833.11Scene 42.662.862.892.49


### 4.2. Using Visibility to Evaluate the Demisting Effect of Different Algorithms

The visibility of the foggy images is low, and it is difficult to distinguish different scenes in the image. Therefore, the visibility can be used as the evaluation index of the effectiveness of the image defogging algorithm. This algorithm can calculate the visibility of images processed by different algorithms, so it can also be used to evaluate the effectiveness of different defogging algorithms. The images restored by the dark primary color algorithm, guide filter algorithm, DEFADE [21] algorithm, and Meng [24] algorithm are used for visibility estimation, and the comparison results are shown in Figure 11 and Table 5. Figure 11(a) are the images with fog, and the three images from top to bottom are image 1, image 2, and image 3. Figures 11(b)–11(e) are the results of dark primary color prior algorithm, guide filter algorithm, DEFADE algorithm, and Meng algorithm.Figure 11
Defogging results of different classic algorithms. (a) Foggy images 1 to 3. (b) Dark channel. (c) Guided filtering. (d) DEFADE. (e) Meng.
(a)(b)(c)(d)(e)Table 5
Visibility and FADE after demisting with different classic algorithms in Figure11.
Figure11Image 1Image 2Image 3Foggy imageVisibility0.79 km0.66 km0.82 kmFADE1.80711.36973.0818Dark channelVisibility1.48 km2.67 km4.00 kmFADE0.75380.23300.6566Guided filteringVisibility1.13 km1.53 km3.39 kmFADE0.74910.47421.1067DEFADEVisibility2.35 km2.45 km2.17 kmFADE0.49340.23990.8394MENGVisibility1.57 km3.39 km2.12 kmFADE0.22210.20900.5498In Table5, the results of visibility calculation are similar to those of FADE fog concentration calculation. The smaller the FADE value is, the lower the visibility is. From the evaluation data in Table 5, it can be seen that the fog image concentrations in Figure 11 are less than 1 km, and the images visibilities detection values after defogging by different algorithms are greater than 1 km. For example, the visibility of image 1 in foggy image is 0.79 km, while the values are 1.48 km, 1.13 km, 2.35 km, and 1.57 km, after defogging separately by dark channel, guide filter, DEFADE and Meng algorithm. Only from the view of defog effect, the visibility of all defog images is improved in different degrees compared with the original image, which shows that all kinds of algorithms play a defog effect. In image 2, the visibility of Meng algorithm is higher than other algorithms, and its FADE value is also the smallest. In image 3, there is a block effect in the defog results of Meng, and DEFADE algorithm shows better visual effect. The FADE values show that the fog removal effect of Meng algorithm is good. However, when the atmospheric light is selected manually by a human–computer interaction, there will be an obvious halo effect in the sky area.We also compared the values of visibility and FADE with some neural network algorithms in Figure12 and Table 6. Figure 12(a) are the images with fog, and the three images from top to bottom are image 4, image 5 and image 6. Figures 12(b)–12(e) are the results of MSCNN algorithm [25], AOD algorithm [26], GFN algorithm [27], and FFA algorithm [9].Figure 12
Defogging results of some neural networks algorithms. (a) FFA. (b) GFN. (c) AOD. (d) MSCNN. (e) Foggy images 4 to 6.
(a)(b)(c)(d)(e)Table 6
Visibility and FADE after demisting with some neural networks algorithms in Figure12.
Figure12Image 4Image 5Image 6Foggy imageVisibility0.42 km0.97 km0.56 kmFADE0.90061.43790.9603MSCNNVisibility1.02 km1.99 km1.87 kmFADE0.53320.57080.4286AODVisibility1.80 km1.62 km2.01 kmFADE0.34640.64850.3258GFNVisibility1.76 km1.31 km2.07 kmFADE0.36350.89960.3209FFAVisibility1.93 km1.48 km1.15 kmFADE0.29320.77080.6113Table6 also shows that the smaller the FADE value is, the bigger the visibility is. From the evaluation data in Table 6, it can be seen that the fog images concentrations in Figure 12 are less than 1 km, and the image visibility detection values after defogging by different neural network algorithms are greater than 1 km. For example, the visibility of image 4 in foggy image is 0.42 km, while the values are 1.02 km, 1.80 km, 1.76 km and 1.93 km after defogging separately by MSCNN, AOD, GFN, and FFA algorithm. The FADE values of different neural network algorithms can only be effectively evaluated with the same image. For different pictures, the FADE calculations cannot be compared, but the visibilities can be effectively compared. Therefore, the visibility calculated by this algorithm can be used as an evaluation index to evaluate the effectiveness of the demisting algorithm.


### 4.3. Evaluation of the Recovery Effect of Defog Color Difference

Fog image not only reduces the visibility but also causes the problem of color shift. Theoretically, the RGB three channels should share the same transmittance valuet, but the longer the wavelength is, the slower the energy attenuation is. Therefore, the smaller the difference between the transmittance of the three channels after defogging, the better the defogging effect and the color restoration. In this paper, the algorithm calculates and counts the different distribution of transmittance values of different channels to evaluate the color offset restoration effect of different algorithms. We compared the restored images of dark primary color algorithm, guide filter algorithm, Meng [24] algorithm, DEFADE [21] algorithm, Tarel [28] algorithm, and Chen algorithm [16]. Figure 13(a) are the fog images, and the four images from top to bottom are images 7 to 10.Figure 13
Defogging results of different algorithms. (a) Foggy images 7 to10. (b) Dark channel. (c) Guided filtering. (d) Meng. (e) DEFADE. (f) Tarel. (g) Chen.
(a)(b)(c)(d)(e)(f)(g)For the four defog images in Figure13 obtained by different algorithms, for each defog image with three channels and three different transmittance images, the absolute value of the difference value of the corresponding transmittance value of each pixel is calculated one by one between the two, and the proportion of the number of pixels in each difference interval to the total number of pixels is calculated. The smaller the difference, the larger the proportion of pixels, the less the color deviation after defogging, and the better the color restoration. Taking channels R and G of image 9 in Figure 13(a) as an example, the calculation results are shown in Figure 14 and Table 7. The first line in Figure 14 is R channel, and the second line is channel G. It can be seen that our method can effectively judge the effect of fog removal.Figure 14
The transmittance histogram of the defogging results of image 9 in Figure13(a) by different algorithms. (a) Dark channel. (b) Guided filtering. (c) Meng. (d) DEFADE. (e) Tarel. (f) Chen.
(a)(b)(c)(d)(e)(f)Table 7
Transmittance differences ofR-G channels after defogging with different algorithms.
Figure13Ratio oft difference of R-G channelsDark channel (%)Guided filtering (%)Meng (%)DEFADE (%)Tarel (%)Chen (%)Image 70–0.194.3393.5391.6490.6497.4497.230.1–0.25.666.428.299.282.52.770.2–0.30.010.050.070.080.0600.3–0.5000000>0.5000000Image 80–0.180.5381.8884.2886.7078.4296.610.1–0.217.2816.5213.5412.9521.413.390.2–0.31.841.582.180.350.1700.3–0.50.350.020000>0.5000000Image 90–0.143.2142.8958.2631.4314.5367.790.1–0.241.2540.8029.9141.2957.0424.220.2–0.314.2915.1811.2316.4720.577.780.3–0.51.251.120.610.687.830.21>0.500.0100.120.030Image 100–0.157.8454.8248.4857.1242.1760.580.1–0.241.9644.9438.9441.9649.8338.990.2–0.30.190.2212.540.198.000.430.3–0.500.010.04000>0.5000000In Figure14, after defogging image 9 in Figure 13 by each algorithm, the transmittances of R channel and G channel are different from each other in the visual sense, and the differences are consistent with the calculation results in Table 7. The visibility of images 7 and 8 is relatively high (2.55 km; 4.76 km), which is in the mist state. Therefore, the transmittance difference between channel R and channel G is relatively small, most of which is concentrated between 0 and 0.1, and the difference between different algorithms is not obvious.The visibilities of images 9 and 10 are relatively low (0.58 km; 0.64 km), and the light attenuations of different wavelengths are quite different. The proportions of the points, where the transmittances difference of channelR and channel G are relatively large, are increased. Chen algorithm [16] compensates the image according to the different attenuation of different wavelengths and effectively corrects the color offset of the image while removing the fog. The visual effect is good.


### 4.4. Discussion of Experimental Results

When different wavelengths of light pass through the fog, they will show different attenuation. When the same wavelength of light passes through different concentrations of fog, it also shows different attenuation. The main innovation of this algorithm is to detect the image visibility according to the different energy attenuation of RGB three channels under different fog concentrations. The visibility values detected by three methods, namely, visual method, instrumental method, and image processing method, may have deviation. There are limitations in the visibility range of Figure6. If it is beyond the range of Figure 6, the reverse extension line and other methods can be used. In the calculation of visibility, we used the value of (R − G)/G. In the following work, we will discuss the different results of the three lines.We compared the data of several different defogging algorithms, such as classic image algorithms and neural network algorithms. The results of the algorithms in this paper are consistent with the results of FADE, while FADE often has better indicators but a worse visual effect. The results show that the smaller the FADE value is, the bigger the visibility is. From the experimental data, we can see that the visibility values detected by the algorithm in this paper are more consistent with the subjective feelings of human eyes. It is simple in principle but feasible to use the difference of transmittance between different channels as the evaluation index of color restoration of the defog image.


## 4.1. Visibility Measurement Results

We select some images with different fog concentrations in Figure8, and the experimental results are shown in Table 2. The visibilities of Figures 8(a)–8(d) are more than 1 km, and those in Figures 8(e)–8(h) are less than 1 km. To improve the computing speed, the pixels with gray values greater than σ in any channels of the image should be removed. Then, we calculated (R − G)/G of the remaining pixels and determined the corresponding visibility value V in Figure 8. The experimental results are in line with the subjective judgment of human eyes.Figure 8
(a–h) Original images.
(a)(b)(c)(d)(e)(f)(g)(h)Table 2
Visibility calculation results and comparison with FADE.
Figure8γ (%)(R − G)/GV (km)FADE(a)16.30.02132.790.4547(b)25.60.02472.050.4250(c)28.80.01734.760.4532(d)24.50.02591.881.0730(e)46.10.01640.641.3509(f)63.90.03030.821.4030(g)91.30.03110.841.5353(h)48.80.03630.951.5041To verify the effectiveness of this algorithm for image visibility estimation, we compared it with the fog aware density evaluator (FADE) model [21], based on natural scene statistics and fog sensing statistical characteristics. FADE evaluates the fog density quantitatively. The lower the index value is, the lower the fog density is. The comparison results are also shown in Table 2. It can be seen that the visibilities of the images in Figures 8(a)–8(d) are higher than 1 km, and the corresponding FADE values are smaller, indicating that the fog concentrations of the images are lower. The visibilities of the images in Figures 8(e)–8(h) are lower than 1 km, and the corresponding FADE values are larger, which indicate that the fog concentrations of the images are higher. However, for images which do not have the same scene, the values of FADE cannot reflect the fog concentrations without the same scene reference images, and the visibility estimated by this algorithm has significant consistency in different scenes.To objectively evaluate the effect of several algorithms, we also compared Figures8(e) and 8(f) with the peak signal-to-noise ratio (PSNR), information entropy (IE), effective detail intensity ratio (EDIR), histogram similarity (HS), and structure similarity (SSIM). The two images are restored by the algorithms of dark channel, Tarel, guided filtering, and Chen. The comparison results are shown in Figure 9 and Table 3.Figure 9
Comparison of defogging results. (a) Foggy image. (b) Dark channel. (c) Tarel. (d) Guided filtering. (e) Chen.
(a)(b)(c)(d)(e)Table 3
Objective evaluation.
Figure8Fog removal algorithmPSNRIEEDIRHSSSIMImage eDark channel11.91936.47880.27810.79010.8226Guided filtering14.21316.65680.27720.91190.9054Tarel13.84697.05860.32880.81320.8475Chen14.89587.01140.30450.89850.9044Image fDark channel7.58226.92180.14790.73320.7269Guided filtering10.61087.47740.15300.92760.9272Tarel15.29837.14500.16360.61820.6337Chen11.28347.53180.15140.94650.9438From the objective evaluation data in Table3, it can be seen that the PSNR and IE of Chen’s algorithm are higher, which shows that the image quality of the algorithm is better after fog removal. EDIR, HS, and SSIM show that the matching degree between the Chen’s algorithm and the original image features is higher, and the ability to maintain the original image structure information is stronger.Figure10 shows the four scenes in different weather conditions of the K277 + 749 down section of Beijing Kunshitai expressway. Table 4 shows the comparison of observed visibilities calculated by the PTZ algorithm [22], curve response fitting algorithm [23], and our algorithm at that time. It can be seen that the error between the actual observation value and calculated results by the algorithm in this paper is smaller. Therefore, our algorithm is suitable for the detection of visibility in fog.Figure 10
Images in different weather conditions. (a) Scene 1. (b) Scene 2. (c) Scene 3. (d) Scene 4.
(a)(b)(c)(d)Table 4
The ratio of observed visibility.
Actual observation value (km)PTZ algorithm (km)Curve response fitting algorithm (km)Algorithm of this paper (km)Scene 10.720.800.750.69Scene 21.291.411.351.31Scene 33.483.083.833.11Scene 42.662.862.892.49


## 4.2. Using Visibility to Evaluate the Demisting Effect of Different Algorithms

The visibility of the foggy images is low, and it is difficult to distinguish different scenes in the image. Therefore, the visibility can be used as the evaluation index of the effectiveness of the image defogging algorithm. This algorithm can calculate the visibility of images processed by different algorithms, so it can also be used to evaluate the effectiveness of different defogging algorithms. The images restored by the dark primary color algorithm, guide filter algorithm, DEFADE [21] algorithm, and Meng [24] algorithm are used for visibility estimation, and the comparison results are shown in Figure 11 and Table 5. Figure 11(a) are the images with fog, and the three images from top to bottom are image 1, image 2, and image 3. Figures 11(b)–11(e) are the results of dark primary color prior algorithm, guide filter algorithm, DEFADE algorithm, and Meng algorithm.Figure 11
Defogging results of different classic algorithms. (a) Foggy images 1 to 3. (b) Dark channel. (c) Guided filtering. (d) DEFADE. (e) Meng.
(a)(b)(c)(d)(e)Table 5
Visibility and FADE after demisting with different classic algorithms in Figure11.
Figure11Image 1Image 2Image 3Foggy imageVisibility0.79 km0.66 km0.82 kmFADE1.80711.36973.0818Dark channelVisibility1.48 km2.67 km4.00 kmFADE0.75380.23300.6566Guided filteringVisibility1.13 km1.53 km3.39 kmFADE0.74910.47421.1067DEFADEVisibility2.35 km2.45 km2.17 kmFADE0.49340.23990.8394MENGVisibility1.57 km3.39 km2.12 kmFADE0.22210.20900.5498In Table5, the results of visibility calculation are similar to those of FADE fog concentration calculation. The smaller the FADE value is, the lower the visibility is. From the evaluation data in Table 5, it can be seen that the fog image concentrations in Figure 11 are less than 1 km, and the images visibilities detection values after defogging by different algorithms are greater than 1 km. For example, the visibility of image 1 in foggy image is 0.79 km, while the values are 1.48 km, 1.13 km, 2.35 km, and 1.57 km, after defogging separately by dark channel, guide filter, DEFADE and Meng algorithm. Only from the view of defog effect, the visibility of all defog images is improved in different degrees compared with the original image, which shows that all kinds of algorithms play a defog effect. In image 2, the visibility of Meng algorithm is higher than other algorithms, and its FADE value is also the smallest. In image 3, there is a block effect in the defog results of Meng, and DEFADE algorithm shows better visual effect. The FADE values show that the fog removal effect of Meng algorithm is good. However, when the atmospheric light is selected manually by a human–computer interaction, there will be an obvious halo effect in the sky area.We also compared the values of visibility and FADE with some neural network algorithms in Figure12 and Table 6. Figure 12(a) are the images with fog, and the three images from top to bottom are image 4, image 5 and image 6. Figures 12(b)–12(e) are the results of MSCNN algorithm [25], AOD algorithm [26], GFN algorithm [27], and FFA algorithm [9].Figure 12
Defogging results of some neural networks algorithms. (a) FFA. (b) GFN. (c) AOD. (d) MSCNN. (e) Foggy images 4 to 6.
(a)(b)(c)(d)(e)Table 6
Visibility and FADE after demisting with some neural networks algorithms in Figure12.
Figure12Image 4Image 5Image 6Foggy imageVisibility0.42 km0.97 km0.56 kmFADE0.90061.43790.9603MSCNNVisibility1.02 km1.99 km1.87 kmFADE0.53320.57080.4286AODVisibility1.80 km1.62 km2.01 kmFADE0.34640.64850.3258GFNVisibility1.76 km1.31 km2.07 kmFADE0.36350.89960.3209FFAVisibility1.93 km1.48 km1.15 kmFADE0.29320.77080.6113Table6 also shows that the smaller the FADE value is, the bigger the visibility is. From the evaluation data in Table 6, it can be seen that the fog images concentrations in Figure 12 are less than 1 km, and the image visibility detection values after defogging by different neural network algorithms are greater than 1 km. For example, the visibility of image 4 in foggy image is 0.42 km, while the values are 1.02 km, 1.80 km, 1.76 km and 1.93 km after defogging separately by MSCNN, AOD, GFN, and FFA algorithm. The FADE values of different neural network algorithms can only be effectively evaluated with the same image. For different pictures, the FADE calculations cannot be compared, but the visibilities can be effectively compared. Therefore, the visibility calculated by this algorithm can be used as an evaluation index to evaluate the effectiveness of the demisting algorithm.


## 4.3. Evaluation of the Recovery Effect of Defog Color Difference

Fog image not only reduces the visibility but also causes the problem of color shift. Theoretically, the RGB three channels should share the same transmittance valuet, but the longer the wavelength is, the slower the energy attenuation is. Therefore, the smaller the difference between the transmittance of the three channels after defogging, the better the defogging effect and the color restoration. In this paper, the algorithm calculates and counts the different distribution of transmittance values of different channels to evaluate the color offset restoration effect of different algorithms. We compared the restored images of dark primary color algorithm, guide filter algorithm, Meng [24] algorithm, DEFADE [21] algorithm, Tarel [28] algorithm, and Chen algorithm [16]. Figure 13(a) are the fog images, and the four images from top to bottom are images 7 to 10.Figure 13
Defogging results of different algorithms. (a) Foggy images 7 to10. (b) Dark channel. (c) Guided filtering. (d) Meng. (e) DEFADE. (f) Tarel. (g) Chen.
(a)(b)(c)(d)(e)(f)(g)For the four defog images in Figure13 obtained by different algorithms, for each defog image with three channels and three different transmittance images, the absolute value of the difference value of the corresponding transmittance value of each pixel is calculated one by one between the two, and the proportion of the number of pixels in each difference interval to the total number of pixels is calculated. The smaller the difference, the larger the proportion of pixels, the less the color deviation after defogging, and the better the color restoration. Taking channels R and G of image 9 in Figure 13(a) as an example, the calculation results are shown in Figure 14 and Table 7. The first line in Figure 14 is R channel, and the second line is channel G. It can be seen that our method can effectively judge the effect of fog removal.Figure 14
The transmittance histogram of the defogging results of image 9 in Figure13(a) by different algorithms. (a) Dark channel. (b) Guided filtering. (c) Meng. (d) DEFADE. (e) Tarel. (f) Chen.
(a)(b)(c)(d)(e)(f)Table 7
Transmittance differences ofR-G channels after defogging with different algorithms.
Figure13Ratio oft difference of R-G channelsDark channel (%)Guided filtering (%)Meng (%)DEFADE (%)Tarel (%)Chen (%)Image 70–0.194.3393.5391.6490.6497.4497.230.1–0.25.666.428.299.282.52.770.2–0.30.010.050.070.080.0600.3–0.5000000>0.5000000Image 80–0.180.5381.8884.2886.7078.4296.610.1–0.217.2816.5213.5412.9521.413.390.2–0.31.841.582.180.350.1700.3–0.50.350.020000>0.5000000Image 90–0.143.2142.8958.2631.4314.5367.790.1–0.241.2540.8029.9141.2957.0424.220.2–0.314.2915.1811.2316.4720.577.780.3–0.51.251.120.610.687.830.21>0.500.0100.120.030Image 100–0.157.8454.8248.4857.1242.1760.580.1–0.241.9644.9438.9441.9649.8338.990.2–0.30.190.2212.540.198.000.430.3–0.500.010.04000>0.5000000In Figure14, after defogging image 9 in Figure 13 by each algorithm, the transmittances of R channel and G channel are different from each other in the visual sense, and the differences are consistent with the calculation results in Table 7. The visibility of images 7 and 8 is relatively high (2.55 km; 4.76 km), which is in the mist state. Therefore, the transmittance difference between channel R and channel G is relatively small, most of which is concentrated between 0 and 0.1, and the difference between different algorithms is not obvious.The visibilities of images 9 and 10 are relatively low (0.58 km; 0.64 km), and the light attenuations of different wavelengths are quite different. The proportions of the points, where the transmittances difference of channelR and channel G are relatively large, are increased. Chen algorithm [16] compensates the image according to the different attenuation of different wavelengths and effectively corrects the color offset of the image while removing the fog. The visual effect is good.


## 4.4. Discussion of Experimental Results

When different wavelengths of light pass through the fog, they will show different attenuation. When the same wavelength of light passes through different concentrations of fog, it also shows different attenuation. The main innovation of this algorithm is to detect the image visibility according to the different energy attenuation of RGB three channels under different fog concentrations. The visibility values detected by three methods, namely, visual method, instrumental method, and image processing method, may have deviation. There are limitations in the visibility range of Figure6. If it is beyond the range of Figure 6, the reverse extension line and other methods can be used. In the calculation of visibility, we used the value of (R − G)/G. In the following work, we will discuss the different results of the three lines.We compared the data of several different defogging algorithms, such as classic image algorithms and neural network algorithms. The results of the algorithms in this paper are consistent with the results of FADE, while FADE often has better indicators but a worse visual effect. The results show that the smaller the FADE value is, the bigger the visibility is. From the experimental data, we can see that the visibility values detected by the algorithm in this paper are more consistent with the subjective feelings of human eyes. It is simple in principle but feasible to use the difference of transmittance between different channels as the evaluation index of color restoration of the defog image.


## 5. Conclusions

There are many reasons that can cause color deviation problem, such as different wavelengths, different optical attenuations, and different visibilities. With the different visibilities, the intensity of dehazing should be different, and we cannot use the same fog removal method to defog the images of different visibilities. So, we proposed a visibility detection algorithm of a single fog image in this paper. This visibility detection method is based on the measurement of transmissivity, which is the same as the principle of transmissive visibility instrument. Based on the prior of dark channel and the attenuation of light wave energy, the preliminary prediction of haze weather conditions and the final measurement of visibility distance can be obtained. The experimental results show that the measurement results are reliable. The follow-up work will further study the application of dynamic video visibility in real-time monitoring.



---

*Source: 5531706-2021-06-25.xml*