CN112465708A - Improved image defogging method based on dark channel - Google Patents

Improved image defogging method based on dark channel Download PDF

Info

Publication number
CN112465708A
CN112465708A CN202011144335.2A CN202011144335A CN112465708A CN 112465708 A CN112465708 A CN 112465708A CN 202011144335 A CN202011144335 A CN 202011144335A CN 112465708 A CN112465708 A CN 112465708A
Authority
CN
China
Prior art keywords
image
dark channel
value
defogging
foggy
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.)
Withdrawn
Application number
CN202011144335.2A
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.)
Nanjing University of Science and Technology
Original Assignee
Nanjing University of Science and Technology
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 Nanjing University of Science and Technology filed Critical Nanjing University of Science and Technology
Priority to CN202011144335.2A priority Critical patent/CN112465708A/en
Publication of CN112465708A publication Critical patent/CN112465708A/en
Withdrawn legal-status Critical Current

Links

Images

Classifications

    • G06T5/73

Abstract

The invention provides an improved image defogging method based on a dark channel, which comprises the steps of calculating an atmospheric light value of a foggy image and a dark channel image; performing Retinex enhancement on the foggy image to obtain an initial defogged image; calculating the atmosphere rough transmittance according to the dark channel image of the foggy image and the initial defogged image; guiding filtering is adopted to refine the coarse transmittance; and obtaining a restored image according to the atmospheric light value, the thinned atmospheric transmittance value and the image degradation model of the dark channel prior defogging algorithm. The invention effectively avoids errors generated by sky areas and large white areas.

Description

Improved image defogging method based on dark channel
Technical Field
The invention belongs to the field of computer vision, and particularly relates to an improved image defogging method based on a dark channel.
Background
The fog day has great interference to the collection of images and videos, further influences subsequent detection, identification and the like, and has great influence on security protection, monitoring and the like. Therefore, the research on the image defogging has great value. In recent years, research in this area has advanced significantly, largely divided into two categories, based on physical models and non-physical models. The non-physical model mainly comprises a Retinex algorithm, such as an automobile license plate image defogging research based on Retinex proposed by the people of the Kishina, the Wen of yellow, and the like, and then a single-scale and multi-scale Retinex enhancement algorithm and the like are developed. This method performs defogging by changing the contrast of an image, has disadvantages of high complexity, and is liable to produce halation and the like, and thus is less used. The physical model is to establish a degradation model of the image and obtain the value of each parameter, thereby obtaining the defogged image. The representative algorithm is a dark channel prior defogging algorithm proposed by the hocamen, and the algorithm has achieved a more ideal result on the processing of the foggy image of the non-sky area, and has the defect that the processing is not in place on the sky area.
Aiming at the problem of sky area processing effect, an image defogging algorithm combining sky segmentation and a super-pixel level dark channel is proposed, but a few boundaries are lost by the method. Dark channel prior defogging algorithm for optimizing region segmentation is also provided, but has the defect that the sky region is easy to generate wrong segmentation.
Disclosure of Invention
The technical scheme for realizing the purpose of the invention is as follows: an image defogging method based on dark channel improvement comprises the following specific steps:
step 1, calculating an atmospheric light value of a foggy image;
step 2: calculating a dark channel image of the foggy image;
and step 3: performing Retinex enhancement on the foggy image to obtain an initial defogged image;
and 4, step 4: calculating the atmosphere rough transmittance according to the dark channel image of the foggy image and the initial defogged image;
and 5: guiding filtering is adopted to refine the coarse transmittance;
and 6, obtaining a restored image according to the atmospheric light value, the refined atmospheric transmittance value and the image degradation model of the dark channel prior defogging algorithm.
Preferably, the atmospheric light value is calculated by adopting a hierarchical search method based on the quadtree subspace division, and the method comprises the following specific steps:
step 1.1: dividing the foggy image into four rectangular areas;
step 1.2: evaluating the four rectangular areas, wherein the evaluation standard is that the standard deviation is subtracted from the average value of the pixels in the rectangular areas, and the rectangular area with the largest value is taken as a target area;
step 1.3: repeating the step 1.1 and the step 1.2 on the target area until the target area is smaller than a set threshold value; the pixel value of the point in the target region that minimizes | (ir (p), ig (p), ib (p)) - (255 ) | |, where ir (p), ig (p), ib (p) are R, G, B component values of the pixel points in the target region, respectively, is used as the atmospheric light value.
Preferably, the specific steps of calculating the dark channel image of the foggy image are as follows:
and (4) taking the minimum value from the three channels of the fog image rgb to form a gray image, and carrying out minimum value filtering on the gray image to obtain a dark channel image.
Preferably, the Retinex enhancement is performed on the foggy image, and the specific steps of obtaining the initial defogged image are as follows:
step 3.1: transforming the hazy image to a logarithmic region;
step 3.2: the central surround function F (x, y) is integrated into 1 and a Gaussian surround scale C, and a scale lambda is obtained:
Figure BDA0002739224140000021
∫∫F(x,y)dxdy=1
in the formula, (x, y) is a pixel point coordinate;
step 3.3: the output image r (x, y) is found by the following equation:
Figure BDA0002739224140000022
wherein S (x, y) is an original foggy image, and F (x, y) is a center surrounding function;
step 3.4: converting the output image r (x, y) obtained in the step 3.4 into a real number domain to obtain an initial defogging image;
step 3.5: and mapping the gray value of the initial defogged image obtained in the step 3.4 to 0-255.
Preferably, the specific steps of calculating the atmospheric coarse transmittance from the dark channel image of the fogging image and the initial defogging image are as follows:
carrying out minimum value filtering on the image subjected to Retinex enhancement to obtain a dark channel image subjected to Retinex enhancement and defogging;
and (3) calculating the atmospheric crude transmittance, wherein the specific calculation formula is as follows:
Figure BDA0002739224140000031
in the formula Ic(y) Retinex enhanced defogged dark channel image, Jc(y) is a dark channel image of the foggy image, [ omega ] is a correction coefficient, AcIs the atmospheric light value, and t (x) is the atmospheric crude throw ratio.
Preferably, the image degradation model of the dark channel prior defogging algorithm is specifically:
I(x)=J(x,t(x)+A[I-t(x)]
wherein J (x) is the original foggy image, t (x) is the refined atmospheric transmittance, A is the atmospheric light value, and I (x) is the final dehazed image.
Compared with the prior art, the invention has the following advantages: (1) the invention effectively solves the problem that the sky area is not processed in place; (2) when the atmospheric light value is calculated, errors generated by a sky area and a large white area are effectively avoided; (3) compared with other improved methods, the method has the advantages of small calculation amount and good real-time property.
Drawings
FIG. 1 is a flow chart of the present invention.
FIG. 2 is a target image acquired prior to defogging according to the present invention.
FIG. 3 is a target image acquired after defogging according to the present invention.
Detailed Description
As shown in fig. 1 to 3, aiming at the defects of the existing dark channel defogging method, the invention provides an image defogging method based on dark channel improvement, which is used for solving the problems that the processing of an empty area in a dark channel defogging sky is not available and the atmospheric light value is mistakenly obtained. Firstly, a hierarchical search method based on quadtree subspace division is adopted for the calculation of the atmospheric light value. Compared with a method for solving an atmospheric light value in a dark channel defogging algorithm, the method can effectively avoid errors generated in a sky area or a large white area. And then, obtaining a rough defogged image by using a non-physical model Retinex enhancement algorithm, wherein the algorithm has a good defogging effect on the sky area. And processing the defogged image to obtain a dark channel image, setting a reasonable threshold value for comparison, and enabling the image to be zero when the image is smaller than the threshold value, so that the dark channel value of the non-sky area meets the dark channel priori principle, and the dark channel value of the sky area is obtained. The method comprises the following steps of substituting an atmospheric scattering model formula to obtain a defogged picture by utilizing an atmospheric light value, a foggy picture dark channel value and a defogged picture dark channel value of a Retinex enhancement algorithm, wherein the method comprises the following steps:
step 1: calculating an atmospheric light value A of the foggy image;
in some embodiments, a hierarchical search method based on quadtree subspace partitioning is adopted to calculate an atmospheric light value, so as to solve the problem that the atmospheric light value calculation is interfered by a white area in a dark channel defogging algorithm, so that the white area is mistakenly taken as the atmospheric light value, and the specific steps are as follows:
step 1.1: dividing the foggy image into four rectangular areas;
step 1.2: evaluating the four rectangles, wherein the evaluation standard is that the standard deviation is subtracted from the average value of the pixels in the rectangular area, and the rectangular area with the maximum value is taken as a target area;
step 1.3: repeating the step 1.1 and the step 1.2 on the target area until the target area is smaller than a set threshold value; the pixel value of the point in the target region where | (ir (p), ig (p), ib (p)) - (255 ) | | is the smallest is taken as the atmospheric light value, and ir (p), ig (p), ib (p) are R, G, B component values of the pixel points in the target region, respectively.
Step 2: dark channel images of the hazy images are calculated.
In some embodiments, the minimum value in the three channels of the fogging image rgb is taken to form a gray map, and the gray map is subjected to minimum value filtering to obtain a dark channel image.
And step 3: and performing Retinex enhancement on the foggy image to obtain an initial defogged image.
In a further embodiment, the specific steps of performing Retinex enhancement on the foggy image to obtain an initial defogged image are as follows:
step 3.1: transforming the hazy image to a logarithmic region;
Figure BDA0002739224140000041
where R (x, y) is the output image, R (x, y) is the reflection image, L (x, y) is the luminance image, and S (x, y) is the original image.
Step 3.2: using the central surround function F (x, y) integrated to 1, and the gaussian surround scale C, the scale λ is found:
Figure BDA0002739224140000042
∫∫F(x,y)dxdy=1
in the formula, (x, y) is the pixel point coordinate.
Step 3.3: the output image r (x, y) is found by the following equation:
Figure BDA0002739224140000043
where S (x, y) is the original foggy image and F (x, y) is the center-surround function.
Step 3.4: and (4) converting the output image r (x, y) obtained in the step (3.4) into a real number domain to obtain an initial defogged image.
Step 3.5: and mapping the gray value of the image obtained in the step 3.4 to 0-255.
And 4, step 4: the atmospheric coarse transmittance is calculated from the dark channel image of the hazy image and the initial defogged image.
And carrying out minimum value filtering on the image subjected to Retinex enhancement and defogging to obtain a dark channel image subjected to Retinex enhancement and defogging, and carrying out threshold processing on the dark channel image subjected to Retinex enhancement and defogging to ensure that a dark channel in a non-sky area is zero and meet dark channel priorality.
And (3) calculating the atmospheric crude transmittance, wherein the specific calculation formula is as follows:
Figure BDA0002739224140000051
in the formula Ic(y) Retinex enhanced defogged dark channel image, Jc(y) is a dark channel image of the foggy image, omega is a correction coefficient, and 0.95 is taken, AcIs the atmospheric light value, and t (x) is the atmospheric crude throw ratio.
And 5: and (3) refining the coarse transmittance by adopting guide filtering, wherein the specific formula is as follows:
qi=∑jWij(I)pj
wherein I is the image after Retinex enhanced defogging, PjIs an atmospheric coarse transmittance image, qiFor images after thinning the transmission, WijIs a weight value.
And 6, substituting the atmospheric light value and the refined atmospheric transmittance value into an image degradation model of a dark channel prior defogging algorithm to obtain a restored image.
In a further embodiment, the image degradation model of the dark channel prior defogging algorithm is specifically as follows:
I(x)=J(x)t(x)+A[I-t(x)]
wherein J (x) is the original foggy image, t (x) is the refined atmospheric transmittance, A is the atmospheric light value, and I (x) is the final dehazed image.

Claims (6)

1. An improved image defogging method based on a dark channel is characterized by comprising the following specific steps:
step 1, calculating an atmospheric light value of a foggy image;
step 2: calculating a dark channel image of the foggy image;
and step 3: performing Retinex enhancement on the foggy image to obtain an initial defogged image;
and 4, step 4: calculating the atmosphere rough transmittance according to the dark channel image of the foggy image and the initial defogged image;
and 5: guiding filtering is adopted to refine the coarse transmittance;
and 6, obtaining a restored image according to the atmospheric light value, the refined atmospheric transmittance value and the image degradation model of the dark channel prior defogging algorithm.
2. The image defogging method based on the dark channel improvement as claimed in claim 1, wherein the atmospheric light value is calculated by adopting a hierarchical search method based on the quadtree subspace division, and the specific steps are as follows:
step 1.1: dividing the foggy image into four rectangular areas;
step 1.2: evaluating the four rectangular areas, wherein the evaluation standard is that the standard deviation is subtracted from the average value of the pixels in the rectangular areas, and the rectangular area with the largest value is taken as a target area;
step 1.3: repeating the step 1.1 and the step 1.2 on the target area until the target area is smaller than a set threshold value; the pixel value of the point in the target region that minimizes | (ir (p), ig (p), ib (p)) - (255 ) | |, where ir (p), ig (p), ib (p) are R, G, B component values of the pixel points in the target region, respectively, is used as the atmospheric light value.
3. The method for improving image defogging based on the dark channel according to claim 1, wherein the step of calculating the dark channel image of the fogging image comprises the specific steps of:
and (4) taking the minimum value from the three channels of the fog image rgb to form a gray image, and carrying out minimum value filtering on the gray image to obtain a dark channel image.
4. The method of claim 1, wherein the Retinex enhancement is performed on the foggy image, and the specific steps of obtaining the initial foggy image are as follows:
step 3.1: transforming the hazy image to a logarithmic region;
step 3.2: the central surround function F (x, y) is integrated into 1 and a Gaussian surround scale C, and a scale lambda is obtained:
Figure FDA0002739224130000011
∫∫F(x,y)dxdy=1
in the formula, (x, y) is a pixel point coordinate;
step 3.3: the output image r (x, y) is found by the following equation:
Figure FDA0002739224130000021
wherein S (x, y) is an original foggy image, and F (x, y) is a center surrounding function;
step 3.4: converting the output image r (x, y) obtained in the step 3.4 into a real number domain to obtain an initial defogging image;
step 3.5: and mapping the gray value of the initial defogged image obtained in the step 3.4 to 0-255.
5. The method for defogging images based on improvement of the dark channel according to claim 1, wherein the step of calculating the coarse transmittance of the atmosphere based on the image of the dark channel of the fogging image and the initial defogging image comprises the specific steps of:
carrying out minimum value filtering on the image subjected to Retinex enhancement to obtain a dark channel image subjected to Retinex enhancement and defogging;
and (3) calculating the atmospheric crude transmittance, wherein the specific calculation formula is as follows:
Figure FDA0002739224130000022
in the formula Ic(y) Retinex enhanced defogged dark channel image, Jc(y) is a dark channel image of the foggy image, [ omega ] is a correction coefficient, AcIs the atmospheric light value, and t (x) is the atmospheric crude throw ratio.
6. The dark channel-based improved image defogging method according to claim 1, wherein the image degradation model of the dark channel prior defogging algorithm is specifically:
I(x)=J(x)t(x)+A[I-t(x)]
wherein J (x) is the original foggy image, t (x) is the refined atmospheric transmittance, A is the atmospheric light value, and I (x) is the final dehazed image.
CN202011144335.2A 2020-10-23 2020-10-23 Improved image defogging method based on dark channel Withdrawn CN112465708A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011144335.2A CN112465708A (en) 2020-10-23 2020-10-23 Improved image defogging method based on dark channel

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011144335.2A CN112465708A (en) 2020-10-23 2020-10-23 Improved image defogging method based on dark channel

Publications (1)

Publication Number Publication Date
CN112465708A true CN112465708A (en) 2021-03-09

Family

ID=74834433

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011144335.2A Withdrawn CN112465708A (en) 2020-10-23 2020-10-23 Improved image defogging method based on dark channel

Country Status (1)

Country Link
CN (1) CN112465708A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113436095A (en) * 2021-06-24 2021-09-24 哈尔滨理工大学 Defogging method for sky area image
CN115861104A (en) * 2022-11-30 2023-03-28 西安电子科技大学 Remote sensing image defogging method based on transmissivity refinement
CN116188331A (en) * 2023-04-28 2023-05-30 淄博市淄川区市政环卫服务中心 Construction engineering construction state change monitoring method and system

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113436095A (en) * 2021-06-24 2021-09-24 哈尔滨理工大学 Defogging method for sky area image
CN115861104A (en) * 2022-11-30 2023-03-28 西安电子科技大学 Remote sensing image defogging method based on transmissivity refinement
CN115861104B (en) * 2022-11-30 2023-10-17 西安电子科技大学 Remote sensing image defogging method based on transmissivity refinement
CN116188331A (en) * 2023-04-28 2023-05-30 淄博市淄川区市政环卫服务中心 Construction engineering construction state change monitoring method and system
CN116188331B (en) * 2023-04-28 2023-07-18 淄博市淄川区市政环卫服务中心 Construction engineering construction state change monitoring method and system

Similar Documents

Publication Publication Date Title
CN108596849B (en) Single image defogging method based on sky region segmentation
CN107680054B (en) Multi-source image fusion method in haze environment
CN107103591B (en) Single image defogging method based on image haze concentration estimation
CN106157267B (en) Image defogging transmissivity optimization method based on dark channel prior
CN112465708A (en) Improved image defogging method based on dark channel
CN108876743B (en) Image rapid defogging method, system, terminal and storage medium
CN107301624B (en) Convolutional neural network defogging method based on region division and dense fog pretreatment
KR101448164B1 (en) Method for Image Haze Removal Using Parameter Optimization
CN108389175B (en) Image defogging method integrating variation function and color attenuation prior
CN109087254B (en) Unmanned aerial vehicle aerial image haze sky and white area self-adaptive processing method
CN105913390B (en) A kind of image defogging method and system
CN108564597B (en) Video foreground object extraction method fusing Gaussian mixture model and H-S optical flow method
CN110009653A (en) Increase limb recognition point sharp picture based on gray level threshold segmentation method and knows method for distinguishing
CN114118144A (en) Anti-interference accurate aerial remote sensing image shadow detection method
CN110245600B (en) Unmanned aerial vehicle road detection method for self-adaptive initial quick stroke width
CN111861896A (en) UUV-oriented underwater image color compensation and recovery method
CN109003238B (en) Image haze removal method based on model, histogram and gray level enhancement
CN113313702A (en) Aerial image defogging method based on boundary constraint and color correction
CN108898132A (en) A kind of terahertz image dangerous material recognition methods based on Shape context description
Choi et al. Fog detection for de-fogging of road driving images
CN112750089B (en) Optical remote sensing image defogging method based on local block maximum and minimum pixel prior
CN112288780B (en) Multi-feature dynamically weighted target tracking algorithm
CN111091501A (en) Parameter estimation method of atmosphere scattering defogging model
Ding et al. Restoration of single sand-dust image based on style transformation and unsupervised adversarial learning
CN116883303A (en) Infrared and visible light image fusion method based on characteristic difference compensation and fusion

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
WW01 Invention patent application withdrawn after publication
WW01 Invention patent application withdrawn after publication

Application publication date: 20210309