Abstract

To solve the color distortion problem produced by the dark channel prior algorithm, an improved method for calculating transmittance of all channels, respectively, was proposed in this paper. Based on the Beer-Lambert Law, the influence between the frequency of the incident light and the transmittance was analyzed, and the ratios between each channel’s transmittance were derived. Then, in order to increase efficiency, the input image was resized to a smaller size before acquiring the refined transmittance which will be resized to the same size of original image. Finally, all the transmittances were obtained with the help of the proportion between each color channel, and then they were used to restore the defogging image. Experiments suggest that the improved algorithm can produce a much more natural result image in comparison with original algorithm, which means the problem of high color saturation was eliminated. What is more, the improved algorithm speeds up by four to nine times compared to the original algorithm.

1. Introduction

The images taken by cameras in foggy weather are born with poor visibility and low contrast, which makes lots of trouble to image segmentation and target detection in video surveillance system and makes various outdoor monitoring systems, such as video surveillance system, unable to work reliably in bad weather. Therefore, it is an important research topic to improve the reliability and robustness of the outdoor monitoring system with simple and effective image defogging algorithm. Many researchers have made extensive studies and achieved a series of theoretical and application results [119].

Image defogging methods fall into two categories [20, 21]: image enhancement and physical model-based restoration. The image enhancement method does not consider the cause of image degradation in foggy weather, only dealing with the characteristics of the foggy image with high precision and low contrast. This can weaken the fog effect on images, improve the visibility of scenes, and enhance the contrast of images. The most commonly used method in image enhancement is histogram equalization, which can effectively enhance the contrast of images, but owing to the uneven depth of scenes in foggy images, namely, different scenes are affected by fog in varying degree, global histogram equalization cannot fully remove the fog effect, while some details are still blurred. In literature [22], the sky is first separated by local histogram equalization, and then depth information matching is obtained skillfully in the non-sky zone by a moving template. This algorithm overcomes the shortcoming of the global histogram equalization for the detail processing and avoids the influence of the sky noise. But when this algorithm is applied, subimage selection easily leads to block effect and thereby cannot improve the visual effect considerably.

The physical model-based restoration method analyzes and processes the degradation process of foggy images in depth. To solve the problem of degraded image restoration, it first analyzes the inverse generation process of degraded images and builds a model for the effect of atmospheric scattering on the attenuation of image contrast. Generally speaking, since the degradation of physical process is considered, foggy images can be enhanced more effectively in this way than simple image processing. Yitzhaky et al. [23] were the first to consider the cause of foggy image degradation. Based on the detailed analysis of the influence of atmosphere on image degradation, an image degradation model was proposed. The effect of the atmosphere on the degradation of the image is considered as a degraded system, which can be used to eliminate the influence of weather factors on the image. However, since the key to building an image degradation model is to determine an atmospheric modulation transfer function and that the ratio of the effect of atmospheric turbulence and aerosol particles in the atmospheric modulation transfer function has something to do with the meteorological conditions of image photographing, the corresponding local meteorological parameters should be acquired from the meteorological station. However, these parameters are usually hard to get due to the harsh additional conditions.

In recent years, He et al. [24] proposed an algorithm based on dark channel a priori, which has attracted broad attention for its simplicity and efficacy. Dark channel a priori enables quick acquisition of transmissivity corresponding to each point from the original image, thus making real-time defogging possible, which is a premium feature for outdoor surveillance. Its practical application, however, usually produces results that are affected by color oversaturation, leading to image distortion. For this reason, this paper proposed an improved algorithm. First, incident light frequency’s effect on the transmittance of various color channels was analyzed according to the Beer-Lambert Law, from which a proportion among various channel transmittances was derived; after that, images were preprocessed by downsampling to refine transmittance, and then the original size was restored to enhance the operational efficiency of the algorithm; finally, the transmittance of all color channels was acquired in accordance with the proportion, and then the corresponding transmittance was used for image restoration in each channel.

The remainder of this paper is structured as follows. Section 2 outlines the principle of the defogging algorithm based on dark channel prior; Section 3 analyzes the shortcomings of the original algorithm and derives an improved algorithm; Section 4 proves the validity of the improved algorithm by comparing it with the existing algorithms in experiments.

2. Dark Channel Prior-Based Defogging Algorithm

2.1. Atmospheric Scattering Model

The atmospheric scattering model proposed by Narasimhan et al. [2529] describes the degradation process of foggy images:where represents the intensity of the image observed, represents the intensity of scene light, represents the atmospheric light at infinity, and is known as transmittance. The first equation item is an attenuation term, and is an atmospheric light item. The aim of image defogging is to restore from .

2.2. Dark Channel Prior

Dark channel prior knowledge comes from statistical observations of a great many outdoor fogless images. It shows that in most images there are always some pixels that have a small value on a color channel. This prior knowledge can be defined as follows:

represents a color channel of , while is a pixel centered square area. Suppose is an outdoor fogless image, and is a dark channel of , and the above experiential law obtained by observations is known as dark channel prior. Dark channel prior knowledge indicates that the value of is always very low and close to 0.

2.3. Defogging by Dark Channel Prior

Suppose that atmospheric light has been fixed; then suppose transmittance is constant in a local region. The minimum operator is adopted for (1), and meanwhile is divided, reducing towhere superscript denotes the component of a certain color channel and denotes a roughly estimated transmittance. The minimum operator is adopted for color channel , so

According to the law of dark channel prior, the dark channel item in the outdoor fogless images should approach 0:

A rough transmittance can be estimated if the above equation is substituted into (4):

It has been discovered that in the practical application if the fog is removed thoroughly, an image will, however, look unreal, and depth perception will be lost. Therefore, constant can be introduced to (6) to retain some fog:

Transmittance can only be roughly estimated according to the above equation, so to improve the accuracy, the original paper used an image matting algorithm [30] to refine the transmittance. The following linear equation can be solved to refine the transmittance:where is a corrected parameter and is the Laplacian matrix proposed by the image matting algorithm, which is usually a large sparse matrix.

After a refined transmittance is obtained, the equation below is used to calculate the resulting image of defogging:where atmospheric light is estimated this way: sort the pixels in dark channel in descending order by brightness value, compare the brightness value of the corresponding points of the first 0.1% pixels in the original image , and finally take the brightest point as atmospheric light .

For most outdoor foggy images, the above algorithm can achieve a good defogging effect, but color distortion or excessive color saturation may be caused when this algorithm is used to process some images. Moreover, the algorithm runs very slowly. For instance, it will take 39.96 seconds to process an image with a size of . To solve this problem, this paper improved the original algorithm.

3. Incident Light Frequency-Based Algorithm

The imaging formula popular in the machine vision field is adopted in the existing defogging models [2529], which was derived based on the Beer-Lambert Law [31]:where represents the brightness value of the pixel at coordinate in the image, represents the reflection coefficient of various body surfaces, and is transmittance , which represents the attenuation degree of energy when light propagates in atmosphere.

As can be seen from the proof procedure of the Beer-Lambert Law, transmittance is derived from the equation below:where represents incident light frequency, represents a certain point on the propagation path of incident light. As shown in (11), transmittance is related to the medium attribute of each point on the propagation path of incident light.

3.1. Original Algorithm Hypotheses

To reduce the complexity of the existing defogging model, two hypotheses are made on transmittance in it.

3.1.1. Constant Frequency

When incident light frequency is constant, (11) is simplified into

As can be seen in the equation above, the medium attribute function on the propagation path is simplified from bivariate function into single-variable function .

3.1.2. Homogeneous Atmospheric Media

Suppose there are homogeneous atmospheric media on the propagation path of incident light; then (12) is further simplified intowhere represents the field depth at point in the image, namely, the spatial distance between object and imaging device.

3.2. Improvement Direction

Although the above two hypotheses have greatly simplified the complexity of the defogging model, they also reduce the quality of defogging. To further improve defogging quality, we reintroduced the effect of incident light frequency on attenuation coefficient into atmospheric light imaging formula (10), thus further improving the atmospheric light imaging formula, as shown below:

At this point, attenuation coefficient is turned into the function of incident light frequency .

According to the distance between object and imaging device (field depth), foggy images can fall into three categories.

(i) Long-Field Images. The overwhelming majority of scenes in the images are in the range of long-field depth (objects are over 500 m away from the camera).

(ii) Short-Field Images. The overwhelming majority of scenes in the images are in the range of short-field depth (objects are less than 500 m away from the camera).

(iii) Mixed-Field Images. Long and short-field scenes exist side by side in the images.

For long-field images, since field depth has increased, the concentration of fog on the propagation path of incident light will show increasingly complex changes with distance increasing. So, the prerequisites for the tenability of (14) are as follows: media are no longer uniformly distributed on the propagation path of light, and a new atmospheric light model needs to be built. According to the observation of the real world, if an observed object is farther away from the observer, the light from it will be harder to discover and thereby be replaced with atmospheric light (the sum of the various light beams from the environment that interact with each other). Thus, the analytical processing of such images can be translated into that of atmospheric light distribution.

For short-field images, due to the small field depth, the concentration of fog within this range can be considered constant, so such foggy images can be processed by (14).

For mixed-field images, zones can be partitioned according to field depth, and then images can be processed separately by scene types.

This paper proposed an improved method for the processing of short-field images. As can be seen from (14), the key to the processing of short-field images lies in the calculation of attenuation coefficient . That is the focus of research in this paper.

3.3. Attenuation Coefficient

Since only the incident light from such three frequency bands as red (R), green (G), and blue (B) is imaged by a sensing method in the current cameras, the analysis of can be limited to R, G, and B. A typical frequency value is fetched, respectively, from R, G, and B, which correspond to attenuation coefficients , respectively. The value of attenuation coefficient can be calculated by the analytical statistics of the attenuation of pure light R, G, and B in foggy weather.

After the value of is calculated, their ratio can be computed. The result is denoted by

The statistical experiment shows that the effect of image restoration is comparatively ideal when .

Suppose it is known that some color channel’s transmittance ; other channels’ transmittance can be calculated by it:where .

As can be seen in the equation above, once a color channel’s transmittance is worked out, other color channels’ transmittance can be calculated according to it, as shown below:

3.4. An Improved Image Restoration Method

Based on the analysis above, this section put forward a new transmittance calculation method.

The main steps are shown as follows:(1)Reduce image size, desampling the input image to .(2)Acquire dark channel pixel value and its color channel according to the formula below:(3)Calculate the transmittance corresponding to the color channel in which the dark channel is located using the formula below:(4)Use (8) to refine transmittance into .(5)Restore to the size of the original image by interpolation and get .(6)Calculate the transmittance of all color channels by (17).(7)Restore original image in all color channels using the formula below:

The rough operating process of the defogging algorithm is shown in Figure 1.

4. Experiments and Analysis

To test the effect of this algorithm, this paper selected six images: Tiananmen (); House (); Swan (); Sweden (); NY (); Gugong ().

To prove the superiority of the proposed algorithm, four famous defogging algorithms, CLAHE [19], Tarel’s [18], Meng’s [17], and He’s [24], were used. The code of CLAHE was downloaded from Xu’s Website [32], and the parameter ClipLimit used by this algorithm is set to 0.02. The code of Tarel’s algorithm was downloaded from Tarel’s Website [33], the percentage of restoration is set to 0.95, balance is set to 0.5, smax is set to 1, and factor is set to 1.3. The code of Meng’s algorithm was downloaded from Meng’s home page [34], the parameter method of Airlight function is set to our, and the Window size is set to 15. The parameter C0 of Boundcon function is set to 30, C1 is set to 300, and the Window size is set to 3. The parameter lambda of CalTransmission function is set to 2 and param is set to 0.5; the parameter delta of Dehazefun function is set to 0.85. The code of He’s algorithm was implemented by MATLAB code, the Window used for dark channel calculation is set to , and used in (6) is set to 0.95. The soft matting algorithm [30] is used to optimize the transmittance result.

The experimental platform we used: hardware platform is Intel(R) Core(TM) i3-3220 CPU with a basic frequency of 3.3 GHz, 8 G memory with a basic frequency of DDR3 1600 MHz, software platform is MATLAB R2016a 64-bit.

Image matting was adopted to refine transmittance in the original algorithm [24]. But this method essentially has high time complexity and space complexity since it is usually used to solve large-scale sparse linear equations. However, the effect of this step on restoration is no more than softening the edge of the transition region between foreground and background to weaken edge effect. Thus, the algorithm proposed in this paper reduces image size significantly, then refines transmittance by image matting, and finally restores the refined transmittance image to the original size by tricubic interpolates.

Figure 2 is a comparison of transmittance between the improved algorithm and the original algorithm. As can be seen in the figure, there is little difference between both in edge softening. However, size reduction can help greatly improve the computational efficiency of restoration algorithm.

As can be seen from Table 1, He’s algorithm consumes the most time; it takes nearly 70 seconds to process an image with size of (typical size of monitor image). CLAHE algorithm consumes the least time, but the defogging effect is very poor because of the serious color distortion. Tarel’s algorithm has the same problem of color distortion as CLAHE. Meng’s algorithm and our algorithm consume almost the same time and both have good defogging effect. However, as can be seen from the local magnification result, Figure 4, our algorithm is better than Meng’s algorithm in detail. It also can be seen that, by downsampling before refining transmittance, the time of the operating efficiency of our algorithm is 49 times as high as that of the original one.

According to the results before and after improvement shown in Figure 3, after the transmittance of multiple channels is corrected, the algorithm proposed in this paper solves the problem of slightly higher color saturation in the existing algorithm and achieves a better and more natural visual effect than the original algorithm.

5. Conclusions

This paper made a theoretical analysis and experimental observation of the dark channel prior-based defogging algorithm, discovering from its theoretical basis that the existing algorithm ignores the effect of incident light frequency on transmittance. Therefore, this paper started with the derivation process of transmittance to reversely derive the relation between various channel transmittances to enhance the defogging algorithm. The experimental results suggest that this improved algorithm can achieve a more natural color effect in the restoration result. Since roughly calculated dark channel was still used to compute the relationship between various transmittances, a slight block effect appeared in our restoration result. The proposed algorithm will be improved in the next work to eliminate the block effect.

Conflicts of Interest

The authors declare that they have no conflicts of interest.