Background technology
Up to now, color digital image is handled and is remained a difficult problem that does not have ripe solution under the random illumination condition.Complicated light condition has greatly increased the difficulty of Color Image Processing, particularly under the very poor situation of lighting environment, arrives photo-sensitive cell, image imaging poor quality owing to lack enough photons.For example,, also can't touch remote natural scene, say nothing of the place that does not allow to use flashlamp, as the museum even use flashlamp at night.In addition, some inappropriate operations (improper as exposing) also can reduce the quality of image during photography.The low-light (level) image has the characteristics that dynamic range is low and noise is big, and these characteristics not only influence the visual perception, all can cause fatal obstacle to later a series of subsequent image processing work (as image segmentation, feature extraction, target following etc.).
Keep color constancy when improving brightness of image/contrast, keep more details when improving signal noise ratio (snr) of image and texture information is a low-light (level) color digital image enhancement techniques verfolgten Ziele.The R of coloured image, G, B component have very strong correlativity, during enhancing rgb space to three passages respectively processing can bring serious cross-color, therefore generally need image transitions to color space with low passage correlativity.Nonetheless, colouring information still has loss to a certain degree.As Heechul Han, " Automatic Illumination and Color Compensation Using Mean Shift and Sigma Filter " paper that Kwanghoon Sohn delivered on the IEEE Transactions on Consumer Electronics periodical in 2009, under the complex illumination condition, it is higher that coloured image strengthens quality.But, the image after the enhancing that obtains of this method still is prone to the cross-color phenomenon.The solution of existing maintenance color constancy is mainly: (1) satisfies the method for W-P hypothesis.As 2007, E.Provenzi, M.Fierro, A.Rizzi, Deng " Random Spray Retinex:A New Retinex Implementation to Investigate the Local Properties of the Model " paper of on " IEEE Trans.Image Processing " periodical, delivering, a kind of new Retinex model implementation has been proposed.Adopt the image after this method strengthens to have good color saturation, but can lose more detailed information.(2) satisfy the method that G-W supposes.As 2004, A.Rizzi, " From Retinex to Automatic Color Equalization:Issues in Developing a New Algorithm for Unsupervised Color Equalization " paper that C.Gatta and D.Marini deliver on " J. Electronic Imaging " periodical.This method and the bilateral filtering technology type with edge retention performance seemingly, the image after the enhancing can keep more detailed information, but color is more flat.
The Retinex model is proposed in 1971 by Land and McCann, and think: observations only depends on the reflection characteristic on surface, and irrelevant with illumination condition.The basic purpose of Retinex algorithm is that input picture is decomposed into reflected image and light image, and it can simply be described as:
S(x,y)=R(x,y)×L(x,y) (1)
In the formula, (x y) is the pixel value of input picture at the capable y row of x to S, (x y) corresponding to the high-frequency information in the input picture, mainly is the information from object such as border, texture to reflected image R, and light image L (x, y) then corresponding in the image from the low-frequency information of scene environment influence.The Retinex theory thinks that (x, (directly (x y) expresses input picture S by reflected image R for x, y) influence y) can not to be subjected to light image L.Therefore, realizing the process of Retinex, promptly is that (x y), thereby derives R (x, process y) by calculating L.This just provides possibility for the scheme of new energy self-adaptive processing low-light (level) coloured image.
Summary of the invention
The present invention is directed to the proposition of above problem, and develop a kind of self-adaption colorful digital picture stretching denoising framework based on the Retinex model, with improve under the random illumination condition intelligently, the picture quality under the low light conditions particularly.The technological means that the present invention adopts is as follows:
Color digital image strengthens and denoising method under a kind of random illumination, it is characterized in that comprising the steps:
Step 1 is transformed into the YCbCr space with original image from rgb space and carries out the image denoising processing: adopt Gaussian filter to remove the Gaussian distribution noise earlier to Cb passage, Cr passage, adopt median filter to remove salt-pepper noise again and obtain new Cb
NewAnd Cr
New, the Y passage remains unchanged;
Step 2 is transformed into the HSI space with original image from rgb space simultaneously, carries out the processing of following steps:
1) brightness of image/contrast stretch processing:
1.: brightness of image/contrast stretch processing: for luminance channel, select for use two-sided filter that it is decomposed, obtain Base figure layer pixel value x
b, use original input luminance component x again
iDivided by Base figure layer pixel value, obtain Detail figure layer pixel value, promptly
2. adopt formula then: l=(1+x
d) log (x
i+ 1)-log (log (x
b+ 1)+1), obtains luminance compensation l as a result, obtain l ' through standardization;
3. based on l ' structure histogram restricted function:
In the formula: E
sBe the average of l ' behind the luminance compensation, E
dBe the average of desired image, E
dSpan be 60~100, the span of percentage is: 100~110;
4. add up the frequency that each gray level occurs among the above-mentioned function g, obtain frequency n
kThereby it is specific as follows to calculate the image histogram that makes new advances: p
k=(n
k+ λ * w * h/256)/(1+ λ); K=0, in the 1...255 formula: w and h distinguish the wide and high of presentation video, and λ is the parameter of control histogram equalization degree, λ=1,2,3;
5. the histogram that 4. obtains according to step carries out overall brightness/contrast stretching of image, and stretched image luminance component l " passes through two-sided filter once more, obtains new luminance component I
New
2) saturation degree compensation: at first pass through formula
Obtain the flatness of image, in the formula: μ and σ are respectively the average and the standard deviations of luminance channel, x
iBe the input the luminance channel pixel value, x
bBe that image is through the pixel value after the two-sided filter;
The flatness parameter γ of the image that following formula is obtained brings following formula into:
S
new=(1+γ)×S
Obtain new image saturation S
New, in the formula: S is the saturation degree component of original image, and parameter γ has described the flatness of image;
Step 3 merges demonstration: will be through the Cb that obtains after step 1 noise reduction process
NewAnd Cr
NewReach constant Y and be transformed into rgb space, obtain image I
YWill be through the I of step 2 restoration and reconstruction
NewS with enhancement process
NewReach constant H and be transformed into rgb space, obtain image I
HPass through image I at last
YAnd image I
HPass through I
O=aI
H+ bI
YAfter the computing, output final image I
o, wherein the span of a is: 0.6~0.8, and the span of b is: 0.2~0.4.
The described standardization of 2. step in the step 2 obtains l ' specific implementation and passes through following formula:
In the formula, l
MaxAnd l
MinBe respectively maximal value and the minimum value of l (x).
The average E of mentioned desired image in the step 2
dValue be 70.
The value of the parameter lambda of mentioned control histogram equalization degree is 2 in the step 2.
Adopt the parameterless luminance compensation Retinex model of revising, make the present invention can be fit to most images, can make image detail more remarkable simultaneously.Adopt the modification histogram of limited images average and variance, make the image acquisition better contrast after the enhancing, and can make mean picture brightness be fit to the human eye sense organ.Employing can guarantee can not damage image when image is not suitable for doing too much enhancing according to the enhancing function of mean picture brightness and image flatness control saturation degree pulling strengrth.The colored shape constancy that so just can keep image promotes the dynamic range of image preferably, also can suppress, remove simultaneously the noise of image, loses less texture and detailed information.
Embodiment
Technical scheme of the present invention such as Fig. 1: at first original RGB digital picture is switched to other color spaces, at the HSI color space image is done enhancement process, in the YCbCr space image is done denoising.The present invention is directed to the characteristic in different color space, two kinds of color spaces are used in combination, promoted the treatment effect of enhancing and denoising.Aspect the figure image intensifying, the present invention has revised the Retinex model algorithm, has proposed improved histogramming algorithm, has provided the formula that promotes saturation degree.Aspect image denoising, the present invention is directed to the characteristics of intrinsic noise under the particular light, selected Gaussian filter to be used in combination with median filter.
One, color digital image strengthens process
Color digital image enhancing process is as follows respectively:
(1) color digital image brightness strengthens process
(1) compensation of color digital image brightness
The present invention realizes the color digital image luminance compensation at the HSI color space.There are some researches prove that HSI can keep the original tone of image to greatest extent, coloured image brightness is stretched, can not destroy the realistic colour of image in the HSI space.
In the tradition Retinex model, adopt Gaussian filter that input picture is decomposed into reflected image and light image, cause easily that details is fuzzy, halation forms or noise enlarges.The present invention selects for use two-sided filter that input picture is decomposed, and this wave filter can keep image detail, can solve halo effect and suppress noise enlarging preferably.The output of two-sided filter as light image L (x, y), the merchant of input picture and light image as reflected image R (x, y).The formula of luminance compensation is as follows:
l=(1+x
d)log(x
i+1)-log(log(x
b+1)+1) (2)
In the formula, x
iBe the pixel value of input image lightness passage (I passage), x
bAnd x
dThe pixel value of representing light image and reflected image respectively.Formula (2) need not any parameter, and luminance compensation l (x) as a result deducts the illumination restricted function by amended light intensity and obtains.Adopt formula (3) to handle then, the result transformed to the 0-255 interval.
In the formula, l
MaxAnd l
MinBe respectively maximal value and the minimum value of l (x).
(2) stretching of color digital image brightness
The present invention adopts the histogram functions of revising that image is carried out brightness/contrast behind luminance compensation and stretches, this method is by adding the restricted function based on image average and standard deviation in statistic histogram, can make image obtain better contrast, simultaneously brightness range that also can limited images makes brightness of image be in the normal illumination scope all the time.If the probability of 256 gray level appearance is:
p
k=(n
k+λ×w×h/256)/(1+λ);k=0,1...255 (4)
In the formula, w and h distinguish the wide and high of presentation video, and λ is the parameter of control histogram equalization degree, λ=1,2,3, and when this parameter value was 1, formula promptly was changed to traditional histogram equalization, and value is greater than 1 restriction equalization degree.Experiment shows, value is can meet the demands in 2 o'clock.Right if specific (special) requirements is arranged, also can consider to increase value to 3.n
kBe based on the frequency that each gray level occurs among the histogram restricted function g of image average and standard deviation.
Restricted function g is defined as follows:
In the formula, E
sBe the average of l ' behind the luminance compensation, E
dBe the average of desired image, E
dSpan be 60~100, this value is in order to make the brightness of image scope in a comparatively moderate interval, the height of brightness according to demand, value in 60~100 is when this parameter setting is 70 can adapt to whole pictures.The percentage parameter can the fine adjustments contrast, and to promote the contrast of image stretch, its span is: 100~110 (when value is 100, not doing variation) can adopt 110 when practical application;
(2) color digital image saturation degree compensation process
Even in the very weak HSI space of YC correlativity, brightness is handled still can be caused color saturation to reduce merely.The present invention proposes an adaptive saturation degree and strengthen function, can strengthen image saturation according to the flatness of general image.Saturation degree component after the enhancing is:
S
new=(1+γ)×S (6)
In the formula, S is the saturation degree component of original image, and parameter γ has described the flatness of image, and it is defined as follows:
In the formula, μ and σ are respectively the average and the standard deviations of luminance channel, x
iBe the input the luminance channel pixel value, x
bBe that image is through the pixel value after the two-sided filter.As can be seen, if image is under the normal illumination or flatness is very poor, then the value of γ can be very little, so just guaranteed when image is not suitable for too much stretching, and saturation degree strengthens function and can not cause color of image to damage.
Two, color digital image denoising process
The denoising process of color digital image is finished in the YCbCr space.The present invention has analyzed the different noise type of low-light (level), selects the gaussian sum median filter to remove Gaussian noise and salt-pepper noise.Its process is as follows respectively:
(1) the removal process of color digital image Gaussian noise
At normal exposure time in can't obtain sufficient illumination during photographic images night, and in order to obtain sufficient illumination, we can only elongate the time shutter.Yet the time shutter is long more, and electronic noise is also big more to the influence of image.Generally, can think that this electronic noise is approximately the Gaussian distribution noise, therefore, the present invention selects for use Gaussian filter that this noise like is removed.
(2) the removal process of color digital image salt-pepper noise
Except that Gaussian noise, the low-light (level) image also has a kind of intrinsic noise, shows as salt-pepper noise.The present invention selects for use median filter that this noise like is removed.
Below in conjunction with technical scheme and accompanying drawing, describe the specific embodiment of the present invention and case study on implementation in detail.
The specific implementation process that color digital image based on the Retinex model of the present invention strengthens denoising method as shown in Figure 2.
1. image denoising is handled: original image is transformed into the YCbCr space from rgb space, adopts Gaussian filter to remove the Gaussian distribution noise earlier to Cb, Cr passage, adopt median filter to remove salt-pepper noise again, the Y passage remains unchanged.(Y is meant luminance component, and Cb refers to the chroma blue component, and Cr refers to the red color component, because YCbCr is ripe color-code scheme, the present invention does not do too much description to its concrete technology contents.)
2. brightness of image/contrast stretch processing: image is transformed into the HSI space from rgb space,, selects for use two-sided filter that it is decomposed, obtain Base figure layer x for luminance channel (I passage)
b, use original input luminance component x again
iDivided by Base figure layer pixel value, obtain Detail figure layer pixel value, promptly
The improvement Retinex model algorithm (formula (2)) that adopts the present invention to propose then obtains luminance compensation l as a result, obtains l ' through standardization, guarantees that its span is 0-255.Then, based on l ' structure histogram restricted function g (formula (5)), the frequency that each gray level occurs among the statistical function g obtains frequency n
kThereby, calculate the image histogram (formula (4)) that makes new advances, according to this histogram, realize that the overall brightness/contrast of image stretches.Stretched image luminance component l " passes through two-sided filter once more, to remove the noise that amplifies owing to the brightness/contrast stretching and to keep image detail, obtains new luminance component I
New
3. saturation degree compensation: the flatness parameter γ of computed image (formula (7)), self-adaptation is adjusted the saturation degree component, obtains new image saturation S
New(formula (6)).
4. merge and show:
After the denoising of YCbCr space, be transformed into rgb space, obtain image I
YBe transformed into rgb space after the HSI spatial manipulation, obtain image I
H
The Cb that will 1. obtain after the noise reduction process through step
NewAnd Cr
NewReach constant Y and be transformed into rgb space, obtain image I
YWill be through the 2. and 3. I of restoration and reconstruction of step
NewS with enhancement process
NewReach constant H and be transformed into rgb space, obtain image I
HPass through image I at last
YAnd image I
HPass through I
O=aI
H+ bI
YAfter the computing, output final image I
o, wherein the span of a is: 0.6~0.8, and the span of b is: 0.2~0.4; I
HExpression strengthens part, I
YExpression denoising part gets when dark images that to strengthen part just more, otherwise the denoising part is just many; In view of the present invention mainly handles the low-light (level) image, so I
HRatio to select in 0.6~0.8 be desirablely (to note I
HCoefficient and I
YThe coefficient sum to guarantee to be 1).I is adopted in invention
O=0.7I
H+ 0.3I
YThe compute mode output image.
The present invention has obtained good visual effect to a large amount of picture experiments of various illumination conditions, various scenes.The experiment case comprises the outdoor scene photo of taking at the colored checker picture of the standard of low-light level low contrast, night, low the exposure image under the facial image under character image, sunset image, the environment backlight and outdoor scene image, daytime buildings indoor setting image, the daylight lamp environment and the image under the incandescent lamp environment down.
1. the colored checker embodiment of standard shows that the present invention can recover shades of colour information under the low-light level low contrast well, makes color clear visible and keep shape constancy;
2. the outdoor scene photo embodiment that takes night shows, the present invention can recover the things details preferably and can redraw things color originally;
3. low exposure character image embodiment down shows that the present invention can handle under-exposed image, and for personage's details expression, the recovery of object details color all has good effect;
4. sunset figure image intensifying embodiment shows, effect was better when the present invention handled the hypographous image of sidelight;
5. facial image under the environment backlight and outdoor scene image embodiment show, the present invention for be in people's object detail under the environment backlight, far away, close shot object image all has good effect;
6. daytime, buildings indoor setting image embodiment showed, the present invention has good effect for recovering interior architecture decoration details;
7. the image embodiment under daylight lamp and the incandescent lamp environment shows, the image that the present invention takes down for non-sunshine condition all has good enhancing effect.
The present invention adopts three kinds of quantitative criteria quantitative evaluations to strengthen the quality of back image:
1. Y-PSNR PSNR is used to estimate the denoising performance that strengthens the back image, is worth greatly more, and the noise in the image is low more.
2. naturalness CNI is used to estimate coloured image and meets the natural perception degree of human eye to color, and value between 0-1 more near 1, shows that this image is natural more.
3. vividness CCI is used for the degree bright in luster of evaluation map picture, is worth greatly more, and presentation video is bright-coloured more.
Subordinate list 1 has provided the result who adopts above-mentioned quantitative criteria to estimate the invention process effect.The result shows that under multiple test environment, through enhancement process of the present invention, the image Y-PSNR significantly improves, and color is more bright-coloured, and most image is more natural, meets the vision perception characteristic of human eye more.
Table 1
The above; only be the preferable embodiment of the present invention; but protection scope of the present invention is not limited thereto; anyly be familiar with those skilled in the art in the technical scope that the present invention discloses; be equal to replacement or change according to technical scheme of the present invention and inventive concept thereof, all should be encompassed within protection scope of the present invention.