A kind of enhancement method of low-illumination image and system
Technical field
The present invention relates to technical field of image processing, more particularly to a kind of enhancement method of low-illumination image and system.
Background technology
In the application of image acquisition or video monitoring, often there is the situation of the low-light (level)s such as night vision or backlight, collect
Image it is partially dark, can identification it is low, need to carry out just specifically being applied after image enhancement processing.Image enhaucament is exactly to expand
The brightness range of big image and the overall brightness of raising image, improve the subjective quality of image so that the image that cannot be recognized is thin
Energy-conservation is enough by human eye or machine recognition.
Common image enhancement processing method include luminance transformation method, homomorphic filtering method, gradient field Enhancement Method and
Retinex Enhancement Method etc..Luminance transformation method with histogram equalization method as representative can make image brightness distribution evenly, and
Strengthen picture contrast, but easily produce enhancing phenomenon.Image is divided into based on the homomorphic filtering method of illumination-reflection model
High and low frequency two parts, reaching strengthens picture contrast while compressing the purpose of dynamic range of images, but occurs that enhancing was existing
As poor to specular, shadow enhancement effect.Gradient field Enhancement Method is then processed the gradient of original image, by reducing figure
As Grad compresses dynamic range of images, increase partial gradient value to strengthen image border.Have the disadvantage to make image in certain journey
Sharpen on degree, and reconstruction image needs certain numerical algorithm in gradient field, is not suitable for using in real time.Retinex strengthens
Method estimates the luminance component of original image using Gaussian smoothing function, and using illumination compensation method reflected image is approached, and can protect
Strengthen the information of image dark place while holding brightness of image, but there is a problem that operand is big, it is difficult to real-time processing high definition figure
Picture, lacks universality, and the direct enhancement process that carries out to image easily produces color loss under RGB color, does not meet
The visual signature of people.
The content of the invention
In view of this, the technical problem to be solved in the present invention is to provide a kind of strong robustness, is easily achieved, is more suitable for people's
The enhancement method of low-illumination image and system of visual signature, it is big to solve current enhancement method of low-illumination image operand, lack
Universality, it is difficult to the technical problem of real-time processing high-definition image.
The technical scheme that present invention solution above-mentioned technical problem is adopted is as follows:
According to an aspect of the present invention, there is provided a kind of enhancement method of low-illumination image include:
The original image of input is transformed into into HIS space by rgb space;
Keep the saturation and chrominance component of image constant, luminance component is strengthened;
The enhanced image of brightness is transformed into into rgb space by HIS space and is exported.
Preferably, the original image of input is transformed into into HIS space by rgb space to further include to carry out as follows
Conversion:
Wherein, I represents brightness, and S represents saturation, and H represents tone;R, G, B represent that respectively three colours of red, green, blue lead to
Road;Min () represents minima, and mean () represents average;The span of A is [200,255].
Preferably, keep the saturation and chrominance component of image constant, enhancing is carried out to luminance component and is further included:
Adaptive-filtering is carried out to luminance component, illumination pattern is obtained;
Calculate the reflectogram of original image;
The contrast of adjustment illumination pattern;
Enhanced luminance graph is synthesized according to the illumination pattern after reflectogram and setting contrast.
Preferably, adaptive-filtering is carried out to luminance component, obtains illumination pattern and further include:
The template window of default M different N*N;Wherein, M takes the integer more than 1, and N takes the odd number including more than 3;Mould
Value in plate window is made up of 0 and 1, and different by the polygonal shape that constitutes for 1 point is worth, all polygons combine
Cover whole template window;
For each pixel, the luminance mean value Mean of each template window is calculatedmAnd corresponding variance δm, wherein, m
For 1 to M integer;
Obtain minimum variance δ of each pixelmThe luminance mean value Mean of corresponding templates windowmAs the pixel
Value after luminance filtering, that is, obtain the illumination value of the pixel.
Preferably, the contrast for adjusting illumination pattern is further included:
Reject pixel of the illumination value two ends proportion less than default ratio value in illumination pattern;
Calculate the average illumination value of remaining pixel;
The illumination value of remaining each pixel of pixel is individually subtracted into average illumination value, illumination differential chart is obtained;
The illumination difference of each pixel in illumination differential chart is multiplied by into respectively default Dynamic gene;
Illumination difference after the adjustment of each pixel in illumination differential chart is added respectively average illumination value, that is, it is right to obtain
Than the illumination pattern after degree adjustment.
According to another aspect of the present invention, there is provided a kind of low-light (level) image intensifier device include:
First modular converter, for the original image of input to be transformed into into HIS space by rgb space;
Luminance enhancement module, for keeping the saturation and chrominance component of image constant, strengthens luminance component;
Second modular converter, for the enhanced image of brightness being transformed into into rgb space by HIS space and being exported.
Preferably, the first modular converter is specifically for being changed as follows:
Wherein, I represents brightness, and S represents saturation, and H represents tone;R, G, B represent that respectively three colours of red, green, blue lead to
Road;Min () represents minima, and mean () represents average;The span of A is [200,255].
Preferably, luminance enhancement module includes:
Adaptive-filtering unit, for carrying out adaptive-filtering to luminance component, obtains illumination pattern;
Reflectogram computing unit, for calculating the reflectogram of original image;
Setting contrast unit, for adjusting the contrast of illumination pattern;
Image composing unit, for synthesizing enhanced luminance graph according to the illumination pattern after reflectogram and setting contrast.
Preferably, adaptive-filtering unit includes:
Template-setup subelement, for presetting the template window of M different N*N;Wherein, M takes the integer more than 1, and N takes
Including more than 3 odd number;Value in template window is made up of 0 and 1, different by the polygonal shape that constitutes for 1 point is worth,
All polygons combine will cover whole template window;
Computation subunit, for for each pixel, calculating the luminance mean value Mean of each template windowmAnd correspondence
Variance δm, wherein, m is 1 to M integer;
Determination subelement, for obtaining minimum variance δ of each pixelmThe luminance mean value Mean of corresponding templates windowm
As the value after the luminance filtering of the pixel, that is, obtain the illumination value of the pixel.
Preferably, setting contrast unit includes:
Filter subelement, for rejecting illumination pattern in illumination value two ends proportion less than default ratio value pixel
Point;
Illumination mean value computation subelement, for calculating the average illumination value of remaining pixel;
Differential chart computation subunit, for the illumination value of remaining each pixel of pixel to be individually subtracted into average light
According to value, illumination differential chart is obtained;
Adjustment subelement, for by the illumination difference of each pixel in illumination differential chart be multiplied by respectively default adjustment because
Son;
Correction subelement, it is average for the illumination difference after the adjustment of each pixel in illumination differential chart to be added respectively
Illumination value, that is, obtain the illumination pattern after setting contrast.
The enhancement method of low-illumination image and system of the embodiment of the present invention, compared with prior art, by HIS space pair
The brightness of image is strengthened, and very dark region (connecing pullous region) can be avoided to become bright-coloured colour after enhancing,
More meet the visual signature of people;Meanwhile, strengthen that algorithm complex is low, operand is little, can not only real-time processing high-definition image, and
The performance requirement to hardware can be reduced.Additionally, be improved by the formula in color space conversion to calculating saturation, it is right
Be not in that image becomes flower phenomenon after the pixel of arbitrarily brightness is strengthened, visual effect is fine, stable performance.In addition, logical
Adaptive filter method is crossed, the gentle region of pixel value changes in Automatic-searching neighborhood of pixel points to be filtered, further according to flat zone
The pixel value in domain can well keep image edge information, it is to avoid image blurring calculating the filtered value of pending point.
Description of the drawings
Fig. 1 is a kind of flow chart of enhancement method of low-illumination image provided in an embodiment of the present invention.
A kind of flow chart of luminance component Enhancement Method that Fig. 2 is provided for the preferred embodiment of the present invention.
A kind of flow chart of brightness adaptive filter method that Fig. 3 is provided for the preferred embodiment of the present invention.
A kind of schematic diagram of template window that Fig. 4 is provided for the preferred embodiment of the present invention.
A kind of flow chart of setting contrast method that Fig. 5 is provided for the preferred embodiment of the present invention.
Fig. 6 is a kind of function structure chart of low-light (level) image intensifier device provided in an embodiment of the present invention.
Fig. 7 strengthens the structural representation of module for a kind of luminance component that the preferred embodiment of the present invention is provided.
A kind of structural representation of brightness adaptive-filtering module that Fig. 8 is provided for the preferred embodiment of the present invention.
A kind of structural representation of setting contrast module that Fig. 9 is provided for the preferred embodiment of the present invention.
Specific embodiment
In order that the technical problem to be solved, technical scheme and beneficial effect are clearer, clear, below tie
Drawings and Examples are closed, the present invention will be described in further detail.It should be appreciated that specific embodiment described herein is only
To explain the present invention, it is not intended to limit the present invention.
Embodiment one
As shown in figure 1, a kind of enhancement method of low-illumination image provided in an embodiment of the present invention, comprises the following steps:
S10, the original image of input is transformed into into HIS space by rgb space.
Preferably, can be changed using below equation:
Wherein, I represents brightness, and S represents saturation, and H represents tone;R, G, B represent that respectively three colours of red, green, blue lead to
Road;Min () represents minima, and mean () represents average;The span of A is [200,255].The value of A is made when certain pixel
When point is very dark, the S values close 0 of the pixel, when the color of certain pixel is very bright-coloured, S values tend to 1, therefore, the value model of A
Enclose for [200,255].
Specifically, saturation S is reflection color purity, and span is from 0 to 1, and saturation is bigger, and color seems
It is more bright-coloured.But when three passages of pixel value all very littles and have a passage value it is relative other two it is larger when, such as (0,
0.003,0), human eye looks like black, and saturation close to 0, but should be calculated according to traditional calculations saturation formula (3)
Saturation be 1, therefore formula (3) is inapplicable to some pixels, especially when brightness value increases, visually, this
Point becomes green by black, therefore, may become colored after image enhaucament, visual effect is bad.By changing to formula (3)
After entering for above-mentioned formula (4), when the value of A in formula (4) is 255, calculating pixel triple channel value according to formula (4) is
(0,0.003,0) pixel saturation is 0.00025.It can be seen that, the saturation calculated using formula (4) is closer to human eye
Vision, is not in that image becomes flower phenomenon after strengthening the pixel of any brightness, visual effect very well, stable performance.
It should be noted that, when the original image of input picture is not R, G, B spatial image, need to first convert thereof into R,
G, B space.
S20, the saturation of holding image and chrominance component are constant, and luminance component is strengthened.
Fig. 2 is referred to, used as a kind of preferred embodiment, this step S20 is further comprising the steps:
S201, adaptive-filtering is carried out to luminance component, obtain illumination pattern.
S202, the reflectogram for calculating original image.
Specifically, in log-domain, the brightness value I of each pixel in original image is deducted into corresponding pixel points in illumination pattern
Brightness value L, obtain the brightness value R of corresponding pixel points in the reflectogram on log-domain, i.e.,:
Log R=log I-log L
The contrast of S203, adjustment illumination pattern.
S204, enhanced luminance graph I is synthesized according to the illumination pattern after reflectogram and setting contrastout。
Specifically, in log-domain, by the brightness value R of each pixel in reflectogram plus the illumination pattern after contrast reduction
The brightness value L of middle corresponding pixel points ', obtain the enhanced brightness value I of brightness on log-domainout, i.e.,:
log Iout=log L'+log R
S30, the enhanced image of brightness is transformed into into rgb space by HIS space and is exported.
Specifically, H, S component keeps constant, with the enhanced I of brightnessout, HIS space is transformed into into rgb space, obtain final product
To enhanced RGB color image.For example, conversion formula is as follows:
As 0≤H<When 120 °,
As 120 °≤H<When 240 °,
When 240 °≤H≤360 °,
Enhanced three color channel R are calculated by above-mentionedout、Gout、BoutAnd output image.
The enhancement method of low-illumination image of the embodiment of the present invention, is strengthened, energy by the brightness in HIS space to image
Enough avoid very dark region (connecing pullous region) from becoming bright-coloured colour after enhancing, more meet the visual signature of people;Together
When, strengthen that algorithm complex is low, operand is little, can not only real-time processing high-definition image, and can reduce the performance to hardware and want
Ask.Additionally, being improved by the formula in color space conversion to calculating saturation, the pixel of any brightness is carried out
Be not in that image becomes flower phenomenon after enhancing, visual effect is fine, stable performance.
Embodiment two
As shown in figure 3, a kind of brightness adaptive filter method that the preferred embodiment of the present invention is provided, the method is with template
Based on window computing, comprise the following steps:
The template window of S2011, default M different N*N.
Wherein, M takes the integer more than 1, and N takes the odd number including more than 3;Value in template window is made up of 0 and 1, by being worth
Polygonal shape for 1 point composition is different, and all polygons combine will cover whole template window;
Specifically, the template window of M different N*N is pre-set, the value in the template window is constituted by 0,1, and M takes greatly
In 1 integer, N takes the odd number including more than 3, in the template window of the M different N*N by be worth for 1 point constitute it is polygon
Shape shape is different, and the selected principle of polygon is that all polygons will cover whole template window.With take M be 9, N be 5,
Namely take as a example by the template window of 9 5*5, but be not limited to the template window, then make 9 kinds of different windows, the number of window
Setting can also be actually needed according to user.Fig. 4 is refer to, the totally 9 kinds of different template windows as shown in Fig. 4 (a)~Fig. 4 (i)
Mouthful, 9 kinds of template windows of different shapes are included by being worth 4 pentagons, 4 hexagons, 1 length of side that constitute for 1 point
For 3 square.
S2012, for each pixel, calculate the luminance mean value Mean of each template windowmAnd corresponding variance δm。
Wherein, m is 1 to M integer;The window of M N*N is slided in entire image, can be according to formula (5), (6)
Calculate the luminance mean value Mean of the template window of the pixel to be filteredmAnd corresponding variance δm, wherein, in this multiple template window
The interior value of mouth represents that k=1,2,3 ..., P, P are the number that each template window intermediate value is 1 with k for 1 point, and the value is 1 point k
The pixel value of correspondence position is represented with I (i, j) in luminance picture I:
The computing formula of variance is:
So as to for each pixel to be filtered, M variance yields σ of the pixel can be obtainedm。
S2013, minimum variance δ for obtaining each pixelmThe luminance mean value Mean of corresponding templates windowmAs the picture
Value after the luminance filtering of vegetarian refreshments.
Specifically, for each pixel, by calculated M σmIt is ranked up, finds minimum σmCorresponding templates
Luminance mean value MeanmAs filter result.The window of N*N is slided in entire image, it is right to can be achieved with using said method
The filtered value of all pixels point, that is, obtain image irradiation information.
In the embodiment of the present invention, by the region that pixel value changes in Automatic-searching neighborhood of pixel points to be filtered are gentle, then
The filtered value of pending point is calculated according to the pixel value of shoulder, image edge information can be well kept, it is to avoid
It is fuzzy.
Embodiment three
As shown in figure 5, a kind of illumination pattern setting contrast method that the preferred embodiment of the present invention is provided, including following step
Suddenly:
Pixel of the illumination value two ends proportion less than default ratio value in S2031, rejecting illumination pattern.
Specifically, the pixel for rejecting illumination value proportion very little can further eliminate effect of noise, default
Ratio value typically takes 1% pixel.
S2032, the average illumination value for calculating remaining pixel.
S2033, the illumination value of remaining each pixel of pixel is individually subtracted into average illumination value, obtains illumination difference
Value figure.
S2034, the illumination difference of each pixel in illumination differential chart is multiplied by into respectively default Dynamic gene.
Wherein, default Dynamic gene takes the numerical value between 0 to 2.
S2035, by the illumination difference after the adjustment of each pixel in illumination differential chart respectively add average illumination value, i.e.,
Obtain the illumination pattern after setting contrast.
In the present embodiment, it is made up of Lighting information, three parts of object edge information and random noise based on image
Ultimate facts, by keep marginal information it is constant in the case of, adjust illumination contrast while, can preferably keep
The detailed information of the original image of input.
Example IV
As shown in fig. 6, a kind of low-light (level) image intensifier device provided in an embodiment of the present invention, including with lower module:
First modular converter 10, for the original image of input to be transformed into into HIS space by rgb space.
Luminance enhancement module 20, for keeping the saturation and chrominance component of image constant, strengthens luminance component.
Second modular converter 30, for the enhanced image of brightness being transformed into into rgb space by HIS space and being exported.
Preferably, the first modular converter 10 can be changed using below equation:
Wherein, wherein, I represents brightness, and S represents saturation, and H represents tone;R, G, B represent respectively three coloured silks of red, green, blue
Chrominance channel;Min () represents minima, and mean () represents average;The span of A is [200,255].The value of A is made when certain
When pixel is very dark, the S values close 0 of the pixel, when the color of certain pixel is very bright-coloured, S values tend to 1, therefore, A's takes
Value scope is [200,255].
Specifically, saturation S is reflection color purity, and span is from 0 to 1, and saturation is bigger, and color seems
It is more bright-coloured.But when three passages of pixel value all very littles and have a passage value it is relative other two it is larger when, such as (0,
0.003,0), human eye looks like black, and saturation close to 0, but should be calculated according to traditional calculations saturation formula (3)
Saturation be 1, therefore formula (3) is inapplicable to some pixels, especially when brightness value increases, visually, this
Point becomes green by black, therefore, may become colored after image enhaucament, visual effect is bad.By changing to formula (3)
After entering for above-mentioned formula (4), when the value of A in formula (4) is 255, calculating pixel triple channel value according to formula (4) is
(0,0.003,0) pixel saturation is 0.00025.It can be seen that, the saturation calculated using formula (4) is closer to human eye
Vision, is not in that image becomes flower phenomenon after strengthening the pixel of any brightness, visual effect very well, stable performance.
Preferably, Fig. 7 is referred to, luminance enhancement module 20 includes adaptive-filtering unit 201, reflectogram computing unit
202nd, setting contrast unit 203 and image composing unit 204, wherein:
Adaptive-filtering unit 201, for carrying out adaptive-filtering to luminance component, obtains illumination pattern;
Reflectogram computing unit 202, for calculating the reflectogram of original image;Specifically, in log-domain, by original image
In the brightness value I of each pixel deduct the brightness value L of corresponding pixel points in illumination pattern, obtain right in the reflectogram on log-domain
The brightness value R of pixel is answered, i.e.,:
Log R=log I-log L
Setting contrast unit 203, for adjusting the contrast of illumination pattern;
Image composing unit 204, for synthesizing enhanced brightness according to the illumination pattern after reflectogram and setting contrast
Figure.Specifically, in log-domain, by the brightness value R of each pixel in reflectogram plus right in the illumination pattern after contrast reduction
Answer pixel brightness value L ', obtain the enhanced brightness value I of brightness on log-domainout, i.e.,:
log Iout=log L'+log R
Second modular converter 30 keeps constant to H, S component, uses enhanced Iout, HIS space is transformed into into rgb space,
Obtain enhanced RGB color image.For example, conversion formula is as follows:
As 0≤H<When 120 °,
As 120 °≤H<When 240 °,
When 240 °≤H≤360 °,
Enhanced three color channel R are calculated by above-mentionedout、Gout、BoutAnd output image.
It should be noted that, when the original image of input picture is not R, G, B spatial image, need to first convert thereof into R,
G, B space.
The low-light (level) image intensifier device of the embodiment of the present invention, is strengthened, energy by the brightness in HIS space to image
Enough avoid very dark region (connecing pullous region) from becoming bright-coloured colour after enhancing, more meet the visual signature of people;Together
When, strengthen that algorithm complex is low, operand is little, can not only real-time processing high-definition image, and can reduce the performance to hardware and want
Ask.Additionally, being improved by the formula in color space conversion to calculating saturation, the pixel of any brightness is carried out
Be not in that image becomes flower phenomenon after enhancing, visual effect is fine, stable performance.
Embodiment five
As shown in figure 8, a kind of adaptive-filtering unit provided in an embodiment of the present invention includes following subelement:
Template-setup subelement 2011, for presetting the template window of M different N*N;Wherein, M takes whole more than 1
Number, N takes the odd number including more than 3;Value in template window is made up of 0 and 1, each by the polygonal shape that constitutes for 1 point is worth
Differ, all polygons combine will cover whole template window;
Specifically, the template window of M different N*N is pre-set, the value in the template window is constituted by 0,1, and M takes greatly
In 1 integer, N takes the odd number including more than 3, in the template window of the M different N*N by be worth for 1 point constitute it is polygon
Shape shape is different, and the selected principle of polygon is the window that all polygons will cover whole template window.With take M as 9,
N is 5, namely is taken as a example by the template window of 9 5*5, but is not limited to the template window, then make 9 kinds of different windows, window
Number can also be actually needed setting according to user.Fig. 4 is refer to, the totally 9 kinds of different moulds as shown in Fig. 4 (a)~Fig. 4 (i)
Plate window, 9 kinds of template windows of different shapes include by be worth constitute for 1 point 4 pentagons, 4 hexagons, 1
The length of side is 3 square.
Computation subunit 2012, for for each pixel, calculating the luminance mean value Mean of each template windowmAnd
Corresponding variance δm, wherein, m is 1 to M integer.
Specifically, the window of M N*N is slided in entire image, can according to formula (5), that (6) calculate this is to be filtered
The luminance mean value Mean of the template window of pixelmAnd corresponding variance δm, wherein, value is 1 point in this multiple template window
Represented with k, k=1,2,3 ..., P, P is the number that each template window intermediate value is 1, the value be 1 point k in luminance picture I
The pixel value of correspondence position is represented with I (i, j):
The computing formula of variance is:
So as to for each pixel to be filtered, M variance yields σ of the pixel can be obtainedm。
Determination subelement 2013, for obtaining minimum variance δ of each pixelmThe luminance mean value of corresponding templates window
MeanmAs the value after the luminance filtering of the pixel, that is, obtain the illumination value of the pixel.
Specifically, for each pixel, by calculated M σmIt is ranked up, finds minimum σmCorresponding templates
Luminance mean value MeanmAs filter result.The window of N*N is slided in entire image, it is right to can be achieved with using said method
The filtering of all pixels, that is, obtain image irradiation information.
In the embodiment of the present invention, by the region that pixel value changes in Automatic-searching neighborhood of pixel points to be filtered are gentle, then
The filtered value of pending point is calculated according to the pixel value of shoulder, image edge information can be well kept, it is to avoid
It is fuzzy.
Embodiment six
As shown in figure 9, the setting contrast unit that the preferred embodiment of the present invention is provided, including following subelement:
Filter subelement 2031, for rejecting illumination pattern in illumination value two ends proportion less than default ratio value picture
Vegetarian refreshments;
Illumination mean value computation subelement 2032, for calculating the average illumination value of remaining pixel;
Differential chart computation subunit 2033, it is flat for the illumination value of remaining each pixel of pixel to be individually subtracted
Illumination value, obtains illumination differential chart;
Adjustment subelement 2034, for the illumination difference of each pixel in illumination differential chart to be multiplied by respectively into default tune
Integral divisor;
Correction subelement 2035, for the illumination difference after the adjustment of each pixel in illumination differential chart to be added respectively
Average illumination value, that is, obtain the illumination pattern after setting contrast.
In the present embodiment, it is made up of Lighting information, three parts of object edge information and random noise based on image
Ultimate facts, by keep marginal information it is constant in the case of, adjust illumination contrast while, can preferably keep
The detailed information of the original image of input.
One of ordinary skill in the art will appreciate that realizing that all or part of step in above-described embodiment method can be
The hardware that correlation is controlled by program is completed, described program can in a computer read/write memory medium is stored in,
Described storage medium, such as ROM/RAM, disk, CD.
Above by reference to the preferred embodiments of the present invention have been illustrated, not thereby limit to the interest field of the present invention.This
Art personnel can have various flexible programs to realize the present invention, for example as one without departing from the scope of the present invention and essence
The feature of individual embodiment can be used for another embodiment and obtain another embodiment.All institutes within the technology design with the present invention
Any modification, equivalent and the improvement made, all should be within the interest field of the present invention.