Unmanned plane image haze sky and white area adaptive processing method
Technical field
The invention belongs to technical field of image processing, and in particular to a kind of unmanned plane image haze sky and white area
Domain adaptive processing method.
Background technique
Currently, the hot spot in unmanned plane research field, is to prevent unmanned plane applied to mapping, target identification, geological disaster
Equal fields are controlled, the execution task of unmanned plane depends greatly on the higher unmanned plane image of image quality.With weather conditions
Deterioration, the image taken photo by plane under haze weather is smudgy, and clarity is not high, the image essential information feature taken photo by plane
Serious distortion is impaired, can not capture useful information, therefore people are higher and higher to the defogging demand of unmanned plane image.
In recent years, the defogging method of single image achieves biggish progress, image defogging classification method can be divided into
Two classes: the Misty Image enhancing based on image procossing and the Misty Image based on physical model are restored.The method of image enhancement is neglected
The factor for having omited image degeneration, it is by enhancing Misty Image clarity, image detail information is outstanding, have one to image restoration
Fixed effect, but this method does not account for image degradation model, it is ineffective.The method of image restoration is dropped for Misty Image
Matter process establishes degeneration physical model, inverting degenerative process, to obtain fog free images.Defogging compared to image enhancement is calculated
Method.The image defog effect obtained based on physical model is more naturally, information loss is less.It goes to construct using Misty Image itself
Constraint condition reaches defogging purpose from the parameter in atmospherical scattering model is estimated in single image, and He Kaiming et al. is proposed
" dark " concept, i.e. any local window in the non-sky area of fogless outdoor image, in all pixels point RGB channel
Minimum value should be close to 0.This method defog effect is ideal, however the bright areas such as sky areas or white are but unsatisfactory for secretly
Primary colors priori rule leads to these regions generally existing color of image problem of dtmf distortion DTMF after defogging, thus solve image sky or
The bright areas cross-color problem such as white becomes a vital task in conventional images recovery.
For current algorithm there are the shortcomings that, the key parameter in atmospherical scattering model is studied, utilize protect side effect
The preferable two-sided filter of fruit or wave filter accurately to estimate atmospheric dissipation function, retain image edge detail information, and
Can between edge and shoulder excessively naturally, preventing image restoration after there is halo effect or fog residual, but sky
Or the bright areas such as white problem of dtmf distortion DTMF does not still solve;Someone is repaired using fixed threshold to transmissivity, in certain journey
The recovery effect of sky mist figure is protected on degree, but be easy to cause the defogging of no sky image insufficient;Also someone is using segmentation sky
Region avoids the color distortion problem of image after defogging, but due to using largest connected region as the sky areas of identification, easily
The missing inspection for causing certain pieces of sky position leads to missing inspection part sky areas cross-color.These algorithms do not solve fundamentally
Certainly defogging cross-color problem, therefore there are also to be hoisted for improvement haze sky or white area defog effect algorithm.
Summary of the invention
The purpose of the present invention is to provide unmanned plane image haze sky and white area adaptive processing method, with
Overcome the problems of the above-mentioned prior art, the present invention can adaptivenon-uniform sampling go out sky or white area and pair
The image defogging of close shot part is handled, and enhances the contrast of image, and practicability is stronger, has high application value.
In order to achieve the above objectives, the present invention adopts the following technical scheme:
Unmanned plane image haze sky and white area adaptive processing method, comprising the following steps:
Step 1: obtaining unmanned plane image I (x);
Step 2: obtaining the dark channel image I of unmanned plane image I (x)dark(x) and gray level image Igray(x);
Step 3: the dark channel image I obtained according to step 2dark(x) brightened dot in, in conjunction with unmanned plane image I
(x) the air light value A of unmanned plane image is obtained;
Step 4: defining atmospheric dissipation function: V (x)=A (1-t (x)), wherein V (x) indicates atmospheric dissipation function, A table
Show air light value, t (x) indicates image transmission rate;And the dark channel image for obtaining step 2 is as the rough estimate of atmospheric dissipation function
It counts V (x);
Step 5: the gray level image I obtained according to step 2gray(x), the grey level histogram of gray level image is sought, and is acquired
Adaptive threshold ThrB divides close shot and sky or white area;
Step 6: fixed using the atmospheric dissipation function for the adaptive threshold ThrB subarea processing rough estimate that step 5 is sought
The new correction formula of justice calculates correction factor, and definition improves atmospheric dissipation function formula, and correction factor substitution is improved formula and is asked
Atmospheric dissipation function V'(x must be improved);
Step 7: the improvement atmospheric dissipation function that step 6 obtains being refined with two-sided filter, obtains fining atmosphere
Dissipative function V " (x);
Step 8: the fine atmospheric dissipation function V " (x) obtained according to step 7 uses transmissivity estimation formulasAcquire the transmissivity t (x) of entire image;
Step 9: establishing image degradation process model, obtain original image I (x) using step 1 and step 3, step 8 obtain
Parameter A, t (x) arrived, recovery obtain mist elimination image J (x).
Further, dark channel image I in step 2dark(x) it is expressed as follows:
Wherein, c is the value in a certain channel in three Color Channels R, G, B.
Further, when seeking air light value A in step 3, maximum preceding 0.1% picture of dark channel image brightness value is chosen
Vegetarian refreshments corresponds to brightness in original foggy image and seeks putting down respectively by tri- channel values of corresponding R, G, B in preceding 0.1% pixel
Mean value, final air light value A take the average value of three air light values corresponding to three channels.
Further, atmospheric dissipation function meets two constraint conditions in step 4: (1) on each pixel, V (x) >
0, i.e. atmospheric dissipation function value is positive value;(2)That is V (x) is most no more than the I of image containing mist (x)
Small color component, therefore using dark channel image as the rough estimate of atmospheric dissipation function.
Further, step 5 specific implementation step is as follows:
Step 5.1: calculating gray level image Igray(x) cumulative distribution probability of gray value, and calculate accumulative point of image
Cloth function L (x) extracts the grey level histogram for being distributed in [0.05,0.95], calculates L (x using distribution function1)=0.05 and L
(x2The corresponding grayscale value x in)=0.951、x2, finally calculate the central point of grey level histogram
Step 5.2: adaptivenon-uniform sampling being carried out to grey level histogram using maximum variance between clusters and is obtained for distinguishing target
With the threshold value sh of background;
Step 5.3: the starting point that grey level histogram spike region is accurately found by reducing grey level histogram section corresponds to
Pixel ThrB, it is specific as follows: to find out the smallest extreme point of histogram in the section [max (Mid, sh), A], and it is right to calculate its
The grayscale value answered, i.e., corresponding pixel ThrB reduce section by dichotomy, are finally set in section [b, ThrM], and
The smallest minimum point in histogram is found out in this section, its corresponding pixel value is set to ThrB;
Wherein,ThrM is histogram highest value point pair in the section [max (Mid, sh), A]
The pixel value answered.
Further, new correction formula in step 6 is defined as:
Wherein, M is correction factor, IgrayIt (x) is gray level image, a is the parameter of influence function Long-term change trend, IdarkIt is dark
Channel image.
Further, definition improves atmospheric dissipation function are as follows:
V'(x)=M*V (x)
Wherein, V (x) is the rough estimate of atmospheric dissipation function.
Further, atmospheric dissipation function will be improved using two-sided filter in step 7 to refine, i.e. V " (x)=Bil
(V'(x));
Wherein, Bil (x) is two-sided filter, and mathematic(al) representation is defined as
W (i, j)=ws(i,j)wr(i,j)
S is the neighborhood centered on (x, y), and (x, y) is the coordinate of central pixel point in filter window, and (i, j) is to close on
The coordinate of pixel, w (i, j) are weighting coefficient, ws(i, j) is space similarity kernel function, wr(i, j) is brightness similarity core
Function, g (x, y) are the brightness value of central pixel point in filter window, and g (i, j) is the brightness value of adjacent pixels point, σs、σrRespectively
For space similarity kernel function, brightness similarity kernel function standard deviation.
Further, original image I (x), atmosphere light A and the transmissivity t (x) found out are substituted into image and moved back in step 9
Change in process model I (x)=J (x) t (x)+A (1-t (x)), deformation can obtain restored image formula and be
Restore to obtain mist elimination image J (x).
Compared with prior art, the invention has the following beneficial technical effects:
The invention proposes one kind for the bright areas adaptive processing method such as haze sky or white, to containing day
When the image containing mist of the bright areas such as empty or white carries out defogging processing, threshold value can be adaptively found out, certainly by threshold decision
Adaptation is partitioned into the bright areas such as sky or white and close shot region, and new correction formula, Jin Ergai are proposed for different zones
Into atmospheric dissipation function.New adaptive processing method can not only accurately detect the bright areas such as haze sky or white simultaneously
Atmospheric dissipation function improvement in its region is handled, the bright areas such as the sky for more meeting human eye or white are recovered, additionally it is possible to
Keep close shot region defog effect.Compared with traditional bilateral filtering algorithm, it is bright that new algorithm is effectively partitioned into sky or white etc.
Region solves the problems, such as bright areas cross-color after self-adaptive processing, the signal-to-noise ratio of image, contrast and color after defogging
Saturation degree, which has, largely to be promoted.
Detailed description of the invention
Fig. 1 is flow diagram of the invention;
Fig. 2 is the present invention and other filtering methods to the unmanned plane figure containing the bright areas such as haze sky or white
As defog effect compares, wherein, (a) (b) (c) (d) is original unmanned plane image, and (e) (f) (g) (h) is to (a) (b)
(c) image after (d) bilateral filtering defogging, (i) (j) (k) (l) is to (a) (b) (c) (d) using after inventive algorithm defogging
Image.
Specific embodiment
Present invention is further described in detail with reference to the accompanying drawing:
Referring to Fig. 1 and Fig. 2, the present invention provides a kind of unmanned plane image haze skies and white area adaptively to locate
Reason method.
Step 1 obtains unmanned plane image: utilizing unmanned plane image capture device, acquisition will carry out defogging processing
Aerial Images I (x).
Step 2, step 1 is obtained unmanned plane image be based on dark channel prior theory seek out dark channel image Idark
(x) and gray level image Igray(x);
The dark channel diagram of acquisition seems that the dark channel prior based on the bright proposition of what happy is theoretical, in most non-sky areas
In, always at least one Color Channel has very low value to certain pixels, almost goes to zero.In other words, the region luminous intensity
Minimum value is counting close to zero for a very little.By taking RGB image as an example, for arbitrary input picture I, dark can use following formula
Expression:
Wherein, c is the value in a certain channel in 3 Color Channels R, G, B;
Step 3, the dark channel image I obtained according to step 2dark(x) brightened dot in, before selection brightness value is maximum
0.1% pixel finds out the brightness value on corresponding position in former unmanned plane color image I (x) and sums and find out average
Value obtains the air light value in three channels respectively, then is averaging the air light value in three channels as finally big in the present invention
Gas light value A.
Step 4 defines atmospheric dissipation function: V (x)=A (1-t (x)), wherein V (x) indicates atmospheric dissipation function, A table
Show air light value, t (x) indicates image transmission rate, and atmospheric dissipation function meets two constraint conditions: (1) on each pixel,
V (x) > 0, i.e. atmospheric dissipation function value should be positive value;(2)That is V (x) is not more than the I of image containing mist
(x) Minimal color weight, therefore using dark channel image as the rough estimate of atmospheric dissipation function in the present invention;
Step 5, the gray level image I obtained according to step 2gray(x), the grey level histogram of image is sought, and is acquired adaptive
Threshold value ThrB is answered to divide the bright areas such as close shot and sky or white;
Sky or white area in image is usually brighter, high peak characteristic is presented on grey level histogram, therefore can
Adaptive threshold ThrB is sought to divide close shot and sky or white area, specific implementation step is as follows:
(1) in order to judge the distribution situation of histogram, first calculating gray level image Igray(x) normalization histogram, and
It calculates image Cumulative Distribution Function L (x), extracts the main histogram for being distributed in [0.05,0.95], calculate L using distribution function
(x1)=0.05 and L (x2The corresponding grayscale value x in)=0.951、x2, finally calculate the central point of main histogram
(2) histogram is split using maximum variance between clusters to obtain sh.By obtaining threshold value sh adaptively come area
Partial objectives for and background;
(3) the corresponding pixel ThrB of starting point of spike histogram is accurately found by reducing histogram.It finds out
The smallest extreme point of histogram in the section [max (Mid, sh), A], and calculate its corresponding grayscale value, i.e., corresponding pixel,
Seek to the ThrB looked for.Section is reduced by dichotomy, is finally set in section [b, ThrM], and find out histogram in this section
In the smallest minimum point, its corresponding pixel value is set to ThrB.
Wherein,ThrM is maximum of points in histogram in the section [max (Mid, sh), A]
Corresponding pixel value.
Step 6, the adaptive threshold ThrB subarea processing rough estimate sought according to step 5 atmospheric dissipation function, it is fixed
Adopted following new correction formula, calculates correction factor M, and definition improves atmospheric dissipation function V'(x)=M*V (x), and substituted into and changed
It is acquired into formula and improves atmospheric dissipation function V'(x);
New correction formula is defined as:
IgrayFor gray level image, a is the parameter of influence function Long-term change trend, and taking the value of a is 10, IdarkFor dark channel image.
Step 7 refines the improvement atmospheric dissipation function that step 6 obtains with two-sided filter, i.e. V " (x)=Bil (V'
(x)) fining atmospheric dissipation function V " (x), is obtained;
The mathematic(al) representation of two-sided filter is defined as
W (i, j)=ws(i,j)wr(i,j)
S is the neighborhood that size is 5 × 5 centered on (x, y), and (x, y) is the coordinate of central pixel point in filter window,
(i, j) is the coordinate of adjacent pixels point.W (i, j) is weighting coefficient, ws(i, j) is space similarity kernel function, wr(i, j) is bright
Similarity kernel function is spent, g (x, y) is the brightness value of central pixel point in filter window, and g (i, j) is the brightness of adjacent pixels point
Value.Space similarity kernel function standard deviation sigmas=3, brightness similarity kernel function standard deviation sigmar=0.1.
Step 8: the fine atmospheric dissipation function V " (x) obtained according to step 7 obtains the deformation of atmospheric dissipation function formula
Transmissivity estimation formulasAnd the A and V " (x) that step 3, step 6 acquire are substituted into transmissivity estimation formulas and obtained
The transmissivity t (x) of entire image out;
Step 9: establishing image degradation process model I (x)=J (x) t (x)+A (1-t (x)), deformation obtains image restoration public affairs
FormulaParameter A, t (x) obtained using step 1 acquisition original image I (x) and step 3, step 8, it is extensive
Appear again mist elimination image J (x).
Fig. 1 is the flow chart of algorithm.Fig. 2 is the treatment effect figure of algorithms of different.Four groups of different unmanned planes are used in Fig. 2
Aerial Images, with two-sided filter as the haze sky of improvement atmospheric dissipation function that is proposed in control group and the present invention or white
Color region adaptivity Processing Algorithm effect compares.In analysis chart 2 experimental result can see with after original image and bilateral filtering
Image compare, new algorithm can not only solve the problems, such as cross-color after the bright areas defogging such as haze sky or white, also compared with
The good defog effect for maintaining close shot area image, improves the color saturation and contrast of restored image.
Table 1 is to objectively evaluate parameter comparison table to after unmanned plane image defogging using different defogging algorithms.
1 algorithms of different defog effect parameter evaluation table of table
As can be seen from Table 1, the haze sky or white area self-adaptive processing algorithm proposed by the present invention of being directed to is to image
Y-PSNR, color saturation after defogging is relatively high, is defined according to Y-PSNR and color saturation, Y-PSNR
Etc. parameters it is bigger, show that image restoration effect is better.Each ginseng of image is both greater than bilateral filtering defogging after defogging as shown in Table 1
Algorithm.For picture contrast, the contrast of image is better than original image and bilateral filtering algorithm to a certain extent after defogging.It can be seen that
The sky or white bright areas self-adaptive processing algorithm proposed by the present invention of being directed to can eliminate bright areas color mistake after defogging
True problem.
Thus, for the unmanned plane image containing mist containing sky or white area, unmanned plane boat proposed by the present invention
It claps image and existing algorithm, tool is better than based on the haze sky or white area self-adaptive processing algorithm for improving atmospheric dissipation function
There is apparent technical advantage.There is high application value to being further processed and accurately extracting the information in Aerial Images.
The present invention be directed to the algorithm that the bright areas such as the sky of the image containing mist or white carry out self-adaptive processing, this algorithms
After the bright areas such as sky or white can be accurately partitioned into and can preferably eliminate the bright areas defogging such as sky or white
Cross-color problem, additionally it is possible to keep to defog effect only.Compared with bilateral filtering defogging algorithm, scheme after this algorithm defogging
As color saturation and contrast are all significantly increased, more meet human eye vision, algorithm practicability is stronger, to improving unmanned plane
Picture quality containing mist of taking photo by plane and extraction useful information have very high learning value and application value.