Student ID: 21021210691.
? College: School of Electronic Engineering
Brief introduction of embedded cattle briefly introduces the theoretical basis of apriori.
Image processing of embedded bovine nose image defogging
Inlaid ox characters:
Dark channel prior theory is a statistical law based on the observation of a large number of outdoor fog-free images: in most images that do not contain sky areas, there are some pixels, and at least one channel of these pixels has a very low value. If the fog-free image is represented by j, the dark channel of the image can be represented as:
Where Ω (x) represents a square window with the pixel point x as the center. Dark channel image is the minimum filter of the original image.
According to the prior theory of dark channel, in the fog-free outdoor image, except the sky area, the dark channel tends to zero, that is:
The reasons for the low brightness of dark channel images generally include shadow areas, brightly colored objects and dark objects.
Generally speaking, pictures with smog are often brighter than those without smog. The thicker the smoke, the higher the pixel value of dark channel. According to the prior theory of dark channel, we can think that the brightness of dark channel in foggy pictures is roughly close to the thickness of smog.
Fig. 1 is a fog-free map and its dark channel image, and fig. 2 is a fog-free map and its dark channel image. By comparison, it can be found that the dark channel images in 1 are almost all black, and there are obviously more white areas in the foggy image in Figure 2. The thicker the fog in the original image, the brighter the corresponding areas in the dark channel image. The brightness value of dark channel image in foggy day image can well reflect the fog concentration. According to this, we can estimate the fog concentration through the dark channel image.
The following describes how to defog an image by using the dark channel prior theory:
In some image defogging methods, the maximum value of pixels in the image is generally taken as the estimated value of atmospheric light. But in the actual picture, the brightest pixel may be a white background wall or a white car. Therefore, using the brightest pixel in the original image as the intensity of atmospheric light sometimes produces great errors.
As described in section 1, the brightness of the dark channel of the smog image is approximately equal to the thickness of the smog, so the brightness of the dark channel of the image can be used to estimate the overall atmospheric light more accurately. The estimation method of total atmospheric illumination is as follows:
Firstly, take one thousandth of the brightest pixel in the dark channel image; Then find the positions of these pixels in the original color image; Finally, the points with the maximum brightness are found in these positions in the original color image as the estimated values of atmospheric light intensity. In practice, this method is more stable than the "brightest pixel method".
Variations of the atmospheric scattering model include
Assume that in the region, the transmittance t(x) is constant and expressed as. Two minimum filters are performed on both ends of the above formula. For the first time, the three channels of R, G, B, G and B at both ends of the equation are taken as the minimum values, and for the second time, the minimum values in the square area centered on the target pixel point are taken as the values of the pixel points. The formula is as follows:
According to the transcendental theory of dark channel:
Substituting Equation 2-3 into Equation 2-2, the transmittance can be obtained.
In real life, even on sunny days, there are inevitably some impurity molecules in the air. Moreover, the existence of fog can help us get better depth of field information, which is what we call spatial perspective. If the fog is completely removed, the depth of field information will also be lost, so the restored image will appear unnatural. So in practice, we will choose to keep some fog to block the foreground. Therefore, parameters are introduced and Equation 2-4 is adjusted to obtain the modified transmittance expression:
The greater the w, the better the defogging effect. When w=0, the transmittance is 1, and the restored image is the original image. When w= 1, it means that the smog has been completely removed. Here, in order to keep certain depth of field information, let w=0.95.
According to the above method, we obtained the information of atmospheric light intensity and transmittance, made constant deformation on the atmospheric scattering model, and calculated with formula (2-6) on the R, G, B, G and B channels of the image, and obtained the restored fog-free image.
The transmittance t(x) is a value between 0 and 1. When a certain value of t(x) is 0, the pixel value of the corresponding point of the obtained image tends to infinity according to the above formula, which we don't want to see. Therefore, in order to avoid this situation, we introduce parameters to limit the threshold of transmittance, so as to control the lower limit of transmittance. The revised expression is:
Repair renderings:
As can be seen from the figure, although the above methods have achieved the effect of defogging, the effect is not ideal. At the edge of Tiananmen Square connected with the sky, there will be obvious banded areas, which we call halo effect. By comparison, it is found that the larger the filter window radius, the more obvious the halo effect. This is because our initial assumption is that the transmittance is constant in the radius area centered on a pixel, which is true in the smooth area of the image, but not at the edge of the sudden change of depth of field. There is a certain error between the transmittance information at the edge and the reality, and we call this transmittance rough. Therefore, in order to achieve a more ideal defogging effect, it is necessary to further refine the calculated transmittance.
In subsequent articles, we will introduce some methods to refine the transmittance to suppress the halo effect.
K. He, J. Sun, X. Tang, "Guided Image Filtering", in IEEE Transactions on Pattern Analysis and Machine Intelligence, Volume 35, No.6, page 1397- 1409, June 20 13, doi:/kloc.