# Adaptive Bright and Dark Channel Combined with Defogging Algorithm Based on Depth of Field

Authors: Shiqi Wang; Tingping Yang; Wenxue Sun; Xiao Lu; Di Fan
Journal: Journal of Sensors
 (2022)

---

## Abstract

Aiming at the problem that the dark channel prior algorithm is not ideal in removing fog at the distant view and the sudden change of depth, this paper proposes an adaptive bright and dark channel combined with defogging algorithm based on the depth of field. The algorithm divides the image into a distant area and a near area based on the depth of field. The near area uses the dark channel to remove the fog, and the distant area uses the bright channel to remove the fog, combined with the use of adaptive superpixel segmentation to give the content-based local area division and defogging control factor based on depth of field. It better solves the problem of large transmittance deviation and defogging distortion under content changes and sudden depth of field changes. From the subjective and objective indicators, the algorithm in this paper has achieved a good defogging effect, and the main indicators and comprehensive defogging quality are better than common algorithms.


---

## Body

## 1. Introduction

Fog has a great impact on the application of visual recognition in intelligent transportation. Dense fog will lead to system imaging blur and recognition failure. Images taken by image sensors in poor weather environments such as fog, rain, and haze will have serious degradation problems, which brings many difficulties in extracting useful information from images and has an important impact on the application of remote sensing, target detection, intelligent transportation, and other fields [1, 2]. The research of image defogging has received widespread attention. The existing image defogging algorithms are mainly divided into enhancement algorithms, restoration algorithms, and deep learning algorithms.The enhanced defogging algorithm improves the image quality through image enhancement technology, mainly including adaptive histogram equalization [3, 4], wavelet transform [5, 6], homomorphic filtering [7], and Retinex enhancement [8–10] algorithms. The adaptive histogram equalization defogging algorithm [3, 4] is an improvement on the basic histogram algorithm, which can indistinguishably improve the image contrast, suppress the slope of the transformation function to some extent, and avoid the phenomenon that rising too fast resulting weak image contrast and oversaturation. However, such methods will amplify the noise in the image when there is a lot of noise in the image. The wavelet transform method divides the image into high-frequency region and low-frequency region and uses the enhancement method for the high-frequency region to achieve the purpose of image defogging by improving the image contrast [5, 6], but it is not suitable for the situation of too bright or too dark and uneven illumination. The homomorphic filtering algorithm composes the illumination component and reflection component of the image, respectively, and processes them in the frequency domain, highlighting the details by enhancing the high-frequency information of the image [7]. It can effectively solve the problem of uneven illumination, but the Fourier transform used causes high computational complexity. The defogging algorithm based on Retinex generally adopts the multiscale Retinex with color restoration (MSRCR) method, which can obtain good defogging effect to a certain extent, but the defogging effect in dense fog scene is not ideal [8–10]. Thanh et al. successively proposed single image dehazing based on adaptive histogram equalization and linearization of gamma correction [11] and single image dehazing with optimal color channels and nonlinear transformation [12]. The method is fast and effective, and the processed image is better than the comparison algorithm in visual and objective indexes.Restoration defogging algorithms mainly include defogging algorithms based on partial differential equations [13, 14] and defogging algorithms based on prior knowledge [15–25]. The defogging algorithm based on partial differential equation uses multiple images to realize image defogging according to the polarization characteristics of light. Wu et al. [13] and Guo and Meng [14], respectively, proposed a series of improvement measures for the partial differential equation model. The defogging algorithm based on prior knowledge infers the cause of image degradation based on assumptions or prior information and estimates the atmospheric light and transmittance based on the atmospheric scattering model to obtain a fog-free image. The most typical one is the dark channel prior defogging algorithm. The dark channel prior defogging algorithm proposed by He et al. [15] has better effects in close and dark areas, but there are problems with distortion and poor defogging effects in distant and bright areas. Yan et al. proposed the bright channel prior [16], which uses the combination of bright channel and dark channel prior to achieve image deblurring, but did not consider the influence of different depths of field on the dehazing effect. Gao et al. proposed a far and near scene fusion defogging algorithm based on the prior of dark-light channel, and the saturation and sharpness of the image have been improved to a certain extent [17]. Yang et al. proposed adaptive haze estimation and transmittance estimation algorithms and achieved a certain dehazing effect [18, 19]. However, there is oversaturation in areas where dense fog and mist change drastically. Zhu et al. proposed a color attenuation prior. The depth of field information is obtained based on this prior, but the sample collection process of this method is difficult, and the theoretical basis is slightly lacking [20]. Fan et al. successively proposed an adaptive defogging algorithm based on color attenuation [21], single image defogging algorithm based on three-region division [22], an iterative defogging algorithm based on pixel-level atmospheric light map [23], and image defogging algorithm based on sparse representation [24]. The sharpness and contrast of the image after defogging are greatly improved. Kumar et al. proposed a region-based adaptive denoising and detail enhancement method, proposed the autocolor transfer method to strengthen the dark regions of the hazy image, and also considered the variation in haze levels in different regions of the image for adaptive adjustment [25].The deep learning defogging algorithm achieves defogging by training the model. It has a good defogging effect, but it requires a lot of calculation and needs to build a large dataset [26]. Cai et al. proposed to use the DehazeNet convolutional neural network to estimate the transmittance of the fog map, but the convolutional neural network takes a long time and has poor real-time performance [27]. Luan et al. proposed a classification algorithm based on a learning framework, using a support vector regression model to obtain accurate transmittance, but the feature extraction process is complicated [28]. Liu et al. designed an end-to-end convolutional neural network GridDehazeNet for image defogging and realized multiscale estimation based on attention [29]. Such algorithms require a large amount of datasets during the training process and are prone to overfitting. It is suitable for a single scene and depends too much on the foggy images and nonfoggy images in the datasets. The defogging effect in the real scene is poor.Aiming at the deficiencies of the above research, this paper proposes an adaptive bright and dark channel combined with defogging algorithm based on depth of field, which solves the problem of distortion in the distant view and poor defogging effect in the sudden depth of field. The segmentation window is adaptively determined based on the image content, and the defogging control factor and transmittance are adaptively determined based on the depth of field. The dark channel is used to defog in near areas and dark areas, and the bright channel is used to defog in distant areas and bright areas, so as to give play to their advantages in different areas. At the same time, based on the depth of field, the dark channel and the bright channel are adaptively divided and the defogging control factor is determined; the superpixel segmentation algorithm is used to give the content-based division of the local areas in the two channels. The two results are applied to the bright and dark channel defogging algorithm, which solves the problem in the original dark channel defogging algorithm. From the experimental results, good defogging effects have been obtained in both the distant and near areas, and the main indicators and comprehensive defogging quality are better than common algorithms.


## 2. Atmospheric Scattering Model and Principle of Bright and Dark Channels

### 2.1. Atmospheric Scattering Model

The atmospheric scattering model describes the imaging process under fog and haze conditions, and it is the theoretical basis of the restoration image defogging algorithms. Its mathematical model is(1)Ix=Jx∗tx+A∗1−tx.In the formula,x represents the image pixel position, Ix represents a foggy image, Jx represents a fog-free image, tx represents transmittance, and A represents the atmospheric light. If β represents the atmospheric scattering coefficient and dx represents the depth of field, that is, the distance from the target position to the camera, the transmittance tx can be expressed as
(2)tx=e−βdx.According to the atmospheric scattering model, whentx and A are obtained, the fog-free image Jx can be obtained backward according to formula (1).


### 2.2. Dark Channel Prior

The dark channel prior is the rule that He et al. [15] summarized by counting the characteristics of a large number of outdoor fog-free images, that is, for a fog-free image, in addition to the sky and bright areas, the value of pixels in its local area at least on one channel is very low and tends to zero. For any input image, its dark channel can be defined as
(3)Jdarkx=miny∈Ωxminc∈r,g,bJcy,⟶0where min represents the operation of taking the minimum value, Ωx represents the local area centered on pixel x, c represents one of the three channels of r,g,b, Jcy represents the pixel in area Ωx, and Jdarkx represents the dark channel image.Assuming that the atmospheric light valueA is known, and in the window Ωx, the transmittance tx is a fixed value and denoted as t~x. The minimum values of both sides of equation (1) are
(4)miny∈ΩxmincIcy=t~x∗miny∈ΩxmincJcy+A∗1−t~x.The dark channel value of a foggy image is represented byIdarkx, then
(5)Idarkx=t~x∗Jdarkx+A∗1−t~x.It can be known from the dark channel prior thatJdarkx approaches 0, and the above formula can be approximated as
(6)Idarkx=A∗1−t~x.The transmittance can be obtained by formula (6):
(7)t~x=1−wx∗IdarkxA,where wx is the defogging control factor, which is used to adjust the defogging intensity and prevent the image distortion caused by too strong defogging. wx can take a fixed value (such as w=0.95) or a variable value.Dark channel defogging is the process of obtaining the transmittancet~x according to the foggy image Ix and the estimated atmospheric light A and then obtaining the defogging image according to the atmospheric scattering model.


### 2.3. Bright Channel Prior

According to the dark channel prior, the dark channel values of sky area, dense fog area, bright area, and white area are relatively large, which does not satisfy the dark channel prior. Yan et al. [16] proposed the bright channel prior through statistical analysis, that is, in natural scene images, for image blocks of white objects, sky, bright areas, light intensity areas, etc., there is at least one color channel with a very large value, close to 1. The bright channel of an image can be defined as
(8)Jbrightx=maxy∈Ωxmaxc∈r,g,bJcy,⟶1where Jbrightx represents the bright channel image, max represents the operation of taking the maximum value.Similar to the dark channel prior defogging process, assuming that the atmospheric light valueA is known, and the transmittance tx in the window Ωx is a fixed value t~x. The maximum values on both sides of equation (1) are
(9)maxy∈ΩxmaxcIcy=t~x∗maxy∈ΩxmaxcJcy+A∗1−t~x.The left side of the above formula is the bright channel of the foggy image, denoted asIbrightx; then,
(10)Ibrightx=t~x∗Jbrightx+A∗1−t~x.According to the theory of bright channel prior,Jbrightx approaches 1, which can be approximately obtained as follows:
(11)Ibrightx=t~x+A∗1−t~x.By simplifying the above formula and introducing the defogging control factorwx, the transmittance can be obtained:
(12)t~x=1−wx∗1−Ibrightx1−A.Similarly, a certain degree of defogging can be achieved according to the bright channel prior.Obviously, dark channel defogging and bright channel defogging have their own applicable areas and failure areas, so both have their limitations. However, after analysis, it is not difficult to find that the applicable areas of them are complementary. Therefore, this paper proposes an adaptive bright and dark channel combined with defogging algorithm based on depth of field, which combines the two defogging methods. For the area where the dark channel prior is applicable, the dark channel is used to obtain the transmittance. For the area where the bright channel prior is applicable, the bright channel is used to obtain the transmittance. The areas are adaptively determined by the depth of field, and the defogging control factor also changes adaptively following the depth of field. The windowΩx is a content-based special-shaped area obtained by the superpixel segmentation method.


## 2.1. Atmospheric Scattering Model

The atmospheric scattering model describes the imaging process under fog and haze conditions, and it is the theoretical basis of the restoration image defogging algorithms. Its mathematical model is(1)Ix=Jx∗tx+A∗1−tx.In the formula,x represents the image pixel position, Ix represents a foggy image, Jx represents a fog-free image, tx represents transmittance, and A represents the atmospheric light. If β represents the atmospheric scattering coefficient and dx represents the depth of field, that is, the distance from the target position to the camera, the transmittance tx can be expressed as
(2)tx=e−βdx.According to the atmospheric scattering model, whentx and A are obtained, the fog-free image Jx can be obtained backward according to formula (1).


## 2.2. Dark Channel Prior

The dark channel prior is the rule that He et al. [15] summarized by counting the characteristics of a large number of outdoor fog-free images, that is, for a fog-free image, in addition to the sky and bright areas, the value of pixels in its local area at least on one channel is very low and tends to zero. For any input image, its dark channel can be defined as
(3)Jdarkx=miny∈Ωxminc∈r,g,bJcy,⟶0where min represents the operation of taking the minimum value, Ωx represents the local area centered on pixel x, c represents one of the three channels of r,g,b, Jcy represents the pixel in area Ωx, and Jdarkx represents the dark channel image.Assuming that the atmospheric light valueA is known, and in the window Ωx, the transmittance tx is a fixed value and denoted as t~x. The minimum values of both sides of equation (1) are
(4)miny∈ΩxmincIcy=t~x∗miny∈ΩxmincJcy+A∗1−t~x.The dark channel value of a foggy image is represented byIdarkx, then
(5)Idarkx=t~x∗Jdarkx+A∗1−t~x.It can be known from the dark channel prior thatJdarkx approaches 0, and the above formula can be approximated as
(6)Idarkx=A∗1−t~x.The transmittance can be obtained by formula (6):
(7)t~x=1−wx∗IdarkxA,where wx is the defogging control factor, which is used to adjust the defogging intensity and prevent the image distortion caused by too strong defogging. wx can take a fixed value (such as w=0.95) or a variable value.Dark channel defogging is the process of obtaining the transmittancet~x according to the foggy image Ix and the estimated atmospheric light A and then obtaining the defogging image according to the atmospheric scattering model.


## 2.3. Bright Channel Prior

According to the dark channel prior, the dark channel values of sky area, dense fog area, bright area, and white area are relatively large, which does not satisfy the dark channel prior. Yan et al. [16] proposed the bright channel prior through statistical analysis, that is, in natural scene images, for image blocks of white objects, sky, bright areas, light intensity areas, etc., there is at least one color channel with a very large value, close to 1. The bright channel of an image can be defined as
(8)Jbrightx=maxy∈Ωxmaxc∈r,g,bJcy,⟶1where Jbrightx represents the bright channel image, max represents the operation of taking the maximum value.Similar to the dark channel prior defogging process, assuming that the atmospheric light valueA is known, and the transmittance tx in the window Ωx is a fixed value t~x. The maximum values on both sides of equation (1) are
(9)maxy∈ΩxmaxcIcy=t~x∗maxy∈ΩxmaxcJcy+A∗1−t~x.The left side of the above formula is the bright channel of the foggy image, denoted asIbrightx; then,
(10)Ibrightx=t~x∗Jbrightx+A∗1−t~x.According to the theory of bright channel prior,Jbrightx approaches 1, which can be approximately obtained as follows:
(11)Ibrightx=t~x+A∗1−t~x.By simplifying the above formula and introducing the defogging control factorwx, the transmittance can be obtained:
(12)t~x=1−wx∗1−Ibrightx1−A.Similarly, a certain degree of defogging can be achieved according to the bright channel prior.Obviously, dark channel defogging and bright channel defogging have their own applicable areas and failure areas, so both have their limitations. However, after analysis, it is not difficult to find that the applicable areas of them are complementary. Therefore, this paper proposes an adaptive bright and dark channel combined with defogging algorithm based on depth of field, which combines the two defogging methods. For the area where the dark channel prior is applicable, the dark channel is used to obtain the transmittance. For the area where the bright channel prior is applicable, the bright channel is used to obtain the transmittance. The areas are adaptively determined by the depth of field, and the defogging control factor also changes adaptively following the depth of field. The windowΩx is a content-based special-shaped area obtained by the superpixel segmentation method.


## 3. Adaptive Bright and Dark Channel Combined with Dehazing Algorithm Based on Depth of Field

The framework of adaptive bright and dark channels combined with defogging algorithm based on depth of field is shown in Figure1. The algorithm is mainly divided into three parts: depth estimation, adaptive transmittance, and atmospheric light estimation based on depth of field, and bright and dark channel estimation based on superpixels. According to the positive correlation between depth of field and brightness [18], the Retinex method was used to calculate brightness and then obtain the estimation of depth of field. The maximum depth of field is the sky, which is approximate to atmospheric light, so atmospheric light A is estimated from the maximum depth of field. At the same time, an adaptive defogging control factor wx is obtained according to the negative correlation between the defogging control factor and the depth of field. According to the depth of field, the near area and the distant area are separated. The dark channel was used to obtain the transmittance in the near areas, and the bright channel was used to obtain the transmittance in the distant area. The local area in the bright and dark channel is obtained by adaptive superpixel segmentation method. The obtained area changes according to the content, and the shape is irregular, which is more in line with the characteristics of the image, and solves the problem that the content jump cannot be adapted when the regular area is divided. After obtaining atmospheric light and transmittance, a defogging image is obtained according to the atmospheric scattering model.Figure 1
The framework of adaptive bright and dark channels combined with defogging algorithm based on depth of field.


### 3.1. Depth Estimation Algorithm Based on Retinex

Observing statistics on multiple foggy images, it is found that the fog density in the foggy image increases with the increase of the scene depth; the brightness of the foggy image gradually increases with the increase of the fog density [18]. Therefore, it can be assumed that the depth of field is positively correlated with the fog density and also positively correlated with the image brightness, that is,
(13)dx∝cx∝vx,where dx, cx, and vx, respectively, represent the scene depth, fog density, and brightness value at x, and ‘∝’ represents a direct ratio.According to the characteristics of the positive correlation between the depth of field brightness, this paper first uses Retinex to obtain the fog mask [30] and then obtains the optimized brightness map, so as to obtain the image depth of field. The specific process is shown in Figure 2.Figure 2
Depth estimation algorithm framework.First, the foggy image is transferred to the YCbCr color space, the normalized brightness componentYx is extracted, and the Gaussian smoothing function Fx is used to convolve with it to obtain the image fog mask L^x, that is,
(14)L^x=Yx⊗Fx,Fx=K∗e,where ‘⊗’ represents the convolution operation; K is the normalization factor; σ is the standard deviation, the magnitude of which controls the smoothness of the function Fx; m and n represent the horizontal and vertical coordinates at x.The uniform fog maskL¯ is the mean value of L^x, namely,,
(15)L¯=∑m=1H∑n=1WL^xH∗W,where H and W represent the height and width of the image, respectively. However, L¯ is only applicable when the fog is evenly distributed. In reality, the fog distribution is positively correlated with the depth of field. Therefore, in this paper, the uniform fog mask L¯ and the brightness component Y(x) of the foggy image are processed according to equation (16) to obtain the fog mask L′x related to the depth of field:
(16)L′x=GuidedFilterYx,1−Yx∗L¯,r,eps,where Guided Filter represents the guided filtering operation, Yx represents the guided image, 1−Yx∗L¯ represents the input image, r represents the local window radius, and eps represents the regularization parameter.Since high-brightness areas such as white objects will be misjudged as those with a far depth of field, a minimum filter of9×9 and bilateral filtering is performed on L′x to eliminate blocking effects and optimize to obtain the brightness map Lx; Finally, according to the linear relationship model between the depth of field and the brightness component [16], the depth map dx is obtained:
(17)dx=Lx−LminLmax−Lmin∗Lx,whereLmin and Lmax represent the minimum and maximum values of the optimized brightness map Lx, respectively.The depth of field obtained based on the Retinex depth of field estimation algorithm is shown in Figure3.Figure 3
The original image and its depth of field map.


### 3.2. Adaptive SLIC Superpixel Segmentation Algorithm

Superpixel segmentation [31, 32] divides adjacent and similar parts into a region, and the result is an irregular window which changes according to the content. The bright and dark channels and their transmittances are obtained by using the divided window instead of the fixed rectangular window, which can solve the block effect problem at the depth change well.The size of the superpixel segmentation window has a great impact on the bright and dark channels and defogging effect. For the dark channel image, when the segmentation window is too large, there are more dark channels in the window, the high pixel value in the dark channel image is reduced, the details of the defogging image are blurred, the level is not obvious, and the edge of the dark channel image is easily expanded; If the segmentation window is too small, although the image details are clear and the levels are rich, the local bright area does not conform to the dark channel prior theory, and the pixel value is prone to be too high, resulting in inaccurate estimated transmittance. For the bright channel image, the opposite is true. In order to avoid the influence of different segmentation windows on the bright and dark channel images, this paper does not select a fixed segmentation window when obtaining the bright and dark channel images but adaptively determines the window size according to the size of the image. When the image resolution is relatively large, the segmentation window is correspondingly increased, and when the image resolution is relatively small, the segmentation window is correspondingly reduced. This paper uses a simple linear iterative clustering algorithm (SLIC) for segmentation. The distance between the seed points of the segmented superpixel block is related to the parameters. The larger the s, the larger the segmentation window, and vice versa. In this paper, the superpixel segmentation window size is controlled by determining the parameter s, which is as follows:
(18)s=floormax15,H∗0.01,W∗0.01,where floor represents rounding towards negative infinity.Figure4 shows the segmentation results of the adaptive SLIC superpixel and the bright and dark channel images. Figure 4(a) is the result of super pixel segmentation of the image in Figure 3, from which it can be seen that the boundary of the super pixel block formed after segmentation is relatively clear. Figure 4(b) is the process image, the superpixel segmentation result is overlaid on the minimum channel image. Figure 4(c) is a dark channel image obtained by using the result of superpixel segmentation. The level is clear and the window size is moderate. In the contour of the mountain and the boundary area between the sky and the scene, the pixels with similar depth values can be better segmented into the same window. Figure 4(d) is the bright channel image obtained by using the superpixel segmentation result. It can be seen from the figure that in the sky and areas with relatively bright brightness, the pixel value is relatively high, and the bright area can be clearly seen in the image after segmentation.Figure 4
Adaptive SLIC superpixel segmentation results and bright and dark channel images, (a) original image adaptive SLIC superpixel segmentation, (b) adaptive SLIC superpixel segmentation with minimum channel image, (c) dark channel image, and (d) bright channel image.
(a)(b)(c)(d)


### 3.3. Acquisition of Adaptive Transmittance

It can be seen from the foregoing that the idea of obtaining the transmittance is to first determine the defogging control factorwx and atmospheric light A; Then, it is divided into the near area and the distant area, and the transmittance of each part is calculated according to equations (7) and (12) with dark channel and bright channel, respectively. After fusion, it becomes the transmittance of the image.


#### 3.3.1. Determination of Adaptive Defogging Control Factor

The defogging control factor represents the degree of defogging. The defogging control factor in the dark channel defogging algorithm of He defaults to 0.95. This value has a better defogging effect for foggy images in the near area, while excessive defogging is likely to cause distortion in the distant area. Through experimentation, it is found that when the value is 0.55, the distortion problem at the distant area is solved, but the defogging effect at the near area is not ideal. In this paper, the nearest point is set to 0.95, and the farthest point is set to 0.55. According to the linear relationship that the depths of fielddx and w are negatively correlated, its size changes adaptively according to the depth of field value. The adaptive defogging control factor is obtained as follows:
(19)wx=0.95−0.4∗dx−dmindmax−dmin,where dmin and dmax represent the minimum and maximum values of the depth of field map, respectively.


#### 3.3.2. Estimation of Atmospheric Light Value

The atmospheric light value is an important parameter in the physical model. The larger the atmospheric light value, the darker the restored image, and vice versa [33]. The depth of field of the image has been estimated in Section 3.1, the bright area represents the distant area, the brightness of the sky at infinity is similar to atmospheric light. Therefore, this paper selects the top 0.1% of the brightest pixels in the depth map and uses the average value of the brightness of the foggy image pixels corresponding to these brightest pixels as the atmospheric light A.


#### 3.3.3. Calculate the Transmittance of Bright and Dark Element Priors

According to the positive correlation between the depth of field and the fog density, the fog density in the distant view in the image is relatively large. The dense fog, highlights, and white areas in the image do not accord with the prerequisites for dark primary colors. This paper proposes an improved algorithm for bright and dark element priors. The dark channel is used to estimate the transmittance in the near area, and the bright channel is used to estimate the transmittance in the distant area. The division of the distant area and the near area is adaptively determined according to the depth of field. According to the characteristics of the depth of field, set the depth of field thresholddBL to divide the bright channel and the dark channel. The area greater than the depth of field threshold is defined as the bright primary color area in the distant area, and the area less than the depth of field threshold is defined as the dark primary color area of the near area. And then the transmittance is obtained according to the dark and bright element priors:
(20)tx=1−wx∗Idarkx/Admin≤d≤dBL1−wx∗1−Ibrightx/1−AdBL≤d≤dmaxwhere dBL=dmin+3∗dmax−dmin/4. The parameter 3/4 in the threshold is the optimal value selected after multiple experiments. In order to ensure that the transmittance value is valid, the lower threshold value t0=0.1 is set to limit the transmittance range, and the obtained atmospheric light A and transmittance tx are substituted into equation (21) to obtain the defogging image Jx:
(21)Jx=Ix−Amaxtx,t0+A


## 3.1. Depth Estimation Algorithm Based on Retinex

Observing statistics on multiple foggy images, it is found that the fog density in the foggy image increases with the increase of the scene depth; the brightness of the foggy image gradually increases with the increase of the fog density [18]. Therefore, it can be assumed that the depth of field is positively correlated with the fog density and also positively correlated with the image brightness, that is,
(13)dx∝cx∝vx,where dx, cx, and vx, respectively, represent the scene depth, fog density, and brightness value at x, and ‘∝’ represents a direct ratio.According to the characteristics of the positive correlation between the depth of field brightness, this paper first uses Retinex to obtain the fog mask [30] and then obtains the optimized brightness map, so as to obtain the image depth of field. The specific process is shown in Figure 2.Figure 2
Depth estimation algorithm framework.First, the foggy image is transferred to the YCbCr color space, the normalized brightness componentYx is extracted, and the Gaussian smoothing function Fx is used to convolve with it to obtain the image fog mask L^x, that is,
(14)L^x=Yx⊗Fx,Fx=K∗e,where ‘⊗’ represents the convolution operation; K is the normalization factor; σ is the standard deviation, the magnitude of which controls the smoothness of the function Fx; m and n represent the horizontal and vertical coordinates at x.The uniform fog maskL¯ is the mean value of L^x, namely,,
(15)L¯=∑m=1H∑n=1WL^xH∗W,where H and W represent the height and width of the image, respectively. However, L¯ is only applicable when the fog is evenly distributed. In reality, the fog distribution is positively correlated with the depth of field. Therefore, in this paper, the uniform fog mask L¯ and the brightness component Y(x) of the foggy image are processed according to equation (16) to obtain the fog mask L′x related to the depth of field:
(16)L′x=GuidedFilterYx,1−Yx∗L¯,r,eps,where Guided Filter represents the guided filtering operation, Yx represents the guided image, 1−Yx∗L¯ represents the input image, r represents the local window radius, and eps represents the regularization parameter.Since high-brightness areas such as white objects will be misjudged as those with a far depth of field, a minimum filter of9×9 and bilateral filtering is performed on L′x to eliminate blocking effects and optimize to obtain the brightness map Lx; Finally, according to the linear relationship model between the depth of field and the brightness component [16], the depth map dx is obtained:
(17)dx=Lx−LminLmax−Lmin∗Lx,whereLmin and Lmax represent the minimum and maximum values of the optimized brightness map Lx, respectively.The depth of field obtained based on the Retinex depth of field estimation algorithm is shown in Figure3.Figure 3
The original image and its depth of field map.


## 3.2. Adaptive SLIC Superpixel Segmentation Algorithm

Superpixel segmentation [31, 32] divides adjacent and similar parts into a region, and the result is an irregular window which changes according to the content. The bright and dark channels and their transmittances are obtained by using the divided window instead of the fixed rectangular window, which can solve the block effect problem at the depth change well.The size of the superpixel segmentation window has a great impact on the bright and dark channels and defogging effect. For the dark channel image, when the segmentation window is too large, there are more dark channels in the window, the high pixel value in the dark channel image is reduced, the details of the defogging image are blurred, the level is not obvious, and the edge of the dark channel image is easily expanded; If the segmentation window is too small, although the image details are clear and the levels are rich, the local bright area does not conform to the dark channel prior theory, and the pixel value is prone to be too high, resulting in inaccurate estimated transmittance. For the bright channel image, the opposite is true. In order to avoid the influence of different segmentation windows on the bright and dark channel images, this paper does not select a fixed segmentation window when obtaining the bright and dark channel images but adaptively determines the window size according to the size of the image. When the image resolution is relatively large, the segmentation window is correspondingly increased, and when the image resolution is relatively small, the segmentation window is correspondingly reduced. This paper uses a simple linear iterative clustering algorithm (SLIC) for segmentation. The distance between the seed points of the segmented superpixel block is related to the parameters. The larger the s, the larger the segmentation window, and vice versa. In this paper, the superpixel segmentation window size is controlled by determining the parameter s, which is as follows:
(18)s=floormax15,H∗0.01,W∗0.01,where floor represents rounding towards negative infinity.Figure4 shows the segmentation results of the adaptive SLIC superpixel and the bright and dark channel images. Figure 4(a) is the result of super pixel segmentation of the image in Figure 3, from which it can be seen that the boundary of the super pixel block formed after segmentation is relatively clear. Figure 4(b) is the process image, the superpixel segmentation result is overlaid on the minimum channel image. Figure 4(c) is a dark channel image obtained by using the result of superpixel segmentation. The level is clear and the window size is moderate. In the contour of the mountain and the boundary area between the sky and the scene, the pixels with similar depth values can be better segmented into the same window. Figure 4(d) is the bright channel image obtained by using the superpixel segmentation result. It can be seen from the figure that in the sky and areas with relatively bright brightness, the pixel value is relatively high, and the bright area can be clearly seen in the image after segmentation.Figure 4
Adaptive SLIC superpixel segmentation results and bright and dark channel images, (a) original image adaptive SLIC superpixel segmentation, (b) adaptive SLIC superpixel segmentation with minimum channel image, (c) dark channel image, and (d) bright channel image.
(a)(b)(c)(d)


## 3.3. Acquisition of Adaptive Transmittance

It can be seen from the foregoing that the idea of obtaining the transmittance is to first determine the defogging control factorwx and atmospheric light A; Then, it is divided into the near area and the distant area, and the transmittance of each part is calculated according to equations (7) and (12) with dark channel and bright channel, respectively. After fusion, it becomes the transmittance of the image.


### 3.3.1. Determination of Adaptive Defogging Control Factor

The defogging control factor represents the degree of defogging. The defogging control factor in the dark channel defogging algorithm of He defaults to 0.95. This value has a better defogging effect for foggy images in the near area, while excessive defogging is likely to cause distortion in the distant area. Through experimentation, it is found that when the value is 0.55, the distortion problem at the distant area is solved, but the defogging effect at the near area is not ideal. In this paper, the nearest point is set to 0.95, and the farthest point is set to 0.55. According to the linear relationship that the depths of fielddx and w are negatively correlated, its size changes adaptively according to the depth of field value. The adaptive defogging control factor is obtained as follows:
(19)wx=0.95−0.4∗dx−dmindmax−dmin,where dmin and dmax represent the minimum and maximum values of the depth of field map, respectively.


### 3.3.2. Estimation of Atmospheric Light Value

The atmospheric light value is an important parameter in the physical model. The larger the atmospheric light value, the darker the restored image, and vice versa [33]. The depth of field of the image has been estimated in Section 3.1, the bright area represents the distant area, the brightness of the sky at infinity is similar to atmospheric light. Therefore, this paper selects the top 0.1% of the brightest pixels in the depth map and uses the average value of the brightness of the foggy image pixels corresponding to these brightest pixels as the atmospheric light A.


### 3.3.3. Calculate the Transmittance of Bright and Dark Element Priors

According to the positive correlation between the depth of field and the fog density, the fog density in the distant view in the image is relatively large. The dense fog, highlights, and white areas in the image do not accord with the prerequisites for dark primary colors. This paper proposes an improved algorithm for bright and dark element priors. The dark channel is used to estimate the transmittance in the near area, and the bright channel is used to estimate the transmittance in the distant area. The division of the distant area and the near area is adaptively determined according to the depth of field. According to the characteristics of the depth of field, set the depth of field thresholddBL to divide the bright channel and the dark channel. The area greater than the depth of field threshold is defined as the bright primary color area in the distant area, and the area less than the depth of field threshold is defined as the dark primary color area of the near area. And then the transmittance is obtained according to the dark and bright element priors:
(20)tx=1−wx∗Idarkx/Admin≤d≤dBL1−wx∗1−Ibrightx/1−AdBL≤d≤dmaxwhere dBL=dmin+3∗dmax−dmin/4. The parameter 3/4 in the threshold is the optimal value selected after multiple experiments. In order to ensure that the transmittance value is valid, the lower threshold value t0=0.1 is set to limit the transmittance range, and the obtained atmospheric light A and transmittance tx are substituted into equation (21) to obtain the defogging image Jx:
(21)Jx=Ix−Amaxtx,t0+A


## 3.3.1. Determination of Adaptive Defogging Control Factor

The defogging control factor represents the degree of defogging. The defogging control factor in the dark channel defogging algorithm of He defaults to 0.95. This value has a better defogging effect for foggy images in the near area, while excessive defogging is likely to cause distortion in the distant area. Through experimentation, it is found that when the value is 0.55, the distortion problem at the distant area is solved, but the defogging effect at the near area is not ideal. In this paper, the nearest point is set to 0.95, and the farthest point is set to 0.55. According to the linear relationship that the depths of fielddx and w are negatively correlated, its size changes adaptively according to the depth of field value. The adaptive defogging control factor is obtained as follows:
(19)wx=0.95−0.4∗dx−dmindmax−dmin,where dmin and dmax represent the minimum and maximum values of the depth of field map, respectively.


## 3.3.2. Estimation of Atmospheric Light Value

The atmospheric light value is an important parameter in the physical model. The larger the atmospheric light value, the darker the restored image, and vice versa [33]. The depth of field of the image has been estimated in Section 3.1, the bright area represents the distant area, the brightness of the sky at infinity is similar to atmospheric light. Therefore, this paper selects the top 0.1% of the brightest pixels in the depth map and uses the average value of the brightness of the foggy image pixels corresponding to these brightest pixels as the atmospheric light A.


## 3.3.3. Calculate the Transmittance of Bright and Dark Element Priors

According to the positive correlation between the depth of field and the fog density, the fog density in the distant view in the image is relatively large. The dense fog, highlights, and white areas in the image do not accord with the prerequisites for dark primary colors. This paper proposes an improved algorithm for bright and dark element priors. The dark channel is used to estimate the transmittance in the near area, and the bright channel is used to estimate the transmittance in the distant area. The division of the distant area and the near area is adaptively determined according to the depth of field. According to the characteristics of the depth of field, set the depth of field thresholddBL to divide the bright channel and the dark channel. The area greater than the depth of field threshold is defined as the bright primary color area in the distant area, and the area less than the depth of field threshold is defined as the dark primary color area of the near area. And then the transmittance is obtained according to the dark and bright element priors:
(20)tx=1−wx∗Idarkx/Admin≤d≤dBL1−wx∗1−Ibrightx/1−AdBL≤d≤dmaxwhere dBL=dmin+3∗dmax−dmin/4. The parameter 3/4 in the threshold is the optimal value selected after multiple experiments. In order to ensure that the transmittance value is valid, the lower threshold value t0=0.1 is set to limit the transmittance range, and the obtained atmospheric light A and transmittance tx are substituted into equation (21) to obtain the defogging image Jx:
(21)Jx=Ix−Amaxtx,t0+A


## 4. Experimental Results and Analysis

The experimental samples are selected from 5 foggy images in different scenes. The images contain different buildings, sceneries, sky, trees, etc., which are well representative. They are foggy images without ground truth. In order to better obtain experimental results, outdoor and indoor image pairs are added, respectively, for extended experiments, and O-HAZE [34] and I-HAZE [35] datasets are selected. O-HAZE contains 45 pairs of foggy images and corresponding fog-free outdoor images. I-HAZE contains 35 pairs of foggy images and corresponding fog-free indoor images. In this paper, we only use the foggy images in the datasets. It is analyzed from both subjective and objective aspects and compared with He’s algorithm [15], MSR algorithm [8], and three-region algorithm [22]. The experimental test environment is the MATLAB 2018a software platform, the CPU is Intel Core i5, the memory is 8GB, and the operating system is Windows 10.


### 4.1. The Experimental Results and Analysis of the Algorithm in This Paper

In this paper, several images containing sky regions and different sceneries are selected for experiments, and the results are shown in Figure5. It can be seen from the figure that the contrast and sharpness of the image after defogging have been greatly improved, the overall defogging effect is better, and the distortion problem in the distant area has also been solved. Comparing the local magnification of the image before and after defogging, it can be seen that the image details are clear, the color is bright, and there is no too dark phenomenon. In Figure 5(c), the first image after defogging improves the contrast of the image as a whole. The details of the ship restored in the near view are richer, the outlines of houses and trees in the distant view are clearly visible, and the defogging effect of the image at the junction with the sky is good. In Figure 5(d), the second image after defogging has no color distortion and disorder as a whole. There is no oversaturation, and the color of the image is restored. Trees, roofs, etc. in the close range can better restore the sharpness of the image, avoiding the problem of overdarkness. The outline of the mountain in the distant view is also clearer.Figure 5
Comparison of the algorithm before and after defogging, (a) the first foggy image, (b) the second foggy image, (c) the first image after defogging, (d) the second image after defogging.
(a)(b)(c)(d)


### 4.2. Comparison with Other Algorithms

This paper selects three images with different sceneries and, respectively, uses the algorithm in this paper, He dark channel defogging algorithm [15], MSR algorithm [8], and three-area defogging algorithm [22] to conduct defogging experiments. The results are shown in Table 1. The box below the figure is an enlarged view of a local area.Table 1
Experimental results of several defogging algorithms.
Image 1sImage 2Image 3Original imageHealgorithmMSRalgorithmThree-areaalgorithmThis paperalgorithmIn image 1, the color distortion of the image processed by the He algorithm is serious, and the mountain area is too dark. Although there is no distortion after processing by the MSR algorithm, the details of the image after defogging are blurred and the definition is not high. After the three-area algorithm is processed, the overall defogging effect is good, but the cloud texture in the sky is not clear. The color of the image processed by the algorithm in this paper is not oversaturated, and the details are richer.In image 2, after the He algorithm is processed, the image in the near view is too dark, and halos appear in some areas of the sky and red light areas. After the MSR algorithm is processed, the whole image has a color cast, the boundary between the sky and the nonsky area is not obvious, and the local details are not clear enough, which affects the visual effect. The color of the sky area processed by the three-area algorithm is unnatural, and a halo appears in the boundary area of the sky. The overall layering of the image processed by the algorithm in this paper is more distinct, the color is real and natural, and the overall brightness is moderate.In image 3, the overall brightness of the image processed by the He algorithm is low, and the sky area is oversaturated, and the color is severely distorted. The overall color of the image processed by the MSR algorithm is true and natural, but the details are blurred. After the three-area algorithm processing, the sky area in the distant view is too bright, rough, and grainy. After processing by the algorithm in this paper, there is no overexposure in the distant view, and the color contrast of the image in the near view is maintained, the details are clear, and there is no overdark phenomenon.In order to better evaluate the quality of defogging image, Table2 lists the seven evaluation indicators of the experimental results in Table 1: Peak Signal to Noise Ratio (PSNR), Mean Gradient, Information Entropy, Structural Similarity (SSIM), ratio of newly added visible edges e, Natural Image Quality Evaluator (NIQE), and Blind Referenceless Image Spatial Quality Evaluator (BRISQUE). Among them, PSNR, SSIM, and e are reference image quality assessments; and Mean Gradient, Information Entropy, NIQE, and BRISQUE are blind image quality assessments. PSNR reflects the degree of image distortion. The larger the PSNR, the smaller the image distortion. The mean gradient reflects the ability of the image to express small details. The larger the mean gradient, the clearer the image. Information entropy measures the richness of image information and reflects the amount of information carried by the image. The greater the information entropy, the richer the information of the image and the better the quality of the image. e refers to the ratio of the newly added visible edges of the defogged image to the original foggy image. The larger the e is, the richer the edge details on the image and the better the contrast after defogging. NIQE can measure the difference of the image in the multivariate Gaussian distribution, and the smaller the value, the higher the quality of the image. BRISQUE is a reference-free spatial domain image quality evaluation algorithm, which is evaluated based on the statistical law of image brightness. The smaller the result, the smaller the image distortion.Table 2
Defogging evaluation indexes of several defogging algorithms.
ImageDefogging algorithmsPSNRMeanGradientInformation entropySSIMeNIQEBRISQUEImage 1He10.13570.02636.87660.58621.77843.402418.8705MSR15.09430.01947.14120.68000.16153.415928.6994Three-area10.21960.03127.01540.58461.07363.444229.5627This paper12.89860.02447.22910.73492.26034.282828.7157Image 2He12.16940.01447.53520.76452.19243.999142.0466MSR11.28370.00727.31400.78631.22046.129945.8880Three-area12.37190.01097.33700.77451.15825.395641.7019This paper12.93030.01377.28160.81882.84744.476441.9678Image 3He9.62920.09347.06510.63390.20115.633330.4511MSR12.41450.07047.20440.91880.12854.177328.3339Three-area10.92920.06987.53350.66730.16654.222720.0357This paper13.01650.09867.78750.81020.23873.728520.9386Average of three imagesHe10.64480.04477.15900.66151.39064.344930.4561MSR12.93080.03237.21980.79500.50354.574434.3071Three-area11.17360.03737.29530.67550.79944.354230.4334This paper12.94850.04567.43270.78801.78214.162630.5407It can be seen from Table2 that the PSNR of the three defogging images recovered by the algorithm is close to 13 on average, the mean gradient is 0.0456 on average, the information entropy is 7.4327 on average, the SSIM is 0.7880 on average, the ratio of newly added visible edges is 1.7821 on average, the NIQE is 4.1626 on average, and the BRISQUE is 30.5407 on average. Compared with the He algorithm, MSR algorithm and the three-region algorithm, the algorithm in this paper has the highest average value of PSNR, mean gradient, information entropy, and the ratio of newly added visible edges. The difference between SSIM, NIQE, and BRISQUE is not much different from the comparison algorithm. The results of all indexes show the effectiveness of the algorithm in this paper.For better experimental analysis, we conducted extended experiments on O-HAZE and I-HAZE datasets. As shown in Table3, the PSNR of the algorithm in this paper is close to 13.3 on average, the mean gradient is 0.019, the information entropy is 7.0301 on average, the SSIM is 0.7238 on average, the ratio of new visible edges is 2.7738 on average, the NIQE is 3.3171 on average, and the BRISQUE is 32.4422 on average. Compared with the other three algorithms, the values of PSNR, information entropy, and SSIM of the proposed algorithm are higher than those of He’s algorithm and three-region algorithm, and slightly lower than those of MSR algorithm. The mean gradient is significantly higher than other comparison algorithms. The ratio of new visible edges is not different from that of the three-region algorithm, but obviously higher than that of the other two algorithms. The values of NIQE and BRISQUE are similar to those of the comparison algorithm. Combining the subjective visual effect and objective evaluation index, the superiority of the proposed algorithm is illustrated.Table 3
Defogging evaluation indexes on the O-Haze and I-Haze datasets.
Defogging algorithmsDatasetsPSNRMeanGradientInformation entropySSIMeNIQEBRISQUEHeO-HAZE13.74480.02016.77260.77803.23903.148628.9011I-HAZE11.27010.01336.72530.66741.55153.347037.9825Average12.50750.01676.74900.72272.39533.247833.4418MSRO-HAZE19.24170.01587.20590.91651.77662.965928.4329I-HAZE15.86530.01017.45320.86390.82823.121431.6590Average17.55350.01307.32960.89021.30243.043730.0456Three-areaO-HAZE12.97160.02166.84420.73163.69953.232228.3549I-HAZE10.90200.01476.83850.63311.87223.270935.9219Average11.93680.01826.84140.68242.78593.251632.1384This paperO-HAZE14.47030.02226.96160.76983.42883.333529.6949I-HAZE12.13900.01587.09850.67772.11873.300635.1895Average13.30470.01907.03010.72382.77383.317132.4422In addition, we also make statistics on the average execution time of the algorithm, as shown in Table4. The algorithm in this paper is mainly divided into three parts. The time of solving the adaptive transmittance and atmospheric light estimation based on the depth of field and using the atmospheric scattering model for defogging is 1.8922 seconds, and the time of calculating the depth of field and bright and dark channel is 3.8147 seconds and 8.6052 seconds, respectively. The algorithm in this paper has achieved good defogging effect, but it takes a long time. Most of the time is spent on the calculation of depth of field and bright and dark channel. The next step will study how to improve the running speed of the algorithm.Table 4
Execution time of several defogging algorithms.
Defogging algorithmsHeMSRThree-areaThis paperExecution time2.18380.06914.68351.8922+3.8147+8.6052


## 4.1. The Experimental Results and Analysis of the Algorithm in This Paper

In this paper, several images containing sky regions and different sceneries are selected for experiments, and the results are shown in Figure5. It can be seen from the figure that the contrast and sharpness of the image after defogging have been greatly improved, the overall defogging effect is better, and the distortion problem in the distant area has also been solved. Comparing the local magnification of the image before and after defogging, it can be seen that the image details are clear, the color is bright, and there is no too dark phenomenon. In Figure 5(c), the first image after defogging improves the contrast of the image as a whole. The details of the ship restored in the near view are richer, the outlines of houses and trees in the distant view are clearly visible, and the defogging effect of the image at the junction with the sky is good. In Figure 5(d), the second image after defogging has no color distortion and disorder as a whole. There is no oversaturation, and the color of the image is restored. Trees, roofs, etc. in the close range can better restore the sharpness of the image, avoiding the problem of overdarkness. The outline of the mountain in the distant view is also clearer.Figure 5
Comparison of the algorithm before and after defogging, (a) the first foggy image, (b) the second foggy image, (c) the first image after defogging, (d) the second image after defogging.
(a)(b)(c)(d)


## 4.2. Comparison with Other Algorithms

This paper selects three images with different sceneries and, respectively, uses the algorithm in this paper, He dark channel defogging algorithm [15], MSR algorithm [8], and three-area defogging algorithm [22] to conduct defogging experiments. The results are shown in Table 1. The box below the figure is an enlarged view of a local area.Table 1
Experimental results of several defogging algorithms.
Image 1sImage 2Image 3Original imageHealgorithmMSRalgorithmThree-areaalgorithmThis paperalgorithmIn image 1, the color distortion of the image processed by the He algorithm is serious, and the mountain area is too dark. Although there is no distortion after processing by the MSR algorithm, the details of the image after defogging are blurred and the definition is not high. After the three-area algorithm is processed, the overall defogging effect is good, but the cloud texture in the sky is not clear. The color of the image processed by the algorithm in this paper is not oversaturated, and the details are richer.In image 2, after the He algorithm is processed, the image in the near view is too dark, and halos appear in some areas of the sky and red light areas. After the MSR algorithm is processed, the whole image has a color cast, the boundary between the sky and the nonsky area is not obvious, and the local details are not clear enough, which affects the visual effect. The color of the sky area processed by the three-area algorithm is unnatural, and a halo appears in the boundary area of the sky. The overall layering of the image processed by the algorithm in this paper is more distinct, the color is real and natural, and the overall brightness is moderate.In image 3, the overall brightness of the image processed by the He algorithm is low, and the sky area is oversaturated, and the color is severely distorted. The overall color of the image processed by the MSR algorithm is true and natural, but the details are blurred. After the three-area algorithm processing, the sky area in the distant view is too bright, rough, and grainy. After processing by the algorithm in this paper, there is no overexposure in the distant view, and the color contrast of the image in the near view is maintained, the details are clear, and there is no overdark phenomenon.In order to better evaluate the quality of defogging image, Table2 lists the seven evaluation indicators of the experimental results in Table 1: Peak Signal to Noise Ratio (PSNR), Mean Gradient, Information Entropy, Structural Similarity (SSIM), ratio of newly added visible edges e, Natural Image Quality Evaluator (NIQE), and Blind Referenceless Image Spatial Quality Evaluator (BRISQUE). Among them, PSNR, SSIM, and e are reference image quality assessments; and Mean Gradient, Information Entropy, NIQE, and BRISQUE are blind image quality assessments. PSNR reflects the degree of image distortion. The larger the PSNR, the smaller the image distortion. The mean gradient reflects the ability of the image to express small details. The larger the mean gradient, the clearer the image. Information entropy measures the richness of image information and reflects the amount of information carried by the image. The greater the information entropy, the richer the information of the image and the better the quality of the image. e refers to the ratio of the newly added visible edges of the defogged image to the original foggy image. The larger the e is, the richer the edge details on the image and the better the contrast after defogging. NIQE can measure the difference of the image in the multivariate Gaussian distribution, and the smaller the value, the higher the quality of the image. BRISQUE is a reference-free spatial domain image quality evaluation algorithm, which is evaluated based on the statistical law of image brightness. The smaller the result, the smaller the image distortion.Table 2
Defogging evaluation indexes of several defogging algorithms.
ImageDefogging algorithmsPSNRMeanGradientInformation entropySSIMeNIQEBRISQUEImage 1He10.13570.02636.87660.58621.77843.402418.8705MSR15.09430.01947.14120.68000.16153.415928.6994Three-area10.21960.03127.01540.58461.07363.444229.5627This paper12.89860.02447.22910.73492.26034.282828.7157Image 2He12.16940.01447.53520.76452.19243.999142.0466MSR11.28370.00727.31400.78631.22046.129945.8880Three-area12.37190.01097.33700.77451.15825.395641.7019This paper12.93030.01377.28160.81882.84744.476441.9678Image 3He9.62920.09347.06510.63390.20115.633330.4511MSR12.41450.07047.20440.91880.12854.177328.3339Three-area10.92920.06987.53350.66730.16654.222720.0357This paper13.01650.09867.78750.81020.23873.728520.9386Average of three imagesHe10.64480.04477.15900.66151.39064.344930.4561MSR12.93080.03237.21980.79500.50354.574434.3071Three-area11.17360.03737.29530.67550.79944.354230.4334This paper12.94850.04567.43270.78801.78214.162630.5407It can be seen from Table2 that the PSNR of the three defogging images recovered by the algorithm is close to 13 on average, the mean gradient is 0.0456 on average, the information entropy is 7.4327 on average, the SSIM is 0.7880 on average, the ratio of newly added visible edges is 1.7821 on average, the NIQE is 4.1626 on average, and the BRISQUE is 30.5407 on average. Compared with the He algorithm, MSR algorithm and the three-region algorithm, the algorithm in this paper has the highest average value of PSNR, mean gradient, information entropy, and the ratio of newly added visible edges. The difference between SSIM, NIQE, and BRISQUE is not much different from the comparison algorithm. The results of all indexes show the effectiveness of the algorithm in this paper.For better experimental analysis, we conducted extended experiments on O-HAZE and I-HAZE datasets. As shown in Table3, the PSNR of the algorithm in this paper is close to 13.3 on average, the mean gradient is 0.019, the information entropy is 7.0301 on average, the SSIM is 0.7238 on average, the ratio of new visible edges is 2.7738 on average, the NIQE is 3.3171 on average, and the BRISQUE is 32.4422 on average. Compared with the other three algorithms, the values of PSNR, information entropy, and SSIM of the proposed algorithm are higher than those of He’s algorithm and three-region algorithm, and slightly lower than those of MSR algorithm. The mean gradient is significantly higher than other comparison algorithms. The ratio of new visible edges is not different from that of the three-region algorithm, but obviously higher than that of the other two algorithms. The values of NIQE and BRISQUE are similar to those of the comparison algorithm. Combining the subjective visual effect and objective evaluation index, the superiority of the proposed algorithm is illustrated.Table 3
Defogging evaluation indexes on the O-Haze and I-Haze datasets.
Defogging algorithmsDatasetsPSNRMeanGradientInformation entropySSIMeNIQEBRISQUEHeO-HAZE13.74480.02016.77260.77803.23903.148628.9011I-HAZE11.27010.01336.72530.66741.55153.347037.9825Average12.50750.01676.74900.72272.39533.247833.4418MSRO-HAZE19.24170.01587.20590.91651.77662.965928.4329I-HAZE15.86530.01017.45320.86390.82823.121431.6590Average17.55350.01307.32960.89021.30243.043730.0456Three-areaO-HAZE12.97160.02166.84420.73163.69953.232228.3549I-HAZE10.90200.01476.83850.63311.87223.270935.9219Average11.93680.01826.84140.68242.78593.251632.1384This paperO-HAZE14.47030.02226.96160.76983.42883.333529.6949I-HAZE12.13900.01587.09850.67772.11873.300635.1895Average13.30470.01907.03010.72382.77383.317132.4422In addition, we also make statistics on the average execution time of the algorithm, as shown in Table4. The algorithm in this paper is mainly divided into three parts. The time of solving the adaptive transmittance and atmospheric light estimation based on the depth of field and using the atmospheric scattering model for defogging is 1.8922 seconds, and the time of calculating the depth of field and bright and dark channel is 3.8147 seconds and 8.6052 seconds, respectively. The algorithm in this paper has achieved good defogging effect, but it takes a long time. Most of the time is spent on the calculation of depth of field and bright and dark channel. The next step will study how to improve the running speed of the algorithm.Table 4
Execution time of several defogging algorithms.
Defogging algorithmsHeMSRThree-areaThis paperExecution time2.18380.06914.68351.8922+3.8147+8.6052


## 5. Conclusions

Aiming at the inapplicable problem of the dark channel prior defogging in the bright area of the image and the blocking effect at the sudden depth of field, this paper proposes an adaptive bright and dark channel combined with defogging algorithm based on the depth of field. On the one hand, the dark channel prior and the bright channel prior are combined to achieve the complementation of the bright and dark areas. On the other hand, based on the depth of field and superpixel segmentation, it realizes the division of content-based abnormity area and the determination of adaptive defogging control factor based on depth of field. It is confirmed that the problem of large transmittance deviation and defogging distortion under content changes and sudden changes in depth of field is well solved. From the experimental results, the algorithm in this paper has achieved a good defogging effect, with high image clarity, good color recovery, and no block effect at the depth mutation. Under objective indicators, most of the indicators are in the first place, and the average defogging quality is better than common algorithms. Although the algorithm in this paper has achieved good results, there are still some problems to be improved. On the one hand, the shortcomings of the dark channel algorithm are not completely eliminated, and the defogging results are still dark in some scenes. On the other hand, the running speed of the algorithm needs to be improved.



---

*Source: 5330876-2022-04-11.xml*