Image Haze Removal Using Dark Channel Prior Technology with Adaptive Mask Size

Image dehazing is a crucial technique in the study of computer vision. The most widely used image dehazing approach is the dark channel prior (DCP) method proposed by He et al. [IEEE Trans. Pattern Anal. Mach. Intell. 33 (2011) 2341]. Because a DCP-based method generates halo artifacts under certain conditions, this study aims to solve this problem and propose a DCP-based method that uses a mask with an adaptive size. The proposed method is based on the inverse ratio of the gradient of a hazy image and calculates the corresponding mask size. A small mask size is used for regions with a large gradient to solve the halo problem and a large mask size is used for regions with a small gradient to achieve the dehazing effect. Subsequently, the gradient was smoothened and the γ function was corrected using a Gaussian filter to obtain a more favorable nonlinear relationship. Finally, the ant colony optimization (ACO) algorithm was employed to determine the optimal parameters for the Gaussian filter and γ function. A new dehazing performance index (DPI) was also proposed in this study as the cost function for the ACO algorithm. The experimental results of this study verified that the proposed method can effectively minimize the effect of halo artifacts without compromising the dehazing performance and color distortion.

Image dehazing is a crucial technique in the study of computer vision. The most widely used image dehazing approach is the dark channel prior (DCP) method proposed by He et al. [IEEE Trans. Pattern Anal. Mach. Intell. 33 (2011) 2341]. Because a DCP-based method generates halo artifacts under certain conditions, this study aims to solve this problem and propose a DCP-based method that uses a mask with an adaptive size. The proposed method is based on the inverse ratio of the gradient of a hazy image and calculates the corresponding mask size. A small mask size is used for regions with a large gradient to solve the halo problem and a large mask size is used for regions with a small gradient to achieve the dehazing effect. Subsequently, the gradient was smoothened and the γ function was corrected using a Gaussian filter to obtain a more favorable nonlinear relationship. Finally, the ant colony optimization (ACO) algorithm was employed to determine the optimal parameters for the Gaussian filter and γ function. A new dehazing performance index (DPI) was also proposed in this study as the cost function for the ACO algorithm. The experimental results of this study verified that the proposed method can effectively minimize the effect of halo artifacts without compromising the dehazing performance and color distortion.

Introduction
Smog is a natural phenomenon commonly found in everyday life. A smog-affected environment is characterized by reduced visibility because the fog, haze, water vapor, and suspended particles in the air cause the scattering of light. A hazy image not only affects visibility but also reduces the effectiveness of image processing, making image dehazing a crucial technique in the study of computer vision. Analyzing the composition of hazy images is the primary task of image dehazing. The earliest image degradation model was proposed by McCartney in 1977, who described the criteria constituting a hazy image and the image degradation process. (1) This model has been extensively applied in computer vision and image processing. Image degradation is caused by direct and indirect attenuations. (2) Direct attenuation refers to the process in which light reflected on the surface of an object decays in an atmospheric medium. Indirect attenuation refers to the degradation phenomenon caused by the scattering of atmospheric light through an atmospheric medium. Thus, the haze image model consisting of direct and indirect attenuations is defined as where I(x, y) represents a haze image; the product of haze-free image J(x, y) multiplied by transmission t(x, y) represents direct attenuation; the product of global atmospheric light intensity A multiplied by the complement of transmission 1 − t(x, y) represents indirect attenuation; and (x, y) represents any arbitrary position in an image. To dehaze an image, Eq. (1) can be rewritten as According to Eq. (2), the success of image dehazing lies in the estimation of transmission t(x, y) and atmospheric light A. Because estimating the transmission rate is difficult, image dehazing methods mostly rely on certain prior knowledge to form a hypothesis about haze or multiple images to estimate the mapping relationships between haze and haze-free images. The present study focused on the method of using prior knowledge to form a hypothesis regarding haze images.
Numerous priori-based methods have been proposed. Tan developed a method of dehazing single images using the Markov Random Field (MRF). (2) This method involves estimating the atmospheric light and light chromaticity of an input image and computing the data cost from the contrast of a small patch cropped from an image as well as the smoothness cost to construct a complete MRF, which is then used to estimate the direct attenuation of the image. Subsequently, the image contrast and scene visibility are enhanced, thereby dehazing the image. Shiau et al. proposed a weighted haze removal method with halo prevention. (3) In this method, Shiau et al. developed a novel different prior that can mitigate the halo artifact problem around sharp edges during scene transmission estimation. This method can automatically detect halo artifacts in images of different haze scenes and adopts a weighted technique to mitigate the effect of halo artifacts induced by haze removal. Zhu et al. developed a color attenuation prior for haze removal from a single hazy image. (4) This prior knowledge can facilitate the establishment of scene depth and a linear model for hazy images. With a supervised learning method, the parameters of the linear model can effectively establish the relationship between hazy images and a corresponding depth map. Berman et al. proposed a nonlocal image dehazing method and found that hazy images contain a line in RGB space, which was called a haze line. (5) Per-pixel transmission can be estimated by modeling pixels of similar colors along a haze line located over different image planes and a combination of radiance and airlight colors. Cai et al. proposed DehazeNet, an end-to-end single image haze removal method based on convolutional neural networks (CNNs). (6) DehazeNet adopts CNN-based deep architecture with layers specifically designed to embody the prior assumptions of other image dehazing methods. It directly learns the mapping relationships between hazy images, and parameters of all its layers in the network can be automatically learned from training hazy images. DehazeNet takes a hazy image as input and outputs its medium transmission to recover a haze-free image. He et al. proposed the use of dark channel prior (DCP) to remove haze from a single image. (7) This prior knowledge is based on the observation that nonsky or nonwhite regions of an object contain an extremely low intensity in the RGB components of an image patch. Hence, the assumption of the method is based on this observation to estimate the transmission of hazy images. He et al. further used a guided image filter to refine transmission maps and improve the original method on the basis of soft matting time consumption problems, and obtained more favorable results. (8) The DCP image haze removal method proposed by He et al. (7,8) is more extensively discussed and widely used for comparison with the aforementioned prior knowledge methods. (9)(10)(11)(12)(13)(14)(15) Although the dehazing effect of the DCP method has attracted considerable attention, it still has flaws in various aspects. A number of improvements have been proposed to overcome the deficiencies of the DCP-based image haze removal method. Yang et al. proposed a DCP-based low-complexity underwater image enhancement method, which employs a color correction method to enhance the color contrast of an object, thereby improving the visual quality. (9) Li et al. developed a content-adaptive and post-enhancement image dehazing method, which considers dark areas to overcome overly saturated results and employs dark channel confidence to avoid artificial defects. (10) This enhancement method enhances the restored image and simultaneously retains the contrast ratio. Hsieh et al. used minimum filter to estimate dark channels and employed an adaptive scaling factor to compensate for dark channels. (11) Provided that soft matting is not used, the proposed method reduces the calculation cost and yields more favorable results in terms of color saturation than the DCP-based method. Shi et al. considered changes in attenuation coefficients, proposing a DCP-based inhomogeneous atmosphere optimal model for the adjustment of scene transmission. (12) This method can effectively overcome the color distortion in sky regions. Bi et al. proposed a method for the accurate estimation of transmission in the atmospheric scattering model based on outdoor haze-free and haze images. (13) The proposed method can obtain high-quality haze-free images with abundant distinguished details. Chen et al. established an image dehazing method that maintains color fidelity. (14) The Sobel operator is used to detect edges and improve transmission, and the piecewise function is adopted to eliminate color distortion in bright regions. Their experimental results revealed that the proposed method effectively enhances the image quality. Ma et al. proposed a fast video dehazing method that combines DCP and atmospheric scattering model. (15) The method can obtain favorable results in terms of processing efficiency and visual quality. Yu et al. proposed a block-to-pixel interpolation method for fine dark channel computation. (16) In this method, block-level dark channels are first calculated and then transmission maps are generated by obtaining a fine pixel-level dark channel through the weighted voting of a block-level dark channel. Their experiments showed that the proposed method can increase the efficiency of haze removal and improves the quality of recovered images. Chengtao et al. developed a DCP dehazing approach using an adaptive factor. (17) In this approach, hazy images are segmented into sky and nonsky regions, and the intensity of light and transmission can be obtained by considering different factors. Compared with the conventional DCP technique, the proposed method generates dehazed images with fewer color distortions. Li et al. proposed a sky segmentation prior and adaptive channel balancing method, which analyzes the physical meaning of atmospheric light and estimates appropriate atmospheric light values. (18) The proposed method can overcome the problem that images cannot be adopted dynamically. Li et al.'s results show that their method is more accurate than the previously proposed methods.
In the aforementioned methods, several authors used color correction to enhance image contrast, while other authors employed minimum filter to prevent halo artifact formation. A few authors adjusted transmission by using models to prevent image distortion. All the DCPbased methods facilitate in enhancing the image quality and improving the dehazing quality of DCPs under certain conditions. While summarizing the problems associated with the aforementioned DCP-based techniques, this study identified two deficiencies that easily occur in DCP-based methods: First, in a DCP-based calculation process, transmission is overestimated in regions with scene depth discontinuity, causing the generation of halo artifacts on dehazed images. Second, in the process of haze removal, overexposure easily occurs in sky or white regions of the image. Hence, this study was focused on identifying a solution to mitigate the halo artifact problem.
When implementing a DCP-based dehazing method, this study found strengths and weaknesses in using large (e.g., 15 × 15 pixel) (7) and small (e.g., 1 × 1 pixel) mask sizes to estimate dark channels. Figure 1 illustrates an example. Figure 1   (c) (d) Figure 1(b) shows an overall favorable dehazing performance; however, dark channels with scene depth discontinuity are underestimated [as shown by the square block in Fig. 1(b)], which causes the generation of halo artifacts on the dehazed image. By contrast, the underestimation of dark channels with scene depth discontinuity is resolved in Fig. 1(c); however, the dehazed image lost its natural color and color contrast [as shown by the square block in Fig. 1(c)]. In conclusion, although favorable dehazing performance is achieved from using a large mask size, the underestimation of dark channels intensifies the halo effect. As the mask size is diminished, the halo artifact problem is mitigated, but the dehazing performance drops, resulting in marked color differences. Because using different mask sizes has its strengths and weaknesses, this study attempted to combine the strengths of different mask sizes.
To do this, dehazed images were examined. According to Fig. 1(b), halo artifacts were found on tree branches and leaves in the dehazed image. This is because the scene depth of the tree leaves differed significantly from the background, causing the underestimation of dark channels in this region. This study also showed that patches of the image with scene depth discontinuity generally have a larger image gradient [as shown in Fig. 1(d)]; therefore, the inverse ratio of image gradient was used as the basis for mask size estimation. Thus, a dehazing method based on a DCP with an adaptive mask size (hereinafter referred to as ADCP) is proposed. For regions where halo artifacts are not easily generated, a large mask size is used to estimate dark channels while maintaining favorable dehazing performance. By contrast, a small mask size is used to estimate dark channels in regions where halo artifacts are easily generated, thus inhibiting the formation of halo artifacts on dehazed images. Subsequently, the γ function was corrected using a Gaussian filter to obtain a more favorable nonlinear relationship. Finally, the ant colony optimization (ACO) algorithm was employed to determine the optimal parameters for the Gaussian filter and γ function. The ACO algorithm is modeled on the basis of the process by which ants find food and lay down pheromones to seek the optimal path. The algorithm is applicable to solving path planning optimization problems. Therefore, in this study, the process of searching for optimal parameters as an optimal path searching problem was adopted. In addition, a new dehazing performance index (DPI) was established as the cost function of the ACO algorithm and used to evaluate image dehazing results based on the parameter search of ACO. The experimental results of this study verified that the proposed method can effectively mitigate the effect of halo artifacts generated by a DCP-based dehazing method without compromising the dehazing performance.
This paper comprises five sections. Section 1 provides an introduction to the haze image model, literature review, and research objective. Section 2 introduces the DCP-based single image dehazing method and procedures. Section 3 describes the proposed ADCP-based single image dehazing method. Section 4 presents the experimental results and discussion in which the results are qualitatively and quantitatively evaluated. Finally, Sect. 5 concludes the study.

Dehazing Method Based on DCP
He et al. proposed the use of DCP to remove haze from a single image. (7) The statistical processing of multiple haze-free color images based on prior knowledge shows that nonsky or nonwhite regions of an object contain an extremely low or close to zero intensity in the RGB components of an image patch. Hence, He et al. used this observation as the assumption of their proposed method and estimated the dark channels of hazy images using constant pixel numbers and patch sizes. Subsequently, they generated transmission maps and recovered hazefree images. The workflow of the DCP-based image dehazing method is described below: Step 1: A dark channel is calculated using constant-sized mask Ω(x, y): where I c (u, v) represents the RGB components of the input image and Ω(x, y) represents the range of mask centered at (x, y).
Step 2: Atmospheric light value Â is estimated on the basis of ( , ) . The pixel value of the input image corresponding to the top 0.1% brightest pixels in the dark channel ( , ) dark J x y  is the atmospheric light estimate.
Step 3: A dark channel is estimated as Step 4: An estimated transmission map is obtained as where ω represents a constant parameter that ranges from 0 to 1 and is used to regulate the estimate error resulting from the effect of haze on a real dark channel.
Step 5: A guided filter (8) is used to refine the estimated transmission map: where GIF( ) represents the guided filter function (8) and I(x, y) represents the hazy image used to guide the estimated transmission map. Refining the map by using a guided filter can prevent the effect of patches on the estimated transmission map, thus yielding a refined transmission map ˆ( , ) t x y , where N gif = 20 is the size of the filter and ε = 0.001, which is the smoothness parameter.
Step 6: A haze-free image is estimated as where t 0 represents the lower bound of transmission to prevent zero denominator in Eq. (7).

Dehazing Method Based on DCP with Adaptive Mask Size
This chapter introduces the method proposed in this study as well as the estimation of the adaptive mask size and optimized parameters using the ACO algorithm.

Estimation of the adaptive mask size
As mentioned above, using a large or small mask size to estimate dark channels has its advantages and disadvantages. Hence, in this study, ADCP, which is based on the inverse ratio of the gradient of a hazy image, is proposed. In the estimation of dark channels, the mask size varies in different scenarios. For example, a small mask size is used for regions with a large gradient, and a large mask size is used for regions with a small gradient. Therefore, the adaptive mask size is defined as where G(x, y) represents the gray-scale gradient of the input image, (x, y) represents any coordinate in the image, and G(x, y) is normalized from 0 to 1; γ represents the amount of nonlinear correction; and N represents the upper bound of mask size. Because pixel is a unit of mask size, the adaptive mask size ranges from integer 1 to N + 1. G(x, y) is calculated using the Sobel operator, which calculates the image edge. The convolution algorithm is performed on the gray-scale values of the input image by using two 3 × 3 masks, subsequently obtaining the horizontal and vertical gray-scale gradients G x (x, y) and G y (x, y), respectively, shown as where I gray (x, y) represents the gray-scale image of the input image. Integrating G x (x, y) and G y (x, y) yields the gray-scale gradient of each pixel point (x, y) as In calculating the dark channels, this study found that a small mask size was used for largegradient pixels and, therefore, the corresponding dark channel was not underestimated. However, the pixels neighboring those with a large gradient have a small gradient, causing the corresponding dark channel to be underestimated. Hence, a Gaussian filter was used to smoothen the image gradient so that the gradient of regions on the image where the gradient varies considerably (high frequency) is smoothened without affecting the gradient of regions with a small gradient variation (low frequency). However, the Gaussian filter size and standard deviation also affect the determination of the dark channel mask size, which also indirectly affects the final quality of the dehazed image. Figure 2 shows the graph of gradients with different γ values and the corresponding mask size. When γ = 1, the curves are linear and inversely proportional to each other, indicating that the larger the gradient, the smaller the corresponding mask size, and the smaller the gradient, the larger the corresponding mask size. The corresponding curves vary according to γ, indicating that γ is an adjustable parameter used to correct nonlinear function relations. Thus, adaptive mask size M(x, y) was used instead to calculate the constant mask size of dark channels, and Eq. (4) for dark channel calculation was rewritten as ( ) To further describe the aforementioned method, an example of one-dimensional (1D) simulation data is provided in Fig. 3, in which Fig. 3(a) shows 1D gray-scale values. A significant change in gray-scale value was found at pixel indices 45 and 95. The results of using a 1 × 15 pixel mask to estimate dark channels are shown in Fig. 3(b), which reveals the underestimation of dark channels on the right of pixel index 45 and on the left of pixel index 95. Such underestimation results in the generation of halo artifacts in dehazed images; therefore, the aforementioned adaptive mask size method was employed. First, the 1D gray-scale gradient was calculated and smoothened using the Gaussian filter. The results are shown in Fig. 3(c), which reveals two larger gradients at pixel indices 45 and 95. A larger and smooth gradient was also found near pixel indices 45 and 95. Subsequently, the smooth gradient in Fig. 3 incorporated into Eq. (8) to calculate the corresponding adaptive mask size, as indicated in Fig.  3(d): the large gradient corresponds to the small mask size and the small gradient corresponds to the large mask size. Hence, the larger gradient found near pixel indices 45 and 95 corresponds to a smaller mask size in Fig. 3(d). Finally, the adaptive mask size was used to calculate the 1D gray-scale dark channel. The results are illustrated in Fig. 3(e). Compared with Fig. 3(b), Fig.  3(e) shows improvement in the underestimation of dark channels on the right of pixel index 45 and on the left of pixel index 95.

Estimation of optimized parameters using ACO algorithm
In estimating the aforementioned adaptive mask, adjusting the size g s of the Gaussian filter for gradient smoothening, the standard deviation g σ , and the amount of nonlinear correction, γ, can yield improved dehazing performance. This study employed the ACO algorithm (21) to determine the optimal parameters. ACO is based on the foodseeking behaviors of ant colonies. When searching for food, ants lay down pheromone trails as they return to their colony. Other ants will follow the pheromone trail. When more ants travel back and forth from the food source to their colony, the pheromone density becomes higher on short paths than on long ones, and positive feedback eventually leads to many ants following the shortest path. The ACO algorithm is applied to combinatorial optimization problems (e.g., travelling salesman, quadratic assignment, and job-shop scheduling problems) in a discrete space. The parameters g s , g σ , and γ were configured for path selection. Plans are shown in Fig. 4, where the range of g s is assumed to be with N 2 being the number of g σ , and the range of γ is with N 3 being the number of γ. In an ant colony, any ant will choose a path. Therefore, a set of parameters can be obtained as 1 2 3 ( , , ) ( , , ) As shown in Fig. 4, different combinations of path parameters generate different dehazing results, which are evaluated using an objective function (i.e., DPI). Finally, the pheromone deposited along the path of the optimal parameter combination is corrected and left for use by the next iteration of the ACO algorithm. See Ref. 21 for details on the algorithm.

Using the dehazing method based on ADCP
The section introduces the complete method of removing haze using the proposed ADCP. Figure 5 presents the workflow of the ADCP-based dehazing method, which details the aforementioned procedures. The gray-filled square block shows the improvements made to the DCP-based method.  Figure 6 shows an example of image dehazing using the proposed ADCP. Figure 6(a) shows the original image. Figure 6(b) shows the dark channels estimated using the constant mask size (15 × 15). Figure 6(c) shows the dark channels estimated using the adaptive mask size. A comparison of the figure diagrams shows that in Fig. 6(b), the dark channel in the region with scene depth discontinuity was underestimated, resulting in the generation of halo artifacts on the dehazed image. As shown around the tree leaves in Fig. 6(d), the method proposed in this study can effectively prevent the formation of a large portion of halo artifacts. Figure 6(e) presents the image dehazing result.

Results and Discussion
To verify the effectiveness of the proposed study, qualitative and quantitative assessments were performed. This section first describes the DPI used in this study and then outlines the two experiments conducted on the benchmark images. The first experiment involved the use of a constant parameter in ADCP, and the second experiment involved the use of the ACO algorithm to determine optimized parameters. Subsequently, dehazing results are compared with those of a DCP-based dehazing method. The MATLAB R2017a program and Windows 10 operating system were employed.

DPI
To quantitatively assess the image dehazing effect, an appropriate DPI is required. Two types of DPI are introduced in this section. First, Hautière et al. proposed the rate of new visible edge, DPI ρ . (19) Because the effect of haze is absent in a dehazed image, a dehazed image will contain more details than a pre-dehazed image. Therefore, DPI ρ is defined as where n r and n o represent the numbers of edges in dehazed and hazy images, respectively. The larger the DPI ρ , the stronger the dehazing effect. However, this DPI has an obvious problem, that is, it does not consider the effect of distortion of a dehazed image. Second, Hsieh et al. (20) proposed a new two-objective DPI, termed DPI λ , which takes into consideration the image dehazing intensity µ and post-dehazing image distortion e and is defined as where w represents the weight coefficient, which ranges from 0 to 1, and is used to balance the weight of the image dehazing intensity µ and post-dehazing image distortion e. Hsieh et al. x y x dim y dim dark where dim x and dim y represent the width and height of an image, respectively; Ĵ dark (x, y) represents the dark channel; MSE( ) represents the calculated mean squared error function; I R , I G , and I B are the RGB channels of the input image; and ˆR J , ˆG J , and ˆB J are the RGB channels of the dehazed image. Hsieh et al. (20) hypothesized that the mean of dark channels in a dehazed image is smaller than that in a hazy image. To avoid color distortion, the mean squared error of RGB components in dehazed and hazy images must not differ significantly. Finally, Hsieh et al. combined their two performance indicators according to the weight ratio and determined weight appropriately. However, the experimental results showed that the mean squared error of RGB components in dehazed and hazy images differed considerably, and that this difference was not entirely caused by color distortion. The present study showed that in the hue, saturation, value (HSV) color space, the hazy image is less saturated and brighter than the dehazed image, leading to a large mean squared error between the RGB components in the dehazed and hazy images. Furthermore, hazy and dehazed images have similar hues, suggesting a conflicting phenomenon: for a strong dehazing effect, a large image distortion e is inevitable, but the mean squared error of RGB components in dehazed and hazy images cannot differ significantly in order to prevent color distortion. Therefore, for this study, Hsieh et al.'s DPI image distortion e was modified into the mean squared error of the hue channel, DPI λh , which is defined as 2 2 (1 ) where ) ( , I H and Ĵ H represent the hues of hazy and dehazed images, respectively. Therefore, the smaller the DPI λh , the stronger the dehazing effect. The weight w was set to 0.64 as recommended by Hsieh et al.

Experiment 1: results of ADCP based image dehazing using a constant parameter
In the experiment, ADCP was a constant parameter. By experience, the size of a Gaussian filter for ADCP was set to 11 × 11, the standard deviation g σ of the Gaussian filter was 10, and the amount of correction, γ, was 2. Subsequently, the ADCP-and DCP-based dehazing results were compared qualitatively and quantitatively. Experimental testing was performed on common images, such as a forest, a brick house, a paddy, sakura trees, mountain, groves, and a highway. Figure 7 presents the ADCP-and DCP-based dehazing results. The second column of the diagram contains the original hazy images; the third column comprises images following DCPbased dehazing; and the column furthest to the right contains images processed by ADCPbased dehazing. According to Fig. 7, pronounced halo artifacts were found in the following locations after the images were dehazed using DCP: near the treetop (forest), the area with depth discontinuity (brick house), around the tree branch (Sakura), the area with depth discontinuity (mountain), and the area around vehicles and motorcycles (highway). These artifacts were caused by the underestimation of dark channels in areas with depth discontinuity. Nevertheless, using ADCP can effectively mitigate the halo artifacts generated after dehazing so that images appear clearer. In addition, the paddy images show that compared with the DCP-processed image, the ADCP-processed image is more saturated in color. The ADCP-based dehazing method can also eliminate the haze between tree groves, thereby rendering a clearer view. Table 1 shows the DPI results based on Fig. 7. The second and third columns are the evaluation results of DPI ρ and reveal that in most situations, using the ADCP-based method yields more satisfactory results. Thus, the proposed method exhibits more favorable dehazing performance and can remove most of the haze effect, thereby revealing more edge information. The fourth and fifth columns are the evaluation results of DPI λh . The result of using the ADCP-based dehazing method was superior to that of using the DCP-based dehazing method, suggesting that the proposed method not only performs well in haze removal but also effectively prevents color distortion that would otherwise occur after image dehazing.

Experiment 2: results of ADCP-based image dehazing using optimized parameters
The second experiment involved using the optimized parameters of ADCP obtained using the ACO (21) algorithm. The size of the Gaussian filter was set to [7, 9,  . The numbers of ant colonies and iterations were set to 30. The objective function was DPI h . Experimental testing was performed on images of a street, a cityscape, Tiananmen, a train, a woman, a railway, and a parking lot. Table 2 shows the optimized parameters obtained for the different images.
In Fig. 8, the first column shows the hazy image, the second column presents the images dehazed using DCP, the third column shows the images dehazed using ADCP with a constant parameter (parameter setting was the same as that of Experiment 1), and the last column provides images dehazed using ADCP with an ACO-optimized parameter. Images in the second column show that halo artifacts were formed around the vehicles in the street image, at the edge of tree leaves in the cityscape image, at the edge of buildings in the Tiananmen image,  at the edge of trains in the train image, around the pedestrians in the railway image, and around the buildings on the right of the parking lot image. According to images in the third column, ADCP with a constant parameter can mitigate the effect of halo artifacts. Results in the fourth column revealed that ADCP with an optimized parameter can more effectively inhibit the formation of halo artifacts in the images. Provided that the dehazing capability is unaffected, the proposed method can effectively prevent halo formation in image dehazing. Table 3 shows the DPI λh values of dehazed images in Fig. 8. Because DPI λh was used as the objective function in ACO, it yielded favorable convergence with an adequate number of iterations and effectively estimated more appropriate ADCP parameters. The experimental results indicate that the optimal dehazing result was obtained using ADCP with optimized parameters, provided that the dehazing effect and color distortion were both accounted for.

Conclusion
In this study, a DCP-based image dehazing method that uses an adaptive mask size was proposed. This ADCP method automatically determines the mask size at every location according to the gradient of the input image. Thus, the proposed method not only prevents the underestimation of dark channels but also mitigates the halo problems associated with DCP-based image dehazing. The ACO algorithm was adopted in this study to find the optimal parameter for ADCP and render more favorable dehazing results. To ensure that the proposed ADCP can remove haze effectively without causing color distortion in dehazed images, a new DPI-DPI λh -was proposed. This new indicator focuses on hue retention without compromising image dehazing performance. The proposed method uses DPI λh as the objective function in ACO and, after a sufficient number of iterations, it can estimate dehazing parameters that can be applied to the ADCP-based method. The experiments in this study verified that the proposed method generated optimal results as determined by qualitative and quantitative comparisons. However, tiny halo artifacts, color oversaturation, and color distortion can still be found in some parts of the images processed by the ADCP-based method. Future studies should continue to explore more favorable image dehazing methods to produce a more satisfactory visual quality.