CN111784601B - Image defogging method - Google Patents

Image defogging method Download PDF

Info

Publication number
CN111784601B
CN111784601B CN202010593554.2A CN202010593554A CN111784601B CN 111784601 B CN111784601 B CN 111784601B CN 202010593554 A CN202010593554 A CN 202010593554A CN 111784601 B CN111784601 B CN 111784601B
Authority
CN
China
Prior art keywords
defogging
image
theta
value
dark channel
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.)
Active
Application number
CN202010593554.2A
Other languages
Chinese (zh)
Other versions
CN111784601A (en
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.)
Zhejiang Tongshan Artificial Intelligence Technology Co ltd
Original Assignee
Zhejiang Tongshan Artificial Intelligence Technology Co ltd
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 Zhejiang Tongshan Artificial Intelligence Technology Co ltd filed Critical Zhejiang Tongshan Artificial Intelligence Technology Co ltd
Priority to CN202010593554.2A priority Critical patent/CN111784601B/en
Publication of CN111784601A publication Critical patent/CN111784601A/en
Application granted granted Critical
Publication of CN111784601B publication Critical patent/CN111784601B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/73Deblurring; Sharpening
    • 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

Landscapes

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

Abstract

The invention relates to an image defogging method, which comprises the following steps: 1: processing an original image, reading gray values of three channels of pixels, obtaining a pixel deviation degree index theta, and recording the minimum value of the three gray values as J;2: comparing θ and J with set thresholds θv and Jv; 3: obtaining a dark channel transmittance graph T1 by using a related formula; 4: carrying out refinement treatment on the dark channel transmittance map T1 through guide filtering to obtain a transmittance map T2 after refinement treatment; 5: fitting a corresponding formula by using the transmissivity graph T2 and the global atmospheric light value A, determining relevant parameters, ensuring that the standard deviation in the fitting process is smaller than a set value, and then taking pixel points with theta < thetav and J > Jv conditions into the corresponding formula to defogging; 6: and (3) merging the two defogging part images obtained in the step (4) and the step (5), and outputting defogged images according to a defogging figure forming model. Compared with the prior art, the invention solves the problem that the dark channel principle is not established in the white sky and the light-colored area.

Description

Image defogging method
Technical Field
The invention relates to the technical field of image processing, in particular to an image defogging method.
Background
The dark channel principle is not established in white sky and light areas, and if correction is not performed, flaws such as noise and the like can appear due to overlarge defogging strength, so that the image quality is affected. This patent adopts and cuts apart the sky and handle alone, and the other part then adopts the method of dark passageway principle defogging, has realized better defogging effect.
The defogging of the images has important significance and practical value for practical production and life. Defogging algorithms are one of the research hotspots of image processing, and existing defogging algorithms can be roughly divided into two categories: one class can be categorized as image enhancement algorithms: the outline and edge detail characteristics of the fog image are improved by increasing the contrast of the image, such as histogram equalization, a Retinex-based defogging algorithm and the like, which are obvious in contrast improvement, but are deficient in color restoration, so that the saturation of the restored image is obviously reduced; one is defogging algorithm based on physical degradation model: estimating model parameters by using priori knowledge of the foggy and foggy images, and restoring the foggy and foggy images by using the obtained model parameters. Such as defogging algorithm based on dark channel principle, defogging algorithm based on color line, etc., which is slightly weaker in contrast ratio reduction than image enhancement algorithm, but has obvious advantage in color reduction. The defogging algorithm based on the dark channel is widely applied due to simple algorithm complexity and good effect. A defogging algorithm (hereinafter referred to as DCP) based on the dark channel principle considers that the formation of fog can be described by a physical degradation model:
I(x)=J(x)t(x)+A[1-t(x)]
Where J (x) is a haze-free image, A is ambient light, and t (x) is transmittance. I.e. the observation image I (x) is constituted by a light curtain formed by the superposition of ambient light scattering by an attenuated real image. Ambient light a may be estimated by counting brighter pixels; whereas for a more difficult to estimate local amount of transmittance t (x), the DCP algorithm uses dark channel a priori knowledge to simplify the estimation of t (x). DCP a priori considers that haze free images are widely available with colored objects, shadows, and dark objects, and therefore images obtained by filtering haze free images with a minimum of sliding windows are mostly 0 or close to 0 except for the sky. Hereby the t (x) estimation can be simplified:
In order to make the defogged image more realistic, the transmittance t (x) is generally estimated by using an enhanced defogging factor adjustment mode:
and (3) restoring the haze-free image according to the A and t (x).
In the white sky and light-colored area, the essential reason for the failure of the dark channel prior algorithm is that the gray values of three channels of pixels are relatively close and have larger values, and then the formula is as follows:
will not be negligible, and large deviations will occur if the processing is also performed using a simplified formula.
Disclosure of Invention
The invention aims to overcome the defects of the prior art and provide an image defogging method which is used for dividing the sky and processing the sky independently and defogging the rest part by adopting a dark channel principle.
The aim of the invention can be achieved by the following technical scheme:
An image defogging method, the method comprising the steps of:
Step1: processing the photographed original image, reading gray values of three channels of pixels, further obtaining a pixel deviation degree index theta, and recording the minimum value of the three gray values as J;
step 2: comparing the pixel deviation degree index theta and the minimum gray value J with set threshold values thetav and Jv;
Step 3: finding a dark channel image I d (X) aiming at the pixel points meeting the conditions that theta is more than or equal to thetav and J is less than or equal to Jv, taking the pixels with the highest set percentage of pixel gray values as global atmospheric light values A aiming at the pixel points meeting the conditions that theta is less than thetav and J is more than or equal to Jv, and obtaining a dark channel transmittance image T1 by utilizing a related formula;
step 4: refining the dark channel transmittance map T1 through guide filtering to obtain a refined transmittance map T2;
Step 5: fitting a corresponding formula by using the transmissivity graph T2 and the global atmospheric light value A, determining relevant parameters, ensuring that the standard deviation in the fitting process is smaller than a set value, and then taking pixel points with theta < thetav and J > Jv conditions into the corresponding formula to defogging;
step 6: and (3) merging the two defogging part images obtained in the step (4) and the step (5), and outputting defogged images according to a defogging figure forming model.
Further, θv in the step 2 is 30.
Further, jv in the step 2 is 130.
Further, the set percentage in the step 3 is 0.1%.
Further, the related formula in the step 3 is as follows:
Wherein ω is a defogging factor.
Further, the set value in the step 5 is 0.001.
Further, the defogging factor has a value of 0.95.
Further, the corresponding formula in the step 5 is as follows:
Where k, n and m are fitting parameters.
Compared with the prior art, the invention has the following advantages
(1) The invention effectively solves the problem that the dark channel principle is not established in the white sky and the light-colored region, and effectively finds out the pixels which do not accord with the dark channel priori theory in the image through the pixel deflection angle and the minimum pixel value;
(2) The method solves the problem of solving the transmissivity of the bright area by a fitting formula method;
(3) The invention carries out special defogging treatment on the area which does not accord with the prior of the dark channel and then fuses the area with the normal area to obtain the final defogging image, and the accuracy is higher.
Drawings
FIG. 1 is a flow chart of the method of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all embodiments of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
In order to screen out these pixels that do not meet the dark channel prior theory, the method of the present invention uses two indexes: one is a pixel deflection angle, which is used for evaluating the similarity degree between three channel gray values of the pixel points; the other is the minimum pixel value, which is used to observe the minimum of the three channel pixel gray values.
As shown in fig. 1, the image defogging method provided by the invention comprises the following steps:
A. Processing an original image shot by an electronic eye, reading gray values of three channels of pixels, calculating a pixel deviation degree index theta, and recording the minimum value of the three gray values as J; then, performing the step B;
B. Comparing the calculated pixel deviation degree index theta and the minimum gray value J with set threshold values thetav and Jv; if theta is more than or equal to thetav and J is less than or equal to Jv, entering a step D, and defogging by using a dark channel priori method; otherwise, entering a step C, and defogging by a transmissivity fitting method; the present embodiment may have θv=30, jv=130;
C. Taking the pixels with the highest pixel gray value of 0.1% as a global atmospheric light value A in all pixel points with theta < thetav and J > Jv; then, performing the step D;
D. After step C is completed, the step can be performed, and a dark channel image I d (X) is found in all pixel points with θ being larger than or equal to θv and J being smaller than or equal to Jv, and the formula is utilized:
Calculating the transmittance T1 of the dark channel; then, step E is carried out; the present embodiment may set ω to 0.95;
E. Refining the transmittance map T1 through guide filtering to obtain a refined transmittance map T2; and then performing the step F;
F. fitting a formula using the transmittance map T2 and the global atmospheric light value a:
determining parameters k, n and m, wherein the standard deviation of fitting is ensured to be less than 0.001 in the fitting process; carrying out defogging by taking pixel points with theta less than thetav and J greater than Jv into a fitting formula; then, step G is carried out;
G. Combining the two images subjected to defogging by different methods; then, performing the step H;
H. outputting defogged images according to the fog pattern forming model.
While the invention has been described with reference to certain preferred embodiments, it will be understood by those skilled in the art that various changes and substitutions of equivalents may be made and equivalents will be apparent to those skilled in the art without departing from the scope of the invention. Therefore, the protection scope of the invention is subject to the protection scope of the claims.

Claims (7)

1. A method of defogging an image, the method comprising the steps of:
Step1: processing the photographed original image, reading gray values of three channels of pixels, further obtaining a pixel deviation degree index theta, and recording the minimum value of the three gray values as J;
step 2: comparing the pixel deviation degree index theta and the minimum gray value J with set threshold values thetav and Jv;
Step 3: finding a dark channel image I d (X) aiming at the pixel points meeting the conditions that theta is more than or equal to thetav and J is less than or equal to Jv, taking the pixels with the highest set percentage of pixel gray values as global atmospheric light values A aiming at the pixel points meeting the conditions that theta is less than thetav and J is more than or equal to Jv, and obtaining a dark channel transmittance image T1 by utilizing a related formula;
step 4: refining the dark channel transmittance map T1 through guide filtering to obtain a refined transmittance map T2;
Step 5: fitting a corresponding formula by using the transmissivity graph T2 and the global atmospheric light value A, determining relevant parameters, ensuring that the standard deviation in the fitting process is smaller than a set value, and then taking pixel points with theta < thetav and J > Jv conditions into the corresponding formula to defogging;
step 6: combining the two parts of images respectively completed in the step 4 and the step 5, and outputting defogged images according to a foggy figure forming model;
The corresponding formula in the step 5 is as follows:
Where k, n and m are fitting parameters.
2. The image defogging method according to claim 1, wherein θv in the step2 is 30.
3. The image defogging method according to claim 1, wherein the Jv in the step 2 is 130.
4. The image defogging method according to claim 1, wherein the set percentage in the step 3 is 0.1%.
5. The image defogging method according to claim 1, wherein the correlation formula in the step 3 is:
Wherein ω is a defogging factor.
6. The image defogging method according to claim 1, wherein the set value in the step 5 is 0.001.
7. The image defogging method according to claim 5, wherein said defogging factor has a value of 0.95.
CN202010593554.2A 2020-06-27 2020-06-27 Image defogging method Active CN111784601B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010593554.2A CN111784601B (en) 2020-06-27 2020-06-27 Image defogging method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010593554.2A CN111784601B (en) 2020-06-27 2020-06-27 Image defogging method

Publications (2)

Publication Number Publication Date
CN111784601A CN111784601A (en) 2020-10-16
CN111784601B true CN111784601B (en) 2024-05-14

Family

ID=72760228

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010593554.2A Active CN111784601B (en) 2020-06-27 2020-06-27 Image defogging method

Country Status (1)

Country Link
CN (1) CN111784601B (en)

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102682443A (en) * 2012-05-10 2012-09-19 合肥工业大学 Rapid defogging algorithm based on polarization image guide
CN105279739A (en) * 2015-09-08 2016-01-27 哈尔滨工程大学 Self-adaptive fog-containing digital image defogging method
WO2016169244A1 (en) * 2015-04-20 2016-10-27 中国矿业大学 Method of denoising and enhancing video image based on random spray retinex and device utilizing same
KR101784350B1 (en) * 2016-06-02 2017-10-11 한국항공대학교산학협력단 Dehazing method and device based on improved median dark channel prior
CN107578386A (en) * 2017-09-01 2018-01-12 荆门程远电子科技有限公司 A kind of optimization defogging processing method of unmanned plane shooting image
CN108230275A (en) * 2018-02-05 2018-06-29 电子科技大学 The method of image defogging
CN108460735A (en) * 2018-02-06 2018-08-28 中国科学院光电技术研究所 Improved dark channel defogging method based on single image
CN108876743A (en) * 2018-06-26 2018-11-23 中山大学 A kind of image rapid defogging method, system, terminal and storage medium
CN109190621A (en) * 2018-09-06 2019-01-11 东北大学 Greasy weather automatic license plate recognition method
CN109255759A (en) * 2018-08-02 2019-01-22 辽宁师范大学 Image defogging method based on sky segmentation and transmissivity adaptive correction
CN111292258A (en) * 2020-01-15 2020-06-16 长安大学 Image defogging method based on dark channel prior and bright channel prior

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8340461B2 (en) * 2010-02-01 2012-12-25 Microsoft Corporation Single image haze removal using dark channel priors
SG11201508430SA (en) * 2013-04-12 2015-11-27 Agency Science Tech & Res Method and system for processing an input image
US9361670B2 (en) * 2014-09-04 2016-06-07 National Taipei University Of Technology Method and system for image haze removal based on hybrid dark channel prior

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102682443A (en) * 2012-05-10 2012-09-19 合肥工业大学 Rapid defogging algorithm based on polarization image guide
WO2016169244A1 (en) * 2015-04-20 2016-10-27 中国矿业大学 Method of denoising and enhancing video image based on random spray retinex and device utilizing same
CN105279739A (en) * 2015-09-08 2016-01-27 哈尔滨工程大学 Self-adaptive fog-containing digital image defogging method
KR101784350B1 (en) * 2016-06-02 2017-10-11 한국항공대학교산학협력단 Dehazing method and device based on improved median dark channel prior
CN107578386A (en) * 2017-09-01 2018-01-12 荆门程远电子科技有限公司 A kind of optimization defogging processing method of unmanned plane shooting image
CN108230275A (en) * 2018-02-05 2018-06-29 电子科技大学 The method of image defogging
CN108460735A (en) * 2018-02-06 2018-08-28 中国科学院光电技术研究所 Improved dark channel defogging method based on single image
CN108876743A (en) * 2018-06-26 2018-11-23 中山大学 A kind of image rapid defogging method, system, terminal and storage medium
CN109255759A (en) * 2018-08-02 2019-01-22 辽宁师范大学 Image defogging method based on sky segmentation and transmissivity adaptive correction
CN109190621A (en) * 2018-09-06 2019-01-11 东北大学 Greasy weather automatic license plate recognition method
CN111292258A (en) * 2020-01-15 2020-06-16 长安大学 Image defogging method based on dark channel prior and bright channel prior

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于阈值分割的暗原色先验图像去雾方法;苏晋鹏等;《计算机工程与应用》;第208-210页 *

Also Published As

Publication number Publication date
CN111784601A (en) 2020-10-16

Similar Documents

Publication Publication Date Title
CN107301623B (en) Traffic image defogging method and system based on dark channel and image segmentation
CN107767354B (en) Image defogging algorithm based on dark channel prior
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
CN107133927B (en) Single image defogging method based on mean-square error dark channel under super-pixel frame
CN110570360B (en) Retinex-based robust and comprehensive low-quality illumination image enhancement method
CN107527325B (en) Monocular underwater vision enhancement method based on dark channel priority
CN110322410B (en) Underwater image defogging and color cast correction method based on bright channel transmissivity compensation
CN110689490A (en) Underwater image restoration method based on texture color features and optimized transmittance
CN109118450B (en) Low-quality image enhancement method under sand weather condition
CN110827221A (en) Single image defogging method based on double-channel prior and side window guide filtering
Zhou et al. Multicolor light attenuation modeling for underwater image restoration
CN104182943A (en) Single image haze removal method combined with human vision characteristic
Yu et al. Image and video dehazing using view-based cluster segmentation
CN107977941B (en) Image defogging method for color fidelity and contrast enhancement of bright area
Peng et al. Single image restoration using scene ambient light differential
CN114119383B (en) Underwater image restoration method based on multi-feature fusion
CN112200755B (en) Image defogging method
CN110458029A (en) Vehicle checking method and device in a kind of foggy environment
CN111091501A (en) Parameter estimation method of atmosphere scattering defogging model
CN112825189B (en) Image defogging method and related equipment
CN111784601B (en) Image defogging method
CN110852971B (en) Video defogging method based on dark channel prior and Retinex and storage medium
CN113379631B (en) Image defogging method and device
CN116797484A (en) Image defogging method and system based on improved 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
GR01 Patent grant
GR01 Patent grant