The theoretical image enchancing method of a kind of improved multiple dimensioned Retinex
Technical field
The invention belongs to night vision image and strengthen the field, be specifically related to the theoretical image enchancing method of a kind of improved multiple dimensioned Retinex.
Background technology
The information that people obtain from the external world has 75% approximately from video image.But video camera in when shooting since night illumination condition not enough, severe weather conditions such as dense fog, heavy rain, sand and dust, the image that video camera is caught has received serious degeneration, and the quality of image is descended, smudgy, contrast is on the low side.The method that adopts digital image processing techniques that the inclement weather degraded image is handled has two big types: figure image intensifying and image restoration.Image restoration is meant removes or minimizes the known or own processing of knowing degeneration of part in the piece image.Image restoration comprises because the degraded image that sensor or environmental limit cause is eliminated fuzzy, noise filtering, and geometric distortion or non-linear correction that sensor is caused.Image recovery method comprises Wiener filtering, least square, constraint least square is arranged, spline interpolation, variation model, PDE, machine learning etc.
The figure image intensifying is meant one type according to the requirement of using; Image is processed; With some information in the outstanding image; Weaken or remove some unwanted information, obtain image more practical concerning concrete application, or convert original image to image processing method that a kind of people of being more suitable for or machine carry out the form of analyzing and processing.The many image enchancing methods of oneself warp proposition of researchist at present, wherein the image enchancing method of comparative maturity has contrast enhancement process, histogram equalizing method, homographic filtering method, small wave converting method.The Retinex image enchancing method all has good characteristic aspect dynamic range compression and the color constancy, thereby can adaptively strengthen various dissimilar images.But the image enchancing method that is based on Retinex produces halation phenomenon in highlight regions, and overall brightness approaches to average, makes local detail information contrast not enough.
Summary of the invention
The invention discloses the theoretical image enchancing method of a kind of improved multiple dimensioned Retinex, its solved multiple dimensioned Retinex theoretical method produce halation phenomenon, to high-dynamics image agents enhance overall luminance shortage, problem that contrast is lower.
In order to solve the technical matters of above-mentioned existence, the present invention has adopted following scheme:
The theoretical image enchancing method of a kind of improved multiple dimensioned Retinex is characterized in that: may further comprise the steps:
(1) input picture adopts the global brightness adjustment function, and non-linear adjusting is carried out in the brightness of dark space details and highlight regions;
(2) utilize the multiple dimensioned Retinex algorithm of standard gain compensation to strengthen image;
(3) calculate selection area brightness average;
(4), calculate the S parameter of curve according to selection area brightness average;
(5) self-adaptation adjustment S curve;
(6) image after strengthening is carried out Nonlinear Mapping.
Be clear zone and dark space according to setting threshold with the brightness of image area dividing in the above-mentioned steps 1; Adopt the different brightness adjustment function to shine upon respectively to two zones, make dynamic range obtain stretching, only the gray level in the middle of the compression than dark space and highlight bar; Said brightness regulation function is:
Wherein
Wherein, D is the grayscale dynamic range of image, and for 8 bit image systems, its value is 256; w
LAnd w
HIt is respectively the weights coefficient in dark space and clear zone; T is the brightness segmentation threshold, and wherein for the 8bit image, the span of said T is 0-255.
Utilizing the multiple dimensioned Retinex algorithm of standard gain compensation to strengthen image in the above-mentioned steps 2 adopts the MSR method to realize; The mathematical form of said MSR method is the weighted mean of the SSR result of a plurality of different scales:
Wherein, K is a normalized factor, makes
∫∫F(x,y)dxdy=1 (7)
It is the output component of n yardstick of i color spectral coverage;
Be the output of multiple dimensioned Retinex at i color spectral coverage; w
nWeights for corresponding each yardstick.
Negative value appears in the image pixel after above-mentioned MSR method is handled, because directly to its pixel value negate logarithm, the visual effect that can not obtain; Need be through gain/compensating operation with its codomain translation be compressed in the scope that display shows, promptly
G, b are respectively gain coefficient and penalty coefficient, and mathematic(al) representation is:
R
Max, R
MinBe respectively the maximal value and the minimum value of input picture; d
MaxDynamic range for output device; Then gradation of image is carried out intercepting, confirm overall gray level value scope, the unified more corresponding dynamic range of output device that is stretched to, the intercepting rule is:
Wherein
Be R
iThe output of intercepting two ends gray-scale value,
With
Be respectively MSR and handle minimum value and the maximal value that each color of back is desired intercepting; Particularly to night vision image, its histogram distribution is similar to Normal Distribution; According to the confidence factor A that sets, calculate the value of two ends intercept point
With
For:
Wherein, μ
iAnd σ
iBe respectively R
iAverage and standard deviation.
Through night vision image is analyzed, draw the information that can characterize the night vision image characteristic in the above-mentioned steps 3; And with the brightness average of selection area foundation as the adjustment of S curve.
Above-mentioned mean value computation expression formula is:
Wherein, N
ABCDBe the sum of all pixels in regional ABCD.
The information of above-mentioned night vision image characteristic is near the picture centre zone; Comprise the state of opposite car light and the overall brightness of vehicle environment of living in.
Above-mentioned self-adaptation adjustment S curve step is that the image overall pixel intensity after MSR handles is approached to average, and the gray-scale value of center section is not come by obvious difference; Wherein use nonlinear S shape transport function to shine upon, the gray-scale value of center section is stretched.
9, the theoretical image enchancing method of said according to Claim 8 improved multiple dimensioned Retinex, it is characterized in that: said S shape transport function expression formula is:
Wherein, h is a gray shade scale, for 8 gray level images, h=256; A, b are used to control the shape of curve; B has represented the position at curve place, and a has represented the speed of curve growth rate;
The acquiring method that said parameter a, b dynamically adjust expression formula is:
Choose to handle two kinds of extreme cases of image, through artificial adjustment a, b obtains better visual effect, parameter be respectively a
0, b
0, a
1, b
1Wherein corresponding average is respectively I
M0, I
M1A then, the expression formula of b is:
Above-mentioned image non-linear mapping step is through formula (15), (16) calculating parameter a, b; With a, b brings formula (14) into then, can get the output image expression formula and be:
Wherein, I
MSR(x y) is image after MSR strengthens; I
Out(x y) is the output display image.
The theoretical image enchancing method of this improved multiple dimensioned Retinex has following beneficial effect:
1,, efficiently solves the multiple dimensioned Retinex algorithm of standard gain compensation and strengthen the halation phenomenon in the image through utilizing the global brightness adjustment function.Overall brightness is got a promotion.
2, according to picture centre regional luminance self-adaptation adjustment S curve, it is carried out Nonlinear Mapping, the stretching gradation of image improves contrast.Improve the robustness of algorithm to complicated night vision image.
Description of drawings
Fig. 1 is a schematic flow sheet of the present invention;
Fig. 2 is picture centre of the present invention zone mean value computation area schematic;
Fig. 3 is the design sketch of the remote input picture of the present invention;
Fig. 4 is the design sketch after medium and long distance algorithm of the present invention strengthens;
Fig. 5 is the closely design sketch of input picture of the present invention;
Fig. 6 is the design sketch after closely algorithm strengthens among the present invention.
Embodiment
Below in conjunction with accompanying drawing, the present invention is further specified:
The present invention implements one and has proposed the theoretical image enchancing method of a kind of improved multiple dimensioned Retinex.Its implementation is following:
The first step: global brightness adjustment.Can know that according to the Retinex theory Retinex algorithm is applicable to the environment that illumination slowly changes.In actual environment, be directed to night vision image especially, be a kind of high-dynamics image, local brightness variation is big.In order to make the Retinex algorithm obtain the better image reinforced effects, and the halation phenomenon after suppressing to strengthen, at first need carry out global brightness adjustment.This paper is clear zone and dark space according to setting threshold with the brightness of image area dividing.Adopt the different brightness adjustment function to shine upon respectively to two zones, make dynamic range obtain stretching, only the gray level in the middle of the compression than dark space and highlight bar.The brightness regulation function representation is following:
Wherein
Wherein, D is the grayscale dynamic range of image, and for 8 bit image systems, its value is 256.w
LAnd w
HIt is respectively the weights coefficient in dark space and clear zone.T is the brightness segmentation threshold.Wherein for the 8bit image, the span of said T is 0-255, and as test result, T gets can have division preferably for dark space and clear zone at 70 o'clock to the road spectrogram of gathering.
Second step: Retinex algorithm pattern image intensifying.
The mathematical form of MSR method is the weighted mean of the SSR result of a plurality of different scales:
F(x,y)=K?exp[-(x
2+y
2)/c
2] (6)
Wherein, K is a normalized factor, makes
∫∫F(x,y)dxdy=1 (7)
is the output component of n yardstick of i color spectral coverage.
is the output of multiple dimensioned Retinex at i color spectral coverage.w
nWeights for corresponding each yardstick.
Negative value can appear in the image pixel after the MSR method is handled, directly to its pixel value negate logarithm, the visual effect that can not obtain.Need be through gain/compensating operation with its codomain translation be compressed in the scope that display shows, promptly
G, b are respectively gain coefficient and penalty coefficient, and mathematic(al) representation is:
R
Max, R
MinBe respectively the maximal value and the minimum value of input picture.d
MaxDynamic range for output device.Then gradation of image is carried out intercepting, confirm overall gray level value scope, the unified more corresponding dynamic range of output device that is stretched to, the intercepting rule is:
Wherein
Be R
iThe output of intercepting two ends gray-scale value,
With
Be respectively MSR and handle minimum value and the maximal value that each color of back is desired intercepting.Particularly to night vision image, its histogram distribution is similar to Normal Distribution.According to the confidence factor A that sets, the value
and
that calculate the two ends intercept point do
Wherein, μ
iAnd σ
iBe respectively R
iAverage and standard deviation.
The 3rd step: selection area mean value computation.
Through night vision image is analyzed, can draw can characterize the night vision image characteristic information generally near the picture centre zone.Comprising the state (as: dipped beam, distance light) of opposite car light and the overall brightness of vehicle environment of living in.The present invention adopts the foundation of the brightness average of selection area as the adjustment of S curve.The zone is selected as shown in Figure 2.Wherein, rectangle ABCD zone is the selected brightness mean value computation of this paper zone.The mean value computation expression formula is:
Wherein, N
ABCDBe the sum of all pixels in regional ABCD.The size of zone ABCD range of choice with the image type of handling and different, need artificially set according to actual conditions.
The 4th step: the S curve is dynamically adjusted.
Image overall pixel intensity after MSR handles is approached to average, and the gray-scale value of center section is not come by obvious difference.The present invention uses nonlinear S shape transport function to shine upon, and the gray-scale value of center section is stretched.Function expression is:
Wherein, h is a gray shade scale, for 8 gray level images, h=256.A, b are used to control the shape of curve.B has represented the position at curve place, and a has represented the speed of curve growth rate.The acquiring method that parameter a, b dynamically adjust expression formula is:
Choose to handle two kinds of extreme cases of image, through artificial adjustment a, b obtains better visual effect, parameter be respectively a
0, b
0, a
1, b
1Wherein corresponding average is respectively I
M0, I
M1A then, the expression formula of b is:
The 5th step: image non-linear mapping.
Through formula (15), (16) calculating parameter a, b.With a, b brings formula (14) into then, can get the output image expression formula and be:
Wherein, I
MSR(x y) is image after MSR strengthens.I
Out(x y) is the output display image.The image processing effect of this algorithm is seen shown in the accompanying drawing 3-6.
Combine accompanying drawing that the present invention has been carried out exemplary description above; Obvious realization of the present invention does not receive the restriction of aforesaid way; As long as the various improvement of having adopted method design of the present invention and technical scheme to carry out; Or design of the present invention and technical scheme are directly applied to other occasion without improving, all in protection scope of the present invention.