METHOD FOR RAPIDLY DEHAZING UNDERGROUND PIPELINE IMAGE BASED ON DARK CHANNEL PRIOR
20200394767 ยท 2020-12-17
Assignee
Inventors
Cpc classification
International classification
Abstract
The present invention proposes a method for rapidly dehazing an underground pipeline image based on dark channel prior (DCP). The method includes: preprocessing a hazy underground pipeline image to obtain a dark channel image corresponding to the hazy image; average-filtering the obtained dark channel image to estimate an image transmittance; compensating an offset value for an average filtering result to obtain a rough estimate of the transmittance; using a pixel value of the original image and an average-filtered image to estimate a global atmospheric light value; and using a physical restoration model to restore a dehazed image. The method of the present invention realizes the timeliness of the algorithm while ensuring the dehazing effect, and is suitable for scientific fields such as video monitoring of underground pipeline environment and identification of underground pipeline defects.
Claims
1. A method for rapidly dehazing an underground pipeline image based on dark channel prior (DCP), comprising the following steps: step (1): preprocessing an original hazy underground pipeline image to obtain a dark channel image corresponding to the hazy image, and using the obtained dark channel image to eliminate a factor affecting an atmospheric light value in the hazy image, wherein the corresponding dark channel image is obtained by solving a minimum value of three color channels of the original hazy underground pipeline image:
=m.sub.av(4) wherein, t.sup.%(ox) is the rough estimate of the transmittance; is an adjustable parameter, 01/m.sub.av; m.sub.av is an average of all pixels in the dark channel image M(x); in order to prevent a dehazed image from appearing too dark or bright overall, after an offset value is compensated, an upper limit of is set to 0.9, and is further expressed as:
=min(m.sub.av,0.9)(5) step (4): expressing the transmittance t(x) according to Formulas (3), (4) and (5) as follows:
L(x)=min(min(m.sub.av,0.9)M.sub.ave(x),M(x))(7) step (5): using a pixel value of the original hazy underground pipeline image and an average-filtered image to estimate the global atmospheric light value A by:
Description
BRIEF DESCRIPTION OF DRAWINGS
[0016] The present invention is described in more detail with reference to the accompanying drawings and examples.
[0017]
[0018]
[0019]
DETAILED DESCRIPTION
[0020] To make the objectives, technical solutions and advantages of the present invention clearer and more comprehensible, the present invention is described in more detail with reference to the accompanying drawings and examples, but these examples should not be construed as a limitation to the present invention.
[0021] As shown in
[0022] S1.1: An original hazy underground pipeline image is preprocessed to obtain a dark channel image corresponding to the original hazy image, and the obtained dark channel image is used to eliminate a factor affecting an atmospheric light value in the hazy image. In this example, a DCP algorithm is used to preprocess the hazy image. The DCP algorithm is concluded based on the statistics of multiple haze-free images. Specifically, in local regions other than a sky region in most haze-free images, some pixels have at least one color channel with a very low value. In other words, the minimum value of the local regions in most haze-free images except the sky region is a very small number. A minimum value of three color channels of the original hazy underground pipeline image is solved as follows:
[0023] In the formula, H represents the original hazy underground pipeline image; H.sup.c represents a color channel of H; {r,g,b} represents red, green and blue channels; H.sup.c(x) represents a value of a color channel of a single pixel in the original hazy underground pipeline image; M(x) is a dark channel image of the original hazy underground pipeline image H.
[0024] S1.2: The DCP algorithm is an image dehazing algorithm based on a physical model, which is a classic atmospheric scattering model expressed as follows:
H(x)=F(x)t(x)+A(1t(x))(2)
[0025] In the formula, x is a spatial coordinate of a pixel in the original hazy underground pipeline image; H is the original hazy underground pipeline image; F is a dehazed underground pipeline image; t(x) is a transmittance, which describes a proportion of reflected light of an object that can reach an observation point through attenuation; A is a global atmospheric light value, which is usually assumed to be a global constant, regardless of the spatial coordinate x.
[0026] It is derived from the atmospheric scattering model that A(1t(x))H(x), which is rewritten as
where A.sub.0 is a minimum of the atmospheric light value in the three color channels.
[0027] S2.1: The dark channel image M(x) of the original hazy underground pipeline image H(x) is average-filtered to estimate the transmittance.
[0028] In the formula, average.sub.S.sub.
[0029] S3.1: An average filtering result can reflect the general trend of t(x), but it certainly has an absolute difference from the real t(x). Therefore, an offset value is compensated for the average filtering result in S2.1 to obtain a rough estimate of the transmittance.
[0030] In the formula, t.sup.%(ox) is the rough estimate of the transmittance, =m.sub.av; is an adjustable parameter, 01/m.sub.av; m.sub.av is an average of all pixels in M(x). If the range of the dark channel image M(x) of the original hazy underground pipeline image H is [0,255], it is necessary to reduce the average of all elements in M (x) by 255 times, so that m.sub.av is constrained within [0,1].
[0031] S3.2: In order to prevent the dehazed image from appearing too dark or bright overall, an upper limit of is set to 0.9. If is too small, the transmittance will be too large, and the residual haze will be excessive in the finally restored image to make the whole image too white. If is too large, the transmittance will be too small, and the finally restored image will appear too dark overall. The offset value is expressed by:
=min(m.sub.av,0.9)
[0032] S4.1: According to the formulas in S2.1 and S3.2, the transmittance t(x) is expressed as follows:
[0033] S4.2: L(x)=A(1t(x)), where A is the global atmospheric light value; L(x) is an ambient light value; t(x) is the transmittance. According to the transmittance formula in S4.1, the ambient light value L(x) is expressed by:
L(x)=min(min(m.sub.av,0.9)M.sub.ave(x),M(x))(6)
[0034] S5.1: The global atmospheric light value is estimated by using a pixel value of the original hazy underground pipeline image and an average-filtered image:
[0035] In the formula, 01 is an empirical constant. It is verified through a test that the effect is better when =0.5.
[0036] S6.1: After the ambient light value L(x) and the global atmospheric light value A are estimated, the dehazed underground pipeline image is restored by using a physical restoration model:
[0037] In the formula, F(x) is the dehazed underground pipeline image.
[0038] S7.1:
[0039] S7.2:
[0040] The specific examples described herein are merely intended to illustrate the spirit of the present invention. A person skilled in the art can make various modifications or supplements to the specific examples described or replace them in a similar manner, but it may not depart from the spirit of the present invention or the scope defined by the appended claims.