A kind of image enchancing method theoretical improved multiple dimensioned Retinex
Technical field
The invention belongs to night vision image to strengthen field, and in particular to image theoretical a kind of improved multiple dimensioned Retinex
Enhancement Method.
Background technology
The information that people obtain from the external world there are about 75% and come from video image.But video camera shooting when due to night light
According to severe weather conditions such as condition deficiency, dense fog, heavy rain, sand and dust, the image that video camera captures usually is set to receive serious move back
Change, make the Quality Down of image, smudgy, contrast is relatively low.Using digital image processing techniques to bad weather Degenerate Graphs
As the method handled has two major classes:Image enhaucament and image restoration.Image restoration refers to remove or minimize piece image
In known or part oneself know the processing of degeneration.Image restoration is included to degraded image caused by the limitation due to sensor or environment
Eliminate fuzzy, noise filtering, and geometric distortion or non-linear be corrected to caused by sensor.Image recovery method includes
Wiener filtering, least square, least square with equality constraint, spline interpolation, Variation Model, partial differential equation, machine learning etc..
Image enhaucament refers to a kind of requirement according to application, and image is processed, to protrude some information in image, cut
The weak or some unwanted information of removal, obtain more practical image for concrete application, or original image is converted into one kind
It is more suitable for people or the image processing method of form that machine is analyzed and processed.At present researcher oneself through proposing that many images increase
The image enchancing method of strong method, wherein comparative maturity has contrast enhancement process, histogram equalizing method, homomorphic filtering side
Method, small wave converting method.Retinex image enchancing methods all have good in terms of dynamic range compression and color constancy
Characteristic, thus can adaptively strengthen various types of image.But the image enchancing method based on Retinex exists
Highlight regions produce halation phenomenon, and global brightness approaches to average, make local detail information contrast insufficient.
The content of the invention
The invention discloses the image enchancing method that a kind of improved multiple dimensioned Retinex is theoretical, which solve multiple dimensioned
Retinex theoretical methods produce halation phenomenon, strengthen the problem of overall brightness is insufficient, contrast is relatively low to high-dynamics image.
In order to solve above-mentioned technical problem, present invention employs following scheme:
A kind of image enchancing method theoretical improved multiple dimensioned Retinex, it is characterised in that:Comprise the following steps:
(1)Input picture, using global brightness adjustment function, the brightness to dark space details and highlight regions carries out non-linear
Regulation;
(2)Strengthen image using specification gain compensation multi-Scale Retinex Algorithm;
(3)Calculate selection area luminance mean value;
(4)According to selection area luminance mean value, S curve parameter is calculated;
(5)Adaptive adjustment S curve;
(6)Nonlinear Mapping is carried out to enhanced image.
According to given threshold by brightness of image region division it is clear zone and dark space in above-mentioned steps 1;Two regions are distinguished
Mapped using different brightness regulation functions, stretched the dynamic range compared with dark space and highlight bar, only compressed middle
Gray level;The brightness regulation function is:
Wherein
Wherein, D is the grayscale dynamic range of image, and for 8 bit image systems, its value is 256;wLAnd wHIt is dark respectively
Area and the weight coefficient in clear zone;T is Intensity segmentation threshold value, wherein for 8bit images, the span of the T is 0-255.
Realized in above-mentioned steps 2 using specification gain compensation multi-Scale Retinex Algorithm enhancing image using MSR methods;
The mathematical form of the MSR methods is the weighted average of the SSR results of multiple different scales:
Wherein, K is normalization factor so that
∫ ∫ F (x, y) dxdy=1(7)
It is the output component of i-th of color spectral coverage, n-th of yardstick;It is multiple dimensioned Retinex i-th
The output of individual color spectral coverage;wnTo correspond to the weights of each yardstick.
There is negative value in image pixel after above-mentioned MSR methods processing, due to directly negating logarithm to its pixel value, it is impossible to
The visual effect got well;Need to translate and be compressed in the range of display shows its codomain by gain/compensating operation,
I.e.
G, b are respectively gain coefficient and penalty coefficient, and mathematic(al) representation is:
Rmax, RminThe respectively maximum and minimum value of input picture;dmaxFor the dynamic range of output equipment;Then it is right
Gradation of image is intercepted, and determines overall gray level value scope, then is uniformly stretched to dynamic range corresponding to output equipment, interception rule
It is then:
WhereinFor RiThe output of both ends gray value is intercepted,WithEach color to be intercepted most after respectively MSR processing
Small value and maximum;Especially for night vision image, its histogram distribution approximation Normal Distribution;According to the confidence system of setting
Number A, calculate the value of both ends intercept pointWithFor:
Wherein, μiAnd σiRespectively RiAverage and standard deviation.
By analyzing night vision image in above-mentioned steps 3, the information that can most characterize night vision image feature is drawn;And with
The foundation that the luminance mean value of selection area adjusts as S curve.
Above-mentioned mean value computation expression formula is:
Wherein, NABCDFor the sum of all pixels in the ABCD of region.
The information of above-mentioned night vision image feature heart areas adjacent in the picture;State and vehicle institute including opposite car light
Locate the overall brightness of environment.
Above-mentioned adaptive adjustment S curve step is that the image overall pixel intensity after MSR is handled is approached to average, in making
Between the gray value of part do not come by significant difference;Wherein mapped using nonlinear S-shaped shape transmission function, by centre
Partial gray value is stretched.
9th, theoretical improved multiple dimensioned Retinex image enchancing method according to claim 8, it is characterised in that:
The S-shaped shape transmission function expression formula is:
Wherein, h is tonal gradation, for 8 gray level images, h=256;A, b is used for the shape of controlling curve;B is represented
Position where curve, a represent the speed of curve growth rate;
The parameter a, b dynamic adjustment expression formula acquiring method be:
The two kinds of extreme cases to be handled image are chosen, by artificially adjusting a, b obtains preferable visual effect, obtains parameter
Respectively a0,b0,a1,b1;It is respectively I wherein to correspond to averagem0, Im1;Then a, b expression formula is:
Above-mentioned image non-linear mapping step passes through formula(15)、(16)Calculating parameter a, b;Then a, b are brought into formula
(14), can obtain output image expression formula is:
Wherein, IMSR(x, y) is through the enhanced images of MSR;Iout(x, y) is output display image.
The image enchancing method theoretical improved multiple dimensioned Retinex has the advantages that:
1st, by using global brightness adjustment function, the increasing of specification gain compensation multi-Scale Retinex Algorithm is efficiently solved
Halation phenomenon in strong image.Overall brightness is set to get a promotion simultaneously.
2nd, S curve is adaptively adjusted according to picture centre region brightness, Nonlinear Mapping, stretching image ash is carried out to it
Degree, improve contrast.Improve robustness of the algorithm to complicated night vision image.
Brief description of the drawings
Fig. 1 is the schematic flow sheet of the present invention;
Fig. 2 is picture centre region mean value computation area schematic of the present invention;
Fig. 3 is the design sketch of the remote input picture of the present invention;
Fig. 4 is the enhanced design sketch of medium and long distance algorithm of the present invention;
Fig. 5 is the design sketch of closely input picture of the invention;
Fig. 6 is the closely enhanced design sketch of algorithm in the present invention.
Embodiment
Below in conjunction with the accompanying drawings, the present invention will be further described:
The present invention implements one and proposes a kind of theoretical image enchancing methods of improved multiple dimensioned Retinex.It was performed
Journey is as follows:
The first step:Global brightness adjustment.Understood according to Retinex is theoretical, it is slowly varying that Retinex algorithm is applied to illumination
Environment.In actual environment, night vision image is particularly directed to, is a kind of high-dynamics image, local brightness variation is big.In order that
Retinex algorithm obtains preferable image enhancement effects, and suppresses enhanced halation phenomenon, it is necessary first to carries out global brightness
Regulation.By brightness of image region division it is clear zone and dark space herein according to given threshold.Two regions are respectively adopted different
Brightness regulation function is mapped, and is stretched the dynamic range compared with dark space and highlight bar, only compresses middle gray level.It is bright
Spend adjustment function and represent as follows:
Wherein
Wherein, D is the grayscale dynamic range of image, and for 8 bit image systems, its value is 256.wLAnd wHIt is dark respectively
Area and the weight coefficient in clear zone.T is Intensity segmentation threshold value.Wherein for 8bit images, the span of the T is 0-255, pin
To the road spectrogram of collection as test result, there can be preferable division for dark space and clear zone when T takes 70.
Second step:Retinex algorithm image enhaucament.
The mathematical form of MSR methods is the weighted average of the SSR results of multiple different scales:
F(x,y)=K exp[-(x2+y2)/c2] (6)
Wherein, K is normalization factor so that
∫ ∫ F (x, y) dxdy=1(7)
It is the output component of i-th of color spectral coverage, n-th of yardstick.It is multiple dimensioned Retinex i-th
The output of individual color spectral coverage.wnTo correspond to the weights of each yardstick.
Negative value occurs in image pixel after the processing of MSR methods, directly negates logarithm to its pixel value, it is impossible to obtain
Visual effect.Need to translate and be compressed in the range of display shows its codomain by gain/compensating operation, i.e.,
G, b are respectively gain coefficient and penalty coefficient, and mathematic(al) representation is:
Rmax, RminThe respectively maximum and minimum value of input picture.dmaxFor the dynamic range of output equipment.Then it is right
Gradation of image is intercepted, and determines overall gray level value scope, then is uniformly stretched to dynamic range corresponding to output equipment, interception rule
It is then:
WhereinFor RiThe output of both ends gray value is intercepted,WithEach color to be intercepted most after respectively MSR processing
Small value and maximum.Especially for night vision image, its histogram distribution approximation Normal Distribution.According to the confidence system of setting
Number A, calculate the value of both ends intercept pointWithFor
Wherein, μiAnd σiRespectively RiAverage and standard deviation.
3rd step:Selection area mean value computation.
By analyzing night vision image, it can be deduced that the information that can most characterize night vision image feature is general in the picture
Heart areas adjacent.Including the state of opposite car light(Such as:Dipped beam, distance light)And the overall brightness of vehicle local environment.This
The foundation that invention is adjusted using the luminance mean value of selection area as S curve.Regional choice is as shown in Figure 2.Wherein, rectangle ABCD
Region is selected luminance mean value zoning herein.Mean value computation expression formula is:
Wherein, NABCDFor the sum of all pixels in the ABCD of region.The size of region ABCD ranges of choice and handled image
Type and it is different, it is necessary to be manually set according to actual conditions.
4th step:S curve dynamic adjusts.
Image overall pixel intensity after MSR is handled is approached to average, makes the gray value of center section unobvious
It is distinguished.The present invention is mapped using nonlinear S-shaped shape transmission function, and the gray value of center section is stretched.
Function expression is:
Wherein, h is tonal gradation, for 8 gray level images, h=256.A, b is used for the shape of controlling curve.B is represented
Position where curve, a represent the speed of curve growth rate.Parameter a, b dynamic adjustment expression formula acquiring method be:
The two kinds of extreme cases to be handled image are chosen, by artificially adjusting a, b obtains preferable visual effect, obtains parameter
Respectively a0,b0,a1,b1.It is respectively I wherein to correspond to averagem0, Im1.Then a, b expression formula is:
5th step:Image non-linear maps.
Pass through formula(15)、(16)Calculating parameter a, b.Then a, b are brought into formula(14), output image expression formula can be obtained
For:
Wherein, IMSR(x, y) is through the enhanced images of MSR.Iout(x, y) is output display image.The image of the algorithm
Shown in treatment effect as accompanying drawing 3-6.
Exemplary description is carried out to the present invention above in conjunction with accompanying drawing, it is clear that realization of the invention is not by aforesaid way
Limitation, it is or not improved by the present invention as long as employing the various improvement of inventive concept and technical scheme of the present invention progress
Design and technical scheme directly apply to other occasions, within the scope of the present invention.