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

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 ﬁ eld. The algorithm divides the image into a distant area and a near area based on the depth of ﬁ eld. 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 ﬁ eld. It better solves the problem of large transmittance deviation and defogging distortion under content changes and sudden depth of ﬁ eld changes. From the subjective and objective indicators, the algorithm in this paper has achieved a good defogging e ﬀ ect, and the main indicators and comprehensive defogging quality are better than common algorithms.


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][9][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][9][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][16][17][18][19][20][21][22][23][24][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 threeregion 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-toend 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.

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 In the formula, x represents the image pixel position, IðxÞ represents a foggy image, JðxÞ represents a fog-free image, tðxÞ represents transmittance, and A represents the atmospheric light. If β represents the atmospheric scattering coefficient and dðxÞ represents the depth of field, that is, the distance from the target position to the camera, the transmittance tðxÞ can be expressed as According to the atmospheric scattering model, when tðxÞ and A are obtained, the fog-free image JðxÞ can be obtained backward according to formula (1).

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, 2 Journal of Sensors 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 where 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, J c ðyÞ represents the pixel in area ΩðxÞ, and J dark ðxÞ represents the dark channel image.
Assuming that the atmospheric light value A is known, and in the window ΩðxÞ, the transmittance tðxÞ is a fixed value and denoted astðxÞ. The minimum values of both sides of equation (1) are The dark channel value of a foggy image is represented by I dark ðxÞ, then It can be known from the dark channel prior that J dark ðxÞ approaches 0, and the above formula can be approximated as The transmittance can be obtained by formula (6): where wðxÞ is the defogging control factor, which is used to adjust the defogging intensity and prevent the image distortion caused by too strong defogging. wðxÞ 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 IðxÞ and the estimated atmospheric light A and then obtaining the defogging image according to the atmospheric scattering model.

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 where J bright ðxÞ 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 value A is known, and the transmittance tðxÞ in the window ΩðxÞ is a fixed valuẽ tðxÞ. The maximum values on both sides of equation (1) are The left side of the above formula is the bright channel of the foggy image, denoted as I bright ðxÞ; then, According to the theory of bright channel prior, J bright ðxÞ approaches 1, which can be approximately obtained as follows: By simplifying the above formula and introducing the defogging control factor wðxÞ, the transmittance can be obtained:t 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 specialshaped area obtained by the superpixel segmentation method.

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 Figure 1. The algorithm is mainly divided into 3 Journal of Sensors 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 wðxÞ 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.

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, where dðxÞ, cðxÞ, and vðxÞ, 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.
First, the foggy image is transferred to the YCbCr color space, the normalized brightness component YðxÞ is extracted, and the Gaussian smoothing function FðxÞ is used to convolve with it to obtain the image fog maskLðxÞ, that is, where ' ⊗ ' represents the convolution operation; K is the normalization factor; σ is the standard deviation, the magnitude of which controls the smoothness of the function FðxÞ; m and n represent the horizontal and vertical coordinates at x. The uniform fog mask L is the mean value ofLðxÞ, namely,, 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: where Guided Filter represents the guided filtering operation, YðxÞ represents the guided image, ð1 − YðxÞ * LÞ represents   Journal of Sensors 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 of 9 × 9 and bilateral filtering is performed on L ′ ðxÞ to eliminate blocking effects and optimize to obtain the brightness map LðxÞ; Finally, according to the linear relationship model between the depth of field and the brightness component [16], the depth map dðxÞ is obtained: where L min and L max represent the minimum and maximum values of the optimized brightness map LðxÞ, respectively. The depth of field obtained based on the Retinex depth of field estimation algorithm is shown in Figure 3.

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 parameter s. 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: where floor represents rounding towards negative infinity. Figure 4 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.

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 factor wðxÞ 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.

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

5
Journal of Sensors 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 field dðxÞ 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: where d min and d max represent the minimum and maximum values of the depth of field map, respectively.

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.

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 threshold d BL 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,   Journal of Sensors 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: where d BL = d min + 3 * ðd max − d min Þ/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 t 0 = 0:1 is set to limit the transmittance range, and the obtained atmospheric light A and transmittance tðxÞ are substituted into equation (21) to obtain the defogging image JðxÞ:

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.

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 Figure 5. 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.

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  Table 1. The box below the figure is an enlarged view of a local area.
In 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, Table 2 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.
It can be seen from Table 2 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 Table 3, 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 9 Journal of Sensors to those of the comparison algorithm. Combining the subjective visual effect and objective evaluation index, the superiority of the proposed algorithm is illustrated.
In addition, we also make statistics on the average execution time of the algorithm, as shown in Table 4. 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.

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.

Data Availability
The data used to support the findings of this study are available from the corresponding author upon request.

Conflicts of Interest
The authors declare that there is no conflict of interest regarding the publication of this paper.