CN109523483A - A kind of image defogging method and device - Google Patents

A kind of image defogging method and device Download PDF

Info

Publication number
CN109523483A
CN109523483A CN201811353047.0A CN201811353047A CN109523483A CN 109523483 A CN109523483 A CN 109523483A CN 201811353047 A CN201811353047 A CN 201811353047A CN 109523483 A CN109523483 A CN 109523483A
Authority
CN
China
Prior art keywords
image
pixel
dark primary
processed
primary image
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
CN201811353047.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.)
Beijing QIYI Century Science and Technology Co Ltd
Original Assignee
Beijing QIYI Century Science and 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 Beijing QIYI Century Science and Technology Co Ltd filed Critical Beijing QIYI Century Science and Technology Co Ltd
Priority to CN201811353047.0A priority Critical patent/CN109523483A/en
Publication of CN109523483A publication Critical patent/CN109523483A/en
Pending legal-status Critical Current

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/20Image enhancement or restoration using local operators
    • 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/20024Filtering details

Landscapes

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

Abstract

The present invention provides a kind of image defogging method and device, image to be processed is pre-processed, obtain the corresponding dark primary image of pretreatment image, to eliminate factor influential on air light value in image to be processed, then according to the corresponding filtering weighting of pixel each in dark primary image and the corresponding gray level image of dark primary image, obtain the corresponding grey level compensation image of dark primary image, and gray level image includes abundant and accurate marginal information, therefore marginal information wrong in dark primary image can be changed by being introduced into gray level image, improve the accuracy of marginal information in grey level compensation image, thus the accuracy of the air index obtained according to grey level compensation image is improved, the thin of the edge that image to be processed can be effectively kept when defogging processing and image to be processed is carried out to image to be processed according to air index and air light value in this way Section, to improve the edge defog effect of image and promote the image visual effect after defogging.

Description

A kind of image defogging method and device
Technical field
The invention belongs to technical field of image processing, more specifically more particularly to a kind of image defogging method and device.
Background technique
In the bad environment of meteorological condition, the image of electronic equipment shooting will receive the suspended particles in air, such as mist Influence so that the quality of image reduces, this is because suspended particles can generate light and absorb and scattering, lead to electronic equipment There is phenomena such as fuzzy image, color distortion and contrast decline in captured image, for the environment bad in meteorological condition In the image that takes, need to carry out image defogging processing to improve the quality of image.
Image defogging processing method can carry out defogging processing using filtering method at present, such as using median filtering, guidance Any one filtering method in filtering and dual area filtering etc., but this filtering method is for any pixel point in image For, the correlation degree in the pixel and neighborhood between pixel is not accounted for, to reduce the defogging effect at the edge of image Fruit.
Summary of the invention
In view of this, the purpose of the present invention is to provide a kind of image defogging method and devices, for improving the side of image The defog effect of edge.Technical solution is as follows:
The present invention provides a kind of image defogging method, which comprises
Image to be processed is pre-processed, the corresponding dark primary image of the image to be processed is obtained;
According to the corresponding filtering weighting of pixel each in the dark primary image and the corresponding gray scale of the dark primary image Image obtains the corresponding grey level compensation image of the dark primary image;
According to the grey level compensation image, obtain the corresponding air index of the image to be processed, and determine it is described to Handle the corresponding air light value of image;
According to the corresponding air index of image to be processed and the corresponding air light value of the image to be processed, to institute It states image to be processed and carries out defogging processing.
Preferably, described according to the corresponding filtering weighting of pixel each in the dark primary image and the dark primary image Corresponding gray level image, obtaining the corresponding grey level compensation image of the dark primary image includes:
Determine the corresponding filtering weighting of each pixel in the dark primary image;
According to the corresponding filtering weighting of pixel each in the dark primary image, place is filtered to the dark primary image Reason, obtains filtered dark primary image;
Obtain the corresponding gray level image of the dark primary image;
According to the pixel value of each pixel at the edge for being located at the gray level image, to the filtered dark primary image Grey level compensation is carried out, the grey level compensation image is obtained.
Preferably, the corresponding filtering weighting of each pixel includes: in the determination dark primary image
Determine that the area adjacency path of the dark primary image, the area adjacency path of the dark primary image are described dark The area adjacency path of presetted pixel group in primary colour image;
To any pixel point in the dark primary image in addition to the pixel in the presetted pixel group: determining the picture The correlation degree of pixel on vegetarian refreshments and the area adjacency path, and according to picture on the pixel and the area adjacency path The correlation degree of vegetarian refreshments obtains the corresponding filtering weighting of the pixel;
To the pixel in the presetted pixel group: this will be determined as the preset filtering weighting of presetted pixel group and preset The corresponding filtering weighting of pixel in pixel group.
Preferably, the corresponding air light value of the determination image to be processed includes: by the filtered dark primary The intensity value of the most bright pixel of brightness is determined as air light value in image.
Preferably, described according to the grey level compensation image, obtain the corresponding air index packet of the image to be processed It includes:
It is filtered according to using in the dark primary image the corresponding filtering weighting of each pixel to be filtered Dark primary image obtains initial atmosphere refractive index;
According to the pixel value of each pixel in the grey level compensation image and the initial atmosphere refractive index, obtain described The corresponding air index of image to be processed.
Preferably, described according to using the corresponding filtering weighting of each pixel in the dark primary image to be filtered to obtain Filtered dark primary image, obtaining initial atmosphere refractive index includes:
According to formula:Obtain initial atmosphere refractive indexI′darkIt (x) is filtered dark Primary colour image, θ are constant factor, and A is the corresponding air light value of the image to be processed;
The pixel value according to each pixel in the grey level compensation image and the initial atmosphere refractive index, obtain The corresponding air index of the image to be processed includes:
According to formula:The corresponding air index t (x) of the image to be processed is obtained, wherein KiFor the pixel value of the ith pixel point in the binary image of the grey level compensation image, n is the grey level compensation image Pixel sum in binary image,For the initial atmosphere refractive index.
The present invention also provides a kind of image demister, described device includes:
Pretreatment unit obtains the corresponding dark primary of the image to be processed for pre-processing to image to be processed Image;
Image acquiring unit, for according to the corresponding filtering weighting of pixel each in the dark primary image and the dark original Chromatic graph obtains the corresponding grey level compensation image of the dark primary image as corresponding gray level image;
Atmospheric parameter obtaining unit, for it is corresponding big to obtain the image to be processed according to the grey level compensation image Gas refractive index, and determine the corresponding air light value of the image to be processed;
Defogging unit, for corresponding according to the corresponding air index of image to be processed and the image to be processed Air light value carries out defogging processing to the image to be processed.
Preferably, described image obtaining unit, comprising:
Weight determines subelement, for determining the corresponding filtering weighting of each pixel in the dark primary image;
Filtering subunit is used for according to the corresponding filtering weighting of pixel each in the dark primary image, to the dark original Chromatic graph picture is filtered, and obtains filtered dark primary image;
First image obtains subelement, for obtaining the corresponding gray level image of the dark primary image;
Second image obtains subelement, and the pixel value of each pixel at the edge of the gray level image is located at for basis, Grey level compensation is carried out to the filtered dark primary image, obtains the grey level compensation image.
Preferably, the atmospheric parameter obtaining unit, comprising:
Air light value obtains subelement, for by the strong of the most bright pixel of brightness in the filtered dark primary image Angle value is determined as air light value;
Initial index of refraction obtains subelement, for according to using the corresponding filtering power of each pixel in the dark primary image The filtered dark primary image being filtered again, obtains initial atmosphere refractive index;
Air index obtain subelement, for according to each pixel in the grey level compensation image pixel value and institute Initial atmosphere refractive index is stated, the corresponding air index of the image to be processed is obtained.
Preferably, the initial index of refraction obtains subelement, is specifically used for according to formula:It obtains Initial atmosphere refractive indexI′darkIt (x) is filtered dark primary image, θ is constant factor, and A is the image to be processed Corresponding air light value;
The air index obtains subelement, is specifically used for according to formula:Obtain it is described to The corresponding air index t (x) of image is handled, wherein KiFor i-th of picture in the binary image of the grey level compensation image The pixel value of vegetarian refreshments, n are the pixel sum in the binary image of the grey level compensation image,For the initial atmosphere Refractive index.
From above-mentioned technical proposal it is found that pre-processing to image to be processed, the corresponding dark primary of pretreatment image is obtained Image, to eliminate factor influential on air light value in image to be processed, then according to pixel pair each in dark primary image The filtering weighting and the corresponding gray level image of dark primary image answered obtain the corresponding grey level compensation image of dark primary image, and grey Spending image includes abundant and accurate marginal information, thus by be introduced into gray level image can change it is wrong in dark primary image Marginal information, improve grey level compensation image in marginal information accuracy, thus improve obtained according to grey level compensation image it is big The accuracy of gas refractive index can have when carrying out defogging processing to image to be processed according to air index and air light value in this way Effect keeps the edge of image to be processed and the details of image to be processed, to improve the edge defog effect of image and promote defogging Image visual effect afterwards.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is the present invention Some embodiments for those of ordinary skill in the art without creative efforts, can also basis These attached drawings obtain other attached drawings.
Fig. 1 is a kind of flow chart of image defogging method provided in an embodiment of the present invention;
Fig. 2 is the flow chart provided in an embodiment of the present invention that grey level compensation is carried out to dark primary image;
Fig. 3 is the schematic diagram provided in an embodiment of the present invention that grey level compensation is carried out to dark primary image;
Fig. 4 is the contrast schematic diagram before and after image defogging provided in an embodiment of the present invention;
Fig. 5 is a kind of structural schematic diagram of image demister provided in an embodiment of the present invention;
Fig. 6 is the structural schematic diagram of image acquiring unit in image demister provided in an embodiment of the present invention;
Fig. 7 is the structural schematic diagram of atmospheric parameter obtaining unit in image demister provided in an embodiment of the present invention.
Specific embodiment
In order to make the object, technical scheme and advantages of the embodiment of the invention clearer, below in conjunction with the embodiment of the present invention In attached drawing, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment is A part of the embodiment of the present invention, instead of all the embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art Every other embodiment obtained without making creative work, shall fall within the protection scope of the present invention.
Referring to Fig. 1, it illustrates a kind of flow charts of image defogging method provided in an embodiment of the present invention, for improving The defog effect at the edge of image, specifically may comprise steps of:
S101: pre-processing image to be processed, the corresponding dark primary image of image to be processed is obtained, to eliminate wait locate Factor influential on air light value in image is managed, influence of the white light to air light value in image to be processed is such as eliminated.
In the present embodiment, processing image can be treated using dark primary elder generation checking method to be pre-processed, wherein dark primary First checking method is by the way that multiple fog free images, (so-called fog free images are shot under no mist or the lesser environment of fog To image) statistics obtain, it is specific: the regional area in most fog free images in addition to sky region In (regional area is the partial region in fog free images), certain some pixel always has at least one Color Channel with very low Value.In other words, the minimum value of the luminous intensity of the regional area in the fog free images in addition to sky region is a very little Number, if being described with formula, corresponding formula is as follows:
Wherein J1For a Color Channel in the channel rgb in image to be processed, θ (x) is with the picture in image to be processed Partial region centered on vegetarian refreshments x, J ' are J1Dark primary, it is possible thereby to which to obtain image to be processed corresponding based on above-mentioned formula Dark primary image.
S102: according to the corresponding filtering weighting of pixel each in dark primary image and the corresponding grayscale image of dark primary image Picture obtains the corresponding grey level compensation image of dark primary image.Why introduce the corresponding gray level image of dark primary image be because are as follows: Gray level image includes abundant and accurate marginal information (accuracy as being located at the pixel value of each pixel at edge is higher), is led to Marginal information wrong in dark primary image can be changed by crossing gray level image, and marginal information is accurate in raising grey level compensation image Degree.
In the present embodiment, the process for obtaining the corresponding grey level compensation image of dark primary image can be as shown in fig.2, packet Include following steps:
S1021: the corresponding filtering weighting of each pixel in dark primary image is determined.
S1022: according to the corresponding filtering weighting of pixel each in dark primary image, place is filtered to dark primary image Reason, obtains filtered dark primary image.
That is for any pixel point in dark primary image: determine the corresponding filtering weighting of the pixel, The pixel is filtered using the pixel corresponding filtering weighting.Filtering is propagated using cluster in the present embodiment Device is filtered dark primary image, this is because cluster, which propagates filter, has good edge preserving smoothing characteristic, The edge of image to be processed can be effectively kept by the filtering processing that cluster propagates filter, and then the edge for improving image is gone Fog effect.
Dark primary image is filtered in order to propagate filter by cluster, it is necessary first to determine dark primary image In the corresponding filtering weighting of each pixel, it is with pixel on area adjacency path between image pixel that wherein cluster, which propagates filter, Correlation degree defines filtering weighting, when its nearlyr correlation degree is stronger at a distance from area adjacency path pixel, filtering power Again bigger, when its remoter correlation degree will weaken pixel at a distance from area adjacency path, filtering weighting also can gradually subtract It is small, pixel group is introduced during calculating filtering weighting thus, can specifically define a fixed area in image is one A pixel group, as 16 pixels adjacent in image form a pixel group, and the area adjacency path in the determining pixel group For the area adjacency path of image, for calculating filtering weighting.
Wherein the area adjacency path in the pixel group is grown by adjacent pixel iteration in the pixel group, growth Rule are as follows: in the pixel group, if pixel y, in the horizontal or vertical direction of x, area adjacency path is that two pixels are connected directly Line segment;If pixel y determines that the area adjacency path iteration is raw by manhatton distance not in the horizontal or vertical direction of x Long direction, specific dy,xFor manhatton distance and unrelated with x and y, if dy,xValue be odd number, then the direction grown is Vertical direction, if dy,xValue be even number, then the direction grown be horizontal direction.
After determining the area adjacency path in pixel group according to above-mentioned growing strategy, for any in other pixel groups Pixel: calculate the pixel to the area adjacency path distance (a kind of mode of correlation degree), and according to the pixel Distance to the area adjacency path obtains the filtering weighting of the pixel, such as according to the corresponding relationship of distance and filtering weighting Obtain the filtering weighting of the pixel;For each pixel in the pixel group where area adjacency path, pixel Filtering weighting can be pre-set one value, the filtering of each pixel in the pixel group as where area adjacency path Weight is 1.
Or correlation degree can be determined by the similarity between pixel, region that thus can be complete with pixel Based on neighborhood paths, for any pixel point in other pixel groups: calculating picture in the pixel and the area adjacency path Similarity between vegetarian refreshments, and the pixel is obtained according to the similarity in the pixel and the area adjacency path between pixel The filtering weighting of point, such as obtains the filtering weighting of the pixel according to the corresponding relationship of similarity and filtering weighting;For area For each pixel in pixel group where the neighborhood paths of domain, the pixel and other in the pixel group in the pixel group are calculated Similarity between pixel (remaining all pixels point or the pixel adjacent with the pixel in such as pixel group), root According to the similarity between other pixels in the pixel in the pixel group and the pixel group, the filtering power of the pixel is obtained Weight.
S1023: the corresponding gray level image of dark primary image is obtained.It is to be understood that by being carried out to dark primary image Greyscale transformation obtains the corresponding gray level image of dark primary image, such as obtains the corresponding gray scale of dark primary image r based on s=T (r) Image s, wherein T () indicates greyscale transformation function, can be using any one in existing greyscale transformation function.
S1024: according to be located at gray level image edge each pixel pixel value, to filtered dark primary image into Row grey level compensation obtains grey level compensation image.
The feasible pattern of one of grey level compensation is: will be located at each pixel at the edge of filtered dark primary image Pixel value be revised as positioned at gray level image edge each pixel pixel value.In the present embodiment, gray level image and dark Primary colour image is all to convert from same image to be processed, therefore gray level image is identical with the edge in dark primary image, This means that each pixel positioned at the edge of filtered dark primary image and each pixel positioned at the edge of gray level image Point position in the picture is identical but pixel value is possible to different, thus to the of the edge for being located at filtered dark primary image For m pixel: the pixel value of m-th of pixel is revised as pixel value of m-th of pixel in gray level image, m 1 Any one into M, M are edge pixel point sum in image to be processed.Due to including abundant and accurate in gray level image Marginal information, the accuracy for being such as located at the pixel value of each pixel at edge is higher, therefore is being located at filtered dark primary figure Thus obtained grey level compensation figure can be improved in the pixel value of each pixel at the edge of picture after modifying referring to gray level image The accuracy of marginal information as in.
It 3 is illustrated with reference to the accompanying drawing, arrow initial position is successively filtered dark primary image in fig. 3 The part of part and gray level image, the 6th pixel (shown in circle) is the pixel positioned at edge in this two parts, and the Pixel value in the dark primary image of 6 pixels after the filtering is different from its pixel value in gray level image, to filtering The pixel value in the 6th pixel dark primary image after the filtering is revised as when rear dark primary image carries out grey level compensation Its pixel value in gray level image, as shown in arrow final position.
S103: according to grey level compensation image, the corresponding air index of image to be processed is obtained, and determines image to be processed Corresponding air light value.It is as follows in a kind of feasible pattern that the present embodiment obtains air index:
According to using the filtered dark original that the corresponding filtering weighting of each pixel is filtered in dark primary image Chromatic graph picture obtains initial atmosphere refractive index;And it is rolled over according to the pixel value of each pixel in grey level compensation image and initial atmosphere Rate is penetrated, the corresponding air index of image to be processed is obtained.
Wherein how to be filtered using the corresponding filtering weighting of pixel each in dark primary image and please refers to step S102 In related description, this present embodiment is no longer illustrated.It in the present embodiment, can be according to formula: Obtain initial atmosphere refractive indexI′darkIt (x) is filtered dark primary image, θ is constant factor, and A is image to be processed Corresponding air light value, the method for determination of air light value may is that the pixel that brightness in filtered dark primary image is most bright The intensity value of point is as air light value.
After obtaining initial atmosphere refractive index, according to formula:It is corresponding to obtain image to be processed Air index t (x), wherein KiFor the pixel value of the ith pixel point in the binary image of grey level compensation image, n is ash Pixel sum in the binary image of degree compensation image,For initial atmosphere refractive index.
S104: according to the corresponding air index of image to be processed and the corresponding air light value of image to be processed, place is treated It manages image and carries out defogging processing.Such as it can be according to the following formula:
Defogging processing is carried out to image I (x) to be processed, obtains restored image J (x).Into One step, in order to avoid air index t (x) is 0 restored image J (x) to be caused excessively to be amplified, defogging institute according to formula Middle introducing parameter t0, formula, which changes, to be as follows:
To reduce the distortion level of restored image J (x).
As shown in figure 4, the processing of image defogging is carried out using image defogging method provided in this embodiment to left figure in Fig. 4, Processing result shown in right figure in Fig. 4 is obtained, by left and right two width figures comparison in Fig. 4 it is found that using image provided in this embodiment Defogging method makes the edge defog effect of image more thorough relative to other regions, improves the edge defog effect of image, and And the edge of image to be processed and the details of image to be processed are effectively kept, afternoon image visual effect is removed to be promoted.
From above-mentioned technical proposal it is found that pre-processing to image to be processed, the corresponding dark primary of pretreatment image is obtained Image, to eliminate factor influential on air light value in image to be processed, then according to pixel pair each in dark primary image The filtering weighting and the corresponding gray level image of dark primary image answered obtain the corresponding grey level compensation image of dark primary image, and grey Spending image includes abundant and accurate marginal information, thus by be introduced into gray level image can change it is wrong in dark primary image Marginal information, improve grey level compensation image in marginal information accuracy, thus improve obtained according to grey level compensation image it is big The accuracy of gas refractive index can have when carrying out defogging processing to image to be processed according to air index and air light value in this way Effect keeps the edge of image to be processed and the details of image to be processed, to improve the edge defog effect of image and promote defogging Image visual effect afterwards.
For the various method embodiments described above, for simple description, therefore, it is stated as a series of action combinations, but Be those skilled in the art should understand that, the present invention is not limited by the sequence of acts described because according to the present invention, certain A little steps can be performed in other orders or simultaneously.Secondly, those skilled in the art should also know that, it is retouched in specification The embodiment stated belongs to preferred embodiment, and related actions and modules are not necessarily necessary for the present invention.
Corresponding with above method embodiment, the embodiment of the present invention also provides a kind of image demister, structure such as Fig. 5 It is shown, it may include: pretreatment unit 11, image acquiring unit 12, atmospheric parameter obtaining unit 13 and defogging unit 14.
Pretreatment unit 11 obtains the corresponding dark primary figure of image to be processed for pre-processing to image to be processed Picture such as eliminates in image to be processed white light to air light value to eliminate factor influential on air light value in image to be processed Influence, wherein the related description in embodiment of the method is please referred to the preprocessing process of image to be processed, to this present embodiment It is not illustrating.
Image acquiring unit 12, for according to the corresponding filtering weighting of pixel each in dark primary image and dark primary image Corresponding gray level image obtains the corresponding grey level compensation image of dark primary image.Why dark primary image corresponding ash is introduced Degree image is because of are as follows: gray level image include it is abundant and accurately marginal information (as positioned at the pixel value of each pixel at edge Accuracy is higher), marginal information wrong in dark primary image can be changed by gray level image, improved in grey level compensation image The accuracy of marginal information.
In the present embodiment, a kind of alternative construction of image acquiring unit 12 is as shown in fig. 6, may include: that weight determines Subelement 121, filtering subunit 122, the first image obtain subelement 123 and the second image obtains subelement 124.
Weight determines subelement 121, for determining the corresponding filtering weighting of each pixel in dark primary image, wherein determining The process of the corresponding filtering weighting of each pixel may is that the area adjacency path of determining dark primary image in dark primary image, The area adjacency path of dark primary image is the area adjacency path of presetted pixel group in dark primary image;To in dark primary image Any pixel point in addition to the pixel in presetted pixel group: the pass of pixel on the pixel and area adjacency path is determined Connection degree, and according to the correlation degree of pixel on the pixel and area adjacency path, obtain the corresponding filtering of the pixel Weight;To the pixel in presetted pixel group: presetted pixel group will be determined as the preset filtering weighting of presetted pixel group In the corresponding filtering weighting of pixel, illustrate and please refer to embodiment of the method, this present embodiment is not being illustrated.
Filtering subunit 122 is used for according to the corresponding filtering weighting of pixel each in dark primary image, to dark primary image It is filtered, obtains filtered dark primary image.
First image obtains subelement 123, for obtaining the corresponding gray level image of dark primary image.It is to be understood that By carrying out greyscale transformation to dark primary image, the corresponding gray level image of dark primary image is obtained, is such as obtained secretly based on s=T (r) The corresponding gray level image s of primary colour image r, wherein T () indicates greyscale transformation function, can use existing greyscale transformation function In any one.
Second image obtains subelement 124, right for the pixel value according to each pixel positioned at the edge of gray level image Filtered dark primary image carries out grey level compensation, obtains grey level compensation image.It is also please referred to for how to carry out grey level compensation Related description in embodiment of the method is not illustrating this present embodiment.
Atmospheric parameter obtaining unit 13, for obtaining the corresponding atmospheric refraction of image to be processed according to grey level compensation image Rate, and determine the corresponding air light value of image to be processed.In the present embodiment, a kind of optional knot of atmospheric parameter obtaining unit 13 Structure is as shown in fig. 7, may include: that air light value obtains subelement 131, initial index of refraction obtains subelement 132 and atmospheric refraction Rate obtains subelement 133.
Air light value obtains subelement 131, for by the strong of the most bright pixel of brightness in filtered dark primary image Angle value is determined as air light value.
Initial index of refraction obtains subelement 132, for according to using the corresponding filtering power of each pixel in dark primary image The filtered dark primary image being filtered again, obtains initial atmosphere refractive index.Specifically, according to formula:Obtain initial atmosphere refractive indexI′dark(x) be filtered dark primary image, θ be constant because Son, A are the corresponding air light value of image to be processed.
Air index obtains subelement 133, for according to the pixel value of each pixel in grey level compensation image and just Beginning air index obtains the corresponding air index of image to be processed.Specifically, according to formula:The corresponding air index t (x) of image to be processed is obtained, wherein KiIt is the two of grey level compensation image The pixel value of ith pixel point in value image, n are the pixel sum in the binary image of grey level compensation image,For initial atmosphere refractive index.
Defogging unit 14, for according to the corresponding air index of image to be processed and the corresponding atmosphere light of image to be processed Value carries out defogging processing to image to be processed.Such as it can be according to the following formula:
Defogging processing is carried out to image I (x) to be processed, obtains restored image J (x).Into One step, in order to avoid air index t (x) is 0 restored image J (x) to be caused excessively to be amplified, defogging institute according to formula Middle introducing parameter t0, formula, which changes, to be as follows:
To reduce the distortion level of restored image J (x).
From above-mentioned technical proposal it is found that pre-processing to image to be processed, the corresponding dark primary of pretreatment image is obtained Image, to eliminate factor influential on air light value in image to be processed, then according to pixel pair each in dark primary image The filtering weighting and the corresponding gray level image of dark primary image answered obtain the corresponding grey level compensation image of dark primary image, and grey Spending image includes abundant and accurate marginal information, thus by be introduced into gray level image can change it is wrong in dark primary image Marginal information, improve grey level compensation image in marginal information accuracy, thus improve obtained according to grey level compensation image it is big The accuracy of gas refractive index can have when carrying out defogging processing to image to be processed according to air index and air light value in this way Effect keeps the edge of image to be processed and the details of image to be processed, to improve the edge defog effect of image and promote defogging Image visual effect afterwards.
In addition, the embodiment of the present invention also provides a kind of storage medium, it is stored with computer program code on the storage medium, The computer program code realizes above-mentioned image defogging method when running.
The embodiment of the present invention also provides a kind of image defogging equipment, which includes processor and memory, Wherein processor is for realizing above-mentioned image defogging method, and memory carries out defogging treated image for storing.
It should be noted that all the embodiments in this specification are described in a progressive manner, each embodiment weight Point explanation is the difference from other embodiments, and the same or similar parts between the embodiments can be referred to each other. For device class embodiment, since it is basically similar to the method embodiment, so being described relatively simple, related place ginseng See the part explanation of embodiment of the method.
Finally, it is to be noted that, herein, relational terms such as first and second and the like be used merely to by One entity or operation are distinguished with another entity or operation, without necessarily requiring or implying these entities or operation Between there are any actual relationship or orders.Moreover, the terms "include", "comprise" or its any other variant meaning Covering non-exclusive inclusion, so that the process, method, article or equipment for including a series of elements not only includes that A little elements, but also including other elements that are not explicitly listed, or further include for this process, method, article or The intrinsic element of equipment.In the absence of more restrictions, the element limited by sentence "including a ...", is not arranged Except there is also other identical elements in the process, method, article or apparatus that includes the element.
The foregoing description of the disclosed embodiments can be realized those skilled in the art or using the present invention.To this A variety of modifications of a little embodiments will be apparent for a person skilled in the art, and the general principles defined herein can Without departing from the spirit or scope of the present invention, to realize in other embodiments.Therefore, the present invention will not be limited It is formed on the embodiments shown herein, and is to fit to consistent with the principles and novel features disclosed in this article widest Range.
The above is only a preferred embodiment of the present invention, it is noted that for the ordinary skill people of the art For member, various improvements and modifications may be made without departing from the principle of the present invention, these improvements and modifications are also answered It is considered as protection scope of the present invention.

Claims (10)

1. a kind of image defogging method, which is characterized in that the described method includes:
Image to be processed is pre-processed, the corresponding dark primary image of the image to be processed is obtained;
According to the corresponding filtering weighting of pixel each in the dark primary image and the corresponding gray level image of the dark primary image, Obtain the corresponding grey level compensation image of the dark primary image;
According to the grey level compensation image, the corresponding air index of the image to be processed is obtained, and determination is described to be processed The corresponding air light value of image;
According to the corresponding air index of image to be processed and the corresponding air light value of the image to be processed, to it is described to It handles image and carries out defogging processing.
2. the method according to claim 1, wherein described corresponding according to pixel each in the dark primary image Filtering weighting and the corresponding gray level image of the dark primary image, obtain the corresponding grey level compensation image of the dark primary image Include:
Determine the corresponding filtering weighting of each pixel in the dark primary image;
According to the corresponding filtering weighting of pixel each in the dark primary image, the dark primary image is filtered, Obtain filtered dark primary image;
Obtain the corresponding gray level image of the dark primary image;
According to the pixel value of each pixel at the edge for being located at the gray level image, the filtered dark primary image is carried out Grey level compensation obtains the grey level compensation image.
3. according to the method described in claim 2, it is characterized in that, each pixel is corresponding in the determination dark primary image Filtering weighting include:
Determine that the area adjacency path of the dark primary image, the area adjacency path of the dark primary image are the dark primary The area adjacency path of presetted pixel group in image;
To any pixel point in the dark primary image in addition to the pixel in the presetted pixel group: determining the pixel With the correlation degree of pixel on the area adjacency path, and according to pixel on the pixel and the area adjacency path Correlation degree, obtain the corresponding filtering weighting of the pixel;
To the pixel in the presetted pixel group: the presetted pixel will be determined as the preset filtering weighting of presetted pixel group The corresponding filtering weighting of pixel in group.
4. according to the method described in claim 2, it is characterized in that, the corresponding air light value of the determination image to be processed It include: that the intensity value of the most bright pixel of brightness in the filtered dark primary image is determined as air light value.
5. the method according to claim 1, wherein described according to the grey level compensation image, obtain it is described to Handling the corresponding air index of image includes:
According to using the filtered dark original that the corresponding filtering weighting of each pixel is filtered in the dark primary image Chromatic graph picture obtains initial atmosphere refractive index;
According to the pixel value of each pixel in the grey level compensation image and the initial atmosphere refractive index, obtain described wait locate Manage the corresponding air index of image.
6. according to the method described in claim 5, it is characterized in that, described according to using each pixel in the dark primary image The filtered dark primary image that corresponding filtering weighting is filtered, obtaining initial atmosphere refractive index includes:
According to formula:Obtain initial atmosphere refractive indexIdarkIt (x) is filtered dark primary figure Picture, θ are constant factor, and A is the corresponding air light value of the image to be processed;
The pixel value according to each pixel in the grey level compensation image and the initial atmosphere refractive index obtain described The corresponding air index of image to be processed includes:
According to formula:The corresponding air index t (x) of the image to be processed is obtained, wherein KiFor The pixel value of ith pixel point in the binary image of the grey level compensation image, n are the two-value of the grey level compensation image Change the pixel sum in image,For the initial atmosphere refractive index.
7. a kind of image demister, which is characterized in that described device includes:
Pretreatment unit obtains the corresponding dark primary image of the image to be processed for pre-processing to image to be processed;
Image acquiring unit, for according to the corresponding filtering weighting of pixel each in the dark primary image and the dark primary figure As corresponding gray level image, the corresponding grey level compensation image of the dark primary image is obtained;
Atmospheric parameter obtaining unit, for obtaining the corresponding atmosphere folding of the image to be processed according to the grey level compensation image Rate is penetrated, and determines the corresponding air light value of the image to be processed;
Defogging unit, for according to the corresponding air index of image to be processed and the corresponding atmosphere of the image to be processed Light value carries out defogging processing to the image to be processed.
8. device according to claim 7, which is characterized in that described image obtaining unit, comprising:
Weight determines subelement, for determining the corresponding filtering weighting of each pixel in the dark primary image;
Filtering subunit is used for according to the corresponding filtering weighting of pixel each in the dark primary image, to the dark primary figure As being filtered, filtered dark primary image is obtained;
First image obtains subelement, for obtaining the corresponding gray level image of the dark primary image;
Second image obtains subelement, for the pixel value according to each pixel positioned at the edge of the gray level image, to institute It states filtered dark primary image and carries out grey level compensation, obtain the grey level compensation image.
9. device according to claim 8, which is characterized in that the atmospheric parameter obtaining unit, comprising:
Air light value obtains subelement, for by the intensity value of the most bright pixel of brightness in the filtered dark primary image It is determined as air light value;
Initial index of refraction obtains subelement, for according to use in the dark primary image the corresponding filtering weighting of each pixel into The filtered dark primary image that row filtering obtains, obtains initial atmosphere refractive index;
Air index obtains subelement, for according to the pixel value of each pixel in the grey level compensation image and it is described just Beginning air index obtains the corresponding air index of the image to be processed.
10. device according to claim 9, which is characterized in that the initial index of refraction obtains subelement, is specifically used for root According to formula:Obtain initial atmosphere refractive indexI′darkIt (x) is filtered dark primary image, θ For constant factor, A is the corresponding air light value of the image to be processed;
The air index obtains subelement, is specifically used for according to formula:It obtains described to be processed The corresponding air index t (x) of image, wherein KiFor the ith pixel point in the binary image of the grey level compensation image Pixel value, n be the grey level compensation image binary image in pixel sum,For initial atmosphere refraction Rate.
CN201811353047.0A 2018-11-14 2018-11-14 A kind of image defogging method and device Pending CN109523483A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811353047.0A CN109523483A (en) 2018-11-14 2018-11-14 A kind of image defogging method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811353047.0A CN109523483A (en) 2018-11-14 2018-11-14 A kind of image defogging method and device

Publications (1)

Publication Number Publication Date
CN109523483A true CN109523483A (en) 2019-03-26

Family

ID=65777798

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811353047.0A Pending CN109523483A (en) 2018-11-14 2018-11-14 A kind of image defogging method and device

Country Status (1)

Country Link
CN (1) CN109523483A (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2026135A2 (en) * 2007-05-11 2009-02-18 Samsung Electronics Co., Ltd. Image forming apparatus and method thereof
US20100040300A1 (en) * 2008-08-18 2010-02-18 Samsung Techwin Co., Ltd. Image processing method and apparatus for correcting distortion caused by air particles as in fog
CN102542533A (en) * 2010-12-16 2012-07-04 方正国际软件(北京)有限公司 Image blurring method and system
CN104217416A (en) * 2013-05-31 2014-12-17 富士通株式会社 Grayscale image processing method and device
CN105898174A (en) * 2015-12-04 2016-08-24 乐视网信息技术(北京)股份有限公司 Video resolution improving method and device
CN106157270A (en) * 2016-08-29 2016-11-23 潍坊学院 A kind of single image rapid defogging method and system
CN106548461A (en) * 2016-10-25 2017-03-29 湘潭大学 Image defogging method

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2026135A2 (en) * 2007-05-11 2009-02-18 Samsung Electronics Co., Ltd. Image forming apparatus and method thereof
US20100040300A1 (en) * 2008-08-18 2010-02-18 Samsung Techwin Co., Ltd. Image processing method and apparatus for correcting distortion caused by air particles as in fog
CN102542533A (en) * 2010-12-16 2012-07-04 方正国际软件(北京)有限公司 Image blurring method and system
CN104217416A (en) * 2013-05-31 2014-12-17 富士通株式会社 Grayscale image processing method and device
CN105898174A (en) * 2015-12-04 2016-08-24 乐视网信息技术(北京)股份有限公司 Video resolution improving method and device
CN106157270A (en) * 2016-08-29 2016-11-23 潍坊学院 A kind of single image rapid defogging method and system
CN106548461A (en) * 2016-10-25 2017-03-29 湘潭大学 Image defogging method

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
汤红忠等: "结合最小颜色通道图与传播滤波的单幅图像去雾算法研究", 《通讯学报》 *
韩正汀等: "基于导向滤波优化的自然图像去雾新方法", 《计算机科学与探索》 *

Similar Documents

Publication Publication Date Title
CN106875373B (en) Mobile phone screen MURA defect detection method based on convolutional neural network pruning algorithm
Santra et al. Learning a patch quality comparator for single image dehazing
CN104517110B (en) The binarization method and system of a kind of image in 2 D code
CN109523480B (en) Defogging method and device for sea fog image, computer storage medium and terminal
CN108564549B (en) Image defogging method based on multi-scale dense connection network
CN109255758B (en) Image enhancement method based on all 1 x 1 convolution neural network
CN108805829B (en) Image data processing method, device, equipment and computer readable storage medium
CN110288550B (en) Single-image defogging method for generating countermeasure network based on priori knowledge guiding condition
CN108765342A (en) A kind of underwater image restoration method based on improvement dark
CN109740721B (en) Wheat ear counting method and device
CN106846261A (en) Underwater picture processing method based on convolutional neural networks
CN103989452A (en) Endoscope apparatus and control method thereof
CN108664839B (en) Image processing method and device
CN108182671B (en) Single image defogging method based on sky area identification
CN104504662A (en) Homomorphic filtering based image processing method and system
CN117764986B (en) Titanium plate surface defect detection method based on image processing
CN110807742A (en) Low-light-level image enhancement method based on integrated network
CN116703911B (en) LED lamp production quality detecting system
CN114926407A (en) Steel surface defect detection system based on deep learning
CN114037622A (en) Underwater image enhancement method based on imaging model and reinforcement learning
CN109101985A (en) It is a kind of based on adaptive neighborhood test image mismatch point to elimination method
CN115937032A (en) Underwater dark image restoration method and system
CN111192213A (en) Image defogging adaptive parameter calculation method, image defogging method and system
Tarawneh et al. Automatic gamma correction based on root-mean-square-error maximization
KR102277005B1 (en) Low-Light Image Processing Method and Device Using Unsupervised Learning

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20190326

RJ01 Rejection of invention patent application after publication