Method for image dehazing based on adaptively improved linear global atmospheric light of dark channel
11257194 · 2022-02-22
Assignee
Inventors
- He Huang (Xi'an, CN)
- Jing Song (Xi'an, CN)
- Lu Guo (Xi'an, CN)
- Guiping Wang (Xi'an, CN)
- Xinrui Li (Xi'an, CN)
- Huifeng Wang (Xi'an, CN)
- Zhe Xu (Xi'an, CN)
- Bo Cui (Xi'an, CN)
- Ying Huang (Xi'an, CN)
- Xiaobin Hui (Xi'an, CN)
Cpc classification
International classification
Abstract
A method for image dehazing based on adaptively improved linear global atmospheric light of a dark channel. A haze image in haze weather is first obtained, a variation angle of atmospheric light of the image is obtain through calculating a slope of a connection line between a center and a center of gravity of a binary image of the image, a linear atmospheric light map that varies regularly along a variation direction of the atmospheric light is obtains, a dehazed image is solved through an atmospheric scattering model, and then a processed haze image taken in the haze weather is output.
Claims
1. A method for image dehazing based on adaptively improved linear global atmospheric light of a dark channel, comprising: step 1: obtaining a haze image in haze weather; step 2: performing threshold segmentation on the haze image obtained in the step 1 to obtain a binary image; step 3: obtaining a center of gravity (x.sub.0 y.sub.0) and an image center (0.5*h 0.5*w) of the binary image obtained in the step 2, where h is a height of the binary image and w is a width of the binary image, then performing normalization by dividing horizontal coordinates and vertical coordinates corresponding to the center of gravity and the image center of the binary image by h and w respectively, so as to obtain a center of gravity (x.sub.0′ y.sub.0′) and a center (0.5 0.5), where k is defined as a slope and θ is defined as a deflection angle of an atmospheric light value, where
θ=arctan(1/k); step 4: calculating the dark channel I.sub.dark(x, y) of the haze image I obtained in the step 1, and rotating the dark channel I.sub.dark(x, y) of the haze image counterclockwise based on the deflection angle θ obtained in the step 3, to obtain the rotated dark channel I.sub.dark′(x, y), where
I.sub.dark(x,y)=min.sub.C∈{r,g,b}(min.sub.(x′,y′)∈Ω(x,y)(I.sub.C(x′,y′))), where Ω(x, y) represents a window of a neighborhood of a point (x, y), I.sub.dark′(x, y) represents a dark channel image, and I.sub.C(x′, y′) represents a monochrome channel image pixel of the haze image I; step 5: obtaining an evenly varied atmospheric light map A′(x, y) for the rotated dark channel obtained in the step 4; step 6: counterclockwise rotating the evenly varied atmospheric light map A′(x, y) obtained in the step 5 by the deflection angle θ of the atmospheric light value obtained in the step 3, to obtain a final atmospheric light map A(x, y) that is distributed regularly based on a variation direction of a concentration degree of haze; and step 7: obtaining a dehazed image based on an atmospheric scattering model, wherein the atmospheric scattering model is:
I(x,y)=J(x,y)t(x,y)+A(x,y)(1−t(x,y)), where J represents the dehazed image, t represents transmittance, and A(x, y) represents the final atmospheric light map A(x, y) obtained in the step 6.
2. The method for image dehazing based on the adaptively improved linear global atmospheric light of the dark channel according to claim 1, wherein Ω(x, y) in the step 4 represents an image block of 9*9.
3. The method for image dehazing based on the adaptively improved linear global atmospheric light of the dark channel according to claim 1, wherein said obtaining the evenly varied atmospheric light map A′(x, y) in the step 5 comprises: sorting, from large to small, each row of dark channel values of the rotated dark channel image I.sub.dark′(x, y), taking a minimum value among first 0.1% of the row of dark channel values as an atmospheric light value of the row, and obtaining the atmospheric light value of the row, to obtain an initial atmosphere light map A.sub.0(x, y); and filtering an initial atmospheric light map, to obtain the evenly varied atmospheric light map A′(x, y).
4. The method for image dehazing based on the adaptively improved linear global atmospheric light of the dark channel according to claim 3, wherein a mean filtering method is used to filter the initial atmospheric light map in the step 5.
5. The method for image dehazing based on the adaptively improved linear global atmospheric light of the dark channel according to claim 1, wherein said obtaining the dehazed image in the step 7 comprises: setting dark primary colors of the dehazed image J to approach 0 based on a statistical law of the dark primary colors as:
J.sub.dark(x,y)=min.sub.C(min.sub.(x′,y′)∈Ω(x,y)(J.sub.C(x′,y′)))−0 where J.sub.dark(x, y) represents a dark channel pixel of the dehazed image, Ω(x, y) represents the window of the neighborhood of the point (x, y), and J.sub.C (x′, y′) represents a monochrome channel image pixel of a haze image J(x, y), wherein A is always positive, and min.sub.C(min.sub.(x′,y′)∈Ω(x,y)J.sub.C(x′, y′)/A(x′, y′)))=0; obtaining a rough transmittance diagram:
t′(x,y)=1−min.sub.C(min.sub.(x′,y′)∈Ω(x,y)I.sub.C(x′,y′)/A(x′,y′))), wherein in a clear day when a distant scene is shielded by little haze, a factor ω is added in such a manner that a dehazing effect is undistorted, where
t(x,y)=1−ωmin.sub.C(min.sub.(x′,y′)∈Ω(x,y)(I.sub.C(x′,y′))); and solving the dehazed image J using I, t and A and outputting the dehazed image J, where
J(x,y)=(I(x,y)−A(x,y))/t(x,y)+A(x,y).
6. The method for image dehazing based on the adaptively improved linear global atmospheric light of the dark channel according to claim 5, wherein the factor ω is 0.95.
Description
BRIEF DESCRIPTION OF DRAWINGS
(1)
(2)
(3)
DESCRIPTION OF EMBODIMENTS
(4) The present disclosure will be described in further detail below with reference to the drawings.
(5) Referring to
(6) At step 1, a haze image is obtained in haze weather.
(7) Using an image capture device to obtain a degraded haze image in the haze weather.
(8) At step 2, threshold segmentation is performed on the haze image obtained in the step 1 to obtain a binary image thereof.
(9) The image is first converted into a grayscale image, and then the threshold segmentation is performed on the grayscale image through Otsu algorithm to convert the grayscale image into the binary image.
(10) At step 3, a center of gravity (x.sub.0 y.sub.0) and an image center (0.5*h 0.5*w) of the binary image (height is h and width is w) in the step 2 are obtained. A normalization is performed by dividing horizontal coordinates and vertical coordinates corresponding to the center of gravity and the image center of the binary image by h and w respectively, so as to obtain a center of gravity (x.sub.0′ y.sub.0′) and a center (0.5 0.5), where k is defined as a slope and θ is defined as a deflection angle of an atmospheric light value, where
(11)
and
θ=arctan(1/k),
(12) in this case, the concentration degree of haze in the image substantially varies and distributes along a direction in which a center line is deflected clockwise by θ.
(13) At step 4, the binary image obtained in the step 2 in which the binary image is subjected to grayscale conversion and binary segmentation is divided into two parts including a bright area and a dark area, and then the center of gravity and the center of the binary image are calculated through the step 3, and a direction in which a line connecting the center of gravity with the center extends is taken as a variation direction of the atmospheric light to tilt the image.
(14) A dark channel of the haze image obtained in the step 1 is obtained according to:
I.sub.dark(x,y)=min.sub.C∈{r,g,b}(min.sub.(x′,y′)∈Ω(x,y)(I.sub.C(x′,y′))),
(15) where ω(x, y) represents a window of a neighborhood of a point (x, y), I.sub.dark(x, y) represents a dark channel image, and I.sub.C(x′, y′) represents a monochrome channel image pixel of the haze image I.
(16) The image dark channel I.sub.dark(x, y) is rotated counterclockwise according to the deflection angle θ obtained in the step 3, to obtain the rotated dark channel. I.sub.dark′(x, y).
(17) At step 5, a distribution map of the atmospheric light of the rotated dark channel obtained in the step 4 is obtained and the acquisition includes sorting, from large to small, each row of dark channel values of the rotated dark channel image I.sub.dark′(x, y), taking a minimum value among first 0.1% of the row of dark channel values as an atmospheric light value of the row, to obtain the atmospheric light value for the row, to obtain an initial atmosphere light map A.sub.0(x, y); and filtering the initial atmospheric light map through a mean filtering method to eliminate an abrupt change in each row of the atmospheric light map, to obtain an evenly varied atmospheric light map A′(x, y).
(18) At step 6, the evenly varied atmospheric light map A′(x, y) obtained in the step 5 is rotated counterclockwise by the atmospheric light value deflection angle θ obtained in the step 3, to obtain a final atmospheric light map A(x, y), which is distributed regularly according to a variation direction of the concentration degree of the haze.
(19) At step 7, an atmospheric scattering model commonly used in research of dehaze algorithms is as follows:
I(x,y)=J(x,y)t(x,y)+A(x,y)(1−t(x,y)),
(20) where J represents a dehazed image, and t represents transmittance. A represents the final atmospheric light map A (x, y) obtained in the step 6.
(21) According to a statistical law of dark primary colors, the dark primary colors of the dehazed image J should approach 0, that is:
J.sub.dark(x,y)=min.sub.C(min.sub.(x′,y′)∈Ω(x,y)(J.sub.C(x′,y′)))=0
(22) where J.sub.dark(x, y) represents a dark channel pixel of the dehazed image, Ω(x, y) represents the window of the neighborhood of the point (x, y), and J.sub.C(x′, y′) represents a monochrome channel image pixel of a haze image J(x, y).
(23) As A is always positive, this leads to:
min.sub.C(min.sub.(x′,y′)∈Ω(x,y)(J.sub.C(x′,y′)/A(x′,y′)))=0.
(24) A rough transmittance diagram can be obtained:
t′(x,y)=1−min.sub.C(min.sub.(x′,y′)∈Ω(x,y)(I.sub.C(x′,y′/A(x′,y′)))).
(25) In a clear day, when a distant scene is shielded by little haze, a factor ω is further added to the above formula in such a manner that a dehazing effect is undistorted. The ω is generally about 0.95.
t(x,y)=1−ωmin.sub.C(min.sub.(x′,y′)∈Ω(x,y)(I.sub.C(x′,y′))).
(26) The I, t and A can be used to solve the dehazed clear image J, and the dehazed clear image J is output.
J(x,y)=(I(x,y)−A(x,y))/t(x,y)+A(x,y).
(27)
(28) A processing effect can be more intuitively seen from processing result comparison and a partially enlarged diagram of
(29) Table 1 is a comparison table of effect parameters by using different algorithms to process the haze image. It can be seen from Table 1 that after the image is dehazed by the improved dark channel dehazing method of the present disclosure, ambiguity, average gradient, contrast, and information entropy are all improved. Thus, it can be seen that the present disclosure further improves the processing effect for the haze image and has better result, so that it is superior to the traditional dark channel dehazing method and has important significance for further research on image dehazing, haze image information extraction and the like.
(30) TABLE-US-00001 TABLE 1 Parameter comparison table of effect by using different algorithms to process the haze image Average Information Image Ambiguity gradient entropy Contrast (a) 0.0266 0.0073 0.0877 (b) 5.4150 0.1990 0.0591 0.5864 (c) 9.0345 0.3199 0.0854 0.6402
(31) According to the description above, the improved dark channel image dehazing algorithm of the present disclosure has a good dehazing effect, good restoration of the distant scene, and an ideal effect on processing of images captured in the haze weather, and it is of great significance to the further processing of images and accurate acquisition of image information.