CN102609909A - Method and device for defogging single image - Google Patents

Method and device for defogging single image Download PDF

Info

Publication number
CN102609909A
CN102609909A CN2012100113265A CN201210011326A CN102609909A CN 102609909 A CN102609909 A CN 102609909A CN 2012100113265 A CN2012100113265 A CN 2012100113265A CN 201210011326 A CN201210011326 A CN 201210011326A CN 102609909 A CN102609909 A CN 102609909A
Authority
CN
China
Prior art keywords
image
pixel
mist
template
template window
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.)
Granted
Application number
CN2012100113265A
Other languages
Chinese (zh)
Other versions
CN102609909B (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.)
China Security and Surveillance Technology PRC Inc
Original Assignee
China Security and Surveillance Technology PRC Inc
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 China Security and Surveillance Technology PRC Inc filed Critical China Security and Surveillance Technology PRC Inc
Priority to CN201210011326.5A priority Critical patent/CN102609909B/en
Publication of CN102609909A publication Critical patent/CN102609909A/en
Application granted granted Critical
Publication of CN102609909B publication Critical patent/CN102609909B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Image Processing (AREA)

Abstract

The invention is suitable for the technical field of digital image treatment and provides a method and device for defogging a single image. The method comprises the following steps: utilizing a preset number of template windows and an image pixel value to obtain a dark pixel image of a foggy image; obtaining a whole atmospheric optical value of the foggy image; obtaining a distribution image of atmospheric transmission transmissivity according to the dark pixel image and the whole atmospheric optical value of the foggy image; and treating the foggy image according to the whole atmospheric optical value, the distribution image of atmospheric transmission transmissivity and a defogging expression formula, thereby obtaining a defogged recovered image. According to the method provided by the invention, a template window corresponding to each pixel point is self-adaptively obtained; a dark pixel of a corresponding pixel point is obtained according to the template window corresponding to a minimum variance; the whole atmospheric optical value is estimated in a preset area; a foggy image imaging model, the defogging expression formula, and the like, are combined; and under the condition of ensuring the defogging effect, the calculated volume and storage volume are greatly reduced, the image processing efficiency is increased, and the like.

Description

A kind of single image defogging method capable and device
Technical field
The invention belongs to the digital image processing techniques field, relate in particular to a kind of single image defogging method capable and device.
Background technology
At present, image mist elimination algorithm roughly can be divided into based on several image mist elimination algorithm with based on the mist elimination algorithm of single image.The multiple image that is based on the Same Scene of the shooting under the different weather condition based on the mist elimination algorithm of multiple image is realized the mist elimination algorithm; This algorithm need be waited until that weather condition changes and could obtain two width of cloth images; Very big restriction is arranged in time, generally be fit to the scene of video monitoring.Because lower to the requirement of input, or additional a spot of information just can realize image sharpening based on the mist elimination algorithm of single image, so more and more receive people's attention.At present, the best algorithm based on the single image mist elimination of effect is the single image defogging method capable based on the dark primary priori that He Kaiming etc. proposes, and this algorithm has proposed a kind of new priori---dark primary (Dark channel prior).Dark primary priori is from the statistical law to the no mist image data base in open air, based on through an observable ultimate facts---and all there is the very low pixel of value of a Color Channel at least in each regional area of most no mist images in open air.Utilize this priori to estimate the transfer rate of light, and repair algorithm (soft matting) through soft stingy figure transfer rate is repaired, utilize the atmosphere imaging model to solve the scene radiance at last.
Though the dark primary transcendental method is being made significant headway aspect the single image mist elimination; But in actual use; Soft matting algorithm makes that the entire process process is more consuming time, and needs a large amount of storage resources, has limited the application and the popularization of this method.
Summary of the invention
The purpose of the embodiment of the invention is to provide a kind of single image defogging method capable and device, is intended to solve because when utilizing the conventional images defogging method capable to carry out the processing of image mist elimination, spended time is long, calculated amount is big, take the many problems of storage resources.
The embodiment of the invention is achieved in that a kind of single image defogging method capable, and said method comprises the steps:
Utilize the template window and the image pixel value of preset number, obtain the dark pixel figure of mist image;
In predeterminable area, obtain the said whole atmosphere light value that the mist image is arranged;
According to said dark pixel figure and the said whole atmosphere light value that the mist image is arranged, obtain the distribution plan of propagation in atmosphere transmissivity;
According to the distribution plan and the mist elimination expression formula of said whole atmosphere light value, said propagation in atmosphere transmissivity, there is the mist image to handle to said, obtain the restored image behind the mist elimination.
Particularly, the template window of said preset number is the template window of M N*N, and M gets the integer greater than 1, and N gets the odd number that comprises more than 3, is that the polygonal shape that 1 point is formed has nothing in common with each other by value in the template window of a said M N*N.
Further, utilize a said M template window and image pixel value, the step of obtaining the dark pixel figure of mist image specifically comprises:
Judging has the arbitrary pixel in the mist image whether to be positioned at preset range;
When said arbitrary pixel is when being positioned at this preset range, utilize a said M template window, obtained the pairing M variance in a said M template window of pixel described in the mist image, and the pairing template window of definite minimum variance;
Utilize the pairing template window of said minimum variance, obtain the dark pixel of said pixel, and then obtain the dark pixel values of all pixels in the preset range in the mist image;
When said arbitrary pixel is not when being positioned at said preset range,, obtain the dark pixel values of all outer pixels of said preset range according to the pixel value that all pixels outside the preset range in the mist image are arranged.
Further, utilize a said M template window, obtained the pairing M variance in a said M template window of pixel described in the mist image, and the step of the pairing template window of definite minimum variance comprise specifically:
According to a preset equal value expression of template and a said M template window, obtain said arbitrary pixel pairing M template average in a said M template window;
According to M the template average and the preset template variance expression formula of said arbitrary pixel, obtain M variance of said arbitrary pixel;
Obtain the pairing template window of minimum variance in the said M variance.
Particularly, said predeterminable area is meant the regional extent that the top one-row pixels of one-row pixels to image preset the mist image is arranged from said, and said mist elimination expression formula is:
J ( x ) = I ( x ) - A max ( t ( x ) , t 0 ) + A ;
Wherein, the arbitrary pixel in the x presentation video, I (x) expression has the mist image, and J (x) is a restored image, t (x) expression propagation in atmosphere transmissivity, A representes whole atmosphere light value, the t0 value is 0.1.
Another purpose of the embodiment of the invention is to provide a kind of single image mist elimination device, and said device comprises:
Dark pixel figure acquiring unit is used to utilize template window and the image pixel value of presetting number, obtains the dark pixel figure of mist image;
Atmosphere light value acquiring unit is used in predeterminable area, obtaining the said whole atmosphere light value that the mist image is arranged;
Transmissivity distribution figure acquiring unit is used for the dark pixel figure and the said whole atmosphere light value that the mist image are arranged according to said, obtains the distribution plan of propagation in atmosphere transmissivity; And
The image restoration unit is used for distribution plan and mist elimination expression formula according to said whole atmosphere light value, said propagation in atmosphere transmissivity, has the mist image to handle to said, obtains the restored image behind the mist elimination.
Particularly, the template window of said preset number is the template window of the different N*N of M, and M gets the integer greater than 1, and N gets the odd number that comprises 3 or more, is that the polygonal shape that 1 point is formed has nothing in common with each other by value in the template window of the individual different N*N of said M.
Further, said dark pixel figure acquiring unit specifically comprises:
Judging unit is used for judging have arbitrary pixel of mist image whether to be positioned at this preset range;
The template acquiring unit; Be used for when said judging unit output result when being; Utilize a said M template window, obtain the arbitrary pixel pairing M variance in a said M template window in the preset range in the mist image, and the pairing template window of definite minimum variance;
The first dark pixel values acquiring unit is used to utilize the pairing template window of said minimum variance, obtains the dark pixel of said pixel, and then obtains the dark pixel values of all pixels in the preset range in the mist image; And
The second dark pixel values acquiring unit, be used for when said judging unit output result for not the time, according to the pixel value that all outer pixels of preset range in the mist image are arranged, obtain the dark pixel values of all outer pixels of said preset range.
Further, said template acquiring unit specifically comprises:
The average acquiring unit is used for obtaining said arbitrary pixel pairing M template average in a said M template window according to preset an equal value expression of template and a said M template window;
The variance acquiring unit is used for M template average and preset template variance expression formula according to said arbitrary pixel, obtains M variance of said arbitrary pixel; And
The template acquiring unit is used for obtaining said M the pairing template window of variance minimum variance.
Particularly, said predeterminable area is meant the regional extent that the top one-row pixels of one-row pixels to image preset the mist image is arranged from said, and said mist elimination expression formula is:
J ( x ) = I ( x ) - A max ( t ( x ) , t 0 ) + A ;
Wherein, the arbitrary pixel in the x presentation video, I (x) expression has the mist image, and J (x) is a restored image, t (x) expression propagation in atmosphere transmissivity, A representes whole atmosphere light value, the t0 value is 0.1.
The embodiment of the invention is obtained the dark pixel figure of mist image through utilizing the template window and the image pixel value of preset number, obtains the whole atmosphere light value that this has the mist image; According to this dark pixel figure and this integral body atmosphere light value of mist image are arranged; Obtain the distribution plan of propagation in atmosphere transmissivity, finally, have the mist image to handle this according to the distribution plan and the mist elimination expression formula of this integral body atmosphere light value, this propagation in atmosphere transmissivity; Obtain the restored image behind the mist elimination; Solved the existing image defogging method capable that utilizes and carried out the image mist elimination when handling, spended time is long, calculated amount is big, take the many problems of storage resources, thereby has reduced calculated amount and memory space effectively; Reduced the mist elimination processing time, and guaranteed the mist elimination effect of mist image is arranged.
Description of drawings
Fig. 1 is the realization flow figure of the single image defogging method capable that provides of first embodiment of the invention;
Fig. 2 be first embodiment of the invention provide obtain the pairing template window realization flow of minimum variance figure;
Fig. 3 is the synoptic diagram of 9 kinds of template window in the single image defogging method capable that provides of the embodiment of the invention;
Fig. 4 is the structural drawing of the single image mist elimination device that provides of second embodiment of the invention.
Embodiment
In order to make the object of the invention, technical scheme and advantage clearer,, the present invention is further elaborated below in conjunction with accompanying drawing and embodiment.Should be appreciated that specific embodiment described herein only in order to explanation the present invention, and be not used in qualification the present invention.
The embodiment of the invention is according to the template window that gets access to and the pixel value of image; Needing to obtain the dark pixel figure that the mist image is arranged of processing; And obtain this whole atmosphere light value that mist image is arranged, the distribution plan of propagation in atmosphere transmissivity etc., obtain the restored image behind the mist elimination according to the mist elimination expression formula.The present invention can make the image mist elimination handle time decreased, the calculated amount that is spent and take storage resources and reduce under the prerequisite that guarantees the mist elimination effect.
Below in conjunction with specific embodiment concrete realization of the present invention is described in detail:
Embodiment one:
Fig. 1 shows the realization flow of the single image defogging method capable that first embodiment of the invention provides, and details are as follows:
In step S101, utilize the template window and the image pixel value of preset number, obtain the dark pixel figure of mist image.
Wherein, The template window that should preset number is the template window of M different N*N, and the value in this template window is formed by 0,1, and M gets the integer greater than 1; N gets the odd number that comprises more than 3, is that the polygonal shape that 1 point is formed has nothing in common with each other by value in the template window of the N*N that this M is different.
This step S101 specifically comprises:
Judging has the arbitrary pixel in the mist image whether to be positioned at preset range;
When this arbitrary pixel is when being positioned at this preset range, utilize this M template window, obtained this arbitrary pixel pairing M variance in this M template window in the mist image, and the pairing template window of definite minimum variance;
Utilize the pairing template window of this minimum variance, obtain the dark pixel of this pixel, and then obtain the dark pixel values of all pixels in this preset range in the mist image;
When this arbitrary pixel is not when being positioned at this preset range,, obtain the dark pixel values of all outer pixels of this preset range according to this pixel value that all pixels outside preset range in mist image are arranged.
Wherein, be meant in this preset range that the scope of this template window central point present position, this preset range are meant at this to be had in the mist image, the scope except that this preset range when this template window can be positioned at this fully the mist image is arranged outward.
In embodiments of the present invention; The proposition of dark pixel is based on the following fact to outdoor image observation clearly and realizes: do not comprising most regional areas of sky and greyish white object; Have at least a Color Channel to possess very low intensity level; There is not the colored scene image J of mist for a width of cloth, definition:
J dark ( x ) = min c ∈ { r , g , b } ( min y ∈ Ω ( x ) ( J c ( y ) ) ) ; - - - ( 1 )
Wherein, c is a color channel among R, G, the B, and Ω (x) is the topography module window of center at pixel x place, like the template window of N*N, J c(y) be that pixel y place, c are the brightness value of passage among the scene image J, y is in this Ω (x) scope.There is not the outdoor scene image J of haze for a width of cloth, except frosty area such as skies, J DarkBrightness very little, often go to zero, therefore, claim J DarkBe the dark pixel of image J, the physical significance of this formula (1) is to obtain in the regional Ω (x) that with x is the center, gets value minimum in R value, G value and the B value of all pixels, and this minimum value is the dark pixel values J of pixel x Dark(x).And there are one-to-one relationship in dark pixel and transmissivity; This transmissivity is represented the propagation in atmosphere rate; When the scenery degree of depth was suddenlyd change, transmissivity also will great changes will take place, so; Transmissivity is always inconstant in a regional area Ω (x), thereby the existing deviation of utilizing the fixed form window to obtain transmissivity that dark pixel values calculates and actual value maybe be too big.
In embodiments of the present invention; The concrete steps of obtaining the pairing template window of minimum variance among this step S101 can be called adaptively selected regional area template, obtain transmissivity and actual value problem bigger than normal that dark pixel values obtains thereby can solve the above-mentioned existing fixed form window that utilizes well.
As shown in Figure 2; When this arbitrary pixel is when being positioned at this preset range; Utilize this M template window; Obtained this arbitrary pixel pairing M variance in this M template window in the mist image, and the pairing template window step of definite minimum variance may further comprise the steps S201, step S202 and step S203, is specially:
In step S201,, obtain this arbitrary pixel pairing M template average in this M template window according to the preset equal value expression of template and this M template window.
In step S202,, obtain M variance of this arbitrary pixel according to M the template average and the preset template variance expression formula of this arbitrary pixel.
Particularly; The template window of the different N*N of a plurality of M in other words can be set in advance, and this moment, N can get the odd number that comprises more than 3, was 9 to get M, N is 5; The template window of also promptly getting 9 5*5 is an example; But be not limited to this template window, then make 9 kinds of different windows, the number of the window that this moment is different also can be set according to user's actual needs.Shown in Fig. 3 (a)~Fig. 3 (i) this be totally 9 kinds of different template window; Comprise by value being that 4 pentagons forming of 1 point, 4 hexagons, 1 length of side are 3 square in these 9 kinds of difform template window, obtain in original mist image the template average M of each pixel in the preset range respectively mAnd corresponding variance δ m, this acquisition methods is respectively like expression formula (2), (3), and wherein value is that 1 point is represented k=1 with k in these a plurality of template window; 2,3 ..., P; This P is 1 number for each template window intermediate value, and this value is that the pixel value of some k correspondence position in the mist image is arranged of 1 is with I (i, j) expression, and be gray level image if this has the mist image; Then (i j) is the brightness value of this k point corresponding grey scale image to I, and is coloured image if this has the mist image; Then need convert this coloured image into gray level image, obtain again this k point corresponding grey scale image brightness value I (i, j):
M m = Σ k = 1 k = P I ( i , j ) P ; - - - ( 2 )
δ m = Σ k = 1 k = P ( I 2 ( i , j ) - M m 2 ) ; - - - ( 3 )
Thereby,, can obtain M variance yields of this arbitrary pixel according to equal value expression (2), variance expression formula (3) for each pixel.
In step S203, obtain the pairing template window of minimum variance in this M variance.
Particularly; According to formula (2), (3),, can obtain a plurality of variances for the pixel in each preset range; Owing to contain the zone on sharp edge edge; Variance is must mild zone big, and therefore, the template window Ω ' in the time of can adopting minimum and this minimum variance of variance less than predetermined threshold value thred_ δ (x) comes the dark pixel values at the pixel x place of computed image; Then this have each pixel in the preset range in the mist image all corresponding these a plurality of preset template window in a more suitable template window, i.e. optimal Template window.If in the actual process; A plurality of identical and satisfied minimum variance values less than predetermined threshold value appear; A pairing template window of minimum variance that then can picked at random satisfies this condition arbitrarily; Thereby utilize this template window Ω ' (x) and formula (1), (x) individual element slides on the mist image having with this template window Ω ', just can obtain the dark pixel values that this has the interior every bit of mist image preset range.
Particularly; With Ω ' is that the template window shown in Fig. 3 (a) is an example (x); In obtaining original mist image during the dark pixel values at pixel x place; Center position correspondence with this template window is positioned over this x place earlier, and this that then this template window covered has 25 pixel organization center points in the mist image at the regional area at x place, also be Ω ' (x); Utilize formula (1) obtain this Ω ' (x) in the scope all values be the pixel of 1 the pairing original mist image of point minimum pixel value in three passages, then represent the dark pixel values of x with this minimum pixel value.According to this theory, utilize this that corresponding optimal Template window of each pixel in preset range in mist image is arranged, can obtain the dark pixel values of all pixels in the preset range in the mist image.There is halation in the method for this adaptively selected best local zone template or title optimal Template window in the time of can avoiding restored image, improves the dirigibility that template is chosen, and guarantees the accuracy of result of calculation.
In addition; All outer pixels of preset range in corresponding original mist image; Minimum value is as the dark pixel values of this pixel in three values of R, G, B of each pixel that then can this preset range is outer, thereby gets access to the dark pixel values of all outer pixels of this preset range.
In step S102, in predeterminable area, obtain the whole atmosphere light value that this has the mist image.
Wherein, this predeterminable area is meant the regional extent that the top one-row pixels of one-row pixels to image preset the mist image is arranged from this.
In the practical implementation process, this integral body atmosphere light value is represented with A, is the atmosphere light of infinite distant place, and the estimation of atmosphere light is general all with pixel value the brightest in image atmosphere light value as a whole.Yet in true picture, the pairing object of bright pixel possibly be the car of a white or the building of a white etc., has in the mist image at this; This integral body atmosphere light value is generally estimated with region of partial sky or the maximum point of mistiness degree, and region of partial sky generally is positioned at the top of image, so; The pixel value that can have high-high brightness with image top is as the atmosphere light value; Particularly, for a Misty Image of taking properly, region of partial sky generally is positioned at the top of image; So when actual estimated integral body atmosphere light value; Usually choose the image top maximum brightness value as the atmosphere light value, like this can rejection image in the interference of white object, can estimate whole atmosphere light value A more exactly.
In step S103, according to this have the mist image dark pixel figure and should integral body atmosphere light value, obtain the distribution plan of propagation in atmosphere transmissivity.
In the practical implementation process, mist figure imaging model is shown in equation (4):
I(x)=J(x)t(x)+A(1-t(x)); (4)
Wherein, I (x) has been meant the mist image, and A is meant whole atmosphere light value, and t is used for describing light and is transmitted to the part that is not scattered in the camera process through media; This intensity comprises pixel R, G, B value; The target of mist elimination is exactly the scene image J (x) that from the mist image I is arranged, restores no mist, and under the ideal situation, J (x) also can be described as the intensity that really, there is not the scenery light of mist interference in representative.
Above-mentioned equation (4) is used existing minimum operation method and simply is converted to following equation (5):
min c ( min y ∈ Ω ′ ( x ) ( I c ( y ) A ) ) = t ( x ) min c ( min y ∈ Ω ′ ( x ) ( I c ( y ) A ) ) + ( 1 - t ( x ) ) ; - - - ( 5 )
Wherein, c is a color channel among R, G, the B, I c(y) for the value of pixel y under the c passage in the mist image arranged.Because for the scene image J of no mist, its regional area Ω ' exists a value to trend towards 0 in (x) at least, also promptly:
J dark ( x ) = min c ( min y ∈ Ω ′ ( x ) ( J c ( y ) ) ) = 0 ; - - - ( 6 )
And (A is greater than 0, less than 255) is permanent in just because A, must following formula (7):
min c ( min y ∈ Ω ′ ( x ) ( I c ( y ) A ) ) = 0 ; - - - ( 7 )
With formula (7) formula substitution equation (5), obtain the computing formula of transmissivity t (x):
t ( x ) = 1 - min c ( min y ∈ Ω ′ ( x ) ( I c ( y ) A ) ) ; - - - ( 8 )
Wherein,
Figure BDA0000130858640000104
It is normalized mist image I that has c(y) dark pixel values.Therefore, can utilize the mist image directly to the propagation in atmosphere transmissivity, also be that transmissivity t (x) estimates; Simultaneously for to make target image have certain perspective depth sense; In following formula (7), add a parameter ω (0<ω≤1), exist, following formula (9) to keep a spot of mist:
t ( x ) = 1 - ω min c ( min y ∈ Ω ′ ( x ) ( I c ( y ) A ) ) ; - - - ( 9 )
Particularly, utilize above-mentioned formula can obtain the distribution plan of whole propagation in atmosphere transmissivity.
In step S104, according to the distribution plan and the mist elimination expression formula of this integral body atmosphere light value, this propagation in atmosphere transmissivity, this original mist image is handled, obtain the restored image behind the mist elimination.
In the practical implementation process, after the distribution plan that obtains whole atmosphere light value and propagation in atmosphere transmissivity, utilize the restored image after the mist elimination expression formula can obtain mist elimination, this mist elimination expression formula is shown in formula (10):
J ( x ) = I ( x ) - A max ( t ( x ) , t 0 ) + A ; - - - ( 10 )
Wherein, the arbitrary pixel in the x presentation video, I (x) expression has the mist image, the scene image of J (x) for restoring, t (x) expression propagation in atmosphere transmissivity, A representes whole atmosphere light value, t 0Value is 0.1.
In embodiments of the present invention; This single image defogging method capable obtains the dark pixel figure of mist image through the template window and the image pixel value of preset number, and the whole atmosphere light value and the dark pixel figure of mist image arranged according to this that gets access to; Obtain the distribution plan of propagation in atmosphere transmissivity; According to the distribution plan and the mist elimination expression formula of this integral body atmosphere light value, this propagation in atmosphere transmissivity, reach the purpose that gets a distinct image at last, thereby under the prerequisite that guarantees the mist elimination effect; Omitted central calculated amount and all very huge soft stingy figure restorative procedure of memory space of prior art; And reduced calculated amount effectively, and reduce storage resources and mist elimination and handled the time that is spent, improved image mist elimination treatment effeciency.
One of ordinary skill in the art will appreciate that all or part of step that realizes in the foregoing description method is to instruct relevant hardware to accomplish through program; Described program can be stored in the storage medium of an embodied on computer readable; Described storage medium is like ROM/RAM, disk, CD etc.
Embodiment two:
Fig. 4 shows the structure of the single image mist elimination device that second embodiment of the invention provides, and for the ease of explanation, only shows the part relevant with the embodiment of the invention.
This single image mist elimination device comprises dark pixel figure acquiring unit 41, atmosphere light value acquiring unit 42, transmissivity distribution figure acquiring unit 43 and image restoration unit 44, wherein:
Dark pixel figure acquiring unit 41 is used to utilize template window and the image pixel value of presetting number, obtains the dark pixel figure of mist image.
Wherein, The template window that should preset number is the template window of M different N*N, and the value in this template window is formed by 0,1, and M gets the integer greater than 1; N gets the odd number that comprises more than 3, is that the polygonal shape that 1 point is formed has nothing in common with each other by value in the template window of the N*N that this M is different.
In embodiments of the present invention, this dark pixel figure acquiring unit 41 specifically comprises:
Judging unit 411 is used for judging have arbitrary pixel of mist image whether to be positioned at this preset range;
Template acquiring unit 412; Be used for when this judging unit 411 output results when being; Utilize this M template window, obtaining this has this arbitrary pixel pairing M variance in this M template window in the mist image, and the pairing template window of definite minimum variance;
The first dark pixel values acquiring unit 413 is used to utilize the pairing template window of this minimum variance, obtains the dark pixel of this pixel, and then obtains the dark pixel values of all pixels in the preset range in the mist image; And
The second dark pixel values acquiring unit 414, be used for when this judging unit 411 output results for not the time, according to the pixel value that all outer pixels of preset range in the mist image are arranged, obtain the dark pixel values of all outer pixels of this preset range.
Wherein, be meant in this preset range that the scope of this template window central point present position, this preset range are meant at this to be had in the mist image, the scope except that this preset range when this template window can be positioned at this fully the mist image is arranged outward.
This template acquiring unit 412 specifically comprises:
The average acquiring unit is used for obtaining this arbitrary pixel pairing M template average in this M template window according to the preset equal value expression of template and this M template window;
The variance acquiring unit is used for this M template average and preset template variance expression formula according to this arbitrary pixel, obtains M variance of this arbitrary pixel; And
The template acquiring unit is used for obtaining this M the pairing template window of variance minimum variance.
In embodiments of the present invention; The template window of a plurality of M in other words different N*N can be set in advance; This moment, N can get the odd number that comprises more than 3, was 9 to get M, N is 5, and the template window of also promptly getting 9 5*5 is an example; But be not limited to this template window; Then make 9 kinds of different windows, the number user of the window that this moment is different can set according to actual needs, and this shown in Fig. 3 (a)~Fig. 3 (i) be totally 9 kinds of different template window; Comprise by value being that 4 pentagons forming of 1 point, 4 hexagons, 1 length of side are 3 square in these 9 kinds of difform template window, utilize the average acquiring unit to obtain in the mist image M template average M of each pixel in the preset range respectively m, m=1,2 ..., 9, utilize the variance acquiring unit to obtain and template average M mM corresponding variance δ m, this acquisition methods then for each pixel, can obtain M variance yields according to formula (2), (3) respectively like expression formula (2), (3).
Further; After obtaining a plurality of variances according to formula (2), (3); Owing to contain the zone on sharp edge edge, variance must be mild regional big, therefore; Template window Ω ' in the time of can adopting minimum and this minimum variance of variance less than predetermined threshold value thred_ δ (x) comes the dark pixel values at the pixel x place of computed image, and obtaining this according to template acquiring unit 412 has the wherein template window of the best in a plurality of preset template window that each pixel in the preset range is all corresponding in the mist image.If in the actual process; A plurality of identical and satisfied minimum variance values less than predetermined threshold value appear; Then can picked at random satisfy a pairing template window of minimum variance of this condition arbitrarily, thereby utilize this template window Ω ' (x) and formula (1), (x) individual element slides on the mist image having with this Ω '; Can obtain the dark pixel values that this has every bit in the mist image; Particularly, be that the template window shown in Fig. 3 (a) is an example (x) with Ω ', in obtaining the mist image during dark pixel values at pixel x place; Center position correspondence with this template window is positioned over this x place earlier; This that then this template window covered has 25 pixel organization center points in the mist image at the regional area at x place, also be Ω ' (x), utilize formula (1) obtain this Ω ' (x) all values in the scope be minimum pixel value in three passages of pixel among 1 the pairing former figure of point; The dark pixel values of then representing x with this minimum pixel value; According to this theory, the first dark pixel values acquiring unit 413 utilizes this that corresponding optimal Template window of each pixel in preset range in mist image is arranged, and can obtain the dark pixel values of all pixels in the preset range in the mist image.When minimum variance during greater than predetermined threshold value thred_ δ, then can be with value minimum in three values of R, G, B of this pixel as its dark pixel values.There is halation in the method for this adaptively selected regional area template or title template window in the time of can avoiding recovering image, improves the dirigibility that template is chosen, and guarantees the accuracy of result of calculation.
In addition; To all outer pixels of preset range in the mist image are arranged; The value of minimum is as the dark pixel values of this pixel in three values of R, G, B of each pixel that then can this preset range is outer; Thereby get access to the dark pixel values of all outer pixels of this preset range according to the second dark pixel values acquiring unit 414; And then according to the dark pixel values of all outer pixels of this preset range, and the dark pixel values of all pixels in the preset range in the mist image is arranged, obtain the dark pixel figure that this view picture has the mist image.
Atmosphere light value acquiring unit 42 is used in predeterminable area, obtaining the whole atmosphere light value that this has the mist image.
Wherein, this predeterminable area is meant the regional extent that the top one-row pixels of one-row pixels to image preset the mist image is arranged from this.
In embodiments of the present invention, this integral body atmosphere light value is represented with A, is the atmosphere light of infinite distant place, and the estimation of atmosphere light is general all with the pixel value of pixel the brightest in image atmosphere light value as a whole.Yet in true picture; The pairing object of bright pixel possibly be the car of a white or the building of a white etc.; Have in the mist image at this, this integral body atmosphere light value is generally estimated with region of partial sky or the maximum point of mistiness degree, and region of partial sky generally is positioned at the top of image; So the pixel value that can have high-high brightness with image top is as the atmosphere light value.Particularly; A preset zone is as the top area of image in the mist image is arranged; By atmosphere light value acquiring unit 42 obtain have maximum brightness value in this top area pixel value as the atmosphere light value, make that the method for the whole atmosphere light value obtain is more convenient, the numerical value that obtains is more accurate.
Transmissivity distribution figure acquiring unit 43, be used for according to this have the mist image dark pixel figure and should integral body atmosphere light value, obtain the distribution plan of propagation in atmosphere transmissivity.
In embodiments of the present invention, obtain the distribution plan of the propagation in atmosphere transmissivity of mist image, repeat no more at this according to above-mentioned formula (4)~(9).
Image restoration unit 44 is used for distribution plan and mist elimination expression formula according to this integral body atmosphere light value, this propagation in atmosphere transmissivity, has the mist image to handle to this, obtains the restored image behind the mist elimination.
In embodiments of the present invention, after the distribution plan that obtains whole atmosphere light value and propagation in atmosphere transmissivity, utilize the restored image after this mist elimination expression formula can obtain mist elimination, this mist elimination expression formula is shown in formula (10):
J ( x ) = I ( x ) - A max ( t ( x ) , t 0 ) + A ; - - - ( 10 )
Wherein, the arbitrary pixel in the x presentation video, I (x) representes original mist image, the scene image of J (x) for restoring, the distribution plan of t (x) expression propagation in atmosphere transmissivity, A representes whole atmosphere light value, t 0Value is 0.1.
In embodiments of the present invention; This single image mist elimination device is chosen the optimal Template window of ground image pixel through using self-adaptation, and then obtains the dark pixel figure of mist image according to the pixel value of this template window and image, according to represent whole atmosphere light value with the most bright value in the predeterminable area; Based on the mist figure imaging model that gets access to, mist elimination expression formula etc.; To there being the mist image to handle, obtain the restored image behind the mist elimination, with respect to existing mist elimination device; Save calculated amount and memory space, and guaranteed mist elimination effect etc.
The embodiment of the invention is obtained in the mist image the corresponding template window of arbitrary pixel minimum variance in the preset range through the template window of preset number; Reach pixel value, obtain the dark pixel values of all outer pixels of this preset range, thereby can obtain the whole dark pixel figure that the mist image is arranged according to all outer pixels of preset range; And in conjunction with obtaining the distribution plan that this whole atmosphere light value that mist image is arranged can obtain the propagation in atmosphere transmissivity; Again according to the mist elimination expression formula, can realize effectively the mist elimination of original mist image is handled, solved that existing defogging method capable spended time is long, calculated amount is big, take the many problems of storage resources; Make calculated amount and memory space be reduced; The mist elimination processing time reduces, and treatment effeciency is improved, and has guaranteed the mist elimination effect.
The above is merely preferred embodiment of the present invention, not in order to restriction the present invention, all any modifications of within spirit of the present invention and principle, being done, is equal to and replaces and improvement etc., all should be included within protection scope of the present invention.

Claims (10)

1. a single image defogging method capable is characterized in that, said method comprises the steps:
Utilize the template window and the image pixel value of preset number, obtain the dark pixel figure of mist image;
In predeterminable area, obtain the said whole atmosphere light value that the mist image is arranged;
According to said dark pixel figure and the said whole atmosphere light value that the mist image is arranged, obtain the distribution plan of propagation in atmosphere transmissivity;
According to the distribution plan and the mist elimination expression formula of said whole atmosphere light value, said propagation in atmosphere transmissivity, there is the mist image to handle to said, obtain the restored image behind the mist elimination.
2. the method for claim 1; It is characterized in that the template window of said preset number is the template window of M N*N, M gets the integer greater than 1; N gets the odd number that comprises more than 3, is that the polygonal shape that 1 point is formed has nothing in common with each other by value in the template window of a said M N*N.
3. method as claimed in claim 2 is characterized in that, utilizes a said M template window and image pixel value, and the step of obtaining the dark pixel figure of mist image specifically comprises:
Judging has the arbitrary pixel in the mist image whether to be positioned at preset range;
When said arbitrary pixel is when being positioned at this preset range, utilize a said M template window, obtained the pairing M variance in a said M template window of pixel described in the mist image, and the pairing template window of definite minimum variance;
Utilize the pairing template window of said minimum variance, obtain the dark pixel of said pixel, and then obtain the dark pixel values of all pixels in the preset range in the mist image;
When said arbitrary pixel is not when being positioned at said preset range,, obtain the dark pixel values of all outer pixels of said preset range according to the pixel value that all pixels outside the preset range in the mist image are arranged.
4. method as claimed in claim 3; It is characterized in that; Utilize a said M template window, obtained the pairing M variance in a said M template window of pixel described in the mist image, and the step of the pairing template window of definite minimum variance comprise specifically:
According to a preset equal value expression of template and a said M template window, obtain said arbitrary pixel pairing M template average in a said M template window;
According to M the template average and the preset template variance expression formula of said arbitrary pixel, obtain M variance of said arbitrary pixel;
Obtain the pairing template window of minimum variance in the said M variance.
5. the method for claim 1 is characterized in that, said predeterminable area is meant the regional extent that the top one-row pixels of one-row pixels to image preset the mist image is arranged from said, and said mist elimination expression formula is:
J ( x ) = I ( x ) - A max ( t ( x ) , t 0 ) + A ;
Wherein, the arbitrary pixel in the x presentation video, I (x) expression has the mist image, and J (x) is a restored image, t (x) expression propagation in atmosphere transmissivity, A representes whole atmosphere light value, t 0Value is 0.1.
6. single image mist elimination device is characterized in that said device comprises:
Dark pixel figure acquiring unit is used to utilize template window and the image pixel value of presetting number, obtains the dark pixel figure of mist image;
Atmosphere light value acquiring unit is used in predeterminable area, obtaining the said whole atmosphere light value that the mist image is arranged;
Transmissivity distribution figure acquiring unit is used for the dark pixel figure and the said whole atmosphere light value that the mist image are arranged according to said, obtains the distribution plan of propagation in atmosphere transmissivity; And
The image restoration unit is used for distribution plan and mist elimination expression formula according to said whole atmosphere light value, said propagation in atmosphere transmissivity, has the mist image to handle to said, obtains the restored image behind the mist elimination.
7. device as claimed in claim 6; It is characterized in that; The template window of said preset number is the template window of M different N*N; M gets the integer greater than 1, and N gets the odd number that comprises more than 3, is that the polygonal shape that 1 point is formed has nothing in common with each other by value in the template window of the N*N that said M is different.
8. device as claimed in claim 7 is characterized in that, said dark pixel figure acquiring unit specifically comprises:
Judging unit is used for judging have arbitrary pixel of mist image whether to be positioned at this preset range;
The template acquiring unit; Be used for when said judging unit output result when being; Utilize a said M template window, obtain the arbitrary pixel pairing M variance in a said M template window in the preset range in the mist image, and the pairing template window of definite minimum variance;
The first dark pixel values acquiring unit is used to utilize the pairing template window of said minimum variance, obtains the dark pixel of said pixel, and then obtains the dark pixel values of all pixels in the preset range in the mist image; And
The second dark pixel values acquiring unit, be used for when said judging unit output result for not the time, according to the pixel value that all outer pixels of preset range in the mist image are arranged, obtain the dark pixel values of all outer pixels of said preset range.
9. device as claimed in claim 8 is characterized in that, said template acquiring unit specifically comprises:
The average acquiring unit is used for obtaining said arbitrary pixel pairing M template average in a said M template window according to preset an equal value expression of template and a said M template window;
The variance acquiring unit is used for M template average and preset template variance expression formula according to said arbitrary pixel, obtains M variance of said arbitrary pixel; And
The template acquiring unit is used for obtaining said M the pairing template window of variance minimum variance.
10. device as claimed in claim 6 is characterized in that, said predeterminable area is meant the regional extent that the top one-row pixels of one-row pixels to image preset the mist image is arranged from said, and said mist elimination expression formula is:
J ( x ) = I ( x ) - A max ( t ( x ) , t 0 ) + A ;
Wherein, the arbitrary pixel in the x presentation video, I (x) expression has the mist image, and J (x) is a restored image, t (x) expression propagation in atmosphere transmissivity, A representes whole atmosphere light value, t 0Value is 0.1.
CN201210011326.5A 2012-01-13 2012-01-13 Method and device for defogging single image Expired - Fee Related CN102609909B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210011326.5A CN102609909B (en) 2012-01-13 2012-01-13 Method and device for defogging single image

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210011326.5A CN102609909B (en) 2012-01-13 2012-01-13 Method and device for defogging single image

Publications (2)

Publication Number Publication Date
CN102609909A true CN102609909A (en) 2012-07-25
CN102609909B CN102609909B (en) 2014-03-12

Family

ID=46527255

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210011326.5A Expired - Fee Related CN102609909B (en) 2012-01-13 2012-01-13 Method and device for defogging single image

Country Status (1)

Country Link
CN (1) CN102609909B (en)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103116876A (en) * 2013-02-22 2013-05-22 北京京东世纪贸易有限公司 Method and device for image defogging
CN103578083A (en) * 2013-09-07 2014-02-12 西安电子科技大学 Single image defogging method based on joint mean shift
CN104008527A (en) * 2014-04-16 2014-08-27 南京航空航天大学 Method for defogging single image
CN104123700A (en) * 2014-06-18 2014-10-29 深圳市金立通信设备有限公司 Electronic equipment
CN104253930A (en) * 2014-04-10 2014-12-31 西南科技大学 Real-time video defogging method
CN104331867A (en) * 2014-11-06 2015-02-04 广东欧珀移动通信有限公司 Image defogging method and device and mobile terminal
CN104599240A (en) * 2014-06-30 2015-05-06 中国海洋大学 Adaptive weight dark channel defogging algorithm for maritime aerial images of unmanned aerial vehicle
CN104634784A (en) * 2013-11-08 2015-05-20 中国电信股份有限公司 Atmospheric visibility monitoring method and device
CN104713526A (en) * 2015-04-01 2015-06-17 无锡桑尼安科技有限公司 Method for detecting types of foreign matters on power transmission line

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101783012A (en) * 2010-04-06 2010-07-21 中南大学 Automatic image defogging method based on dark primary colour
US20110188775A1 (en) * 2010-02-01 2011-08-04 Microsoft Corporation Single Image Haze Removal Using Dark Channel Priors
CN102254306A (en) * 2011-07-14 2011-11-23 北京邮电大学 Real-time image defogging method based on image simplified hierachical model

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110188775A1 (en) * 2010-02-01 2011-08-04 Microsoft Corporation Single Image Haze Removal Using Dark Channel Priors
CN101783012A (en) * 2010-04-06 2010-07-21 中南大学 Automatic image defogging method based on dark primary colour
CN102254306A (en) * 2011-07-14 2011-11-23 北京邮电大学 Real-time image defogging method based on image simplified hierachical model

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
KAIMING HE ET AL.: "Single Image Haze Removal Using Dark Channel Prior", 《IEEE CONFERENCE ON COMPUTER VISION AND PATTERN RECOGNITION》 *
王燕等: "一种单幅图像去雾方法", 《电光与控制》 *

Cited By (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103116876B (en) * 2013-02-22 2014-04-16 北京京东世纪贸易有限公司 Method and device for image defogging
CN103116876A (en) * 2013-02-22 2013-05-22 北京京东世纪贸易有限公司 Method and device for image defogging
CN103578083A (en) * 2013-09-07 2014-02-12 西安电子科技大学 Single image defogging method based on joint mean shift
CN103578083B (en) * 2013-09-07 2016-06-29 西安电子科技大学 Single image defogging method based on associating average drifting
CN104634784A (en) * 2013-11-08 2015-05-20 中国电信股份有限公司 Atmospheric visibility monitoring method and device
CN104634784B (en) * 2013-11-08 2018-01-05 中国电信股份有限公司 atmospheric visibility monitoring method and device
CN104253930A (en) * 2014-04-10 2014-12-31 西南科技大学 Real-time video defogging method
CN104253930B (en) * 2014-04-10 2017-04-05 西南科技大学 A kind of real-time video defogging method
CN104008527B (en) * 2014-04-16 2017-02-01 南京航空航天大学 Method for defogging single image
CN104008527A (en) * 2014-04-16 2014-08-27 南京航空航天大学 Method for defogging single image
CN104123700A (en) * 2014-06-18 2014-10-29 深圳市金立通信设备有限公司 Electronic equipment
CN104599240A (en) * 2014-06-30 2015-05-06 中国海洋大学 Adaptive weight dark channel defogging algorithm for maritime aerial images of unmanned aerial vehicle
CN104331867A (en) * 2014-11-06 2015-02-04 广东欧珀移动通信有限公司 Image defogging method and device and mobile terminal
CN104713526B (en) * 2015-04-01 2017-01-25 国网山东省电力公司沂源县供电公司 Method for detecting types of foreign matters on power transmission line
CN104713526A (en) * 2015-04-01 2015-06-17 无锡桑尼安科技有限公司 Method for detecting types of foreign matters on power transmission line

Also Published As

Publication number Publication date
CN102609909B (en) 2014-03-12

Similar Documents

Publication Publication Date Title
CN102609909B (en) Method and device for defogging single image
CN103218778B (en) The disposal route of a kind of image and video and device
CN102411774B (en) Processing method, device and system based on single-image defogging
CN106251301B (en) A kind of single image to the fog method based on dark primary priori
US9189830B2 (en) Image defogging method and system
CN102063706B (en) Rapid defogging method
EP2568438A2 (en) Image defogging method and system
CN103150708B (en) Based on the image Quick demisting optimization method of black channel
Shiau et al. Weighted haze removal method with halo prevention
CN102663721B (en) Defocus depth estimation and full focus image acquisition method of dynamic scene
CN107451966B (en) Real-time video defogging method implemented by guiding filtering through gray level image
CN105118027B (en) A kind of defogging method of image
CN103426151B (en) A kind of image defogging method and device
CN104166968A (en) Image dehazing method and device and mobile terminal
CN104217404A (en) Video image sharpness processing method in fog and haze day and device thereof
CN103049888A (en) Image/video demisting method based on combination of dark primary color of atmospheric scattered light
CN102768760A (en) Quick image dehazing method on basis of image textures
CN104299192A (en) Single image defogging method based on atmosphere light scattering physical model
CN104091310A (en) Image defogging method and device
CN103578083A (en) Single image defogging method based on joint mean shift
CN104331867B (en) The method, device and mobile terminal of image defogging
CN105046658A (en) Low-illumination image processing method and device
CN104867122A (en) Infrared self-adaptive non-uniformity correction and detail enhanced cascade processing method
CN104281999A (en) Single image defogging method based on structural information
CN104346783A (en) Processing method and processing device for defogging image

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20140312

Termination date: 20180113

CF01 Termination of patent right due to non-payment of annual fee