Embodiment
In order to make technical problem solved by the invention, technical scheme and beneficial effect clearly understand, below in conjunction with drawings and Examples, the present invention is further elaborated.Should be appreciated that specific embodiment described herein only in order to explain the present invention, be not intended to limit the present invention.
The embodiment of a kind of image processing method of the present invention, as shown in Figure 1, comprises the steps:
Red component, green component, the blue component of S1, each pixel of acquisition image;
S2, between picture frame dynamic stage, setting color correction matrix or setting color gamut space transition matrix or calculate the combinatorial matrix of product of color correction matrix and color gamut space transition matrix;
S3, in the image line valid period, described color correction matrix or described color gamut space transition matrix or described combinatorial matrix is utilized to correct the red component of each pixel of described image, green component, blue component.
As shown in Figure 2, T1 is picture frame section ineffective time, and T2 is image line section effective time.In order to determine between frame dynamic stage, need to detect and be in frame invalid time started and end time.In order to determine the row valid period, detection is needed to be in frame effectively and row effective time started and end time.
Described color correction matrix is:
(1)
And need meet: M11+M12+M13=1; (2)
M21+M22+M23=1;(3)
M31+M32+M33=1;(4)
Described colorcorrectionmatrix is color correction matrix, and described M11, M12, M13, M21, M22, M23, M31, M32, M33 are color correction coefficient;
Color gamut space transition matrix is
; A11, a12, a13, a21, a21, a23, a31, a32, a33 are color gamut space conversion coefficient.
The formula calculating the combinatorial matrix presetting color correction matrix and default color gamut space transition matrix product is as follows:
(6)
for combinatorial matrix,
for color gamut space transition matrix,
for color correction matrix.
Image processing method of the present invention between picture frame dynamic stage, setting color correction matrix or setting color gamut space transition matrix or calculate the combinatorial matrix of color correction matrix and color gamut space transition matrix product; In the image line valid period, described color correction matrix or described color gamut space transition matrix or described combinatorial matrix is utilized to correct the red component of each pixel of described image, green component, blue component.This image processing method can carry out the selection of image procossing on demand, if and carry out colour correction and space conversion operation simultaneously, the merging to color correction matrix and color gamut space transition matrix in the method and image rectification are in the different time periods, multiplier can be reused, reduce the use of multiplier, thus reach the effect reducing circuit area.
Carry out linear transformations by the constant color correction matrix of 3*3 to input picture, multiplication calculates introduces extra noise, and the image noise that each processing links is introduced under low light shines superposes the noise level that will cause final image bad luck.Color representation and noise level are two large important indicators of assess image quality.All very large in dark scene lower integral time and global gain, corresponding noise is also in high level.Consider that low light is according to the reality more even more important than color representation of Noise measarement level under scene, then adopt the coefficient reducing color correction matrix to reduce noise.
A kind of processing method between the step S1 and step S2 of described image processing method, adds following steps: S4: between picture frame dynamic stage, obtain current integration time and current global gain value;
S5: between picture frame dynamic stage, according to described current integration time and described current global gain value adjustment color correction matrix.
As shown in Figure 3, then whole image processing method comprises the steps: S1, obtains red component, green component, the blue component of each pixel of image;
S4: between picture frame dynamic stage, obtains current integration time and current global gain value;
S5: between picture frame dynamic stage, according to described current integration time and described current global gain value adjustment color correction matrix;
S2, between picture frame dynamic stage, set the combinatorial matrix of the product of the color correction matrix after described adjustment or setting color gamut space transition matrix or the color correction matrix after calculating described adjustment and color gamut space transition matrix;
S3, in the image line valid period, the color correction matrix after described adjustment or described color gamut space transition matrix or described combinatorial matrix is utilized to correct the red component of each pixel of described image, green component, blue component.
As the embodiment of the present invention, as shown in Figure 4, described step S5 specifically comprises:
S51, judge whether the described current integration time is greater than threshold value described time of integration, when the described current integration time is greater than the described threshold value time of integration, then judge to enter low light scene;
S52, under low light scene, judge whether described current global gain value is greater than described global gain threshold value, if described current global gain value is greater than described global gain threshold value, judge to need automatically to adjust color correction matrix;
If S53 judges to need automatically to adjust color correction matrix, calculate the difference of described current global gain value and global gain threshold value, utilize difference determination regulation coefficient k;
S54, regulation coefficient k is utilized to adjust described color correction matrix.
The difference of described current global gain value and global gain threshold value is larger, then regulation coefficient k value is less, and the span of described regulation coefficient k is [0,1], and namely when difference is larger, be then currently in half-light environment, corresponding noise is also in high level.Consider that low light is according to the reality more even more important than color representation of Noise measarement level under scene, then K gets minimum value 0, and the coefficient reducing color correction matrix reaches the object reducing picture noise.When difference is less, then K gets maximum 1, makes image have higher color representation.
Color correction matrix after described adjustment is as follows:
(5) described in
for adjusting rear color correction matrix, k is regulation coefficient.
As embodiments of the invention, then in corresponding step S2, between picture frame dynamic stage, the combinatorial matrix calculating the color correction matrix after adjustment and color gamut space transition matrix product is specific as follows:
Combinatorial matrix is:
(7)
for combinatorial matrix,
for color gamut space transition matrix,
for the color correction matrix after adjustment.
Image processing method of the present invention is between picture frame dynamic stage, according to current integration time and current global gain value, color correction matrix is adjusted, to meet the demand of image being carried out under different light scene to colour correction, between picture frame dynamic stage, the color correction matrix also after setting adjustment or the combinatorial matrix of setting color gamut space transition matrix or the color correction matrix after calculating adjustment and color gamut space transition matrix product; In the image line valid period, after utilizing described adjustment, color correction matrix or described color gamut space transition matrix or described combinatorial matrix correct the red component of each pixel of described image, green component, blue component.This image processing method can carry out the selection of image procossing on demand, if and carry out colour correction and space transforming process simultaneously, the merging to color correction matrix and color gamut space transition matrix in the method and image rectification are in the different time periods, multiplier can be reused, reduce the use of multiplier, thus reach the effect reducing circuit area.
The foregoing is only preferred embodiment of the present invention, not in order to limit the present invention, all any amendments done within the spirit and principles in the present invention, equivalent replacement and improvement etc., all should be included within protection scope of the present invention.