Transfer from http://www.cnblogs.com/Imageshop/p/3307308.html
In the field of Image de-fog, few people do not know the "single image Haze removal Using Dark Channel Prior" article, which is the 2009 CVPR best paper. Dr. He Keming, who graduated from Tsinghua University in 2007 and graduated from the Chinese University of Hong Kong in 2011, is a deep-rooted, lamented the level of some of the so-called Ph. D. In China, so the doctor can truly be called Doctor.
For some of Dr. Ho's information and papers, you can visit here: http://research.microsoft.com/en-us/um/people/kahe/
The first contact of the paper was in 2011, said the real time, just casually browse the next, see inside the soft matting process is more complex, and execution speed is very slow, there is no big interest. Recently and occasionally picked up, carefully studied, I think the reasoning steps of the paper is particularly clear, the explanation is in place. coincided with a visit to one of its other articles, Guided Image Filtering, which mentions the process of using guided filtering instead of the soft matting, and is very fast, so my interest in de-fog algorithm has been greatly improved.
This article is mainly on the "single Image Haze removal Using Dark Channel Prior" translation, collation, and part of the interpretation. If your English level is good, suggest that the original text may come to be more cool.
A brief description of the thesis thought
First look at what the Dark channel priori is:
In the vast majority of non-sky local areas, some pixels will always have at least one color channel with very low values. In other words, the minimum value of light intensity in this area is a very small number.
We give a mathematical definition of the dark channel, and for any input image J, the dark Channel can be expressed as follows:
JC represents each channel of a color image, and Ω (x) represents a window centered in pixel x.
Formula (5) of the meaning of the code is also very simple expression, first of all the RGB components of each pixel in the minimum value, deposited a pair and the original image size of the same grayscale image, and then the grayscale image of the minimum filter, the radius of the filter is determined by the window size, generally windowsize = 2 * radius + 1;
The theory of dark Channel transcendental suggests that:
In real life, the low channel value of the dark primary color is mainly three factors: a) The shadow of a car, a building and a glass window in a city, or a projection of a natural landscape such as a leaf, tree, or rock; b) A brightly colored object or surface with a low value for some of the three channels of RGB (e.g. green grass/trees Red or yellow flowers/leaves, or blue water); c) darker objects or surfaces, such as dark-coloured trunks and stones. In short, the natural scenery everywhere is the shadow or the color, these scenery's image's dark primary color is always very gloomy.
We put aside the examples listed in the paper, we find a few images of the fog from the Internet, to see the results are as follows:
Some fog-free pictures of their dark passages
Look at the dark passages of some foggy graphs:
Some foggy pictures of their dark passages
The window size used for these dark channel images is 15*15, which is the minimum filter radius of 7 pixels.
From the above images, we can see the universality of the Dark channel transcendental theory obviously. In the author's paper, the statistical characteristics of more than 5,000 pairs of images are basically consistent with this priori, so we can think of a theorem.
With this priori, there is a need for some mathematical derivation to finally solve the problem.
First of all, in computer vision and computer graphics, the following equation describes the fog pattern formation model is widely used:
where I (x) is the image we have now (the image to be foggy), J (x) is the fog-free image we want to restore, a is the global atmospheric light component, and T (x) is the transmittance. Now the known condition is I (x), which requires the target value J (x), obviously, this is an equation with countless solutions, so it takes a priori.
The formula (1) is slightly processed and deformed to the following formula:
As mentioned above, superscript C denotes the meaning of the r/g/b three channels.
First assume that in each window the transmittance t (x) is constant, define him as, and a value is given, and then the formula (7) on both sides of the two-time minimum operation, get the following formula:
In the above-mentioned, J is a fog-free image to be asked, according to the prior theory of dark Primary Colors:
Therefore, it can be deduced that:
Bashi (10) in-band (8), get:
This is the pre-estimate of transmittance.
In real life, even sunny white clouds, there are some particles in the air, so look at the distant objects can still feel the influence of fog, in addition, the existence of fog let human feel the existence of depth of field, it is necessary to retain a certain degree of fog when the fog, which can be introduced in the formula (11) in the [0,1] Between the factors, the formula (11) is modified to:
All of the test results in this article depend on: ω=0.95.
All of the above inferences are assumed to be known when the global Gas light A is used, and in practice we can obtain the value from a fog image with the help of a dark channel diagram. The steps are as follows:
1) Take the first 0.1% pixels from the Dark channel map by the size of the brightness.
2) in these locations, in the original fog image I look for the corresponding value with the highest luminance point, as a value.
At this point, we will be able to perform a non-fog image recovery. by formula (1): J = (i-a)/T + A
Now that the i,a,t have been obtained, it is perfectly possible to perform the J calculation.
When the value of the projection map T is very small, it causes the value of J to be large, so that the boas image is over the whole to the white field, so it is generally possible to set a threshold value of T0, when T value is less than T0, so t=t0, all the renderings in this paper are t0=0.1 as the standard calculation.
Therefore, the final recovery formula is as follows:
When directly using the above theory to recover, the effect of fog is also very obvious, such as the following examples:
Fog map, fog map.
Notice that there is obviously an uncoordinated area around the original two words of the first image, and the horizontal direction at the top of the second figure seems to have not been de-fogging, because our transmittance graph is too coarse.
In order to obtain a finer transmittance graph, Dr. Ho put forward the soft matting method in the article, which can get very fine results. But one of his Achilles ' heel is that it is very slow and not used for practical use. In 2011, Dr. Ho, in addition to a paper, referred to the method of guided filtering to obtain a better transmittance graph. The main process of this method focuses on simple box blur, and the box blur has multiple and radius-independent fast algorithms. Therefore, the practicability of the algorithm is very strong, about the guidance of the filter algorithm in the Dr Ho's website can be studied on their own, in addition to the fog, there are other aspects of the application, this part of this article is not many.
Using the guided filter to remove the fog effect:
Use the original projected transmittance graph using a guided filtered transmittance graph
(a) original (b) de-fog result map
(c) Dark channel diagram (d) Guide map (grayscale image of original images)
(e) Projected transmittance graph (f) using a guided filtered transmittance graph
The influence of each parameter on the fog-out result
First: The size of the window. This is a key parameter to the result, the larger the window, the greater the probability that it will contain the dark channel, the darker the Dark channel. We do not go from the theoretical point of view, from the practical effect, it seems that the larger the window, the effect of fog is less obvious, as shown in the following figure: