28 American Scientific Research Journal for Engineering, Technology, and Sciences (ASRJETS) ISSN (Print) 2313-4410, ISSN (Online) 2313-4402 © Global Society of Scientific Research and Researchers http://asrjetsjournal.org/ Estimation of Parameters in Atmospheric Scattering Dehazing Model in Accordance with Visual Characteristics Tang Chunminga, Lian Zhengb*, Chen Chunkaic a,b,cTianjin Polytechnic University , School of Electronics and Information Engineering, TianJin 300387 aEmail: tangchunminga@hotmail.com bEmail: 916269471@qq.com Abstract In view of the problem that the restoration effect of the daytime defogging algorithm is not ideal, especially the over-enhancement and color distortion in the sky and its nearby. A new parameter estimation method for atmospheric scattering model is proposed. Firstly, the sky and non-sky areas are segmented. Then, estimating the atmospheric light at the junction, and then corresponding restrictions on the value of transmittance according to the change of the depth of field. Finally, the transmittance is optimized by context-based regularization, so that the final image after dehazing is more in line with the visual characteristics. Through the subjective comparison and analysis with the existing mainstream algorithms, the dehazing effect of the proposed method has the advantages of low noise and high color recovery, especially in the sky. The restoration with the non-sky junction is the best, enriching the details that other algorithms have not restored and the colors are true and natural. Keywords: Image dehazing; atmospheric scattering model; atmospheric light; transmittance. 1. Introduction In recent years, due to the bad weather such as smog, the image and video quality of outdoor scene shooting will be seriously degraded, which affects our visual experience and perception of details. It urgently requires us to restore degraded images through image processing. ------------------------------------------------------------------------ * Corresponding author. http://asrjetsjournal.org/ American Scientific Research Journal for Engineering, Technology, and Sciences (ASRJETS) (2019) Volume 51, No 1, pp 28-37 29 The recovery methods for degraded images are generally divided into two categories [1], one is to use image enhancement to highlight the difference between the target and the background to reduce the influence of haze, such as Retinex algorithm [2]; the other is according the principle of image degradation, through the atmospheric scattering model [9] to obtain a clear fog-free image, such as the maximum local contrast method proposed by Tan and his colleagues [3] and proposed by He and his colleagues [4]. dark channel prior algorithm. Current research shows that the model dehazing effect is better than the former. However, in this model, the atmospheric light estimates of many methods are relatively rough. In these methods, the brightest points or regions in the dark channel are selected to estimate atmospheric light [4-8,18]. Its biggest problem is susceptible to large areas of glare or white objects such as lights, snow and water, especially those that contain the sky. This is due to the high overall brightness of the sky area, which will seriously affect the estimation of atmospheric light, while atmospheric light estimation Inadequately, it will lead to inaccurate estimation of the transmittance of the sky area. Then because of the sky depth of field is large, the transmittance of this part of the area is generally estimated to be too low, so that the sky area after defogging is too enhanced, resulting in color distortion. In the past two years, with the development of deep learning and artificial intelligence, convolutional neural networks have also been applied to the field of dehazing. Based on the atmospheric scattering model, DehazeNet proposed by B. Cai and his colleagues [15] uses deep learning to learn the characteristics of haze. In order to estimate the concentration of smog and the depth of the scene to obtain better transmittance; Wenqi Ren and his colleagues [16] proposed a mapping between learning haze images and their corresponding transmittance maps. Multi-scale deep neural network for image dehazing; Boyi Li and his colleagues [17] proposed an All-in-One dehazing convolution network, which generates clear images directly through a small convolutional neural network. It is easy to embed in other deep network models to improve the defogging effect; K. Swami and his colleagues [20] proposed CANDY (de-fog image based on conditional confrontation network), which is a complete end-to-end model that can be directly The fog image is clean and fog-free. CANDY also adds visual quality optimization to the fog-free image, so it produces high-quality fog-free images. But deep learning defogging algorithms require a large number of data sets and special The collection of acquisitions, and the high standards of hardware requirements make the research cost higher. After studying the advantages and disadvantages of the above various algorithms, this paper proposes a new estimation method for atmospheric light, dark channel map and transmittance based on the atmospheric scattering model based on the atmospheric scattering model. Improve the defogging effect. 2. Parameter Estimation in Atmospheric Scattering Model The atmospheric scattering model describes the process of image degradation in smog and other weather, as in equation (1): ( ) ( ) ( ) (1 ( ))I x J x t x A t x= + − (1) ( )( ) d xt x e β−= (2) American Scientific Research Journal for Engineering, Technology, and Sciences (ASRJETS) (2019) Volume 51, No 1, pp 28-37 30 Where I(x) is the captured degraded image, J(x) is the restoration map, A is the atmospheric light. t(x) is the transmittance, using the equation (2), β is the scattering coefficient, d(x) For the scene distance, t(x) is negatively correlated with the imaging distance d(x). The key to whether the ideal J(x) can be obtained in this model is whether it can accurately estimate A and t(x). 2.1. Estimation of atmospheric light At present, the estimation method of atmospheric light A is to select the brightest point or region in the dark channel map according to the He’s method [4]. The atmospheric light A estimated by this method is as shown in the blue region in Figure 1(a), Figure 1(b) is the dehazing result obtained according to A in Figure. 1(a). The effect between the sky and the non-sky junction is very poor. Figure 1: (a) Input image (b) dehazing by He’s method According to equation (2), when the scene distance is infinity, t(x) is tight to zero. According to equation (1), I(x) is equal to A, that is, the reflected light of the object at the far end is transmitted through the atmosphere. The scattering of the medium attenuates to zero, and only the atmospheric light A is captured by the optical sensor. So theoretically A should take the value at the infinity point of the image, but the brightest point found by the method of He[4] is not necessarily the most far point. According to the principle of parallel perspective, the boundary between the sky and the non-sky is the line of extinction. This line of extinction is regarded as infinity. Therefore, it is estimated that the value of atmospheric light A is more in line with the principle of atmospheric scattering model. The result should be more accurate. According to this theory, a new method for estimating atmospheric light is proposed. Firstly, the sky and non- sky regions are separated. According to the characteristics of the sky region with high brightness and uniform color [10], we use equation (3-4). The rough division of the sky in I(x):    = <>= elseI andGII b gb , , 0 1 21 ττ (3) 1 1 1 ( ) M gi sky i I x b x M τ = = − ∈Ω∑ , (4) American Scientific Research Journal for Engineering, Technology, and Sciences (ASRJETS) (2019) Volume 51, No 1, pp 28-37 31 Where Ib represents the divided binary image; τ1 and τ2 represents the grayscale and gradient threshold respectively, τ2=0.04 is the empirical value. Ig, G respectively represent the grayscale of I(x) and its standard neighborhood difference gradient; Ωsky for the estimated sky areaIn the sky area, we first assume that the 1/5 area at the top of the image is the sky. (If the sky area is less than one-fifth of the image, there is very little distortion of the sky after dehazing, which has little effect on the algorithm and can be treated as no-sky image processing). Taking the gray mean value of the Ωsky area as the threshold value, in order to prevent the value from being too large and causing false detection, by setting b to define a, since the sky area selects the upper 1/5 of the image and the gray value of the area is higher than I. The average gray value of I(x), so b takes 1/7 of the average gray level of I(x). In the case of rough segmentation, it may be disturbed by scenes such as clouds due to the setting of the gradient threshold, resulting in mis-segmentation. However, since the purpose of dividing the sky is to find the area where the sky and the non-sky meet, it does not require precise segmentation. Therefore, after the pattern morphology processing such as eroding and dilating operations, the mis-segmented regions are eliminated, and the binary image after the sky segmentation is obtained. The effect after the segmentation is shown in Figure. 2(b), (d). In the neighborhood of the sky and non-sky junction, look for the brightest point in the dark channel map as an estimate of atmospheric light A, as shown in Figure 2(a), 2(c). (a)Input (b)Result (c)Input (d)Result Figure 2: Result sky segmentation At present, the estimation of dark channel maps generally adopts the method of He[4]. However, we study the distribution of fog distribution expressed by images and images by studying the fog concentration distribution map D(x) obtained by Yu Mingchen and his colleagues [11] in 2016. It is quite consistent, and it can maintain the edge information while also having smooth characteristics. Therefore, we do a minimum filtering on D(x) American Scientific Research Journal for Engineering, Technology, and Sciences (ASRJETS) (2019) Volume 51, No 1, pp 28-37 32 and get a new dark channel map, which is stronger than He’s method. The light interference is small, and the denser the fog, the larger the D(x) value. We estimate the atmospheric light in this new dark channel map. In Figure 3, we fixed the algorithm by the literature [5] and [14]. In other steps, the estimated value of atmospheric light A is changed to compare the superiority of the algorithm. (a)Result of [4] (b)Our result (c)Result of [13] (d)Our result Figure 3: Comparison after using our method to estimate atmospheric light A 2.2. Improvement and optimization of transmittance After determining the atmospheric light A, the initial estimation of the transmittance according to equation (5) is obtained [4]. ))(min(min1)(ˆ )( c c cxy A yIxt Ω∈ −= (5) ))(min(min1)(~ )( c c cxy A yIxt Ω∈ −= ω (6) In order to estimate the transmittance more accurately, we further optimize )(ˆ xt according to equation (6) to obtain ( )t x . The parameter ω is the limiting factor, which is used to control the degree of defogging. The closer it is to 1, the more obvious the defogging effect is. But at the same time, the image color tends to be over saturated. Because the intensity of the light emitted by the point source is inversely proportional to the square of the distance, that is, the visibility of the target decreases as the depth of field increases, and the intensity of the American Scientific Research Journal for Engineering, Technology, and Sciences (ASRJETS) (2019) Volume 51, No 1, pp 28-37 33 close distance decays rapidly, and as the distance increases, This rate of decay tends to be smooth, and this phenomenon is also in line with daily observations. Based on this optical characteristic, we appropriately adjust the parameter ω to limit the transmittance and prevent the image from being over saturated. According to the equation (7), it is divided into three segments. Each pixel points adaptively adjusts the parameter ω according to the mapping relationship between the transmittance and the depth of field, so that the final restored image can produce natural depth of field effects from far and near.       > + < = 65.0)(ˆ9.0 )(ˆ 05.0)(ˆ,7.0 2 xt elsecxta xt , ,ω (7) Since the depth d(x) is usually not easy to obtain, we use the initial estimated )(ˆ xt in equation (7) because the transmittance is negatively correlated with the depth of field. The farther the distance is, the smaller the transmittance is, Therefore, )(ˆ xt should be positively correlated with the limiting factor ω. The limiting factor ω is usually in the range of 0.7~0.9, so the first segment represents the distant view, ω should take a smaller value, here we take 0.7 (less than 0.7, the defogging effect is too weak), The parameters a and c of the second quadratic curve can be calculated from the endpoint coordinates (0.05, 0.7) and (0.65, 0.9) of the two labels in Figure. 4: a = 0.476, c = 0.6988, and the third segment indicates Closer view, visibility is higher, ω should be closer to 1, here we take 0.9. t(x) ω 1 0.95 0.9 0.85 0.8 0.75 0.7 0.65 10.90.80.70.60.50.40.30.20.10 Figure 4: Adaptive value of ω At this time, the transmittance we obtained is based on the block, which is rich in edge information, and leads to the halo effect after defogging. This requires optimization of the transmittance. Here we use Meng and his colleagues [5] the context regularization method based on L1 norm weighting proposed in optimizes the transmittance. Since the gross estimated transmittance has a halo effect at the scene edge where there is a large depth of field change, we hope to introduce a weighting function to constrain the adjustment. This distortion phenomenon protects the edge information of the image. Therefore, according to equation (8), the optimized American Scientific Research Journal for Engineering, Technology, and Sciences (ASRJETS) (2019) Volume 51, No 1, pp 28-37 34 transmittance is obtained by minimizing the objective function, so that the obtained transmittance can ensure continuous and smooth while retaining the image. Edge information: ∑ ∈ ⊗+− wj jj tDWtt 1 2 2 ||)(||||~|| 2 min  λ (8) Among them, the first term is the fidelity term, which is used to measure the fidelity of t(x) and ( )t x ; the second term is the context constraint of t(x), that is, the constraint condition of the objective function, and is also the L1 weighted regularization term. This item can be derived from equation (9): ∑∑ ∈ ∈ − Ii wj jiijji i ttw ||min , (9) ti and tj are adjacent pixels, which are replaced by a set of difference operators Dj, which is rewritten as the second term of equation (8). In literature [5], 8 Kirsch operators and 1 Laplacia operator are used. The set of higher-order difference operators of the group. The Wj in the equation (9)and ω in equation (8) represent weighting functions. The most important thing here is the construction of the weighting function, which determines the transmittance after regularization, and thus also The defogging effect of the final restored image. In [5], we construct according to the variance of the RGB vector values of adjacent pixels in the original image. Here we use another method to introduce the following formula to form the weighting function [10]. 1)))()((( −+−= εαyxwxy  (10) Equation (10) represents that the weighting function is constructed based on the difference in brightness of the neighborhood pixel points. The difference operator is added, and after rewriting, as in equation (11): -1)|(|)( εα +⊗= ijj DiW  (11) Then, according to the variable splitting method used in the literature [5], the auxiliary variable is introduced, the objective function is simplified, and the optimized transmittance is obtained through iterative optimization. Finally, using the guided filtering proposed by He and his colleagues [4] to refine the transmittance, and finally get t*. After many experiments, we found that the transmittance of the sky area obtained at this time tends to be low, which will lead to the sky area being over-enhanced. Therefore, the transmittance of the sky area should be further limited, as in equation (12):     = <−= elsextxt xtxtxt , ,, )()( )()4.0)(*2max()( * ** ss (12) American Scientific Research Journal for Engineering, Technology, and Sciences (ASRJETS) (2019) Volume 51, No 1, pp 28-37 35 (a)Transmittance before optimization (b)Result (c)Transmittance after optimization (d)Result Figure 5: Comparison of image defogging results after transmittance optimization There σ represents the average value of the t* at the junction of the sky and the non-sky. With the boundary line as the boundary, the sky area is treated in two cases. If the transmittance is less than the set threshold σ, it is processed according to equation (12), and the upper limit is added and set. 0.4, so that the region's t(x) is not too low. The defogged result obtained in this way is more real and natural than the pre-optimization of the transmittance, and the details are more abundant, as shown in Figure. 5. 3. Experimental results and analysis The general algorithm adds image enhancement methods such as gamma correction after image defogging. This paper does not add any post-correction. We have selected the classic haze test chart with sky area and the latest defogging database, and The dehazing results of He[4], Berman [14] and B. Cai [15] were compared, as shown in Fig. 6. The comparison shows that He has the weakest dehazing effect and the sky area is too bright; Berman has better defogging effect. However, there are also problems such as excessive fogging, insufficient overall color, over-saturation and darkness in the foreground, and inaccurate color recovery in the sky. B. Cai's method is generally effective, and the effect is not obvious in some images. Depth learning with deep learning requires a large number of real scene values, but it is more difficult to capture both foggy and fog-free images in the same natural scene, so the dataset is basically an indoor scene image plus artificial fog processing, which is natural. There is a deviation in the fog of the scene, so the algorithm is not effective in the natural scene. The method has the best restoration effect. While ensuring the image defogging effect, the color restoration is closer to the original image. At the junction of the sky and the non-sky, the details are richer and the color is more natural. The defogging effect of the whole image is very layered, more in line with the imaging principle and visual American Scientific Research Journal for Engineering, Technology, and Sciences (ASRJETS) (2019) Volume 51, No 1, pp 28-37 36 characteristics. Since some documents do not find the source program, in Figure 7 In addition, the results of the algorithm in Fattal [13] and Boyi Li [17] are compared as a comparison reference. We also used the fog-free density evaluator (FADE) proposed in [19], and used this objective evaluation method to analyze the dehazing results of Figure 6, as shown in Table 1. The evaluation method Based on the statistics of a large number of natural scene pictures and fog characteristics, the fog concentration in the image can be evaluated without reference. The larger the index value, the higher the image fog concentration; otherwise, the image fog concentration is low. Table 1: Referenceless Prediction of Perceptual Fog Density Figure He Berman B. Cai Our Manhattan 0.2205 0.1428 0.2696 0.1792 Hongkong 0.2456 0.1401 0.3415 0.2058 YT_Google_223 1.2438 0.5984 1.3414 0.4384 YT_Bing_639 3.1950 1.2731 1.3930 1.2553 YT_Google_590 1.5525 1.1888 2.0993 1.1826 Through Table 1, we find that in the mist image, the objective index of dehazing is not as good as that of Berman, but combined with subjective observation, the color restoration of the algorithm is more accurate, and the sky has not been enhanced, but the algorithm result of Berman The color is obviously distorted, which embodies the superiority of the algorithm in color recovery. In the dense fog image, the objective index of this paper is better, and while ensuring defogging, there is still no over-enhancement to the sky area, and no The phenomenon of color distortion. 4. Conclusion Aiming at the deficiency of key parameters estimation in atmospheric scattering and defogging model, a new estimation method is proposed. The effectiveness of this method is proved by a large number of experimental verifications and analysis. References [1] Singh D, Kumar V. Comprehensive survey on haze removal techniques[J]. Multimedia Tools & Applications, 2018, 77(8):9595-9620. [2] Liu H B, Yang J, Zheng-Ping W U, et al. A Fast Single Image Dehazing Method Based on Dark Channel Prior and Retinex Theory[J]. Acta Automatica Sinica, 2015, 41(7):1264-1273. [3] Tan R T. Visibility in bad weather from a single image[C]. Computer Vision and Pattern Recognition, CVPR 2008:1-8. [4] He K, Sun J, Tang X. Single image haze removal using dark channel prior[C]. Computer Vision and Pattern Recognition, 2009:1956-1963. [5] Meng G, Wang Y, Duan J, et al. Efficient Image Dehazing with Boundary Constraint and Contextual American Scientific Research Journal for Engineering, Technology, and Sciences (ASRJETS) (2019) Volume 51, No 1, pp 28-37 37 Regularization[C]. IEEE International Conference on Computer Vision. 2014:617-624. [6] J.H. Kim, J.Y. Sim, C.S. Kim, Single image dehazing based on contrast enhancement. 2011 ICASSP:1273-1276 [7] Park D, Park H, Han D K, et al. Single image dehazing with image entropy and information fidelity[C]. IEEE International Conference on Image processing. 2015:4037-4041. [8] Cui T, Qu L, Tian J, et al. Single image haze removal based on luminance weight prior[C]. IEEE International Conference on Cyber Technology in Automation, Control, and Intelligent Systems. 2016. [9] Narasimhan, Srinivasa G, Nayar, et al. Vision and the atmosphere[J]. International Journal of Computer Vision, 2002, 48(3):233-254. [10] Li Jiayuan, Hu Qingwu, Ai Mingyao, et al. Image Dehazing Combined with Sky Recognition and Dark Channel Principle[J]. Chinese Journal of Image and Graphics, 2015, 20(4): 514-519. [11] Ju Mingye, Zhang Dengyin, JI Yingtian. Image Dehazing Algorithm Based on Fog Concentration Estimation[J]. Acta Automatica Sinica, 2016, 42(9): 1367-1379. [12] Farbman Z, Fattal R, Lischinski D, et al. Edge-preserving decompositions for multi-scale tone and detail manipulation[J]. Acm Transactions on Graphics, 2008, 27(3):1-10. [13] Fattal R. Dehazing Using Color-Lines[J]. Acm Transactions on Graphics, 2014, 34(1):1-14. [14] Berman D, Treibitz T, Avidan S. Non-local Image Dehazing[C]. Computer Vision and Pattern Recognition. 2016:1674-1682. [15] Cai B, Xu X, Jia K, et al. DehazeNet: An End-to-End System for Single Image Haze Removal[J]. IEEE Transactions on Image Processing, 2016, 25(11):5187-5198. [16] Ren W, Liu S, Zhang H, et al. Single Image Dehazing via Multi-scale Convolutional Neural Networks[C]// European Conference on Computer Vision. Springer, Cham, 2016:154-169. [17] Li B, Peng X, Wang Z, et al. AOD-Net: All-in-One Dehazing Network[C]// IEEE International Conference on Computer Vision. IEEE Computer Society, 2017:4780-4788. [18] Zhang Dengyin, Ju Mingye, Wang Xuemei. A Fast Image Dehazing Algorithm Based on Dark Channel Priori[J]. Science Technology and Engineering, 2016, 43(20): 1437-1443. [19] Choi L K, You J, Bovik A C. Referenceless Prediction of Perceptual Fog Density and Perceptual Image Defogging[J]. IEEE Transactions on Image Processing, 2015, 24(11):3888-3901. [20] Swami K, Das S K. CANDY: Conditional Adversarial Networks based Fully End-to-End System for Single Image Haze Removal[J]. 2018.