CN110111268B - Single image rain removing method and device based on dark channel and fuzzy width learning - Google Patents

Single image rain removing method and device based on dark channel and fuzzy width learning Download PDF

Info

Publication number
CN110111268B
CN110111268B CN201910314127.3A CN201910314127A CN110111268B CN 110111268 B CN110111268 B CN 110111268B CN 201910314127 A CN201910314127 A CN 201910314127A CN 110111268 B CN110111268 B CN 110111268B
Authority
CN
China
Prior art keywords
image
rain
channel
defogging
color space
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
CN201910314127.3A
Other languages
Chinese (zh)
Other versions
CN110111268A (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.)
Shanghai Normal University
Original Assignee
Shanghai Normal 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 Shanghai Normal University filed Critical Shanghai Normal University
Priority to CN201910314127.3A priority Critical patent/CN110111268B/en
Publication of CN110111268A publication Critical patent/CN110111268A/en
Application granted granted Critical
Publication of CN110111268B publication Critical patent/CN110111268B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/77Retouching; Inpainting; Scratch removal
    • 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/20081Training; Learning

Landscapes

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

Abstract

The invention relates to a single image rain removing method and a single image rain removing device based on dark channel and fuzzy width learning, wherein the method comprises the following steps: step S1: carrying out defogging pretreatment on an original image; step S2: carrying out high-low frequency separation on the image after the defogging pretreatment, and carrying out color space conversion on a high-frequency part to convert the RGB color space into a YCbCr color space; step S3: taking a Y channel of a YCbCr color space corresponding to the images of the training set part as input of fuzzy width learning to carry out model training; step S4: taking a Y channel of the test set part as input of fuzzy width learning to obtain a rainless image of the Y channel; step S5: combining the high-pass layer rain removing graph with the low-pass base layer to obtain a primary rain removing effect graph; step S6: and optimizing the preliminary rain removing effect picture based on the image subjected to defogging pretreatment to obtain a final rain removing effect picture. Compared with the prior art, the invention has the advantages of high color reduction degree and the like.

Description

Single image rain removing method and device based on dark channel and fuzzy width learning
Technical Field
The invention relates to an image processing technology, in particular to a single image rain removing method and device based on dark channel and fuzzy width learning.
Background
Computer vision systems are widely used in various industries, including video surveillance, visual tracking and navigation, intelligent transportation, entertainment industries, and the like. Computer vision systems in indoor situations have been commonly used and studied, while some outdoor conditions, such as rain, snow, fog, remain challenging issues for computer vision systems. Common bad weather is mainly classified into steady bad weather (mainly referring to fog and haze) and dynamic bad weather (mainly referring to rain, snow, sand storm, etc.) according to the composition particles and visual characteristics. Wherein the steady-state bad weather is mainly constituted by an aerosol system consisting of very small water droplets and particles like dust. The pixel intensity in the image varies relatively slowly due to the absorption and scattering effects of the aerosol particles on atmospheric light. Compared with the steady bad weather, the composition particles of the dynamic bad weather such as the rain weather are usually much larger, and the motion trail of the particles is easily influenced by external factors such as wind and the like while the particles fall rapidly, so that the blurring and the rain line shielding are generated in the image, the establishment of the model and the scene restoration become more complicated, and the problems of over-bright local area, blurred background image and the like are caused. The degradation of image quality in rainy days greatly restricts the functions of outdoor intelligent vision systems such as vision monitoring, vision navigation, target tracking and the like, and the states of raindrop particles are variable, and the direction and thickness of a rain line are different under different conditions. Therefore, the research on how to recover high-quality images from various rain-degraded images has extremely high research and application values.
Disclosure of Invention
The invention aims to overcome the defects of the prior art and provide a method and a device for removing rain from a single image based on dark channel and fuzzy width learning.
The purpose of the invention can be realized by the following technical scheme:
a single image rain-removing processing method based on dark channel and fuzzy width learning comprises the following steps:
step S1: carrying out defogging pretreatment on an original image;
step S2: carrying out high-low frequency separation on the image after the defogging pretreatment, and carrying out color space conversion on a high-frequency part to convert the RGB color space into a YCbCr color space;
step S3: taking a Y channel of a YCbCr color space corresponding to the images of the training set part as input of fuzzy width learning to carry out model training;
step S4: taking a Y channel of a YCbCr color space corresponding to the image of the test set part as input of fuzzy width learning to obtain a rain-free image of the Y channel;
step S5: synthesizing the rain-free image of the Y channel and the Cb channel Cr channel into a high-pass layer rain removing image, taking the low-frequency part obtained in the step S2 as a low-pass base layer, and combining the high-pass layer rain removing image and the low-pass base layer to obtain a primary rain removing effect image;
step S6: and optimizing the preliminary rain removing effect picture based on the image subjected to defogging pretreatment to obtain a final rain removing effect picture.
The result of the defogging pretreatment in the step S1 is:
Figure BDA0002032521270000021
wherein: fr (x) is the image after the defogging pretreatment, f (x) is the original image, a is the global atmospheric brightness, tr (x) is the transmittance, and T0 is a threshold set to 0.1.
The step S6 specifically includes:
step S61: extracting an image detail part from the defogged preprocessed image by using a Gaussian high-pass filter;
step S62: adjusting the transparency of the extracted detail part to a set proportion;
step S63: and superposing the detail part after the transparency is adjusted as a mixed color on the primary rain removing effect graph as the primary color to obtain a final rain removing effect graph.
The set proportion is 30%, and the detail part after the transparency is adjusted is specifically as follows:
IdeT=(Ide×Alpha+127)/255
wherein: i isdeTFor details after adjustment of transparency, Alpha is transparency, IdeAs part of the original detail.
The mathematical expression of the superposition process in step S63 is:
Figure BDA0002032521270000022
wherein: b is the final rain-removing effect picture, IpreThe primary rain removing effect picture is obtained by combining the rain removing detail layer with the base layer.
A single image rain removal processing apparatus based on dark channel and blur width learning, comprising a memory, a processor, and a program stored in the memory and executed by the processor, the processor implementing the following steps when executing the program:
step S1: carrying out defogging pretreatment on an original image;
step S2: carrying out high-low frequency separation on the image after the defogging pretreatment, and carrying out color space conversion on a high-frequency part to convert the RGB color space into a YCbCr color space;
step S3: taking a Y channel of a YCbCr color space corresponding to the images of the training set part as input of fuzzy width learning to carry out model training;
step S4: taking a Y channel of a YCbCr color space corresponding to the image of the test set part as input of fuzzy width learning to obtain a rain-free image of the Y channel;
step S5: synthesizing the rain-free image of the Y channel and the Cb channel Cr channel into a high-pass layer rain removing image, taking the low-frequency part obtained in the step S2 as a low-pass base layer, and combining the high-pass layer rain removing image and the low-pass base layer to obtain a primary rain removing effect image;
step S6: and optimizing the preliminary rain removing effect picture based on the image subjected to defogging pretreatment to obtain a final rain removing effect picture.
Compared with the prior art, the invention has the following beneficial effects:
1) the fog generated by rainwater in the picture is treated completely by applying the principle of defogging of the hidden channel, so that the rainwater line hidden in the fog is highlighted, and the subsequent rainwater removal effect is improved.
2) The image after defogging operation is subjected to high-pass filtering and low-pass filtering operation to respectively obtain a detail layer and a basic layer, and only the Y channel of the high-frequency part after color space conversion is subjected to fuzzy width learning to remove rain, so that the color image training problem of three channels is converted into the single-channel detail layer training problem, the network training time is greatly reduced, and the network efficiency is improved; and secondly, more original information is reserved, so that the color reduction degree is enhanced.
3) And extracting image details of the original defogged image by using a guide filter, and finally superposing the detail image on a primary rain removal effect image serving as a primary color by using the transparency of thirty percent as a mixed color to obtain a final enhanced rain removal image.
Drawings
FIG. 1 is a schematic flow chart of the main steps of the method of the present invention;
FIG. 2 is a diagram illustrating a comparison between an effect graph generated by the method of the present invention and an effect graph generated by another algorithm.
Detailed Description
The invention is described in detail below with reference to the figures and specific embodiments. The present embodiment is implemented on the premise of the technical solution of the present invention, and a detailed implementation manner and a specific operation process are given, but the scope of the present invention is not limited to the following embodiments.
A method for processing a single image to remove rain based on learning of dark channel and blur width, the method is implemented by a computer system in the form of a computer program, the computer system comprises a memory, a processor, and a program stored in the memory and executed by the processor, as shown in fig. 1, the processor executes the program to implement the following steps:
step S1: the original image is subjected to a defogging preprocessing,
specifically, an algorithm of preferential defogging of a dark channel is adopted to remove a distant fog-like rain scene in the image. For any one
Input fog-free image F ofDThe dark channel is a priori defined as follows:
Figure BDA0002032521270000041
wherein: frDRepresenting each channel of the color image RGB, Ω (x) represents a window centered on pixel x. We can then solve the dehazed image in conjunction with the following fog map model:
F(x)=Fr(x)tr(x)+A(1-tr(x))
wherein: f (x) is the input image to be defogged, Fr (x) is the image to be restored without fog, A is the global atmospheric brightness, and tr (x) is the transmittance. Finally, after a series of formula deformations, our fog-free solution model is:
Figure BDA0002032521270000042
wherein: fr (x) is the image after the defogging pretreatment, f (x) is the original image, a is the global atmospheric brightness, tr (x) is the transmittance, and T0 is a threshold set to 0.1.
Step S2: carry out high low frequency separation with defogging preliminary treatment back image, get the high frequency part and carry out the conversion of colour space, convert YCbCr colour space from RGB colour space, it is specific, this application carries out high low frequency separation with defogging back image, gets the high frequency part and carries out the conversion of colour space, converts YCbCr colour space from RGB colour space. And finally, taking a Y channel of the high-frequency part in the YCbCr color space as the input of the fuzzy width learning. The specific mathematical expression of RGB color space conversion is as follows;
Y=0.257*R+0.564*G+0.098*B+16
Cb=-0.148*R-0.291*G+0.439*B+128
Cr=0.439*R-0.368*G-0.071*B+128
wherein: r, G, B are the values of the three channels of the RGB color space.
Step S3: and performing model training by taking a Y channel of the YCbCr color space corresponding to the images of the training set part as input of fuzzy width learning, namely the input data is as follows: x ═ X1,x2,...,xN)T∈RN×MThe present application uses a first order TS model, which uses a first order TS fuzzy model to input:
xs=(xs1,xs2,...,sxm)
map it to the ith fuzzy subsystem, and the fuzzy subsystem has kiA fuzzy rule. It is noted as:
Figure BDA0002032521270000051
wherein:
Figure BDA0002032521270000052
is at [0,1 ]]Between random generationK is 1, 2iIs the fuzzy rule of the ith fuzzy system.
For the input of the enhancement layer, the intermediate output value Zsi of the s training sample of the i-th blurring subsystem can be expressed as:
Figure BDA0002032521270000053
wherein:
Figure BDA0002032521270000056
for blurring the coefficients of the rules
The Zp that the p-blur subsystem maps to the intermediate output of the enhancement layer can be expressed as:
Figure BDA0002032521270000054
wherein: j is the number of fuzzy subsystems. Then to ZjPerforming a non-linear transformation to obtain an output of the enhancement layer, expressed as:
Figure BDA0002032521270000055
finally, the output O of the whole network, i.e. the Y channel rain-free map, is:
O=Fp+HgWe
wherein: fpRepresenting the p-th fuzzy subsystem, wherein W is a coefficient matrix and is obtained by pseudo-inverse calculation
Step S5: synthesizing the rain-free image of the Y channel and the Cb channel Cr channel into a high-pass layer rain removing image, taking the low-frequency part obtained in the step S2 as a low-pass base layer, and combining the high-pass layer rain removing image and the low-pass base layer to obtain a primary rain removing effect image;
step S6: based on the image after the defogging pretreatment, optimizing the preliminary rain effect image to obtain the final rain effect image, specifically including:
step S61: extracting an image detail part from the defogged preprocessed image by using a Gaussian high-pass filter;
step S62: adjusting the transparency of the extracted detail part to a set proportion, preferably, the set proportion is 30%, and the detail part after adjusting the transparency specifically comprises:
IdeT=(Ide×Alpha+127)/255
wherein: i isdeTFor details after adjustment of transparency, Alpha is transparency, IdeAs part of the original detail.
Step S63: and superposing the detail part after the transparency is adjusted as a mixed color on the primary rain removing effect graph as the primary color to obtain a final rain removing effect graph.
The mathematical expression of the superimposition process in step S63 is:
Figure BDA0002032521270000061
wherein: b is the final rain-removing effect picture, IpreThe primary rain removing effect picture is obtained by combining the rain removing detail layer with the base layer.
The accuracy of network training is reduced because many deep learning rain removing methods are directly trained without preprocessing. And because the existing deep learning method has the problems of various parameters, overlong training iteration time, large training data volume and the like, the fuzzy width learning input is converted into the high frequency of a Y channel in a YCbCr space after the obvious rain line at a near place is highlighted, and the convergence speed of network training is greatly improved. Finally, for the detail smoothing part, the network result is enhanced by adopting a detail mixing and overlapping method, and as shown in fig. 2, the image detail is enhanced under the condition of restraining the rain line. Therefore, the training speed is greatly improved while the accuracy is higher, and the training speed is specifically shown in table 1:
Figure BDA0002032521270000062

Claims (8)

1. a single image rain-removing processing method based on dark channel and fuzzy width learning is characterized by comprising the following steps:
step S1: the original image is subjected to a defogging preprocessing,
step S2: carrying out high-low frequency separation on the image after the defogging pretreatment, carrying out color space conversion on a high-frequency part, converting the RGB color space into the YCbCr color space,
step S3: the Y channel of the YCbCr color space corresponding to the images of the training set part is used as the input of the fuzzy width learning to carry out model training,
step S4: taking the Y channel of YCbCr color space corresponding to the image of the test set part as the input of fuzzy width learning to obtain the rain-free image of the Y channel,
step S5: synthesizing the rain-free image of the Y channel and the Cb channel Cr channel into a high-pass layer rain-removing image, taking the low-frequency part obtained in the step S2 as a low-pass base layer, combining the high-pass layer rain-removing image and the low-pass base layer to obtain a primary rain-removing effect image,
step S6: optimizing the preliminary rain removing effect graph based on the image subjected to defogging pretreatment to obtain a final rain removing effect graph;
the step S6 specifically includes:
step S61: extracting image detail parts from the defogged preprocessed image by a Gaussian high-pass filter,
step S62: adjusting the transparency of the extracted detail part to a set proportion,
step S63: and superposing the detail part after the transparency is adjusted as a mixed color on the primary rain removing effect graph as the primary color to obtain a final rain removing effect graph.
2. The method for processing the rain removed from the single image based on the dark channel and the fuzzy width learning as claimed in claim 1, wherein the result of the defogging preprocessing in the step S1 is:
Figure FDA0002939854790000011
wherein: fr (x) is the image after the defogging pretreatment, f (x) is the original image, a is the global atmospheric brightness, tr (x) is the transmittance, and T0 is a threshold set to 0.1.
3. The method for processing the rain removed from the single image based on the learning of the dark channel and the blur width according to claim 1, wherein the set proportion is 30%, and the detail part after the transparency is adjusted is specifically as follows:
IdeT=(Ide×Alpha+127)/255
wherein: i isdeTFor details after adjustment of transparency, Alpha is transparency, IdeAs part of the original detail.
4. The method for processing the raining of the single image based on the learning of the dark channel and the blur width as claimed in claim 3, wherein the mathematical expression of the superposition process in the step S63 is as follows:
Figure FDA0002939854790000021
wherein: b is the final rain-removing effect picture, IpreThe primary rain removing effect picture is obtained by combining the rain removing detail layer with the base layer.
5. A single image rain removal processing apparatus based on dark channel and blur width learning, comprising a memory, a processor, and a program stored in the memory and executed by the processor, wherein the processor executes the program to implement the following steps:
step S1: the original image is subjected to a defogging preprocessing,
step S2: carrying out high-low frequency separation on the image after the defogging pretreatment, carrying out color space conversion on a high-frequency part, converting the RGB color space into the YCbCr color space,
step S3: the Y channel of the YCbCr color space corresponding to the images of the training set part is used as the input of the fuzzy width learning to carry out model training,
step S4: taking the Y channel of YCbCr color space corresponding to the image of the test set part as the input of fuzzy width learning to obtain the rain-free image of the Y channel,
step S5: synthesizing the rain-free image of the Y channel and the Cb channel Cr channel into a high-pass layer rain-removing image, taking the low-frequency part obtained in the step S2 as a low-pass base layer, combining the high-pass layer rain-removing image and the low-pass base layer to obtain a primary rain-removing effect image,
step S6: optimizing the preliminary rain removing effect graph based on the image subjected to defogging pretreatment to obtain a final rain removing effect graph;
the step S6 specifically includes:
step S61: extracting image detail parts from the defogged preprocessed image by a Gaussian high-pass filter,
step S62: adjusting the transparency of the extracted detail part to a set proportion,
step S63: and superposing the detail part after the transparency is adjusted as a mixed color on the primary rain removing effect graph as the primary color to obtain a final rain removing effect graph.
6. The apparatus for processing the raining of a single image based on the learning of the dark channel and the blur width as claimed in claim 5, wherein the result of the defogging preprocessing in the step S1 is:
Figure FDA0002939854790000022
wherein: fr (x) is the image after the defogging pretreatment, f (x) is the original image, a is the global atmospheric brightness, tr (x) is the transmittance, and T0 is a threshold set to 0.1.
7. The device for processing rain removed from a single image based on learning of dark channel and blur width according to claim 5, wherein the set proportion is 30%, and the detail part after adjusting the transparency is specifically:
IdeT=(Ide×Alpha+127)/255
wherein: i isdeTFor details after adjustment of transparency, Alpha is transparency, IdeAs part of the original detail.
8. The apparatus for processing raining of a single image based on the learning of dark channel and blur width as claimed in claim 7, wherein the mathematical expression of the superposition process in step S63 is:
Figure FDA0002939854790000031
wherein: b is the final rain-removing effect picture, IpreThe primary rain removing effect picture is obtained by combining the rain removing detail layer with the base layer.
CN201910314127.3A 2019-04-18 2019-04-18 Single image rain removing method and device based on dark channel and fuzzy width learning Active CN110111268B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910314127.3A CN110111268B (en) 2019-04-18 2019-04-18 Single image rain removing method and device based on dark channel and fuzzy width learning

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910314127.3A CN110111268B (en) 2019-04-18 2019-04-18 Single image rain removing method and device based on dark channel and fuzzy width learning

Publications (2)

Publication Number Publication Date
CN110111268A CN110111268A (en) 2019-08-09
CN110111268B true CN110111268B (en) 2021-08-03

Family

ID=67485815

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910314127.3A Active CN110111268B (en) 2019-04-18 2019-04-18 Single image rain removing method and device based on dark channel and fuzzy width learning

Country Status (1)

Country Link
CN (1) CN110111268B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110544217B (en) * 2019-08-30 2021-07-20 深圳市商汤科技有限公司 Image processing method and device, electronic equipment and storage medium
CN110928187B (en) * 2019-12-03 2021-02-26 北京工业大学 Sewage treatment process fault monitoring method based on fuzzy width self-adaptive learning model

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105184761A (en) * 2015-08-28 2015-12-23 中国科学院深圳先进技术研究院 Image rain removing method based on wavelet analysis and system
CN105931208A (en) * 2015-08-22 2016-09-07 首都师范大学 Physical model-based low-illuminance image enhancement algorithm

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI480810B (en) * 2012-03-08 2015-04-11 Ind Tech Res Inst Method and apparatus for rain removal based on a single image
CN105046653B (en) * 2015-06-12 2018-04-17 中国科学院深圳先进技术研究院 A kind of video raindrop minimizing technology and system
CN107909556B (en) * 2017-11-27 2021-11-23 天津大学 Video image rain removing method based on convolutional neural network
CN109064419A (en) * 2018-07-12 2018-12-21 四川大学 A kind of removing rain based on single image method based on WLS filtering and multiple dimensioned sparse expression

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105931208A (en) * 2015-08-22 2016-09-07 首都师范大学 Physical model-based low-illuminance image enhancement algorithm
CN105184761A (en) * 2015-08-28 2015-12-23 中国科学院深圳先进技术研究院 Image rain removing method based on wavelet analysis and system

Also Published As

Publication number Publication date
CN110111268A (en) 2019-08-09

Similar Documents

Publication Publication Date Title
CN110148095B (en) Underwater image enhancement method and enhancement device
CN102750674B (en) Video image defogging method based on self-adapting allowance
CN111292258B (en) Image defogging method based on dark channel prior and bright channel prior
CN102831591B (en) Gaussian filter-based real-time defogging method for single image
CN109993804A (en) A kind of road scene defogging method generating confrontation network based on condition
CN106157267A (en) A kind of image mist elimination absorbance optimization method based on dark channel prior
CN110517203B (en) Defogging method based on reference image reconstruction
CN110148093B (en) Image defogging improvement method based on dark channel prior
CN110111268B (en) Single image rain removing method and device based on dark channel and fuzzy width learning
CN105631823A (en) Dark channel sky area defogging method based on threshold segmentation optimization
CN109523474A (en) A kind of enhancement method of low-illumination image based on greasy weather degradation model
CN108717686A (en) A kind of real-time video defogging method based on dark channel prior
CN105809643A (en) Image enhancing method based on self-adaptive block channel stretching
CN107730472A (en) A kind of image defogging optimized algorithm based on dark primary priori
CN106251296A (en) A kind of image defogging method and system
CN114693548B (en) Dark channel defogging method based on bright area detection
CN111598814A (en) Single image defogging method based on extreme scattering channel
CN112419163A (en) Single image weak supervision defogging method based on priori knowledge and deep learning
CN108765337B (en) Single color image defogging processing method based on dark channel prior and non-local MTV model
CN115249211A (en) Image restoration method based on underwater non-uniform incident light model
CN109360169B (en) Signal processing method for removing rain and mist of single image
Xu et al. Global image dehazing via frequency perception filtering
CN111028184B (en) Image enhancement method and system
CN115760640A (en) Coal mine low-illumination image enhancement method based on noise-containing Retinex model
CN115439346A (en) Defogging enhancement method for fog-containing image based on airborne embedded FPGA development platform

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