Image defogging method for road traffic in haze days

Haze weather conditions, reduced visibility and poor line of sight will seriously affect driving safety. In the case of haze weather, the weather obscures the field of vision, the quality of collected images is significantly reduced, and the working efficiency of intelligent transportation system is low, based on the a priori defogging algorithm of dark channel, this paper explores the image restoration method combined with image region segmentation, and optimizes it from the perspective of traffic application, so as to obtain better processing effect. The research shows that this method makes the image details more prominent after defogging, has better visual effect and time performance, and is conducive to target detection in haze weather.


Introduction
The research on road traffic image defogging in haze weather has attracted more and more attention of scholars. As the haze weather obscures the field of vision and reduces the visibility, it is not conducive for the driver to find the surrounding abnormalities in time, resulting in an increase in the probability of road traffic accidents.Generally, due to the influence of haze weather, the image contrast and color distortion obtained by on-board video will seriously affect the effect of target detection and tracking during driving. Therefore, people pay more and more attention to the exploration of image defogging algorithm.
At present, there are three kinds of commonly used image defogging methods: image enhancement method, depth learning model defogging method and physical model defogging method. Retinex algorithm is commonly used in image enhancement methods [1] . It mainly solves the problem of image blur by removing image noise and improving local or global contrast, but this method is easy to cause information loss and has general effect; with the development of deep learning theory, many defogging models based on deep learning have been proposed in recent years. Although these models can achieve good results on virtual images, the training samples are often synthetic and not taken in the real world, so the effect is often unsatisfactory in practical application; based on the principle of image degradation, the physical model defogging method defogs the image through data mining or prior knowledge.
He [2] proposed a single image defogging algorithm based on dark channel a priori according to the statistical law of outdoor images. Dark channel a priori defogging algorithm is often used for outdoor single image defogging, which is often used in traffic scenes. The video images collected in real time on the road are often affected by micro particles such as dust and water vapor in the air medium. Therefore, the reflected light generated by the object will degrade with the distance from the acquisition equipment. In addition, the mixture of object reflected light and atmospheric ambient light will also weaken the contrast of the collected image. At present, there is no specific defogging algorithm for the driving characteristics in smog days. In view of the problems existing in the current defogging algorithm, in order to better serve the road traffic, the defogging algorithm needs to be optimized to enhance the 2 defogging effect and improve the optimization efficiency. This paper attempts to explore the road traffic defogging algorithm based on the dark passage prior algorithm and combined with the sky region segmentation.

Single image defogging algorithm
In the field of image defogging, MC Cartney proposed a fuzzy image degradation model, that is, the formula of atmospheric scattering model in fog, as shown in (1): In this model, I represents the observed brightness; J represents scene brightness; t is the transmittance, between 0 and 1. In fact, the value of t is related to the distance; A is the global atmospheric light, which is a constant. In this model, the defog Image J can be obtained as long as the global atmospheric light A and the transmittance t(x) corresponding to the pixel are estimated.
When the atmosphere is uniform, the transmission coefficient t can be expressed as formula (2): Among them, β Represents the scattering coefficient of the atmosphere, and d is the distance, from the scene target to the image acquisition equipment. The equation indicates that the scene brightness decays exponentially with depth. In haze weather, the atmospheric transmittance is low, close to 0, and the value of I (x) is basically determined by the atmospheric brightness A. therefore, a large amount of white appears in the captured image, so it is difficult to collect scene information.
He et al put forward the a priori theory of dark primary color. The dark primary color image can be obtained by local minimum filtering on the foggy image. For any image J, the dark channel can be defined as formula (3): Among (y) Is the brightness of position y corresponding to channel c of Image J;c Represents a channel of the image. In this model, the image uses RGB model, so c represents one of the three channels R, G and B;Ω(x) represents a neighborhood of a pixel.Then the dark channel corresponding to a pixel x ) The value of is the smallest luminance value in the three channels in the neighborhood of x. If J is an outdoor fog free image, except for the sky area, the dark channel intensity of J is relatively low and tends to 0, then formula (4) can be obtained: → 0 (4) He called this hypothesis a dark channel a priori. However, the dark channel a priori is not a good a priori method for the sky region. The reason is that the color of the sky region is close to white, and there must be a large number of high brightness regions in the corresponding dark channels in a large number of sky regions. Therefore, the dark channel a priori assumption has a very large error in the sky region, and the dark channel intensity in these regions cannot be regarded as 0.
In fact, in sunny weather, there are no particles in the atmosphere. When people look at distant targets, they will still be affected by particles in the air.Therefore, defogging algorithms often can not remove all haze, that is, the value of transmittance can not be set too high.For this purpose, he sets a value for the value of transmittance (0< ≤1), The value used to correct the transmittance, and the corrected transmittance estimation method is used to obtain formula (5): In this way, part of the haze can be retained in the area with the most serious haze in the distance in the image, and the transmittance of the distant scenery can be limited, so that the image after defogging can retain a certain sense of reality.According to he's research,The value of is usually taken as 0.95, and in some later improvements, it is also commonly used as 0.92.As shown in Figure 1, in the outdoor scene with sky area, some values in the dark channel will be highlighted. In this case, the a priori assumption of the dark channel will fail. In addition, the speed of dark channel method is slow and it is difficult to achieve real-time, but realtime is a hard requirement in road traffic. From the perspective of application, the algorithm is improved to a certain extent to solve the problem of image enhancement in haze environment and make the image details more prominent, which is conducive to target detection in the process of driving. Wang Shiyi [3] proposed a method for obtaining local atmospheric light based on Gaussian convolution. In this paper, it is considered that the atmospheric light a is recognized as a constant without considering that the atmospheric light in the local environment may be different, so the author puts forward a method to obtain the local atmospheric light. The author uses a 3x3 sliding window with a sliding distance of 1 each time to calculate the local atmospheric light at the center of the window. [4] A method for segmenting the sky region is proposed. The method considers that the sky region is relatively smooth and the gradient of the sky region is different from that of other regions, so as to recognize and segment the sky region by setting the threshold for binarization.For the video image collected by the vehicle video in the haze weather in road traffic, the sky area is generally distributed in about two-thirds of the area above the image.The areas threatening the moving vehicles are usually concentrated in the road area, that is, below the video content. Therefore, try to set a "skyline" in the original image. It is considered that the part above the skyline is the sky or buildings, and the area below the skyline is also the actual key processing area. The part above the "skyline" is not processed, This can not only speed up the program processing speed, but also avoid the sky area to a certain extent. The experimental effect is shown in Figure 2. (b) The selection height of "skyline" in is 50% of the whole image, and the area below the skyline is defogged. Thus, the execution efficiency of the algorithm is accelerated, and the sky region will not affect the defogging effect of the main part of the image.

Optimization of image defogging algorithm for road traffic
In road traffic, the change between two or more consecutive frames of images obtained by on-board video is very small, and the difference between images is small. It can be considered that the change of dark channel between similar images is also limited. Therefore, several consecutive frames of images can be defogged directly. It is found that when the reuse times of defogging parameters are small (no more than 4 times), it has no significant effect on the defogging effect.
As shown in Fig. 3, by observing the position of plants and trees on the right side of Fig. (b) and Fig.  (c), it can be found that these are two different frames. They share the defogging parameters of Fig. (b) for defogging, and it can be found that the defogging effect is hardly affected. At this time, the maximum reuse times of selecting defogging parameters is 2, which reduces the time of extracting defogging parameters once, and most of the time consumption of defogging process is concentrated in the first step. At this time, the algorithm can reduce the time consumption by nearly half. However, when the defogging parameters are reused for the sixth time, if a target changes greatly from extracting the defogging parameters to using the defogging parameters, it is easy to produce a "ghost" phenomenon in its original position,as shown in Figure 4, this is due to the "fog circle" phenomenon caused by the small value here in the dark channel extraction, and the "fog circle" is not consistent with its target position, so a "ghost" is generated.Through experiments, it is found that the best effect is to reuse the defogging parameters 2 to 4 times. Experiments show that under this method, the speed of defogging process is significantly accelerated, and the speed even exceeds the original algorithm of dark channel a priori. The comparison of defogging effect and time with different algorithms is shown in Table 1: Through comparison, it can be found that the original defogging algorithm is relatively soft, has good defogging effect for close range and large targets, and does not emphasize details; Local atmospheric light + bilateral filtering pay more attention to details after defogging, which has a certain enhancement effect on the image;The proposed new algorithm has the most obvious fog effect, the strongest enhancement effect and the most obvious noise.
Through experimental observation, it can be seen that after defogging algorithm, the target in the image becomes clear. At this time, the designed system can detect the target that is difficult to be found by the naked eye.The white vehicle in the image is changing lanes, and its movement trend may pose a threat to the driving vehicle and there is a risk of traffic accidents, which can be detected;The black vehicle in the distance ahead is difficult to distinguish in the original image, and its contour has become clear after enhanced by the defogging algorithm, which can be captured by the detection method used;The pedestrians riding motorcycles are not detected because they move slowly and have no lane change trend, so the algorithm considers that the target is not threatened.
In addition, He proposed to conduct guided filtering on the dark channel in the original algorithm. Wang weipeng [5] proposed to conduct bilateral filtering on the dark channel to make the dark channel smooth and fuzzy, and the bilateral filtering belongs to boundary preserving filtering, which can preserve the boundary and part of the texture in the image while blurring the image, In this way, the dark channel can be blurred without destroying the position characteristics of the dark channel generated by different targets.

Conclusion
Based on the dark channel a priori defogging algorithm, the algorithm content is improved, and a new single image defogging method with visual effect and time performance better than the original algorithm is found. However, the noise and slow running speed restrict the performance of the algorithm and need to be further improved.