Background technology
How making robot can better understand operational environment residing for it, or have the Context aware ability similar with intelligent life body, is that Chinese scholars is paid close attention to and the challenging research topic of actively investigation for a long time.Therefore, propose a kind of reality scene signal reconstruct method that can be used for machine vision to have great importance.
High dynamic range HDR image is a kind of strong tools that can store natural scene monochrome information.But, the brightness value of natural scene spans a lot of order of magnitude, and the dynamic range of general display device and printing device is only 2 orders of magnitude, map HDR image on lower display device simply by linear transformation, often cause the detailed information of highlight regions and dark areas seriously to be lost.Become compared with the details of dark areas and not easily identify from black, and the details of highlight regions becomes and not easily differentiates from white.In order to meet the demand of machine vision perception true environment, need to carry out signal reconstruct to the HDR image collected.
Retinex theory is that Land one of proposing is used for explaining under the illumination condition of change, and vision system is the color theory of how obtaining information from natural scene.Land found through experiments, and when eye-observation natural scene, the brightness values inciding natural daylight radiation value on human eye retina and scenery surface has nothing to do.According to this experiment conclusion, target image is divided into reflector and illumination layer by Retinex method, reaches compression of dynamic range and the object strengthening image afterwards by weakening the impact of illumination layer.Based on center/around Retinex method be non-iterative, the new value after process is provided by the ratio of the weighted average of this pixel and surrounding pixel point thereof.First this Retinex is proposed by Land, and has developed single scale Retinex (SSR) and multiple dimensioned Retinex (MSR) by Rahman.Center/circulating type Retinex method not only realizes and operates than being easier to, simultaneously than before the method for version, arithmetic speed significantly improves, and treatment effect is better, adopts the most extensive in actual applications.
MSR method is weighted on average by the SSR result of multiple different scale, includes the advantage of multiple yardstick, can obtain certain balance in dynamic range compression and associative perception maintenance.Although " halation " phenomenon can not be eliminated completely, can weaken " halation ", make the treatment effect of image more desirable.But simultaneously also there is weight factor to be not easy to determine, and the problem that amount of calculation is excessive.Gain/skew refers to after Retinex method, in order to allow image obtain better display effect, intercepts the signal side-play amount that a histogrammic part is minimum and maximum.
Problem when center/circulating type Retinex is visual for HDR image: parameter problem, ease for use has become in Development of Consumer Electronic Products the major issue needing to consider.And the number of customer parameter becomes and weighs the important index of of ease for use.If be made up of N number of SSR in MSR, then the customer parameter of each SSR has: weight factor wn, intercepts threshold value Tth and Tdown around the scale parameter c of function and two of gain/skew.So the customer parameter of MSR be 4 × N number of.As N=6, the parameter that MSR needs user to set reaches 24.And this each parameter can have an impact to last image effect.This is obviously not suitable for being applied in the middle of consumer electronics product.Halo problem, utilize SSR process effectively can improve the visual effect of high dynamic range images, but obviously locate to produce " halation " phenomenon at comparison of light and shade, although and MSR process can weaken " halation " phenomenon to a certain extent, effect is also imperfect.And due to the problem of parameter and amount of calculation, limit its application.Contrast problem, in order to obtain better picture quality, center/circulating type Retinex uses the method for gain/skew clamp to strengthen result images.Gain/skew refers to after Retinex method, in order to allow image obtain better display effect, intercepts the signal side-play amount that a histogram part is minimum and maximum.But traditional gain/skew clamp approaches is also not suitable for HDR image, and the contrast of the result images of generation is too low.
Summary of the invention
The object of the present invention is to provide a kind of high dynamic range reality scene signal reconstruct method that can be used for machine vision that improve computational speed and final image contrast, to solve the problem proposed in above-mentioned background technology.
For achieving the above object, the invention provides following technical scheme:
Can be used for a high dynamic range reality scene signal reconstruct method for machine vision, concrete steps are as follows:
(1) HDR image inputted, first through parameter integration, determines weight factor and the scale parameter of the SSR of each single scale;
(2) carry out SSR process after determining the weight factor of each SSR and scale parameter, the mathematical form of SSR method is shown below:
R
i(x, y)=logI
i(x, y)-log [F (x, y) * I
i(x, y)] (formula 1)
Wherein R
i(x, y) is the output of Retinex at i-th color spectral coverage, the i.e. brightness value of coordinate (x, y) position, and * represents convolution algorithm, and F (x, y) is around function, and form is:
F (x, y)=K.exp [-(x
2+ y
2)/c
2] (formula 2)
Wherein c is the scale parameter of Gauss around function, and K is the normalization factor, makes:
∫ ∫ F (x, y) dxdy=1 (formula 3)
(3) weighted average of the SSR result of multiple different scale becomes MSR, and formula is as follows:
(formula 4)
Wherein R
mi(x, y) is the output of multiple dimensioned Retinex at i-th color spectral coverage, and N is SSR number, and Wn is the weights of each SSR corresponding, F
n(x, y) be the n-th SSR around function;
(4) carry out the process of gain/skew: by image normalization, then histogram is divided into 11 intervals, counts the number of the pixel in each interval, with 5% of maximum in histogram for threshold value, calculate the bound of the intercepting threshold value of this image.
As the further scheme of the present invention: described step (2) uses quick bilateral filtering to replace gaussian filtering in the process of SSR process.
As the present invention's further scheme: the processing method of the gain/skew in described step (4) is semi-automatic gain/skew.
Compared with prior art, the invention has the beneficial effects as follows:
The present invention uses quick bilateral filtering to instead of gaussian filtering in traditional Retinex, in so avoiding " halation " phenomenon, and improves the computational speed of method; Propose a kind of semi-automatic gain/offset method, the method, independent of color channel, calculates the bound intercepting threshold value automatically, effectively raises the contrast of final image according to different picture materials; A large amount of parameter in the middle of traditional center/circulating type Retinex method has been carried out rational integration, has summed up unique customer parameter, this parameter makes user can average out between computational speed and picture quality; The present invention can be used for consumer digital camera, in the middle of the image rendering software in machine vision environment sensing and later stage.
Embodiment
Be described in more detail below in conjunction with the technical scheme of embodiment to this patent.
Can be used for a high dynamic range reality scene signal reconstruct method for machine vision, concrete steps are as follows:
(1) HDR image inputted, first through parameter integration, determines weight factor and the scale parameter of the SSR of each single scale; Form due to HDR image has a variety of, so in order to make the parameter of specifying more representative, first the HDR image of input operates through normalization;
(2) carry out SSR process after determining the weight factor of each SSR and scale parameter, in the process of SSR process, use quick bilateral filtering to replace gaussian filtering, the mathematical form of SSR method is shown below:
R
i(x, y)=logI
i(x, y)-log [F (x, y) * I
i(x, y)] (formula 1)
Wherein R
i(x, y) is the output of Retinex at i-th color spectral coverage, the i.e. brightness value of coordinate (x, y) position, and * represents convolution algorithm, and F (x, y) is around function, and form is:
F (x, y)=K.exp [-(x
2+ y
2)/c
2] (formula 2)
Wherein c is the scale parameter of Gauss around function, and K is the normalization factor, makes:
∫ ∫ F (x, y) dxdy=1 (formula 3)
(3) weighted average of the SSR result of multiple different scale becomes MSR, and formula is as follows:
(formula 4)
Wherein R
mi(x, y) is the output of multiple dimensioned Retinex at i-th color spectral coverage, and N is SSR number, and Wn is the weights of each SSR corresponding, F
n(x, y) be the n-th SSR around function;
(4) process of gain/skew is carried out: the processing method of gain/skew is semi-automatic gain/skew, by image normalization, then histogram is divided into 11 intervals, count the number of the pixel in each interval, with 5% of maximum in histogram for threshold value, calculate the bound of the intercepting threshold value of this image.
In instances, adopt method process HDR image of the present invention, its processing procedure is as follows:
(1) HDR image inputted is first through parameter integration, determine weight factor and the scale parameter of each SSR, form due to HDR image has a variety of, so in order to make the parameter of specifying more representative, first the HDR image of input operates through normalization.
All unknown parameters in the improved method that this method proposes are as shown in table 1:
All unknown parameters in the improved method that table 1 this method proposes
Wherein N value be greater than 0 positive integer, be the unique customer parameter in this method, can be used for obtaining the balance between image effect and method amount of calculation.When N value is larger, image effect is better, and corresponding amount of calculation is also larger; When N value more hour, computational speed is faster, but picture quality also can decline.
When N=1, the method that this method proposes is SSR, c
1be the spatial domain scale parameter in quick bilateral filtering method, this method gets 1/10 of the smaller value in original image length and width, that is: c
1=min (length, width)/10.C
2it is the brightness domain scale parameter in quick bilateral filtering method.Owing to having carried out normalization operation above, the maximum of brightness domain has been 1, and minimum value is minimum (due to logarithm operation, replacing 0 by minimum).Therefore our decree c
2=0.1.
When N is the odd number being greater than 1, first calculate the space scale constant c being in the SSR of Median Position
1.Small-scale Space constant successively decreases with the multiple of 2 successively, is respectively 1/2*c
1, 1/4*c
1, 1/8*c
1, 1/16*c
1by that analogy.Large-scale dimension constant increases progressively with the multiple of 2 successively, is respectively 2*c
1, 4*c
1, 8*c
1, 16*c
1by that analogy.In like manner, the brightness domain scale parameter c of the SSR of Median Position is in
2=0.1.Small scale brightness domain constant successively decreases with the multiple of 2 successively, is respectively 1/2*c
2, 1/4*c
2, 1/8*c
2, 1/16*c
2by that analogy.Large scale brightness domain constant increases progressively with the multiple of 2 successively, is respectively 2*c
2, 4*c
2, 8*c
2, 16*c
2by that analogy.
When N is the even number being greater than 1, first N+1 is become odd number by this method, after having determined the scale parameter of each SSR, then removes the SSR being in Median Position according to method above.
Wn is the weight factor of each SSR, our decree Wn=1/N, like this by regulating N value, the SSR of different scale also can be made to have different weights.
Parameter Tup and Tlow then determines according to semi-automatic gain/offset method.
(2) SSR process is carried out after determining the weight factor of each SSR and scale parameter, because the gaussian filtering in traditional SSR can produce " halation " phenomenon, therefore the improved method that this method proposes uses quick bilateral filtering to instead of gaussian filtering, avoid the generation of " halation " phenomenon, and arithmetic speed is significantly increased.
The illumination estimate of bilateral filtering to image is as follows:
(formula 5)
Wherein
(formula 6)
For normalization coefficient, Ω is overall diagram image field, Ip and Is is the pixel value at locus p and s place, f and g is respectively the weights kernel function in spatial domain and pixel grey scale territory, is usually all taken as Gaussian function.The size of these two Gaussian function cores is established to be respectively c in the method
1, c
2.
(3), after SSR weighted average is become MSR, image also needs the process carrying out gain/skew.Gain/skew refers to after Retinex method, in order to allow image obtain better display effect, intercepts the signal side-play amount that a histogrammic part is minimum and maximum.The modified model Retinex method that this method proposes adopts semi-automatic gain/migration processing, and wherein " semi-automatic " is although refer to that threshold value intercepting changes along with the change of picture material independent of Color Channel.Processing method is as follows: first by image normalization, then histogram is divided into 11 intervals, counts the number of the pixel in each interval.Experiment shows, use any one histogram can produce similar result, so semi-automatic gain/skew is independent of Color Channel, for the histogram of red channel, as shown in Figure 2, with 5% of maximum in histogram for threshold value, 5% is empirical value, calculate the bound of the intercepting threshold value of this image, the image color after semi-automatic gain/migration processing is more gorgeous, and contrast is stronger.
The present invention uses quick bilateral filtering to instead of gaussian filtering in traditional Retinex, in so avoiding " halation " phenomenon, and improves the computational speed of method; Propose a kind of semi-automatic gain/offset method, the method, independent of color channel, calculates the bound intercepting threshold value automatically, effectively raises the contrast of final image according to different picture materials; A large amount of parameter in the middle of traditional center/circulating type Retinex method has been carried out rational integration, has summed up unique customer parameter, this parameter makes user can average out between computational speed and picture quality; The present invention can be used for consumer digital camera, in the middle of the image rendering software in machine vision environment sensing and later stage.
Above the better embodiment of this patent is explained in detail, but this patent is not limited to above-mentioned execution mode, in the ken that one skilled in the relevant art possesses, various change can also be made under the prerequisite not departing from this patent aim.