CN103227928B - White balance adjusting method and device - Google Patents
White balance adjusting method and device Download PDFInfo
- Publication number
- CN103227928B CN103227928B CN201310109918.5A CN201310109918A CN103227928B CN 103227928 B CN103227928 B CN 103227928B CN 201310109918 A CN201310109918 A CN 201310109918A CN 103227928 B CN103227928 B CN 103227928B
- Authority
- CN
- China
- Prior art keywords
- light source
- green
- source point
- proportionality coefficient
- coefficient
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Landscapes
- Color Image Communication Systems (AREA)
- Processing Of Color Television Signals (AREA)
Abstract
The invention relates to the field of image processing, and discloses a white balance adjusting method and device. The method includes the following steps: obtaining the corresponding RGB pixel values through distinguishing green pixels and grey pixels; confirming impossible light source points as per the RGB pixel values respectively corresponding to the green pixels and the grey pixels; then performing comprehensive judgment as per the impossible light source points to confirm the accurate actual color-ratio factor of the light source points; then calculating the white balance gain value as per the accurate actual color-ratio factor of the light source points; and finally performing the white balance adjustment.
Description
Technical field
The present invention relates to image processing field, particularly relate to a kind of method of adjustment and device of white balance.
Background technology
Due to the difference in the principle of human eye and camera image sensor aware colors, cause to same object under different light sources, video camera cannot present identical color, there will be the situation of colour cast.Consistent with the color seen by human eye in order to enable video camera obtain, need to introduce the image of AWB to video camera and process.AWB its object is to, regardless of under any light source, white object to be reduced to white.
Because under the color of grey object under some light source and other light source, the color of non-grey object may be obscured, this problem can have a negative impact for the performance of AWB algorithm.Grey object color under the color of the green object such as under outdoor daylight and room fluorescent lights is closely similar, and under the colour of skin under room fluorescent lights and incandescent lamp, grey object color closely; These situations all can cause AWB algorithm to be judged by accident, obtain the white balance result of mistake.
At present, the implementation of following white balance is there is in prior art, comprise: adopt difference between green and blue, green and redness to judge that current pixel point is green plants or non-green plant respectively, and find brightness maxima or average brightness in green, non-green pixel respectively; Think that current light source is daylight, and during Green brightness height, current light source is fluorescent lamp when non-green part luma height.Although the type that said method can provide current light source is fluorescent lamp or daylight, but do not further consider the material elements of daylight, and be easily subject to the impact of the intensity of brightness of pixel, adopting said method to carry out, the adjustment of white balance is often easy causes erroneous judgement to light source.
Summary of the invention
Embodiments of the invention provide a kind of method of adjustment and device of white balance, can obtain correct white balance point, and then realize AWB.
For achieving the above object, embodiments of the invention adopt following technical scheme:
First aspect, embodiments provides a kind of method of adjustment of white balance, comprising:
Obtain the rgb pixel value of pixel in input picture;
According to the rgb pixel value of described pixel, from described pixel, determine green pixel point and gray pixels point;
The first light source point color-ratio coefficient is determined according to the rgb pixel value of green pixel point, and according to the rgb pixel value determination secondary light source point color-ratio coefficient of gray pixels point;
According to described first light source point color-ratio coefficient and secondary light source point color-ratio coefficient determination actual light source point color-ratio coefficient;
Current AWB yield value is determined according to described actual light source point color-ratio coefficient;
Described current white balance gains value is used to carry out blank level adjustment.
In conjunction with first aspect, in the implementation that the first is possible, the described rgb pixel value according to pixel in described input picture, from described pixel, determine that green pixel point comprises:
Rgb pixel value according to described pixel calculates, and obtains the red green proportionality coefficient of described pixel, bluish-green proportionality coefficient and brightness value;
One in the red green proportionality coefficient being combined as default green object of red green proportionality coefficient and bluish-green proportionality coefficient determining pixel and whole combinations of bluish-green proportionality coefficient value, and, when the brightness value of described pixel is within the scope of luminance threshold, then described pixel is defined as green pixel point.
In conjunction with first aspect, in the implementation that the second is possible, the described rgb pixel value according to described pixel, from described pixel, determine that gray pixels point comprises:
Rgb pixel value according to described pixel calculates, and obtains the red green proportionality coefficient of described pixel, bluish-green proportionality coefficient;
When determining that the red green proportionality coefficient of described pixel is one in the red green proportionality coefficient set of default grey object, and when the bluish-green proportionality coefficient of described pixel is in the bluish-green proportionality coefficient set of default grey object, then described pixel is defined as gray pixels point.
In conjunction with the implementation that the second of first aspect is possible, the described rgb pixel value according to green pixel point determines that the first light source point color-ratio coefficient comprises:
Respectively average value processing is carried out to the red green proportionality coefficient of all green pixel points and bluish-green proportionality coefficient, obtains red green proportionality coefficient average and bluish-green proportionality coefficient average;
Calculate according to red green proportionality coefficient average, bluish-green proportionality coefficient average and default green object colour temperature line, obtain red green proportionality coefficient projection value, bluish-green proportionality coefficient projection value;
Calculate according to described red green proportionality coefficient projection value and default red green proportionality coefficient mapping relations, obtain the red green proportionality coefficient of the first light source point, and calculate according to described bluish-green proportionality coefficient projection value and default bluish-green proportionality coefficient mapping relations, obtain the bluish-green proportionality coefficient of the first light source point;
According to the combination of the red green proportionality coefficient of described first light source point and the bluish-green proportionality coefficient of described first light source point, determine the first light source point color-ratio coefficient.
In conjunction with the third possible implementation of first aspect, in the 4th kind of possible implementation, the described rgb pixel value determination secondary light source point color-ratio coefficient according to gray pixels point comprises:
Respectively average value processing is carried out to the red green proportionality coefficient of all gray pixels points and bluish-green proportionality coefficient, obtains red green proportionality coefficient average and bluish-green proportionality coefficient average;
Described red green proportionality coefficient average is defined as the red green proportionality coefficient of secondary light source point, and described bluish-green proportionality coefficient average is defined as the bluish-green proportionality coefficient of secondary light source point;
According to the combination of the red green proportionality coefficient of described secondary light source point and the bluish-green proportionality coefficient of described secondary light source point, determine secondary light source point color-ratio coefficient.
In conjunction with any one possible implementation in first four kinds of first aspect or first aspect, in the 5th kind of possible implementation, describedly to comprise according to described first light source point color-ratio coefficient and secondary light source point color-ratio coefficient determination actual light source point color-ratio coefficient:
Rgb pixel value according to described pixel calculates, and obtains the brightness average of described pixel;
Calculate according to the brightness average of described pixel, exposure gain value and aperture time, obtain scene brightness estimate;
When scene illumination estimate value be greater than the first luminance threshold, green pixel point quantity be greater than the first amount threshold and gray pixels point quantity is less than the second amount threshold time, first light source point color-ratio coefficient is defined as actual light source point color-ratio coefficient, and calculates current AWB yield value according to the red green proportionality coefficient of the 3rd light source point and bluish-green proportionality coefficient.
In conjunction with the 5th kind of possible implementation of first aspect, the 6th kind of possible implementation, describedly also to comprise according to described first light source point color-ratio coefficient and secondary light source point color-ratio coefficient determination actual light source point color-ratio coefficient:
When scene illumination estimate value be greater than the first luminance threshold, green pixel point quantity is greater than the first amount threshold, gray pixels point quantity is more than or equal to the second amount threshold time, judge whether current light source is fluorescent light according to secondary light source point color-ratio coefficient; When determining that current light source is fluorescent light, the first light source point color-ratio coefficient is defined as actual light source point color-ratio coefficient;
Wherein, described green pixel point quantity and gray pixels point quantity are perform step according to the rgb pixel value of described pixel, and adding up determine green pixel point and gray pixels point from described pixel while obtains.
In conjunction with the 5th kind of possible implementation of first aspect, the 7th kind of possible implementation, describedly also to comprise according to described first light source point color-ratio coefficient and secondary light source point color-ratio coefficient determination actual light source point color-ratio coefficient:
When scene illumination estimate value be not more than the first luminance threshold and be more than or equal to the second luminance threshold, green pixel point quantity be greater than the first amount threshold and gray pixels point quantity is less than the second amount threshold time, the first light source point color-ratio coefficient is defined as actual light source point color-ratio coefficient.
In conjunction with the 5th kind of possible implementation of first aspect, the 8th kind of possible implementation, describedly also to comprise according to described first light source point color-ratio coefficient and secondary light source point color-ratio coefficient determination actual light source point color-ratio coefficient:
When scene illumination estimate value be not more than the first luminance threshold and be more than or equal to the second luminance threshold, green pixel point quantity be greater than the first amount threshold time, judge whether current light source is fluorescent light according to secondary light source point color-ratio coefficient, when determining that current light source is fluorescent light, be weighted according to the red green proportionality coefficient in the first light source point color-ratio coefficient and secondary light source point color-ratio coefficient, using the red green proportionality coefficient of the red green proportionality coefficient in the first light source point color-ratio coefficient and secondary light source point color-ratio coefficient of weighted calculation as the 3rd light source point, and be weighted according to the bluish-green proportionality coefficient in the first light source point color-ratio coefficient and secondary light source point color-ratio coefficient, using the bluish-green proportionality coefficient of the bluish-green proportionality coefficient in the first light source point color-ratio coefficient and secondary light source point color-ratio coefficient of weighted calculation as the 3rd light source point, and according to the red green proportionality coefficient of the 3rd light source point and bluish-green proportionality coefficient determination actual light source point color-ratio coefficient.
In conjunction with the 5th kind of possible implementation of first aspect, the 9th kind of possible implementation, describedly also to comprise according to described first light source point color-ratio coefficient and secondary light source point color-ratio coefficient determination actual light source point color-ratio coefficient:
When scene illumination estimate value is less than the second luminance threshold, when gray pixels point quantity is more than or equal to the second amount threshold, secondary light source point color-ratio coefficient is defined as actual light source point color-ratio coefficient.
Second aspect, embodiments provides a kind of adjusting device of white balance, comprising:
Acquiring unit, for obtaining the rgb pixel value of pixel in input picture;
First determining unit, for the rgb pixel value according to described pixel, determines green pixel point and gray pixels point from described pixel;
Second determining unit, for determining the first light source point color-ratio coefficient according to the rgb pixel value of green pixel point, and according to the rgb pixel value determination secondary light source point color-ratio coefficient of gray pixels point;
3rd determining unit, for according to described first light source point color-ratio coefficient and secondary light source point color-ratio coefficient, determines actual light source point color-ratio coefficient.
4th determining unit, for determining current AWB yield value according to described actual light source point color-ratio coefficient;
Adjustment unit, for carrying out blank level adjustment according to described current white balance gains value.
In conjunction with second aspect, in the implementation that the first is possible, described first determining unit comprises:
First computing module, calculates for the rgb pixel value according to described pixel, obtains the red green proportionality coefficient of described pixel, bluish-green proportionality coefficient and brightness value;
First determination module, for one in whole combinations of the red green proportionality coefficient of pixel and the red green proportionality coefficient being combined as default green object of bluish-green proportionality coefficient and bluish-green proportionality coefficient value, and, pixel, within the scope of luminance threshold, is defined as green pixel point by the brightness value of pixel.
In conjunction with second aspect, in the implementation that the second is possible, described first determining unit comprises:
Second computing module, calculates for the rgb pixel value according to described pixel, obtains the red green proportionality coefficient of described pixel, bluish-green proportionality coefficient;
Second determination module, for when determine that the red green proportionality coefficient of pixel is one in the red green proportionality coefficient set of default grey object, and when the bluish-green proportionality coefficient of pixel is in the bluish-green proportionality coefficient set of default grey object, then pixel is defined as gray pixels point.
In conjunction with the implementation that the second of second aspect is possible, in the implementation that the third is possible, described second determining unit comprises:
First average value processing module, for carrying out average value processing respectively to the red green proportionality coefficient of all green pixel points and bluish-green proportionality coefficient, obtains red green proportionality coefficient average and bluish-green proportionality coefficient average;
3rd computing module, for calculating according to red green proportionality coefficient average, bluish-green proportionality coefficient average and default green object colour temperature line, obtains red green proportionality coefficient projection value, bluish-green proportionality coefficient projection value; And for calculating according to described red green proportionality coefficient projection value and default red green proportionality coefficient mapping relations, obtain the red green proportionality coefficient of the first light source point, and calculate according to described bluish-green proportionality coefficient projection value and default bluish-green proportionality coefficient mapping relations, obtain the bluish-green proportionality coefficient of the first light source point;
First composite module, for the combination according to the red green proportionality coefficient of described first light source point and the bluish-green proportionality coefficient of described first light source point, determines the first light source point color-ratio coefficient.
In conjunction with the third possible implementation of second aspect, in the 4th kind of possible implementation, described second determining unit comprises:
Second average value processing module, for carrying out average value processing respectively to the red green proportionality coefficient of all gray pixels points and bluish-green proportionality coefficient, obtains red green proportionality coefficient average and bluish-green proportionality coefficient average;
3rd determination module, for described red green proportionality coefficient average is defined as the red green proportionality coefficient of secondary light source point, and is defined as the bluish-green proportionality coefficient of secondary light source point by described bluish-green proportionality coefficient average;
Second composite module, for the combination according to the red green proportionality coefficient of described secondary light source point and the bluish-green proportionality coefficient of described secondary light source point, determines secondary light source point color-ratio coefficient.
In conjunction with any one possible implementation in first four kinds of second aspect or second aspect, in the 5th kind of possible implementation, described 3rd determining unit comprises:
4th calculates module, calculates, obtain the brightness average of described pixel for the rgb pixel value according to described pixel; And calculate for the brightness average according to described pixel, exposure gain value and aperture time, obtain scene brightness estimate; And for calculating current AWB yield value according to the red green proportionality coefficient of the 3rd light source point and bluish-green proportionality coefficient;
4th determination module, for being greater than the first luminance threshold in scene illumination estimate value, green pixel point quantity be greater than the first amount threshold and gray pixels point quantity is less than the second amount threshold time, the first light source point color-ratio coefficient is defined as actual light source point color-ratio coefficient;
Wherein, described green pixel point quantity and described gray pixels point quantity in the rgb pixel value according to described pixel by described first determining unit, are added up while determining green pixel point and gray pixels point and obtain from described pixels.
In conjunction with the 5th kind of possible implementation of second aspect, the 6th kind of possible implementation, according to secondary light source point color-ratio coefficient, described 4th determination module is also for being greater than the first luminance threshold when scene illumination estimate value, when green pixel point quantity is greater than the first amount threshold, gray pixels point quantity is more than or equal to the second amount threshold, judge whether current light source is fluorescent light; When determining that current light source is fluorescent light, the first light source point color-ratio coefficient is defined as actual light source point color-ratio coefficient.
In conjunction with the 5th kind of possible implementation of second aspect, the 7th kind of possible implementation, described 4th determination module also for be not more than the first luminance threshold when scene illumination estimate value and be more than or equal to the second luminance threshold, green pixel point quantity be greater than the first amount threshold and gray pixels point quantity is less than the second amount threshold time, the first light source point color-ratio coefficient is defined as actual light source point color-ratio coefficient.
In conjunction with the 5th kind of possible implementation of second aspect, the 8th kind of possible implementation, described 4th determination module also for be not more than the first luminance threshold when scene illumination estimate value and be more than or equal to the second luminance threshold, green pixel point quantity be greater than the first amount threshold time, judge whether current light source is fluorescent light according to secondary light source point color-ratio coefficient, when determining that current light source is fluorescent light, red green proportionality coefficient according to the first light source point color-ratio coefficient and secondary light source point color-ratio coefficient is weighted, using the red green proportionality coefficient of the red green proportionality coefficient in the described first light source point color-ratio coefficient and secondary light source point color-ratio coefficient of weighted calculation as the 3rd light source point, and be weighted according to the bluish-green proportionality coefficient of the first light source point color-ratio coefficient and secondary light source point color-ratio coefficient, using the bluish-green proportionality coefficient of the bluish-green proportionality coefficient in the described first light source point color-ratio coefficient and secondary light source point color-ratio coefficient of weighted calculation as the 3rd light source point, and according to the red green proportionality coefficient of the 3rd light source point and bluish-green proportionality coefficient determination actual light source point color-ratio coefficient.
In conjunction with the 5th kind of possible implementation of second aspect, the 9th kind of possible implementation, described 4th determination module is also for being less than the second luminance threshold when scene illumination estimate value, when gray pixels point quantity is more than or equal to the second amount threshold, secondary light source point color-ratio coefficient is defined as actual light source point color-ratio coefficient.
The method of adjustment of a kind of white balance that the embodiment of the present invention provides and device, by distinguishing green pixel point and gray pixels point with after obtaining corresponding rgb pixel value, possible light source point is determined respectively according to green pixel point and each self-corresponding rgb pixel value of gray pixels point, synthetic determination is carried out again according to possible light source point, to determine actual light source point color-ratio coefficient accurately, compared to the technical scheme that the type that can only provide current light source in prior art is fluorescent lamp or daylight, the method that the embodiment of the present invention provides can provide yield value accurately for equipment, to ensure can both carry out automatic white balance to each two field picture.
Accompanying drawing explanation
In order to be illustrated more clearly in the embodiment of the present invention or technical scheme of the prior art, be briefly described to the accompanying drawing used required in embodiment or description of the prior art below, apparently, accompanying drawing in the following describes is only some embodiments of the present invention, for those of ordinary skill in the art, under the prerequisite not paying creative work, other accompanying drawing can also be obtained according to these accompanying drawings.
The method of adjustment flow chart of a kind of white balance that Fig. 1 provides for the embodiment of the present invention;
The method of adjustment flow chart of the another kind of white balance that Fig. 2 provides for the embodiment of the present invention;
The method of adjustment flow chart of the another kind of white balance that Fig. 3 provides for the embodiment of the present invention;
The method of adjustment flow chart of the another kind of white balance that Fig. 4 provides for the embodiment of the present invention;
The colour temperature line schematic diagram that Fig. 5 provides for the embodiment of the present invention;
The schematic diagram of the pixel value conversion line of the green object that Fig. 6 provides for the embodiment of the present invention and grey object;
The method of adjustment flow chart of the another kind of white balance that Fig. 7 provides for the embodiment of the present invention;
The method of adjustment flow chart of the another kind of white balance that Fig. 8 provides for the embodiment of the present invention;
The composition frame chart of the adjusting device of a kind of white balance that Fig. 9 provides for the embodiment of the present invention;
The composition frame chart of the adjusting device of the another kind of white balance that Figure 10 provides for the embodiment of the present invention;
The composition frame chart of the adjusting device of the another kind of white balance that Figure 11 provides for the embodiment of the present invention;
The composition frame chart of the adjusting device of the another kind of white balance that Figure 12 provides for the embodiment of the present invention;
The composition frame chart of the adjusting device of the another kind of white balance that Figure 13 provides for the embodiment of the present invention;
The composition frame chart of the adjusting device of the another kind of white balance that Figure 14 provides for the embodiment of the present invention;
The composition frame chart of a kind of electric terminal that Figure 15 provides for the embodiment of the present invention.
Detailed description of the invention
Below in conjunction with the accompanying drawing in the embodiment of the present invention, be clearly and completely described the technical scheme in the embodiment of the present invention, obviously, described embodiment is only the present invention's part embodiment, instead of whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art, not making the every other embodiment obtained under creative work prerequisite, belong to the scope of protection of the invention.
Embodiments provide a kind of method of adjustment of white balance, as shown in Figure 1, comprising:
101, the rgb pixel value of pixel in input picture is obtained.
Wherein, described pixel is the pixel on the same frame input picture of equipment collection, and in embodiments of the present invention, described rgb pixel value all adopts rgb format to represent.
102, according to the rgb pixel value of described pixel, from described pixel, green pixel point and gray pixels point is determined.
Wherein, according to the rgb pixel value of described pixel, from described pixel, determine the implementation of green pixel point and the rgb pixel value according to described pixel, from described pixel, determine that the implementation of gray pixels point can respectively with reference to method flow as shown in Figure 2 and Figure 3.
Method flow as shown in Figure 2 comprises:
A1021, to calculate according to the rgb pixel value of described pixel, obtain the red green proportionality coefficient of described pixel, bluish-green proportionality coefficient and brightness value.
In embodiments of the present invention, the rgb pixel value of described pixel all can be expressed as R value, G value and B value, then red green proportionality coefficient rx is R/G, and bluish-green proportionality coefficient bx is B/G, and brightness value L is R+2*G+B.
A1022, in whole combinations of the red green proportionality coefficient of fixation vegetarian refreshments and the red green proportionality coefficient being combined as default green object of bluish-green proportionality coefficient and bluish-green proportionality coefficient value one, and, when the brightness value of pixel is within the scope of luminance threshold, then pixel is defined as green pixel point.
Concrete, in embodiments of the present invention, brightness value can be expressed as Lmin < L < Lmax within the scope of luminance threshold, and one in whole combinations of the red green proportionality coefficient of pixel and the red green proportionality coefficient being combined as default green object of bluish-green proportionality coefficient and bluish-green proportionality coefficient value can be expressed as (rx-rx_c)
2+ (bx-bx_c)
2< rad
2, wherein, Lmin, Lmax, rx_c, bx_c, rad are the numerical value set, Lmin, Lmax, for characterizing the span of normal brightness, is generally positive integer, rx_c, bx_c, rad are for whole combinations of the red green proportionality coefficient and bluish-green proportionality coefficient value that are limited to the green object under Different Light.If some formation circle, then rx_c, a bx_c that this is all combined to form, be central coordinate of circle, rad is radius.
Method flow as shown in Figure 3 comprises:
B1021, to calculate according to the rgb pixel value of described pixel, obtain the red green proportionality coefficient of described pixel, bluish-green proportionality coefficient.
Wherein, the computational methods of step b1021 and expression formula can refer to the associated description of step a1021.
B1022, when determining that the red green proportionality coefficient of pixel is one in the red green proportionality coefficient set of default grey object, and when the bluish-green proportionality coefficient of pixel is in the bluish-green proportionality coefficient set of default grey object, then pixel is defined as gray pixels point.
Concrete, the red green proportionality coefficient of pixel can be expressed as rx_gray1 < rx < rx_gray2 in the red green proportionality coefficient set of the grey object preset, bluish-green proportionality coefficient bx_gray1 < bx < bx_gray2 in the bluish-green proportionality coefficient set of the grey object preset of pixel.Wherein, rx_gray1, rx_gray2, bx_gray1, bx_gray2 are the parameter that the sets possible value in order to the red green proportionality coefficient and bluish-green proportionality coefficient that represent grey object.
103, calculate according to the rgb pixel value of green pixel point, obtain the first light source point color-ratio coefficient, and calculate according to the rgb pixel value of gray pixels point, obtain secondary light source point color-ratio coefficient.
Wherein, determine the first light source point color-ratio coefficient according to the rgb pixel value of green pixel point, and the method flow shown in Fig. 4 and Fig. 5 can be had respectively to realize according to the rgb pixel value determination secondary light source point color-ratio coefficient of gray pixels point.
Method flow as shown in Figure 4 comprises:
A1031, respectively average value processing is carried out to the red green proportionality coefficient of all green pixel points and bluish-green proportionality coefficient, obtain red green proportionality coefficient average and bluish-green proportionality coefficient average.
In embodiments of the present invention, the red green proportionality coefficient average of green pixel point and bluish-green proportionality coefficient average can be expressed as rx_avg, bx_avg.
A1032, to calculate according to red green proportionality coefficient average, bluish-green proportionality coefficient average and default green object colour temperature line, obtain red green proportionality coefficient projection value, bluish-green proportionality coefficient projection value.
Concrete, the green object colour temperature line preset is pre-set, in embodiments of the present invention, only enumerate a kind of possible establishing method at this, be included in the scene of brightness uniformity, photographic subjects is x-rite company colorchecker24 colour atla, takes multiple images under the light source of different-colour.Get the r/g of the green object pixel point in captured image, b/g value, and take r/g as input, b/g exports to calculate a default green object colour temperature line, the fitting a straight line namely in Fig. 5.
Based on the setting of above-mentioned default green object colour temperature line, the computational methods of red green proportionality coefficient projection value, bluish-green proportionality coefficient projection value can refer to following formula:
rx_p=(bx_avg+(rx_avg/k_line-b_line))/(k_line+1/k_line)
bx_p=k_line*rx_p+b_line
Wherein, k_line and b_line is respectively slope in being abscissa with rx, taking bx as the direct coordinate system of ordinate of default green object colour temperature line and intercept.
A1033, to calculate according to described red green proportionality coefficient projection value and default red green proportionality coefficient mapping relations, obtain the red green proportionality coefficient of the first light source point.
Concrete, in embodiments of the present invention, the red green proportionality coefficient rx_w of the first light source point is k_r_line*rx_p+b_r_line.Wherein, k_r_line and b_r_line is the characteristic value of default red green proportionality coefficient mapping relations, its method to set up carries out one_to_one corresponding for needing the green object rgb pixel value under Same Scene and the r/g value corresponding to grey object rgb pixel value, using the r/g value of green object rgb pixel value as input, the r/g value of grey object rgb pixel value is as exporting, the then corresponding linear feature value of fitting a straight line is k_r_line, b_r_line, can refer to straight line as shown in Figure 6.
A1034, to calculate according to described bluish-green proportionality coefficient projection value and default bluish-green proportionality coefficient mapping relations, obtain the bluish-green proportionality coefficient of the first light source point.
Concrete, in embodiments of the present invention, the bluish-green proportionality coefficient bx_w of the first light source point is k_b_line*bx_p+b_b_line.Wherein, k_b_line and b_b_line is the characteristic value of default red green proportionality coefficient mapping relations, its method to set up carries out one_to_one corresponding for needing the green object rgb pixel value under Same Scene and the b/g value corresponding to grey object rgb pixel value, using the b/g value of green object rgb pixel value as input, the b/g value of grey object rgb pixel value is as exporting, the then corresponding linear feature value of fitting a straight line is k_b_line, b_b_line.
A1035, combination according to the red green proportionality coefficient of described first light source point and the bluish-green proportionality coefficient of described first light source point, determine the first light source point color-ratio coefficient.
Wherein, known with reference to above-mentioned Fig. 5 and Fig. 6, for a pixel value, uniquely determined in rectangular coordinate system by its red green proportionality coefficient and bluish-green proportionality coefficient.Therefore, the first light source point color-ratio coefficient is also under the condition of pixel value, the red green proportionality coefficient of described first light source point and the bluish-green proportionality coefficient of described first light source point is combined, uniquely can determine the first light source point color-ratio coefficient.
Method flow as shown in Figure 7 comprises:
B1031, respectively average value processing is carried out to the red green proportionality coefficient of all gray pixels points and bluish-green proportionality coefficient, obtain red green proportionality coefficient average and bluish-green proportionality coefficient average.
B1032, described red green proportionality coefficient average is defined as the red green proportionality coefficient of secondary light source point, and described bluish-green proportionality coefficient average is defined as the bluish-green proportionality coefficient of secondary light source point.
B1033, combination according to the red green proportionality coefficient of described secondary light source point and the bluish-green proportionality coefficient of described secondary light source point, determine secondary light source point color-ratio coefficient.
104, according to described first light source point color-ratio coefficient and secondary light source point color-ratio coefficient, actual light source point color-ratio coefficient is determined.
Concrete, in embodiments of the present invention, the concrete methods of realizing of step 104 can refer to method flow as shown in Figure 8.
Method flow as shown in Figure 8 comprises:
1041, calculate according to the rgb pixel value of described pixel, obtain the brightness average of described pixel.
In the present embodiment, it should be noted that, the brightness value obtaining pixel according to the rgb pixel value of pixel is known, the formula of Y (brightness)=(0.299*R)+(0.587*G)+(0.114*B) such as can be adopted to obtain the brightness value of pixel, and then the brightness of all pixels is averaged can obtain brightness average.The embodiment of the present invention does not get rid of the mode that other obtain brightness average.
1042, calculate according to the brightness average of described pixel, exposure gain value and aperture time, obtain scene brightness estimate.When scene illumination estimate value be greater than the first luminance threshold, green pixel point quantity be greater than the first amount threshold and gray pixels point quantity is less than the second amount threshold time, then perform step 1043a; When scene illumination estimate value be greater than the first luminance threshold, green pixel point quantity is greater than the first amount threshold, gray pixels point quantity is more than or equal to the second amount threshold time, then perform step 1043b; When scene illumination estimate value be not more than the first luminance threshold and be more than or equal to the second luminance threshold, green pixel point quantity be greater than the first amount threshold and gray pixels point quantity is less than the second amount threshold time, then perform step 1043c; When scene illumination estimate value be not more than the first luminance threshold and be more than or equal to the second luminance threshold, green pixel point quantity be greater than the first amount threshold time, then perform step 1043d; When scene illumination estimate value is less than the second luminance threshold, when gray pixels point quantity is more than or equal to the second amount threshold, then perform step 1043e.
Wherein, in the present embodiment, described green pixel point quantity and described gray pixels point quantity perform step 102 according to the rgb pixel value of described pixel, carries out cumulative obtaining from described pixel while determining green pixel point and gray pixels point.
Concrete, in embodiments of the present invention, scene brightness estimate I=L_avg/ (gain*shutter), wherein gain, shutter are respectively exposure gain and shutter time value.Under the preferred conditions, require that exposure must accurately, to ensure the accurate of exposure gain and aperture time.
In the present embodiment, it should be noted that, the luminous intensity of the shooting environmental of scene brightness and this image is closely related, at identical luminous flux with in the identical time, light intensity is stronger, then represent that the light energy comprised in light is larger, the light energy arrived on photo-sensitive cell is also larger, and consequent image is brighter; Light intensity is more weak, then represent that the light energy comprised in light is less, the light energy arrived on photo-sensitive cell is also less, and consequent image is darker.
In the present embodiment, it should be noted that, aperture time refers to that shutter is opened, the time that imager chip is photosensitive.In identical scene light intensity with under identical luminous flux (also namely identical f-number), aperture time is larger, then image is brighter; Aperture time is less, then image is darker.Therefore, in order to obtain a suitable brightness of image, imaging system needs to arrange a suitable aperture time.
In the present embodiment, it should be noted that, exposure gain refers to that the analog picture signal exported by sensitive chip is in the amplifier gain reaching this section of signal of telecommunication between ADC Collect conversion.Exposure gain is larger, then image is brighter, and signal gain is less, then image is darker.
In the present embodiment, it should be noted that, actual light source point color-ratio coefficient is the color-ratio coefficient with reference to white point (white point), this reference white point is often referred to as reference white color (reference white) or target white (target white) in technical documentation, be used to image capture, coding and reproduction time definition white.The numerical value of white point is not constant, needs to make corresponding change according to the numerical value of difference to it of use occasion.Such as commonly use incandescent lamp to throw light on when pickup, and the light colour temperature of incandescent lamp is lower relative to daylight, thus presents the color of orange partially.If still use the white point numerical value be as the criterion with daylight to define white in this case, the result of photography just there will be the problem of colour cast.
In the present embodiment, it should be noted that, utilize colour temperature to judge that light source is known.The colour temperature of such as Ordinary Light Sources Have is: standard candle is 1930K (kelvin degree unit); Tengsten lamp is 2760-2900K; Fluorescent lamp is 3000K; Flash lamp is 3800K; Noon, sunlight was 5600K; X-flash is 6000K; Blue sky is 12000-18000K.
1043a, the first light source point color-ratio coefficient is defined as actual light source point color-ratio coefficient.
1043b, judge whether current light source is fluorescent light according to secondary light source point color-ratio coefficient; When determining that current light source is fluorescent light, the first light source point color-ratio coefficient is defined as actual light source point color-ratio coefficient.
1043c, the first light source point color-ratio coefficient is defined as actual light source point color-ratio coefficient.
1043d, judge whether current light source is fluorescent light according to secondary light source point color-ratio coefficient, when determining that current light source is fluorescent light, red green proportionality coefficient according to the first light source point color-ratio coefficient and secondary light source point color-ratio coefficient is weighted, using the red green proportionality coefficient of the red green proportionality coefficient in the described first light source point color-ratio coefficient and secondary light source point color-ratio coefficient of weighted calculation as the 3rd light source point, and be weighted according to the bluish-green proportionality coefficient of the first light source point color-ratio coefficient and secondary light source point color-ratio coefficient, using the bluish-green proportionality coefficient of the bluish-green proportionality coefficient in the described first light source point color-ratio coefficient and secondary light source point color-ratio coefficient of weighted calculation as the 3rd light source point, and according to the red green proportionality coefficient of the 3rd light source point and bluish-green proportionality coefficient determination actual light source point color-ratio coefficient.
Concrete, in embodiments of the present invention, the red green proportionality coefficient rx_final of the 3rd light source point is (rx_g*w1+rx_w*w2)/(I_out-I_in), and the bluish-green proportionality coefficient of the 3rd light source point is bx_final=(bx_g*w1+bx_w*w2)/(I_out-I_in).Wherein, I_out is the first luminance threshold, and for outdoor brightness under being characterized in solar radiation, I_in is the second luminance threshold, for being characterized in room brilliancy under solar radiation.The weight used during weighted calculation is w1=I-I_in, w2=I_out-I.
1043e, secondary light source point color-ratio coefficient is defined as actual light source point color-ratio coefficient.
What deserves to be explained is, in above-mentioned steps 1043a to 1043e, all use identical optimum configurations, that is, the first luminance threshold, the second luminance threshold, the first amount threshold, the second amount threshold carry out unifying to arrange.
105, current AWB yield value is determined according to described actual light source point color-ratio coefficient.
Further, the specific implementation calculating current AWB yield value according to the red green proportionality coefficient of the 3rd light source point and bluish-green proportionality coefficient can refer to formula:
R_gain=1/rx_final,G_gain=1,B_gain=1/bx_final。
106, described current white balance gains value is used to carry out blank level adjustment.
The method of adjustment of a kind of white balance that the embodiment of the present invention provides, by distinguishing green pixel point and gray pixels point with after obtaining corresponding rgb pixel value, possible light source point is determined respectively according to green pixel point and each self-corresponding rgb pixel value of gray pixels point, synthetic determination is carried out again according to possible light source point, to determine actual light source point color-ratio coefficient accurately, compared to the technical scheme that the type that can only provide current light source in prior art is fluorescent lamp or daylight, the method that the embodiment of the present invention provides can provide yield value accurately for equipment, to ensure can both carry out automatic white balance to each two field picture.
Embodiments provide a kind of adjusting device of white balance, can be used for realizing all method flows as Fig. 1 to Fig. 8, as shown in Figure 9, this device comprises:
Acquiring unit 21, for obtaining the rgb pixel value of described pixel, described rgb pixel value is rgb format.
First determining unit 22, for the rgb pixel value according to described pixel, determines green pixel point and gray pixels point from described pixel.
Second determining unit 23, for determining the first light source point color-ratio coefficient according to the rgb pixel value of green pixel point, and according to the rgb pixel value determination secondary light source point color-ratio coefficient of gray pixels point.
3rd determining unit 24, for according to described first light source point color-ratio coefficient and secondary light source point color-ratio coefficient, determines actual light source point color-ratio coefficient.
4th determining unit 25, for determining current AWB yield value according to described actual light source point color-ratio coefficient.
Adjustment unit 26, for carrying out blank level adjustment according to described current white balance gains value.
Optionally, as shown in Figure 10, described first determining unit 22 comprises:
First computing module 221, calculates for the rgb pixel value according to described pixel, obtains the red green proportionality coefficient of described pixel, bluish-green proportionality coefficient and brightness value.
First determination module 222, for one in whole combinations of the red green proportionality coefficient of pixel and the red green proportionality coefficient being combined as default green object of bluish-green proportionality coefficient and bluish-green proportionality coefficient value, and, pixel, within the scope of luminance threshold, is defined as green pixel point by the brightness value of pixel.
Optionally, as shown in figure 11, described first determining unit 22 comprises:
Second computing module 223, calculates for the rgb pixel value according to described pixel, obtains the red green proportionality coefficient of described pixel, bluish-green proportionality coefficient.
Second determination module 224, for when determine that the red green proportionality coefficient of pixel is one in the red green proportionality coefficient set of default grey object, and when the bluish-green proportionality coefficient of pixel is in the bluish-green proportionality coefficient set of default grey object, then pixel is defined as gray pixels point.
Optionally, as shown in figure 12, described second determining unit 23 comprises:
First average value processing module 231, for carrying out average value processing respectively to the red green proportionality coefficient of all green pixel points and bluish-green proportionality coefficient, obtains red green proportionality coefficient average and bluish-green proportionality coefficient average.
3rd computing module 232, for calculating according to red green proportionality coefficient average, bluish-green proportionality coefficient average and default green object colour temperature line, obtains red green proportionality coefficient projection value, bluish-green proportionality coefficient projection value; And for calculating according to described red green proportionality coefficient projection value and default red green proportionality coefficient mapping relations, obtain the red green proportionality coefficient of the first light source point, and calculate according to described bluish-green proportionality coefficient projection value and default bluish-green proportionality coefficient mapping relations, obtain the bluish-green proportionality coefficient of the first light source point.
First composite module 233, for the combination according to the red green proportionality coefficient of described first light source point and the bluish-green proportionality coefficient of described first light source point, determines the first light source point color-ratio coefficient.
Optionally, as shown in figure 13, described second determining unit 23 comprises:
Second average value processing module 234, for carrying out average value processing respectively to the red green proportionality coefficient of all gray pixels points and bluish-green proportionality coefficient, obtains red green proportionality coefficient average and bluish-green proportionality coefficient average.
3rd determination module 235, for described red green proportionality coefficient average is defined as the red green proportionality coefficient of secondary light source point, and is defined as the bluish-green proportionality coefficient of secondary light source point by described bluish-green proportionality coefficient average.
Second composite module 236, for the combination according to the red green proportionality coefficient of described secondary light source point and the bluish-green proportionality coefficient of described secondary light source point, determines secondary light source point color-ratio coefficient.
Optionally, as shown in figure 14, described 3rd determining unit 24 comprises:
4th computing module 241, calculates for the rgb pixel value according to described pixel, obtains the brightness average of described pixel; And calculate for the brightness average according to described pixel, exposure gain value and aperture time, obtain scene brightness estimate.
4th determination module 242, for being greater than the first luminance threshold in scene illumination estimate value, green pixel point quantity be greater than the first amount threshold and gray pixels point quantity is less than the second amount threshold time, the first light source point color-ratio coefficient is defined as actual light source point color-ratio coefficient; And for being greater than the first luminance threshold in scene illumination estimate value, when green pixel point quantity is greater than the first amount threshold, gray pixels point quantity is more than or equal to the second amount threshold, judge whether current light source is fluorescent light according to secondary light source point color-ratio coefficient; When determining that current light source is fluorescent light, the first light source point color-ratio coefficient is defined as actual light source point color-ratio coefficient; And for be not more than the first luminance threshold in scene illumination estimate value and be more than or equal to the second luminance threshold, green pixel point quantity be greater than the first amount threshold and gray pixels point quantity is less than the second amount threshold time, the first light source point color-ratio coefficient is defined as actual light source point color-ratio coefficient; And for be not more than the first luminance threshold in scene illumination estimate value and be more than or equal to the second luminance threshold, green pixel point quantity be greater than the first amount threshold time, judge whether current light source is fluorescent light according to secondary light source point color-ratio coefficient; When determining that current light source is fluorescent light, the red green proportionality coefficient according to the first light source point color-ratio coefficient and secondary light source point color-ratio coefficient is weighted, and obtains the red green proportionality coefficient of the 3rd light source point; And for being less than the second luminance threshold in scene illumination estimate value, when gray pixels point quantity is more than or equal to the second amount threshold, secondary light source point color-ratio coefficient is defined as actual light source point color-ratio coefficient.
Wherein, described green pixel point quantity and described gray pixels point quantity in the rgb pixel value according to described pixel by described first determining unit 22, are added up while determining green pixel point and gray pixels point and obtain from described pixels.
The adjusting device of a kind of white balance that the embodiment of the present invention provides, by distinguishing green pixel point and gray pixels point with after obtaining corresponding rgb pixel value, possible light source point is determined respectively according to green pixel point and each self-corresponding rgb pixel value of gray pixels point, synthetic determination is carried out again according to possible light source point, to determine actual light source point color-ratio coefficient accurately, compared to the technical scheme that the type that can only provide current light source in prior art is fluorescent lamp or daylight, the method that the embodiment of the present invention provides can provide yield value accurately for equipment, to ensure can both carry out automatic white balance to each two field picture.
The embodiment of the present invention additionally provides a kind of electric terminal, as shown in figure 15, it has at least one central processing unit 31 and memory 32, described memory 32 is configured with code, described processor for calling the code stored in memory 32, in order to realize all method flows as shown in Figures 1 to 6.Further, bus communication is passed through between described central processing unit 31 and memory 32.
Wherein, described central processing unit 31 is for obtaining the rgb pixel value of pixel in input picture, and described rgb pixel value is rgb format; According to the rgb pixel value of described pixel, from described pixel, determine green pixel point and gray pixels point; Rgb pixel value according to green pixel point calculates, and obtains the first light source point color-ratio coefficient, and calculates according to the rgb pixel value of gray pixels point, obtains secondary light source point color-ratio coefficient; According to described first light source point color-ratio coefficient and secondary light source point color-ratio coefficient, determine actual light source point color-ratio coefficient; Current AWB yield value is determined according to described actual light source point color-ratio coefficient; Described current white balance gains value is used to carry out blank level adjustment.
Described memory 32, for storing rgb pixel value, the first light source point color-ratio coefficient, secondary light source point color-ratio coefficient, the AWB yield value of described pixel.
Further, described central processing unit 31, calculates for the rgb pixel value according to described pixel, obtains the red green proportionality coefficient of described pixel, bluish-green proportionality coefficient and brightness value; One in whole combinations of the red green proportionality coefficient of pixel and the red green proportionality coefficient being combined as default green object of bluish-green proportionality coefficient and bluish-green proportionality coefficient value, and, when the brightness value of pixel is within the scope of luminance threshold, then pixel is defined as green pixel point.
Described memory 32, also for storing the red green proportionality coefficient of described pixel, bluish-green proportionality coefficient and brightness value.
Further, described central processing unit 31, calculates for the rgb pixel value according to described pixel, obtains the red green proportionality coefficient of described pixel, bluish-green proportionality coefficient; When determining that the red green proportionality coefficient of pixel is one in the red green proportionality coefficient set of default grey object, and when the bluish-green proportionality coefficient of pixel is in the bluish-green proportionality coefficient set of default grey object, then pixel is defined as gray pixels point.
Further, described central processing unit 31, for carrying out average value processing respectively to the red green proportionality coefficient of all green pixel points and bluish-green proportionality coefficient, obtains red green proportionality coefficient average and bluish-green proportionality coefficient average; Calculate according to red green proportionality coefficient average, bluish-green proportionality coefficient average and default green object colour temperature line, obtain red green proportionality coefficient projection value, bluish-green proportionality coefficient projection value; Calculate according to described red green proportionality coefficient projection value and default red green proportionality coefficient mapping relations, obtain the red green proportionality coefficient of the first light source point, and calculate according to described bluish-green proportionality coefficient projection value and default bluish-green proportionality coefficient mapping relations, obtain the bluish-green proportionality coefficient of the first light source point; According to the combination of the red green proportionality coefficient of described first light source point and the bluish-green proportionality coefficient of described first light source point, determine the first light source point color-ratio coefficient.
Described memory 32, also for storing default green object colour temperature line, red green proportionality coefficient projection value, bluish-green proportionality coefficient projection value, default bluish-green proportionality coefficient mapping relations.
Further, described central processing unit 31, for carrying out average value processing respectively to the red green proportionality coefficient of all gray pixels points and bluish-green proportionality coefficient, obtains red green proportionality coefficient average and bluish-green proportionality coefficient average; Described red green proportionality coefficient average is defined as the red green proportionality coefficient of secondary light source point, and described bluish-green proportionality coefficient average is defined as the bluish-green proportionality coefficient of secondary light source point; According to the combination of the red green proportionality coefficient of described secondary light source point and the bluish-green proportionality coefficient of described secondary light source point, determine secondary light source point color-ratio coefficient.
Further, described central processing unit 31 calculates for the rgb pixel value according to described pixel, obtains the brightness average of described pixel, calculate according to the brightness average of described pixel, exposure gain value and aperture time, obtain scene brightness estimate, when scene illumination estimate value be greater than the first luminance threshold, green pixel point quantity be greater than the first amount threshold and gray pixels point quantity is less than the second amount threshold time, first light source point color-ratio coefficient is defined as actual light source point color-ratio coefficient, and calculates current AWB yield value according to the red green proportionality coefficient of the 3rd light source point and bluish-green proportionality coefficient, when scene illumination estimate value be greater than the first luminance threshold, green pixel point quantity is greater than the first amount threshold, gray pixels point quantity is more than or equal to the second amount threshold time, judge whether current light source is fluorescent light according to secondary light source point color-ratio coefficient, when determining that current light source is fluorescent light, the first light source point color-ratio coefficient is defined as actual light source point color-ratio coefficient, and calculates current AWB yield value according to the red green proportionality coefficient of the 3rd light source point and bluish-green proportionality coefficient, when scene illumination estimate value be not more than the first luminance threshold and be more than or equal to the second luminance threshold, green pixel point quantity be greater than the first amount threshold and gray pixels point quantity is less than the second amount threshold time, first light source point color-ratio coefficient is defined as actual light source point color-ratio coefficient, and calculates current AWB yield value according to the red green proportionality coefficient of the 3rd light source point and bluish-green proportionality coefficient, when scene illumination estimate value be not more than the first luminance threshold and be more than or equal to the second luminance threshold, green pixel point quantity be greater than the first amount threshold time, judge whether current light source is fluorescent light according to secondary light source point color-ratio coefficient, when determining that current light source is fluorescent light, red green proportionality coefficient according to the first light source point color-ratio coefficient and secondary light source point color-ratio coefficient is weighted, using the red green proportionality coefficient of the red green proportionality coefficient in the described first light source point color-ratio coefficient and secondary light source point color-ratio coefficient of weighted calculation as the 3rd light source point, and be weighted according to the bluish-green proportionality coefficient of the first light source point color-ratio coefficient and secondary light source point color-ratio coefficient, using the bluish-green proportionality coefficient of the bluish-green proportionality coefficient in the described first light source point color-ratio coefficient and secondary light source point color-ratio coefficient of weighted calculation as the 3rd light source point, current AWB yield value is calculated according to the red green proportionality coefficient of the 3rd light source point and bluish-green proportionality coefficient, when scene illumination estimate value is less than the second luminance threshold, when gray pixels point quantity is more than or equal to the second amount threshold, secondary light source point color-ratio coefficient is defined as actual light source point color-ratio coefficient, and calculates current AWB yield value according to the red green proportionality coefficient of the 3rd light source point and bluish-green proportionality coefficient.
Wherein, described green pixel point quantity and gray pixels point quantity are that described central processing unit 31 performs the rgb pixel value of step according to described pixel, and adding up determine green pixel point and gray pixels point from described pixel while obtains.
Described memory 32 is also for storing brightness average, exposure gain value, aperture time, scene brightness estimate, the first luminance threshold, the second luminance threshold, the first amount threshold, second amount threshold of described pixel.
A kind of electric terminal that the embodiment of the present invention provides, by distinguishing green pixel point and gray pixels point with after obtaining corresponding rgb pixel value, possible light source point is determined respectively according to green pixel point and each self-corresponding rgb pixel value of gray pixels point, synthetic determination is carried out again according to possible light source point, to determine actual light source point color-ratio coefficient accurately, compared to the technical scheme that the type that can only provide current light source in prior art is fluorescent lamp or daylight, the method that the embodiment of the present invention provides can provide yield value accurately for equipment, to ensure can both carry out automatic white balance to each two field picture.
Method and apparatus as herein described is contained in the present invention can be implemented in such as that (but being not limited to) is various below to be had in the electronic installation of image, video processing function or associated with it: mobile phone, wireless device, personal digital assistant (PDA), hand-held or portable computer, white balance detects and adjusting device, camera, video camera, televimonitor, flat-panel monitor, computer monitor, electronic photo etc.Device as herein described can be configured to certainly as non-display device but be independent display unit output display signal, also can be configured to the combination with display unit.
Through the above description of the embodiments, those skilled in the art can be well understood to the mode that the present invention can add required common hardware by software and realize, and can certainly pass through hardware, but in a lot of situation, the former is better embodiment.Based on such understanding, technical scheme of the present invention can embody with the form of software product the part that prior art contributes in essence in other words, this computer software product is stored in the storage medium that can read, as the floppy disk of computer, hard disk or CD etc., comprise some instructions and perform method described in each embodiment of the present invention in order to make a computer equipment (can be personal computer, server, or the network equipment etc.).
The above; be only the specific embodiment of the present invention, but protection scope of the present invention is not limited thereto, is anyly familiar with those skilled in the art in the technical scope that the present invention discloses; change can be expected easily or replace, all should be encompassed within protection scope of the present invention.Therefore, protection scope of the present invention should be as the criterion with the protection domain of described claim.
Claims (20)
1. a method of adjustment for white balance, is characterized in that, comprising:
Obtain the rgb pixel value of pixel in input picture;
According to the rgb pixel value of described pixel, from described pixel, determine green pixel point and gray pixels point;
The first light source point color-ratio coefficient is determined according to the rgb pixel value of green pixel point, and according to the rgb pixel value determination secondary light source point color-ratio coefficient of gray pixels point;
According to described first light source point color-ratio coefficient and secondary light source point color-ratio coefficient determination actual light source point color-ratio coefficient;
Current white balance gains value is determined according to described actual light source point color-ratio coefficient;
Described current white balance gains value is used to carry out blank level adjustment.
2. method according to claim 1, is characterized in that, the described rgb pixel value according to pixel in described input picture, determines that green pixel point comprises from described pixel:
Rgb pixel value according to described pixel calculates, and obtains the red green proportionality coefficient of described pixel, bluish-green proportionality coefficient and brightness value;
One in the red green proportionality coefficient being combined as default green object of red green proportionality coefficient and bluish-green proportionality coefficient determining described pixel and whole combinations of bluish-green proportionality coefficient value, and, when the brightness value of described pixel is within the scope of luminance threshold, then described pixel is defined as green pixel point.
3. method according to claim 1, is characterized in that, the described rgb pixel value according to described pixel, determines that gray pixels point comprises from described pixel:
Rgb pixel value according to described pixel calculates, and obtains the red green proportionality coefficient of described pixel, bluish-green proportionality coefficient;
When determining that the red green proportionality coefficient of described pixel is one in the red green proportionality coefficient set of default grey object, and when the bluish-green proportionality coefficient of described pixel is in the bluish-green proportionality coefficient set of default grey object, then described pixel is defined as gray pixels point.
4. method according to claim 2, is characterized in that, the described rgb pixel value according to green pixel point determines that the first light source point color-ratio coefficient comprises:
Respectively average value processing is carried out to the red green proportionality coefficient of all green pixel points and bluish-green proportionality coefficient, obtains red green proportionality coefficient average and bluish-green proportionality coefficient average;
Calculate according to red green proportionality coefficient average, bluish-green proportionality coefficient average and default green object colour temperature line, obtain red green proportionality coefficient projection value, bluish-green proportionality coefficient projection value;
Calculate according to described red green proportionality coefficient projection value and default red green proportionality coefficient mapping relations, obtain the red green proportionality coefficient of the first light source point, and calculate according to described bluish-green proportionality coefficient projection value and default bluish-green proportionality coefficient mapping relations, obtain the bluish-green proportionality coefficient of the first light source point;
According to the combination of the red green proportionality coefficient of described first light source point and the bluish-green proportionality coefficient of described first light source point, determine the first light source point color-ratio coefficient.
5. method according to claim 3, is characterized in that, the described rgb pixel value determination secondary light source point color-ratio coefficient according to gray pixels point comprises:
Respectively average value processing is carried out to the red green proportionality coefficient of all gray pixels points and bluish-green proportionality coefficient, obtains red green proportionality coefficient average and bluish-green proportionality coefficient average;
Described red green proportionality coefficient average is defined as the red green proportionality coefficient of secondary light source point, and described bluish-green proportionality coefficient average is defined as the bluish-green proportionality coefficient of secondary light source point;
According to the combination of the red green proportionality coefficient of described secondary light source point and the bluish-green proportionality coefficient of described secondary light source point, determine secondary light source point color-ratio coefficient.
6. the method according to claim 1-5 any one, is characterized in that, describedly comprises according to described first light source point color-ratio coefficient and secondary light source point color-ratio coefficient determination actual light source point color-ratio coefficient:
Rgb pixel value according to described pixel calculates, and obtains the brightness average of described pixel;
Calculate according to the brightness average of described pixel, exposure gain value and aperture time, obtain scene brightness estimate;
When scene illumination estimate value be greater than the first luminance threshold, green pixel point quantity be greater than the first amount threshold and gray pixels point quantity is less than the second amount threshold time, the first light source point color-ratio coefficient is defined as actual light source point color-ratio coefficient;
Wherein, described green pixel point quantity and gray pixels point quantity are perform step according to the rgb pixel value of described pixel, and adding up determine green pixel point and gray pixels point from described pixel while obtains.
7. method according to claim 6, is characterized in that, describedly also comprises according to described first light source point color-ratio coefficient and secondary light source point color-ratio coefficient determination actual light source point color-ratio coefficient:
When scene illumination estimate value be greater than the first luminance threshold, green pixel point quantity is greater than the first amount threshold, gray pixels point quantity is more than or equal to the second amount threshold time, judge whether current light source is fluorescent light according to secondary light source point color-ratio coefficient; When determining that current light source is fluorescent light, the first light source point color-ratio coefficient is defined as actual light source point color-ratio coefficient.
8. method according to claim 6, is characterized in that, describedly also comprises according to described first light source point color-ratio coefficient and secondary light source point color-ratio coefficient determination actual light source point color-ratio coefficient:
When scene illumination estimate value be not more than the first luminance threshold and be more than or equal to the second luminance threshold, green pixel point quantity be greater than the first amount threshold and gray pixels point quantity is less than the second amount threshold time, the first light source point color-ratio coefficient is defined as actual light source point color-ratio coefficient.
9. method according to claim 6, is characterized in that, describedly also comprises according to described first light source point color-ratio coefficient and secondary light source point color-ratio coefficient determination actual light source point color-ratio coefficient:
When scene illumination estimate value be not more than the first luminance threshold and be more than or equal to the second luminance threshold, green pixel point quantity be greater than the first amount threshold time, judge whether current light source is fluorescent light according to secondary light source point color-ratio coefficient, when determining that current light source is fluorescent light, be weighted according to the red green proportionality coefficient in the first light source point color-ratio coefficient and secondary light source point color-ratio coefficient, using the red green proportionality coefficient of the red green proportionality coefficient in the described first light source point color-ratio coefficient and secondary light source point color-ratio coefficient of weighted calculation as the 3rd light source point, and be weighted according to the bluish-green proportionality coefficient in the first light source point color-ratio coefficient and secondary light source point color-ratio coefficient, using the bluish-green proportionality coefficient of the bluish-green proportionality coefficient in the described first light source point color-ratio coefficient and secondary light source point color-ratio coefficient of weighted calculation as the 3rd light source point, and according to the red green proportionality coefficient of the 3rd light source point and bluish-green proportionality coefficient determination actual light source point color-ratio coefficient.
10. method according to claim 6, is characterized in that, describedly also comprises according to described first light source point color-ratio coefficient and secondary light source point color-ratio coefficient determination actual light source point color-ratio coefficient:
When scene illumination estimate value is less than the second luminance threshold, when gray pixels point quantity is more than or equal to the second amount threshold, secondary light source point color-ratio coefficient is defined as actual light source point color-ratio coefficient.
The adjusting device of 11. 1 kinds of white balances, is characterized in that, comprising:
Acquiring unit, for obtaining the rgb pixel value of pixel in input picture;
First determining unit, for the rgb pixel value according to described pixel, determines green pixel point and gray pixels point from described pixel;
Second determining unit, for determining the first light source point color-ratio coefficient according to the rgb pixel value of green pixel point, and according to the rgb pixel value determination secondary light source point color-ratio coefficient of gray pixels point;
3rd determining unit, for according to described first light source point color-ratio coefficient and secondary light source point color-ratio coefficient, determines actual light source point color-ratio coefficient;
4th determining unit, for determining current AWB yield value according to described actual light source point color-ratio coefficient;
Adjustment unit, for carrying out blank level adjustment according to described current white balance gains value.
12. devices according to claim 11, is characterized in that, described first determining unit comprises:
First computing module, calculates for the rgb pixel value according to described pixel, obtains the red green proportionality coefficient of described pixel, bluish-green proportionality coefficient and brightness value;
First determination module, for one in whole combinations of the red green proportionality coefficient of pixel and the red green proportionality coefficient being combined as default green object of bluish-green proportionality coefficient and bluish-green proportionality coefficient value, and, when the brightness value of pixel is within the scope of luminance threshold, pixel is defined as green pixel point.
13. devices according to claim 11, is characterized in that, described first determining unit comprises:
Second computing module, calculates for the rgb pixel value according to described pixel, obtains the red green proportionality coefficient of described pixel, bluish-green proportionality coefficient;
Second determination module, determine that the red green proportionality coefficient of pixel is in of the red green proportionality coefficient set of default grey object for working as, and when the bluish-green proportionality coefficient of pixel is in the bluish-green proportionality coefficient set of default grey object, then pixel is defined as gray pixels point.
14. devices according to claim 12, is characterized in that, described second determining unit comprises:
First average value processing module, for carrying out average value processing respectively to the red green proportionality coefficient of all green pixel points and bluish-green proportionality coefficient, obtains red green proportionality coefficient average and bluish-green proportionality coefficient average;
3rd computing module, for calculating according to red green proportionality coefficient average, bluish-green proportionality coefficient average and default green object colour temperature line, obtains red green proportionality coefficient projection value, bluish-green proportionality coefficient projection value; And for calculating according to described red green proportionality coefficient projection value and default red green proportionality coefficient mapping relations, obtain the red green proportionality coefficient of the first light source point, and calculate according to described bluish-green proportionality coefficient projection value and default bluish-green proportionality coefficient mapping relations, obtain the bluish-green proportionality coefficient of the first light source point;
First composite module, for the combination according to the red green proportionality coefficient of described first light source point and the bluish-green proportionality coefficient of described first light source point, determines the first light source point color-ratio coefficient.
15. devices according to claim 13, is characterized in that, described second determining unit comprises:
Second average value processing module, for carrying out average value processing respectively to the red green proportionality coefficient of all gray pixels points and bluish-green proportionality coefficient, obtains red green proportionality coefficient average and bluish-green proportionality coefficient average;
3rd determination module, for described red green proportionality coefficient average is defined as the red green proportionality coefficient of secondary light source point, and is defined as the bluish-green proportionality coefficient of secondary light source point by described bluish-green proportionality coefficient average;
Second composite module, for the combination according to the red green proportionality coefficient of described secondary light source point and the bluish-green proportionality coefficient of described secondary light source point, determines secondary light source point color-ratio coefficient.
16. devices according to claim 11-15 any one, it is characterized in that, described 3rd determining unit comprises:
4th computing module, calculates for the rgb pixel value according to described pixel, obtains the brightness average of described pixel; And calculate for the brightness average according to described pixel, exposure gain value and aperture time, obtain scene brightness estimate;
4th determination module, for being greater than the first luminance threshold in scene illumination estimate value, green pixel point quantity be greater than the first amount threshold and gray pixels point quantity is less than the second amount threshold time, the first light source point color-ratio coefficient is defined as actual light source point color-ratio coefficient;
Wherein, described green pixel point quantity and described gray pixels point quantity in the rgb pixel value according to described pixel by described first determining unit, are added up while determining green pixel point and gray pixels point and obtain from described pixels.
17. devices according to claim 16, it is characterized in that, according to secondary light source point color-ratio coefficient, described 4th determination module is also for being greater than the first luminance threshold when scene illumination estimate value, when green pixel point quantity is greater than the first amount threshold, gray pixels point quantity is more than or equal to the second amount threshold, judge whether current light source is fluorescent light; When determining that current light source is fluorescent light, the first light source point color-ratio coefficient is defined as actual light source point color-ratio coefficient.
18. devices according to claim 16, it is characterized in that, described 4th determination module also for be not more than the first luminance threshold when scene illumination estimate value and be more than or equal to the second luminance threshold, green pixel point quantity be greater than the first amount threshold and gray pixels point quantity is less than the second amount threshold time, the first light source point color-ratio coefficient is defined as actual light source point color-ratio coefficient.
19. devices according to claim 16, it is characterized in that, described 4th determination module also for be not more than the first luminance threshold when scene illumination estimate value and be more than or equal to the second luminance threshold, green pixel point quantity be greater than the first amount threshold time, judge whether current light source is fluorescent light according to secondary light source point color-ratio coefficient, when determining that current light source is fluorescent light, red green proportionality coefficient according to the first light source point color-ratio coefficient and secondary light source point color-ratio coefficient kind is weighted, using the red green proportionality coefficient of the red green proportionality coefficient in the described first light source point color-ratio coefficient and secondary light source point color-ratio coefficient of weighted calculation as the 3rd light source point, and be weighted according to the bluish-green proportionality coefficient in the first light source point color-ratio coefficient and secondary light source point color-ratio coefficient, using the bluish-green proportionality coefficient of the bluish-green proportionality coefficient in the described first light source point color-ratio coefficient and secondary light source point color-ratio coefficient of weighted calculation as the 3rd light source point, and according to the red green proportionality coefficient of the 3rd light source point and bluish-green proportionality coefficient determination actual light source point color-ratio coefficient.
20. devices according to claim 16, it is characterized in that, described 4th determination module is also for being less than the second luminance threshold when scene illumination estimate value, when gray pixels point quantity is more than or equal to the second amount threshold, secondary light source point color-ratio coefficient is defined as actual light source point color-ratio coefficient.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310109918.5A CN103227928B (en) | 2013-03-29 | 2013-03-29 | White balance adjusting method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310109918.5A CN103227928B (en) | 2013-03-29 | 2013-03-29 | White balance adjusting method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN103227928A CN103227928A (en) | 2013-07-31 |
CN103227928B true CN103227928B (en) | 2015-04-29 |
Family
ID=48838165
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201310109918.5A Active CN103227928B (en) | 2013-03-29 | 2013-03-29 | White balance adjusting method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103227928B (en) |
Families Citing this family (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103546732B (en) * | 2013-10-18 | 2016-05-18 | 广州市浩云安防科技股份有限公司 | Image processing method and system |
TWI498848B (en) * | 2014-10-13 | 2015-09-01 | Quanta Comp Inc | Multi-exposure imaging system and white balance method |
CN105100764B (en) * | 2015-06-26 | 2018-03-16 | 小米科技有限责任公司 | Image pickup method and device |
CN104954772B (en) * | 2015-06-26 | 2017-05-10 | 济南中维世纪科技有限公司 | Image adjacent-grey pixel selection algorithm applied to automatic white balance algorithm |
CN105872510B (en) * | 2016-04-25 | 2017-11-21 | 浙江大华技术股份有限公司 | A kind of image white balancing treatment method and device |
WO2017186071A1 (en) | 2016-04-25 | 2017-11-02 | Zhejiang Dahua Technology Co., Ltd. | Methods, systems, and media for image white balance adjustment |
CN105898263B (en) * | 2016-05-24 | 2017-08-25 | 厦门美图之家科技有限公司 | A kind of image white balance method, device and computing device |
CN109215612A (en) * | 2017-06-30 | 2019-01-15 | 北京小米移动软件有限公司 | Adjusting method and device that screen is shown, electronic equipment, storage medium |
CN107564047B (en) * | 2017-09-12 | 2020-10-20 | 北京小米移动软件有限公司 | Image processing method and device, electronic equipment and computer readable storage medium |
CN107801012B (en) | 2017-10-30 | 2019-05-17 | Oppo广东移动通信有限公司 | White balancing treatment method and device, electronic device and computer readable storage medium |
JP6879268B2 (en) * | 2018-06-18 | 2021-06-02 | 株式会社Jvcケンウッド | Color correction device |
CN117998070B (en) * | 2024-04-03 | 2024-06-11 | 宁波舜宇光电软件开发有限公司 | Brightness and white balance regulating method for image and image display equipment |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1863321A (en) * | 2005-05-11 | 2006-11-15 | 索尼公司 | White balance controlling apparatus, method, program and image pickup apparatus |
CN1953561A (en) * | 2006-11-27 | 2007-04-25 | 北京中星微电子有限公司 | A system and method to correct white balance |
CN101072365A (en) * | 2006-05-11 | 2007-11-14 | 奥林巴斯映像株式会社 | White balance control method, imaging apparatus and storage medium storing white balance control program |
CN101159879A (en) * | 2006-10-08 | 2008-04-09 | 普立尔科技股份有限公司 | Digital picture capturing device and white balance adjustment method thereof |
CN102300100A (en) * | 2010-06-28 | 2011-12-28 | 比亚迪股份有限公司 | White balance control device and method |
-
2013
- 2013-03-29 CN CN201310109918.5A patent/CN103227928B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1863321A (en) * | 2005-05-11 | 2006-11-15 | 索尼公司 | White balance controlling apparatus, method, program and image pickup apparatus |
CN101072365A (en) * | 2006-05-11 | 2007-11-14 | 奥林巴斯映像株式会社 | White balance control method, imaging apparatus and storage medium storing white balance control program |
CN101159879A (en) * | 2006-10-08 | 2008-04-09 | 普立尔科技股份有限公司 | Digital picture capturing device and white balance adjustment method thereof |
CN1953561A (en) * | 2006-11-27 | 2007-04-25 | 北京中星微电子有限公司 | A system and method to correct white balance |
CN102300100A (en) * | 2010-06-28 | 2011-12-28 | 比亚迪股份有限公司 | White balance control device and method |
Also Published As
Publication number | Publication date |
---|---|
CN103227928A (en) | 2013-07-31 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103227928B (en) | White balance adjusting method and device | |
CN109151426B (en) | White balance adjusting method and device, camera and medium | |
US8994845B2 (en) | System and method of adjusting a camera based on image data | |
CN110572637B (en) | Image anomaly detection method, terminal device and storage medium | |
CN111064899B (en) | Exposure parameter adjusting method and device | |
JP5497151B2 (en) | Automatic backlight detection | |
CN108174172B (en) | Image pickup method and device, computer readable storage medium and computer equipment | |
CN102265707A (en) | Method for controlling light-emitting device in terminal equipment, apparatus thereof and terminal equipment | |
KR100478064B1 (en) | Illumination light color estimating method of obtaining white balance and image sensing apparatus | |
CN110213502A (en) | Image processing method, device, storage medium and electronic equipment | |
CN103546732A (en) | Image processing method and system | |
US8810681B2 (en) | Image processing apparatus and image processing method | |
CN105578062A (en) | Light metering mode selection method and image acquisition device utilizing same | |
CN105898152A (en) | Method and system for restoring ambient light luminance on image | |
JP5899894B2 (en) | Imaging apparatus, image processing apparatus, image processing program, and image processing method | |
CN102238394A (en) | Image processing apparatus, control method thereof, and image-capturing apparatus | |
US20200029016A1 (en) | Moving object monitoring device and moving object monitoring system | |
CN104754238A (en) | Imaging control method and device and imaging control system | |
JP2015192152A (en) | White balance adjustment device, white balance adjustment method and imaging device | |
CN111918047A (en) | Photographing control method and device, storage medium and electronic equipment | |
CN116634279A (en) | Image processing method, device, electronic equipment and storage medium | |
CN116506737A (en) | Method, device, equipment and storage medium for determining exposure parameters | |
CN111510636B (en) | Method and device for acquiring brightness evaluation value and computer storage medium | |
CN115190282B (en) | Method for avoiding white balance distortion of camera module under high color temperature | |
JP2016019081A (en) | Image processing system, control method thereof, and control program |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant |