Dehaze Enhancement Algorithm Based on Retinex Theory for Aerial Images Combined with Dark Channel ()

1. Introduction
Under foggy conditions, aerial images are severely degraded. Processing based on machine vision for image detection and recognition depends on the sharpness of the images captured by the imaging equipment. Therefore, the study of image sharpness has become one of the hot research topics in machine vision.
Image defogging is a method to remove unfavorable factors in an image that are unclear due to bad weather or a shooting device. When removing the effects of severe weather, such as rain and snow [1], haze [2], etc., leading to severe image quality, some researchers have used physical models [3] to study the causes of image degradation. He Kaiming (HE Kai-ming) proposed a method of image dehazing based on dark channel prior [4]. In order to reduce the complexity, Huang Darong uses wavelet thresholds to estimate the atmospheric light, then uses the atmospheric light to calculate the transmission map, and then uses the atmospheric light to restore the image [5]. Rajiv Kapoor uses the guidance filter to refine the transmission image based on the defogging of the dark channel. The limited contrast adaptive histogram equalization (CLAHE) is used to improve visibility and effectively reduce the halo phenomenon [6]. Other researchers have analyzed foggy images through the method of image enhancement [7]. The main reason for image quality is due to the decrease in contrast and brightness. Early image enhancement was enhanced by histogram equalization [8]. With different reasons for image degradation, Land and McCann proposed the retinal theory; Jobson et al. proposed the retinal enhancement algorithm (Retinex); Reitnex theory has better results in low contrast image applications, but due to the single-scale Retinex (Single Scale Retinex (SSR) algorithm [9] cannot take into account the contradiction between large-scale and small-scale at the same time in enhancing pictures. Later, on the basis of SSR, a multi-scale Retinex (Multi-Scale Reinex, MSR) theory was proposed [10]. Because the enhanced image cannot maintain color consistency, they also proposed a multi-scale Retinex (Multi-Scale with color recovery) Retinex with Color Restore (MSRCR) algorithm [11], which takes into account the dynamic range while maintaining color consistency. In 2017, LIU [12] obtained the MSR algorithm of more than 3 scales through mathematical derivation, which has a better effect on balancing dynamic range and color consistency. In order to further maintain the image edge details and texture details, PU proposed a fractional variational frame theory on the Retinex framework, thereby improving the texture details of the picture [13]. In the past 5 years, with the deepening of machine learning research, neural network-based defogging technology has also emerged. Among them, the defogging algorithm based on adversarial neural network [14] has excellent performance in defogging, but the data is not easy. Processing, and compared with the traditional defogging algorithm, the algorithm is not good in processing speed.
However, different algorithms perform differently in different foggy images. Based on the dark channel priors, they exhibit blockiness and inconsistent colors in aerial image dehazing, and the lack of dimming, while the typical Retinex algorithm shows the performance after fog removal. The image showed insufficient contrast and details were lost. Based on the Retinex algorithm model, this article combined the atmospheric scattering model to effectively estimate the fog-free incident light component and the fog-free reflected light component, and finally restored the fog-free image by the Retinex model.
2. Reitnex Theory
According to the Retinex physical model, the image acquired by the imaging device can be expressed as:
(1)
Among them,
is the foggy image,
is the incident light component,
is the reflected light component
To reduce the amount of calculation, convert the formula to the logarithmic domain, that is:
(2)
The core of traditional Retinex is to accurately estimate the incident light component. Generally, the input foggy image and Gaussian filter function are used to estimate the convolution operation, where:
(3)
is a normalization constant such that:
(4)
The single-scale Retinex (SSR) defogging operation can be expressed as:
(5)
Because single-scale Retinex (SSR) does not consider the influence of various scales on the defogging when estimating the incident light component, detailed information cannot be avoided. Therefore, researchers have proposed the concept of multi-scale, using three large, medium, and small scales to estimate the incident light component, and finally the idea of image fusion. The weighted average of the defogging results at each scale is within the dynamic range. Reduce fog while reducing loss of detail information. Multi-scale Retinex (MSR) mathematical expression is as follows:
(6)
where
is the weight value.
Multi-scale Retinex with color recovery (MSRCR) adds a color recovery factor to eliminate the color distortion of the image after defogging. Its mathematical form is as follows:
(7)
Traditional MSRCR uses a pair of gain and offset to perform linear transformations to transform the output domain of multi-scale Retinex (MSR) into the display domain. Its mathematical form is as follows:
(8)
3. Atmospheric Scattering Model
McCartney et al. Described the causes of image degradation based on atmospheric scattering phenomena and constructed an atmospheric scattering model. The phenomenon described by the atmospheric physical scattering model is shown in Figure 1.
During the transmission of a beam of parallel light, its energy must be scattered due to the small particles in the atmosphere. If the length of the scattering medium is x, the mathematical expression of its attenuation model is:
(10)
where
is attenuated light,
is incident parallel light,
is attenuation index, and d is called depth of field distance.
The atmospheric light intensity received by the imaging device after the atmospheric light passes through the transmission path is:
(11)
the total light intensity is:
(12)
let
,
,
. Then the simplified calculation formula is as follows:
(13)
Dark Channel Prior Theory
Kaiming-He et al. Conducted statistics on the dark channels of a large number of fog-free images without sky areas, and found that the pixels of each area have
a gray value of 0 or near 0 in at least one color channel. Based on this prior knowledge, put forward the dark channel theory.
(14)
Among them,
represents the R, G, and B color channels of the foggy image,
is a window centered on x; c is the three color channels. In the non-sky area of the fog-free image, the gray value of the dark channel is very low, that is
. According to the atmospheric scattering model formed by the fog image, if the fog is to be removed, two parameters need to be taken-the atmospheric light value. A and transmittance
. Kaiming-He et al. first assumed that the atmospheric light value A is a known quantity. Based on this assumption, the dark channel operation can be obtained:
(15)
Take the minimum value of the brightness in the local area of the three RGB channels and redefine the transmittance. The mathematical form is as follows:
(16)
According to prior knowledge:
(17)
Due to the presence of various small particles in the sky area leading to scattering phenomena, adjustment parameters are introduced to maintain the authenticity of the image after defogging, which is:
(18)
After the atmospheric light value A and transmittance are known, a restored fog-free image can be obtained, namely:
(19)
The result after defogging through the dark channel prior algorithm is shown in Figure 2.
4. Retinex Defogging Algorithm Combined with Dark Channel Model
Because the Retinex algorithm model is based on the principle of constant color enhancement and defogging, there is no analysis of the essential reason for the formation of fog. By adjusting the contrast and brightness of the image to achieve the effect of defogging enhancement, over-enhancement will occur. The dark channel prior defogging algorithm fully analyzes the cause of the formation
![]()
Figure 2. Prior defogging results of dark channel.
of fog and understands the nature of its formation. However, due to insufficient estimation of transmittance, the image processed by the dark channel prior defogging algorithm will appear darker. Holo effect and other issues. This section fully combines the advantages of the two defogging models. Based on the Retinex model, the dark channel defogging algorithm is used to analyze the nature of the fog, while maintaining higher contrast and brightness while defogging. The processing flow is as follows Figure 3.
The dark channel prior principle is developed based on the atmospheric scattering model, and the Retinex model is similar to the atmospheric scattering model. The Retinex model is equivalent to the attenuation model in the atmospheric scattering model. Atmospheric scattering model to estimate the incident light in the Retinex algorithm is a combination of the two algorithms. The mathematical forms of the two models are as follows:
(20)
where
is the fogged image obtained by the imaging device,
is the incident light component of the image after defogging, and
is the reflected light component after defogging. Assuming that the defogged images of the two models can simultaneously meet the images collected under sunny weather conditions, there are:
(21)
Among them,
is a fog-free incident light component, and
is a fog-free reflected light component. From the foggy image
,
can be effectively separated to achieve the purpose of defogging.
The Retinex model of the foggy image according to the above formula can be
![]()
Figure 3. Retinex + DCP defogging process.
expressed as:
(22)
It is known from Retinex theory that the foggy incident light component
can be obtained by Gaussian blurring of foggy images. Retinex can meet the dynamic range compression, enhance the details and maintain the color balance. Then the incident light component
of the foggy image can be obtained by the following formula:
(23)
where
is the Gaussian surround function and n is the number of scales.
The fog reflection map can be obtained by the principle of atmospheric light scattering, namely:
(24)
Solve the fog-free reflection map
through the fog reflection map
, and use the dark channel dehazing principle to determine the atmospheric transmittance
and the atmospheric light value
. The experimental results show that when
, the calculation amount can be reduced, and at the same time, a good Defog effect. According to the dark channel defogging theory, its transmittance is obtained:
(25)
The Retinex model is used to separate foggy reflected light components. The foggy reflected light component can be obtained by logarithmic transformation, which has the form:
(26)
where
is obtained from the fog reflection light component obtained by it:
(27)
Finally, through the Retinex physical model, the components of the fog-free incident light and the fog-free reflected light are multiplied to obtain a fog-free image after defogging.
5. Experimental Results and Evaluation
In order to verify the effectiveness of the algorithm proposed in section 3, this algorithm uses Microsoft Visual Studio 2015 development platform and Open CV tripartite library. The computer's configuration is 4GB, operating system: Windows 10 (64-bit) for verification. The algorithm of this paper is used to enhance the defogging. The processing result and the corresponding gray histogram are shown in the following Figure 4.
5.1. Subjective Evaluation
Compare the pros and cons of the effect after image processing. Because the
![]()
Figure 4. Experimental results of the algorithm in this paper.
subjective evaluation is simple and fast, it can reflect the first sense of the processed image for various tasks, which will help researchers to take advantage of the masses in subsequent research. It is beneficial for related personnel to have better visual effects when applying these images. The experimental images in this paper use the characteristics of low fog density, low contrast and overall graying. It can be seen from the histogram display that the histogram of the algorithm results in this paper is more evenly distributed and the gray levels are more obvious, which makes the recognition of ground objects very high. However, the gray level of the original image in this experiment is concentrated in a certain area, and the image shows underexposure, and the graying phenomenon is serious.
As shown in Figure 5, the image obtained by the algorithm in this paper has higher contrast and color vividness. Effectively avoid the under-estimation of the dark channel algorithm in the sky region and the phenomenon of Retinex over-enhancement. And it effectively removes the interference of fog, which greatly improves the visual effect of the overall image.
As shown in this paper, various image dehazing methods are used for horizontal comparison, including the method of Fattal et al. in the literature [3], the method of Tarel et al. in the literature [15], and the standard dark channel dehazing algorithm, NASA The defogging enhancement algorithm based on Retinex theory, by reproducing its algorithm, is compared with the results of the algorithm in this paper. The results are shown in Figure 6, and Figure 6(a) is the original image. From left to right, the defogging results of different algorithms. The experimental images in this paper are all with high fog concentration and low visibility. As a whole, the Fattal algorithm has average defogging ability, and the sky area is completely distorted. The Tarel algorithm still has a large amount of fog remaining, and does not show a good defogging effect. The HE algorithm performs well in defogging, but the overall color of the defogging image obtained is dark, as shown in Figure 6(d-3) and Figure 6(d-4). The image itself has low brightness and poor visual effects. The Retinex algorithm uses excellent image performance in this paper, but still cannot retain the authenticity of the sky area. At the same time, the contrast shown in Figure 6(e-2) and Figure 6(e-4) is too high, and there is an over-enhancement phenomenon. There is a
phenomenon of color distortion. The algorithm proposed in this paper performs well in defogging performance, with higher color fidelity and rich levels.
5.2. Objective Evaluation
The SSIM evaluation factor is the result of multi-information fusion. The mean, variance, and covariance of the image are required. The brightness, contrast, and structure of the image are integrated to form a comprehensive SSIM evaluation index.
By comparing the evaluation factors of the images of the results of different algorithms, the quality of the image can be objectively evaluated. The higher the average gradient and the SSIM score, the higher the quality of the image. The original images in the figure are selected as a (1,2), a (1,3), a (1,5) and evaluated as comparative images. The results are shown in Table 1.
According to Table 1, it can be concluded that the average gradient (avgGradient) and structural similarity (SSIM) of the algorithm in this paper exceed the other algorithms in scores. The image processed by this algorithm maintains the original image structure while dehazing and has more details Information, at the same time, it has a higher global and local contrast, removes the graying phenomenon of the original image, the color distortion is small, and there is no color distortion and halo in the sky area, while avoiding the phenomenon of excessive enhancement of the Retinex algorithm, Effectively improve the visual effect of the image.
6. Conclusion
Aiming at the phenomenon that the single Retinex defogging algorithm has
![]()
Table 1. Algorithm comparison evaluation index results.
insufficient defogging capacity and over-enhancement, based on the channel-based prior defogging algorithm, the brightness of the aerial image after defogging is low, and the sky area has poor performance of color shift and halo phenomenon. In this article, according to the characteristics of the two models, the aerial image is separated into foggy incident light component and foggy reflected light component. Using the dark channel defogging algorithm, the atmospheric light value and transmittance of the fog incident light component and the fog reflected light component are re-estimated, respectively, to obtain new fog-free incident light component and fog-free reflected light component. The fog-free image obtained by Retinex physical imaging model has higher contrast and brightness. Experiments on the algorithm proposed in this article verify the effectiveness of the proposed algorithm. Through subjective and objective evaluation with a variety of existing defogging algorithms, the algorithms presented in this article have significantly improved the defogging capabilities of aerial images, with higher contrast and color saturation.