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 ( x ) = min c { r , g , b } .Math. ( H c ( x ) ) ( 1 ) wherein, 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; step (2): average-filtering the corresponding dark channel image M(x) of the original hazy underground pipeline image to estimate a transmittance by: average S a ( 1 - M ( x ) A 0 ) = 1 - M ave ( x ) A 0 = 1 - .Math. y ( x ) .Math. M ( y ) A 0 .Math. S a 2 ( 2 ) wherein, A.sub.0 is a minimum of the atmospheric light value in the three color channels; average.sub.S.sub.a() represents average filtering performed by using an S.sub.a window; S.sub.a represents the size of the average filtering window; M(x) is the dark channel image of the original hazy underground pipeline image H(x); M.sub.ave(x) represents average filtering performed by using an S.sub.a window on the dark channel image M(x) corresponding to the original hazy underground pipeline image; (x) is an S.sub.aS.sub.a neighborhood of a spatial coordinate x; M(y) is a pixel in the S.sub.aS.sub.a neighborhood of the spatial coordinate x in the dark channel image corresponding to the original hazy underground pipeline image; step (3): compensating an offset value for an average filtering result to obtain a rough estimate of the transmittance by: i .Math. % .Math. ( x ) = 1 - .Math. M ave ( x ) A 0 ( 3 )
=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: t ( x ) = max ( 1 - min ( .Math. .Math. m av , 0.9 ) .Math. M ave ( x ) A 0 , 1 - M ( x ) A 0 ) ( 6 ) wherein, it is derived from a physical model of hazy image degradation that L(x)=A(1t(x)), A being the global atmospheric light value, L(x) being an ambient light value, and t(x) being the transmittance; according to Formula (6), the ambient light value L(x) is expressed by:
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: A = .Math. .Math. .Math. max ( max c { r , g , b } .Math. ( H c ( x ) ) ) + ( 1 - .Math. ) .Math. .Math. max ( M ave ( x ) ) ( 8 ) wherein, is an empirical constant, which is 0.5; and step (6): using a physical restoration model to restore the dehazed underground pipeline image by: F ( x ) = H ( x ) - L ( x ) 1 - L ( x ) A ( 9 ) wherein, F(x) is the dehazed underground pipeline image.

Description

BRIEF DESCRIPTION OF DRAWINGS

[0016] The present invention is described in more detail with reference to the accompanying drawings and examples.

[0017] FIG. 1 is a flowchart according to an example of the present invention.

[0018] FIG. 2 shows a comparison of a dehazing effect according to an example of the present invention.

[0019] FIG. 3 shows a comparison of a dehazing time of a hazy underground pipeline image with different resolutions according to an example of the present invention.

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 FIG. 1, a method for rapidly dehazing an underground pipeline image based on DCP specifically includes the following steps:

[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:

[00001] M ( x ) = min c { r , g , b } .Math. ( H c ( x ) ) ( 1 )

[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

[00002] t ( x ) 1 - M ( x ) A 0 ,

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.

[00003] average S a ( 1 - M ( x ) A 0 ) = 1 - M ave ( x ) A 0 = 1 - .Math. y ( x ) .Math. M ( y ) A 0 .Math. S a 2 ( 3 )

[0028] In the formula, average.sub.S.sub.a() represents average filtering performed by using an S.sub.a window; M.sub.ave(x) represents average filtering performed by using an S.sub.a window on the dark channel image M(x) corresponding to the original hazy underground pipeline image; S.sub.a represents the size of the average filtering window; (x) is an S.sub.aS.sub.a neighborhood of the spatial coordinate x; M(y) is a pixel in the S.sub.aS.sub.a neighborhood of the spatial coordinate x in the dark channel image corresponding to the original hazy underground pipeline image. Compared with other filtering methods, average filtering has a faster execution speed, and reduces the complexity of the dehazing algorithm as much as possible on the basis of ensuring the dehazing effect.

[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.

[00004] i .Math. % .Math. ( x ) = 1 - .Math. M ave ( x ) A 0 ( 4 )

[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:

[00005] t ( x ) = max ( 1 - min ( .Math. .Math. m av , 0.9 ) .Math. M ave ( x ) A 0 , 1 - M ( x ) A 0 ) ( 5 )

[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:

[00006] A = .Math. .Math. .Math. max ( max c { r , g , b } .Math. ( H c ( x ) ) ) + ( 1 - .Math. ) .Math. .Math. max ( M ave ( x ) ) ( 7 )

[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:

[00007] F ( x ) = H ( x ) - L ( x ) 1 - L ( x ) A ( 8 )

[0037] In the formula, F(x) is the dehazed underground pipeline image.

[0038] S7.1: FIG. 2 shows a comparison of a dehazing effect of an underground pipeline image. FIG. 2(b) shows a dehazing effect of FIG. 2(a), and FIG. 2(d) shows a dehazing effect of FIG. 2(c). As can be seen from FIG. 2 that the present invention effectively improves the clarity and contrast of the underground pipeline image.

[0039] S7.2: FIG. 3 shows a comparison of a dehazing time of a hazy underground pipeline image with different resolutions. As can be seen from FIG. 3 that the present invention performs average filtering to estimate the ambient light value and the global atmospheric light value, which improves the timeliness of the method while ensuring the dehazing effect.

[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.