An image dehazing algorithm based on double priors constraint

Aiming at the color distortion of the restored image in the sky region, we propose an image dehazing algorithm based on double priors constraint. Firstly, we divided the haze image into sky and non-sky regions. Then the Color-lines prior and dark channel prior are used for estimating the transmission of sky and non-sky regions respectively. After introducing color-lines prior to correct sky regions restored by the dark channel prior, we get an accurate transmission. Finally, the local media mean value and standard deviation are used to refine the transmission to obtain the dehazing image. Experimental results show that the algorithm has obvious advantages in the recovery of the sky area.


Introduction
Image dehazing methods based on the degradation model have drawn a great attention in recent years. After analyzing lots of outdoor haze-free image, dark channel prior was put forward [1] to estimate the initial transmission. This method can achieve satisfactory recovery effects in most natural scenes, which has been widely used for image dehazing at present. However, due to the fact that the dark channel prior does not apply to the sky region, there is a halo in the sky region of the image after dehazing. At the same time, the color of the image is distorted. Therefore, some improved algorithms have been proposed. Tarel use median filtering to estimate the transmission [2], which reduces the complexity of the algorithm. Zhu proposed an image dehazing algorithm based on the color attenuation prior [3], which improved the running speed of the algorithm. However, the algorithm relies too much on the color information and cannot handle the entire fog image well.
In general, the above algorithm has a poor effect on the restoration of the sky region, and it is likely to cause color distortion. As a result, some improved algorithms for the sky region have been proposed successively. Li [4] separately estimated the transmission of the non-sky region and the sky region, suppressing the color distortion effectively, but the color of restored image is dark. Sui [5] used Markov random fields to estimate the transmission. Although there is no color distortion in the sky area, this method does not handle well in the details of the distant images.
In order to achieve the dehazing in the sky region, this paper proposes an image dehazing algorithm based on double priors constraint. After dividing the sky region, the proposed method introduce color-lines prior to correct sky regions restored by the dark channel prior, then we obtain the accurate transmission through the fusion of two transmission. Finally we obtain haze-free images by the atmospheric degradation model.

Atmospheric Degradation Model And The Dark Channel Prior
The scattering effect of light leads to the production of haze image. The causes of haze image degradation is shown in figure 1. where I (x) denotes the degraded image, J (x) is the haze-free image to be restored, A is the global atmospheric light intensity, which is assumed to be a constant in this paper, t (x) is the transmission, reflecting the degree of attenuation of the scene. Then the atmospheric degradation model is proposed by McCartney [6], which can be written as equation (1):

The dark channel prior
In most of the local patch except the sky region, the intensity of some pixels in at least one color channel is very small, which is called the dark channel prior. For a fog-free image J (x). There are: where J c (x) represents the R,G,B color channels of image J (x), and Ω (x) denotes the local patch centered on x. Due to the large intensity of the pixels in the sky region, there is no dark color point with an intensity close to zero. While performing image defogging, the difference between the color values of the three channels will be amplified, resulting in color distortion of the image.

The Color-lines Prior
Beased on a statistical analysis of a large number of natural images. Omer found that the pixels in the local area obey one-dimensional distribution in the RGB color space, showing a line, which is called Color-lines. Then, Fattal [7] relies on this discovery to define a model in a local image region. He [1] estimated the transmission based on the distance from the origin to the color line. By which we can estimate an accurate transmission. According to the Color-Lines prior and surface reflection properties, the recovered haze-free image can be represented as equation (3): where R is a vector in the RGB color space, which represents the relative luminance of the reflected light in each color channel. The scalar l(x) is the radiation at the pixel x in the local patch Ω. In other words， R can be regarded as the reflectivity of the surface, while l(x) is the surface shadow. Since the transmission t(x) is smoothed locally [8], we regard it as a constant. So in a small local patch, equation (1) can be rewritten as: where R t R  . In addition, Based on the above analysis, it is known that the pixels x(x∈Ω) following this model differ only in surface shadow. According to equation (4), we can know that the I (x) corresponding to these pixels presents a one-dimensional distribution in the RGB color space. The color-line corresponding to these local areas changes with l (x) . As indicated by the blue dotted line in figure 2, its direction is the same as the reflectivity R,which is denoted by the purple line. Under the effect of atmospheric light, the color-line does not exceed the origin. To which it is A(1-t) from the origin. So the intersection of the atmospheric light and the color line indicates the distance from the atmospheric light direction to the color line.

Sky Region Segmentation
In most haze images containing sky regions, there are clear differences between sky and non-sky regions. According to which, we can achieve the separation of sky and non-sky regions.
As a result of the noise interference, it is difficult to achieve accurate segmentation for an image with noise interference at the junction directly. Therefore, the proposed method achieves the division of the sky region by quadratic segmentation. At first, we converted natural images to grayscale images. Next,we segmented the sky region from the image according to equation (5) to obtain a preliminary segmentation result: Here Igary is gray intensity of the pixel x. The difficulty in segmenting the sky region lies in the determination of the segmentation threshold T. Weather it is correct or not is crucial to the segmentation result. In order to ensure the correct segmentation of the sky region, we use the Otsu Algorithm to achieve the second segmentation, where the threshold T is obtained by equation (5): The relationship between σ 2 and t is expressed as follows: where μr refers to the gray average of the image, and Wsky and Wnon-sky are the probability distributions of the sky and non-sky regions. Based on the above quadratic segmentation method, the sky region and the non-sky region can be distinguished accurately. The segmentation result is shown in figure 4:

The Estimation of Initial Transmission
After the segmentation, we make use of the Color-lines prior and the dark channel prior for the sky and non-sky regions to obtain the initial transmission respectively. For a color-line that has been obtained in the segmented sky region, we can obtain the transmission by counting its distance from the origin according to figure 2. As known from the second section, that the deviation distance can be regarded as the intersection of the color-line and the straight line A(1-t). Because the pixels in the local patch belong to the same Color-line, we randomly select two pixels x1 and x2 in the local patch Ω, whose intensity are I(x1) and I(x1) respectively. Therefore, the color-line can be expressed as: Here, denotes the direction of the Color-line. As shown in figure 2, it is in the same direction as R. Furthermore, the pixel intensity is only different in l(x) in the local patch, so equation (8) can be written as : We can estimate t according to equation (10). Followed by which, a rough estimation of the transmission ' ( ) sky t x in sky region is obtained by equation (7).
On the other hand, for non-sky regions, the initial transmission ' ( ) nonsky t x can be obtained by the dark channel prior. In general, the haze image has different transmission between the sky area and the non-sky area. To avoid the halo phenomenon after dehazing,

Experimental results
In order to verify the effectiveness of the proposed method, we compares experimental results with the current mainstream dehazing algorithm to analyze the applicability of this algorithm. At the same time, we compared with the results of the restoration of the composite image to comprehensively demonstrate the effect of our algorithm. Finally, we introduce objective indicators to achieve the qualitative analysis of experimental results.

Analysis of Experimental Results
The comparison of the proposed method with other methods is shown in figure 5. It can be summed up that He's method can achieve effective dehazing, However, its results in the sky regions is unsatisfactory. As we can see, color distortions appear in the sky regions of several images. Though Fattal'method retains more detailed information in the flat region, it has poor ability of margin preservation and the restored image is darker. Meng'method has clear details in the image after dehazing, but there is still distortion in the sky region. Compared with these methods, the proposed method is more natural and clear in the details of the image. At the same time, it corrects the color distortion in the sky region, and greatly improves the image quality.
In order to further verify the effectiveness of the proposed, we analyzes the results of the synthetic images, which is shown in figure 6. It can be seen that the proposed algorithm has obvious advantages in the recovery of the sky area. For example, dark cloud patches rarely appear in the sky area, effectively correcting color distortion in the sky area. Other than, the restored image is more natural and conforms to human visual characteristics.

Analysis of Quantitative Comparison
To further quantify the proposed method, we use the image entropy and peak signal-tonoise ratio (PSNR) to analyze the various algorithms in figure 5 quantitatively.
The entropy of the image represents the average information contained in the image. The PSNR is the most direct method in image quality evaluation, which mainly reflects the fidelity of the image and the integrity of the structure. Table 1 is the entropy and PSNR of the results in figure 5.
We found that the entropy of the image restored by the proposed method is the largest, indicating that the recovered image contains more information. Because the proposed algorithm improves the defect of the dark channel prior to the sky region and the recovered image is more clear and natural, so the PSNR is the largest. In general, the proposed method maintains more detailed information than other methods.

Conclusion
In this paper, we proposes an image dehazing algorithm based on double priors constraint.
The proposed method has a great effect on the dehazing in the sky region. While achieving color retention, the restored image retains more image detail. What's more, the image quality is improved significantly. However, we can't get ideal dehazing image when dealing with denser images. This is a major research direction for follow-up work.