CN113920136A - Improved dark channel prior defogging algorithm - Google Patents

Improved dark channel prior defogging algorithm Download PDF

Info

Publication number
CN113920136A
CN113920136A CN202111191635.0A CN202111191635A CN113920136A CN 113920136 A CN113920136 A CN 113920136A CN 202111191635 A CN202111191635 A CN 202111191635A CN 113920136 A CN113920136 A CN 113920136A
Authority
CN
China
Prior art keywords
dark channel
channel
image
algorithm
improved
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111191635.0A
Other languages
Chinese (zh)
Inventor
刘万军
王迪
曲海成
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Liaoning Technical University
Original Assignee
Liaoning Technical University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Liaoning Technical University filed Critical Liaoning Technical University
Priority to CN202111191635.0A priority Critical patent/CN113920136A/en
Publication of CN113920136A publication Critical patent/CN113920136A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/40Image enhancement or restoration using histogram techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/50Image enhancement or restoration using two or more images, e.g. averaging or subtraction
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/70Denoising; Smoothing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/40Analysis of texture
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/90Determination of colour characteristics
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20212Image combination
    • G06T2207/20221Image fusion; Image merging

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Image Processing (AREA)

Abstract

The invention discloses an improved dark channel prior defogging algorithm, which comprises the following steps: using Rayleigh scattering theory to improve the estimated value of atmospheric light; a segmentation method based on an active contour model is adopted to segment a sky region to obtain a sky region and a non-sky region; estimating dark channel values using different sizes of filtering; the calculation of the transmittance is simplified, and the processing speed of the algorithm is improved. According to the method, firstly, on the basis of an original dark channel prior defogging algorithm, a Rayleigh scattering theory is added to improve an atmospheric light estimation method, then a fog image is divided into a sky region and a non-sky region, dark channel images with different filter sizes are fused to obtain a fused dark channel, and finally, the solving process of the transmissivity is simplified to improve the operation speed of the algorithm and enhance the real-time property.

Description

Improved dark channel prior defogging algorithm
Technical Field
The invention belongs to the technical field of image defogging, and particularly relates to an improved dark channel prior defogging algorithm.
Background
Outdoor images photographed in environments such as fog and haze have a large number of suspended particles in the atmosphere, and the image quality is affected to various degrees in terms of contrast, color, and the like. However, in many image processing systems such as target detection and satellite remote sensing, people have strict requirements on the quality of input images. Therefore, the method for carrying out the sharpening processing on the foggy day image with the degraded quality has very practical significance in the field of computer vision.
At the initial stage of image defogging work, methods such as improving image contrast and saturation are often adopted to represent main characteristics of an image, and the method can achieve the purpose of image clearness, but is low in reliability and prone to large-scale information loss. With the continuous development of modern science and technology and the continuous improvement of image quality requirements, the atmospheric scattering model is applied to the field of image defogging, and a large number of defogging algorithms depending on the atmospheric scattering model appear, and the algorithms fully consider the image degradation process and physically remove the fog existing in the image. At present, along with the rise of deep learning, processing a foggy image by using a deep learning method gradually becomes a mainstream, but the method is limited by many factors, and the problem of incomplete defogging still exists when the image in a real scene is subjected to sharpening processing.
In summary, the method for performing the sharpening process on the foggy day image can be divided into three categories, namely an algorithm based on image enhancement, an algorithm based on deep learning and a defogging algorithm based on a physical model. The defogging algorithm based on image enhancement can effectively improve the contrast and color information of an image, but can sacrifice part of detail information, such as the defogging algorithm based on histogram equalization, curvelet transformation and Retinex. Image defogging algorithms based on deep learning have emerged in the recent years. Ren et al propose a convolutional neural network for multi-scale feature extraction and defogging by estimating fog map transmittance. But often perform less than fully when dealing with fog patterns in real weather. The defogging algorithm based on the physical model analyzes the process of image quality degradation, and the pertinence is stronger. Jackson et al propose a defogging method for estimating an initial transmittance graph by using Rayleigh scattering and establishing a scattering coefficient model and optimizing the transmittance graph by using guide filtering, thereby improving the operation speed but not completely defogging the image. He and the like propose a dark channel defogging algorithm, most of foggy images can be effectively recovered by using the algorithm, but the processed sky area can generate a serious halo effect because the bright sky area does not meet dark channel prior. Then He and the like propose to use guiding filtering to replace a soft matting method to optimize the transmissivity on the basis of a Dark Channel Prior (DCP) theory, so that the defogging efficiency is improved, but the problems of incomplete defogging, low processing speed and the like still exist after the processing. Aiming at the defects of methods such as He and the like, Liu and the like propose that a self-adaptive threshold value is introduced in the process of acquiring the dark primary color, so that the accuracy of the transmissivity is improved, but the operation efficiency is still lower.
Disclosure of Invention
Based on the defects of the prior art, the invention aims to provide an improved dark channel prior defogging algorithm to solve the problems of low defogging speed, color distortion and incomplete defogging of the traditional defogging method.
In order to solve the technical problems, the invention is realized by the following technical scheme:
the invention provides an improved dark channel prior defogging algorithm, which comprises the following steps:
s1: using Rayleigh scattering theory to improve the estimated value of atmospheric light;
s2: a segmentation method based on an active contour model is adopted to segment a sky region to obtain a sky region and a non-sky region;
s3: estimating dark channel values using different sizes of filtering;
s4: the calculation of the transmittance is simplified, and the processing speed of the algorithm is improved.
Optionally, the step S1 includes the following steps:
s11, according to Rayleigh scattering, selecting the pixel sequence with the highest intensity from the blue channel of the input image according to the column, and averaging the sequence data to obtain A1For eliminating the halo effect, A1The expression of (a) is as follows:
A1=avg(max(Iin the B column direction))
In the formula: a. the1Average maximum of blue channel of fog pattern, IBIs the blue channel value of the fog map;
s12, calculating the average value A of the lowest pixels in the red and green channels2Further eliminate A1Later unnecessary texture information:
A2=avg(min(IG)+min(IR))
in the formula: i isGIs the green channel value of the fog map, IRIs the red channel value of the fog map, A2Is the average of the darkest green channel and the darkest red channel;
s13, calculation A1And A2To estimate the atmospheric light a:
A=A1+A2
optionally, in step S2, the dark channel maps with different filter sizes are fused, and the edge area emphasizes using the dark channel map with a smaller filter size, so as to better extract the scene structure information of the depth discontinuity area and avoid halo artifacts from being generated in the edge area; the smooth area uses a larger filtering size dark channel image to ensure that the restored image does not generate color cast due to over-enhancement.
Further, the step S3 includes the following steps:
s31, converting RGB into a gray histogram;
s32, down-sampling the original image and reducing the original image into 1/4 of the original image;
and S33, acquiring the transmittance of the original image by adopting an interpolation method.
Therefore, the method is characterized in that firstly, on the basis of the original dark channel prior defogging algorithm, the Rayleigh scattering theory is added to improve the atmospheric light estimation method, then the fog image is divided into a sky region and a non-sky region, the dark channel images with different filter sizes are fused to obtain a fused dark channel, and finally, the solving process of the transmissivity is simplified to improve the operation speed of the algorithm and enhance the real-time property.
The foregoing description is only an overview of the technical solutions of the present invention, and in order to make the technical means of the present invention more clearly understood, the present invention may be implemented in accordance with the content of the description, and in order to make the above and other objects, features, and advantages of the present invention more clearly understood, the following detailed description is given in conjunction with the preferred embodiments, together with the accompanying drawings.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings of the embodiments will be briefly described below.
FIG. 1 is a flow chart of the improved dark channel a priori defogging algorithm of the present invention.
Detailed Description
Other aspects, features and advantages of the present invention will become apparent from the following detailed description, taken in conjunction with the accompanying drawings, which form a part of this specification, and which illustrate, by way of example, the principles of the invention. In the referenced drawings, the same or similar components in different drawings are denoted by the same reference numerals.
In order to solve the problems of low defogging speed, color distortion, incomplete defogging and the like of the traditional defogging method, the invention provides an improved dark channel prior defogging algorithm, and the algorithm flow is shown in fig. 1. The improved dark channel prior defogging algorithm of the invention comprises the following steps:
s1: using Rayleigh scattering theory to improve the estimated value of atmospheric light;
s2: a segmentation method based on an active contour model is adopted to segment a sky region to obtain a sky region and a non-sky region;
s3: estimating dark channel values using different sizes of filtering;
s4: the calculation of the transmittance is simplified, and the processing speed of the algorithm is improved.
The atmospheric light value is an important parameter for image defogging, and the defogging performance of the whole image is reduced due to large calculation amount or large error. Conventional defogging algorithms estimate a by selecting the largest pixel. In order to accurately estimate the brightness of the pixel to express the haze density, the characteristic that blue light is easier to scatter than light of other colors is utilized by Rayleigh scattering theory, the B (blue) channel of the RGB three-color channel of the fog image is taken as the maximum value, and the R (red) and G (green) channels are respectively taken as the minimum value. An improved atmospheric light calculation method is thus proposed, incorporating both the brightest and darkest pixels into the calculation. The method mainly comprises the following steps:
(1) blue light is scattered most in RGB images according to rayleigh scattering. In order to comprehensively consider image parts with different depths, a pixel sequence with the highest intensity is selected from a blue channel of an input image in a row and an average value of sequence data is obtained to obtain A1For eliminating the halo effect, A1The expression of (a) is as follows:
A1=avg(max(Iin the B column direction))
In the formula: a. the1Average maximum of blue channel of fog pattern, IBIs the blue channel value of the fog map.
(2) Calculate the average value A of the lowest pixels in the red and green channels2Further eliminate A1And then unnecessary texture information.
A2=avg(min(IG)+min(IR))
In the formula: i isGIs the green channel value of the fog map, IRIs the red channel value of the fog map, A2The average of the darkest green channel and the darkest red channel.
(3) Calculation of A1And A2To estimate the atmospheric light A
A=A1+A2
An Active Con-road Model (ACM) method is a very representative method. The ACM combines the constrained information on the image with a priori knowledge to define a closed and continuous energy curve. The energy curve is continuously close to the target contour under the combined action of the internal force and the external force, and when the energy of the curve is minimum, the energy curve is considered to reach the target contour, namely the target edge is obtained. First, a curve is defined, x(s) ═ x(s), y (s)), s ∈ [0,1 ]. The curve energy function is:
Figure BDA0003301345020000051
in the formula, EintIs the energy term inside the curve, EextIs a curve external energy item, which is specifically expressed as:
Figure BDA0003301345020000061
Figure BDA0003301345020000062
alpha(s) and beta(s) are weight coefficients; alpha(s) | X'(s) | non-woven2The tension of the curve is controlled and the continuity of the curve is ensured for the elastic energy of the curve; beta(s) | X '(s)' non-woven phosphor2The curve rigidity energy controls the curve bending degree and ensures the curve smoothness. ^ represents gradient operator, I (x, y) represents image, GσGaussian filter operator with standard deviation sigma, convolution, EextIs given an energy constraint according to the image.
The GVF-Snake model introduces a GVF field V (x, y) ([ mu (x, y), ν (x, y)) on the basis of the Snake model, and the GVF field is used as a new external force field to replace a Gaussian external force field of the Snake model, so that the GVF-Snake model energy functional is obtained as follows,
Figure BDA0003301345020000063
μ is a parameter for controlling the integrand, and is set according to the amount of noise present in the image, and generally, the larger the noise, the larger the value. Variable ux、uy、vx、vyIs the first derivative of u, v in x, y direction. Term 1 is a smoothing energy term that can produce a slowly diffusing vector field; item 2 is the edge energy item, V ═ f at the edge of the image, such that the gradient forces are directed towards the edge, pushing the curve towards the edge, whereas | f | tends to 0 away from the edge, item 2 is | +, f |, thThe 1 term plays a major role in diffusing edge information toward a smooth region, so that the capture range of the contour curve increases.
In using the minimum filtering operation to obtain the dark channel, the filter size is a key parameter that affects the final defogging effect. The larger filter size is more compatible with the dark channel theory, because more dark pixels are included, but at the same time, the halo effect is caused by the large size filtering; conversely, a smaller filter size can effectively suppress halo effects in the edge region, but can cause oversaturation of the recovered image.
In order to solve the above defects, the invention provides an improved dark channel estimation method, which fuses dark channel images with different filtering sizes, and the edge area emphasizes the use of the dark channel image with a smaller filtering size, so as to better extract the scene structure information of the depth discontinuous area and avoid halo artifacts generated in the edge area; the smooth area uses a larger filtering size dark channel image to ensure that the restored image does not generate color cast due to over-enhancement. Therefore, the key of the fusion is to construct a weight map showing the depth discontinuity areas, and the median filtering technique, as a nonlinear filtering operation, can effectively suppress the impulse noise component while preserving edge information, which can be expressed as:
Figure BDA0003301345020000071
in the formula, omega1(x) The filter area is centered at x (taking a 15 × 15 square matrix), mean is the median filter operation, and W is the minimum channel of the input image.
Taking the image edge information image as a weight image, fusing the dark channel images with different sizes by adopting a pixel level fusion mode to obtain a fused dark channel Ifdark(x) The expression is:
Figure BDA0003301345020000072
in the formula (I), the compound is shown in the specification,
Figure BDA0003301345020000073
for filtering dark channel images of size 3 x 3,
Figure BDA0003301345020000074
is a dark channel image with a filter size of 15 x 15.
The algorithm of the invention utilizes the dark channel with smaller filtering size to effectively compensate the edge area of the dark channel, and utilizes the fog-free image recovered by the fused dark channel to avoid the supersaturation problem caused by the dark channel with small size and inhibit the halo effect caused by the dark channel with larger size to a certain extent.
Because the graph of the transmittance of the dark channel defogging is finer than other algorithms, and a large amount of processing time is occupied in the whole algorithm, and the processing efficiency of the program is reduced, if the precision is reduced a little properly, the defogging effect of the dark channel defogging should not be greatly different theoretically, the method adopted by the invention does not calculate the transmittance of the original image, but simplifies the calculation of the transmittance by the following method:
1. converting RGB into a gray level histogram;
2. down-sampling the original image, reducing the original image to 1/4 of the original image, storing in V (x), and solving for the transmittance of V (x);
3. and obtaining the approximate transmittance of the original image by adopting an interpolation method.
Experiments prove that the method greatly improves the execution speed, and the defogging effect is basically consistent with the original scheme. However, if the reduction factor is not particularly large, for example, 0.5 times the original size, the time consumption of the two scaling operations may also offset the profit gained by computing the transmittance map of the small map, and therefore this down-sampling rate must be chosen appropriately.
In the research, the traditional dark channel prior defogging has poor treatment effect on the sky part, and the sky often has large-area textures and blocking phenomena. The fundamental reason is that the sky part basically does not accord with the defogging prior condition of the dark channel, and the invention adopts a method for avoiding the excessive enhancement of the sky part in the image defogging algorithm, wherein (1) the image is converted into the gray scale, and the decolorizing algorithm with the contrast retaining function is used for retaining more edge information; (2) solving gradient information of the gray level image, and realizing by adopting an edge detection operator; (3) denoising and filtering the gradient information; (4) distinguishing gradient information according to a set gradient threshold and a brightness threshold; (5) and performing Gaussian feathering processing on the distinguished images.
After the sky area is obtained, the transmittance map of the sky area is uniformly set to a fixed value, but this is not good, and appropriate correction should be made according to a specific value. In the above operation with He, the resulting sky region does not really belong to the sky, and a certain point does not necessarily belong to the sky completely or not at all. Therefore, the present invention proposes an optimization method, as follows:
Jx=(tp×Ix+Jx×(255-Ix))/255
wherein JxPoints referring to dark channels, tpThe fixed transmittance value similar to He is specified by adjusting the image processing effect, and in the above formula, if i (x) is 255, that is, completely belongs to the sky, the transmittance at that point is a fixed value, and if i (x) is 0, that is, completely does not belong to the sky, the value of the calculation formula is not changed, and normal defogging is not affected.
In addition, regarding the calculation of the atmospheric light value a, He proposes that the average value of the obtained pixels of the sky part is taken as a, which is also very reasonable, but in the actual processing, for some images without the sky part at all, the detected sky area is very small (obviously belonging to false detection, but the program does not know), and this is also unreasonable as the atmospheric light value. Therefore, the processing mode of the invention is to calculate the A value of the sky part and then detect the proportion of the sky pixel in the whole image.
While the foregoing is directed to the preferred embodiment of the present invention, other and further embodiments of the invention may be devised without departing from the basic scope thereof, and the scope thereof is determined by the claims that follow.

Claims (4)

1. An improved dark channel a priori defogging algorithm, comprising the steps of:
s1: using Rayleigh scattering theory to improve the estimated value of atmospheric light;
s2: a segmentation method based on an active contour model is adopted to segment a sky region to obtain a sky region and a non-sky region;
s3: estimating dark channel values using different sizes of filtering;
s4: the calculation of the transmittance is simplified, and the processing speed of the algorithm is improved.
2. The improved dark channel a priori defogging algorithm according to claim 1, wherein said step S1 comprises the steps of:
s11, according to Rayleigh scattering, selecting the pixel sequence with the highest intensity from the blue channel of the input image according to the column, and averaging the sequence data to obtain A1For eliminating the halo effect, A1The expression of (a) is as follows:
A1=avg(max(Iin the B column direction))
In the formula: a. the1Average maximum of blue channel of fog pattern, IBIs the blue channel value of the fog map;
s12, calculating the average value A of the lowest pixels in the red and green channels2Further eliminate A1Later unnecessary texture information:
A2=avg(min(IG)+min(IR))
in the formula: i isGIs the green channel value of the fog map, IRIs the red channel value of the fog map, A2Is the average of the darkest green channel and the darkest red channel;
s13, calculation A1And A2To estimate the atmospheric light a:
A=A1+A2
3. the improved dark channel a priori defogging algorithm according to claim 1, wherein in said step S2, the dark channel maps with different filtering sizes are fused, and the edge region emphasizes the use of the dark channel map with smaller filtering size so as to better extract the scene structure information of the depth discontinuity region and avoid the halo artifact generated in the edge region; the smooth area uses a larger filtering size dark channel image to ensure that the restored image does not generate color cast due to over-enhancement.
4. The improved dark channel a priori defogging algorithm according to claim 1, wherein said step S3 comprises the steps of:
s31, converting RGB into a gray histogram;
s32, down-sampling the original image and reducing the original image into 1/4 of the original image;
and S33, acquiring the transmittance of the original image by adopting an interpolation method.
CN202111191635.0A 2021-10-13 2021-10-13 Improved dark channel prior defogging algorithm Pending CN113920136A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111191635.0A CN113920136A (en) 2021-10-13 2021-10-13 Improved dark channel prior defogging algorithm

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111191635.0A CN113920136A (en) 2021-10-13 2021-10-13 Improved dark channel prior defogging algorithm

Publications (1)

Publication Number Publication Date
CN113920136A true CN113920136A (en) 2022-01-11

Family

ID=79240100

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111191635.0A Pending CN113920136A (en) 2021-10-13 2021-10-13 Improved dark channel prior defogging algorithm

Country Status (1)

Country Link
CN (1) CN113920136A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114155173A (en) * 2022-02-10 2022-03-08 山东信通电子股份有限公司 Image defogging method and device and nonvolatile storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114155173A (en) * 2022-02-10 2022-03-08 山东信通电子股份有限公司 Image defogging method and device and nonvolatile storage medium

Similar Documents

Publication Publication Date Title
CN106157267B (en) Image defogging transmissivity optimization method based on dark channel prior
CN107301623B (en) Traffic image defogging method and system based on dark channel and image segmentation
CN107527332A (en) Enhancement Method is kept based on the low-light (level) image color for improving Retinex
CN108389175B (en) Image defogging method integrating variation function and color attenuation prior
CN109255759B (en) Image defogging method based on sky segmentation and transmissivity self-adaptive correction
Gao et al. Sand-dust image restoration based on reversing the blue channel prior
CN112419162A (en) Image defogging method and device, electronic equipment and readable storage medium
CN114331873B (en) Non-uniform illumination color image correction method based on region division
CN107705258B (en) Underwater image enhancement method based on three-primary-color combined pre-equalization and deblurring
CN108133462B (en) Single image restoration method based on gradient field region segmentation
CN110827221A (en) Single image defogging method based on double-channel prior and side window guide filtering
CN111861896A (en) UUV-oriented underwater image color compensation and recovery method
CN109118440B (en) Single image defogging method based on transmissivity fusion and adaptive atmospheric light estimation
CN114693548B (en) Dark channel defogging method based on bright area detection
CN109345479B (en) Real-time preprocessing method and storage medium for video monitoring data
CN111325688A (en) Unmanned aerial vehicle image defogging method fusing morphological clustering and optimizing atmospheric light
CN113920136A (en) Improved dark channel prior defogging algorithm
CN113034379A (en) Weather-time self-adaptive rapid image sharpening processing method
CN112825189B (en) Image defogging method and related equipment
CN109636735B (en) Rapid video defogging method based on space-time consistency constraint
CN116862809A (en) Image enhancement method under low exposure condition
CN108765310B (en) Adaptive transmissivity restoration image defogging method based on multi-scale window
CN115170437A (en) Fire scene low-quality image recovery method for rescue robot
Abbaspour et al. A new fast method for foggy image enhancement
CN115619662A (en) Image defogging method based on dark channel prior

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination