CN103227928A - White balance adjusting method and device - Google Patents

White balance adjusting method and device Download PDF

Info

Publication number
CN103227928A
CN103227928A CN2013101099185A CN201310109918A CN103227928A CN 103227928 A CN103227928 A CN 103227928A CN 2013101099185 A CN2013101099185 A CN 2013101099185A CN 201310109918 A CN201310109918 A CN 201310109918A CN 103227928 A CN103227928 A CN 103227928A
Authority
CN
China
Prior art keywords
light source
green
proportionality coefficient
coefficient
source point
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.)
Granted
Application number
CN2013101099185A
Other languages
Chinese (zh)
Other versions
CN103227928B (en
Inventor
左坤隆
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201310109918.5A priority Critical patent/CN103227928B/en
Publication of CN103227928A publication Critical patent/CN103227928A/en
Application granted granted Critical
Publication of CN103227928B publication Critical patent/CN103227928B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Processing Of Color Television Signals (AREA)
  • Color Image Communication Systems (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

The method of adjustment of white balance and device
Technical field
The present invention relates to image processing field, relate in particular to a kind of method of adjustment and device of white balance.
Background technology
Because the difference on the principle of human eye and camera image sensor aware colors, cause to a kind of object under different light sources, video camera can't present identical color, the situation of colour cast can occur.Consistent for video camera can be accessed with the seen color of human eye, need to introduce Automatic white balance the image of video camera is handled.Its purpose of Automatic white balance is white object to be reduced to white no matter under any light source.
Since under some light source under the color of grey object and other light source color of non-grey object may obscure, this problem can have a negative impact for the performance of Automatic white balance algorithm.Closely similar such as the color of the green object under outdoor daylight and the grey object color under the room fluorescent lights, the grey object color is very approaching under the colour of skin under the room fluorescent lights and the incandescent lamp; These situations all can cause the Automatic white balance algorithm to be judged by accident, obtain wrong white balance result.
At present, the implementation that has following white balance in the prior art, comprise: adopt the difference between green and blueness, green and the redness to judge that current pixel point is respectively an also right and wrong green plants of green plants, and find brightness maximum or average brightness in green, the non-green pixel respectively; Think that current light source is a daylight when non-green portion brightness is high, and green brightness when high current light source be fluorescent lamp.Though it is fluorescent lamp or daylight that said method can provide the type of current light source, but do not further consider the material elements of daylight, and be subjected to the influence of the intensity of brightness of pixel easily, the adjustment of adopting said method to carry out white balance often causes erroneous judgement to light source easily.
Summary of the invention
Embodiments of the invention provide a kind of method of adjustment and device of white balance, can access correct white balance point, and then realize Automatic white balance.
For achieving the above object, embodiments of the invention adopt following technical scheme:
First aspect, the embodiment of the invention provide a kind of method of adjustment of white balance, comprising:
Obtain the rgb pixel value of pixel in the input picture;
According to the rgb pixel value of described pixel, from described pixel, determine green pixel point and gray pixels point;
Determine the first light source point color-ratio coefficient according to the rgb pixel value of green pixel point, and determine secondary light source point color-ratio coefficient according to the rgb pixel value of gray pixels point;
Determine actual 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 current Automatic white balance yield value according to described actual light source point color-ratio coefficient;
Use described current white balance gains value to carry out the white balance adjustment.
In conjunction with first aspect, in first kind of possible implementation, described rgb pixel value according to pixel in the described input picture, determine that from described pixel the green pixel point comprises:
Rgb pixel value according to described pixel is calculated, and obtains the red green proportionality coefficient of described pixel, bluish-green proportionality coefficient and brightness value;
In whole combinations of the red green proportionality coefficient that is combined as default green object of the red green proportionality coefficient of determining pixel and bluish-green proportionality coefficient and bluish-green proportionality coefficient value one, and, the brightness value of described pixel then is defined as described pixel the green pixel point in the luminance threshold scope time.
In conjunction with first aspect, in second kind of possible implementation, described rgb pixel value according to described pixel, determine that from described pixel the gray pixels point comprises:
Rgb pixel value according to described pixel is calculated, and obtains the red green proportionality coefficient of described pixel, bluish-green proportionality coefficient;
When the red green proportionality coefficient of determining described pixel is one in the red green proportionality coefficient set of default grey object, and the bluish-green proportionality coefficient of described pixel then is defined as described pixel the gray pixels point during for one in the bluish-green proportionality coefficient set of default grey object.
In conjunction with second kind of first aspect possible implementation, described rgb pixel value according to green pixel point determines that the first light source point color-ratio coefficient comprises:
Red green proportionality coefficient and bluish-green proportionality coefficient to all green pixel points carry out the average processing respectively, obtain 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 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 first light source point;
According to the combination of 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, described rgb pixel value according to gray pixels point determines that secondary light source point color-ratio coefficient comprises:
Red green proportionality coefficient and bluish-green proportionality coefficient to all gray pixels points carry out the average processing respectively, obtain red green proportionality coefficient average and bluish-green proportionality coefficient average;
Described red green proportionality coefficient average is defined as secondary light source puts red green proportionality coefficient, and described bluish-green proportionality coefficient average is defined as secondary light source puts bluish-green proportionality coefficient;
Put the combination that red green proportionality coefficient and described secondary light source are put bluish-green proportionality coefficient according to described secondary light source, determine secondary light source point color-ratio coefficient.
In conjunction with any one possible implementation in first aspect or first aspect preceding four kinds, in the 5th kind of possible implementation, describedly determine that 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 comprises:
Rgb pixel value according to described pixel is calculated, and obtains the brightness average of described pixel;
Brightness average, exposure yield value and aperture time according to described pixel calculate, and obtain the scene brightness estimated value;
When scene brightness estimated value greater than first luminance threshold, green pixel number of spots greater than first amount threshold and gray pixels number of spots during less than second amount threshold, the first light source point color-ratio coefficient is defined as actual light source point color-ratio coefficient, and calculates current Automatic white balance yield value according to the red green proportionality coefficient and the bluish-green proportionality coefficient of the 3rd light source point.
In conjunction with the 5th kind of possible implementation of first aspect,, describedly determine that 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 also comprises the 6th kind of possible implementation:
When scene brightness estimated value during more than or equal to second amount threshold, judges according to secondary light source point color-ratio coefficient whether current light source is fluorescent light greater than first amount threshold, gray pixels number of spots greater than first luminance threshold, green pixel number of spots; When definite 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 number of spots and gray pixels number of spots are the rgb pixel value of execution in step according to described pixel, and adding up when determining green pixel point and gray pixels point from described pixel obtains.
In conjunction with the 5th kind of possible implementation of first aspect,, describedly determine that 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 also comprises the 7th kind of possible implementation:
When scene brightness estimated value is not more than first luminance threshold and during less than second amount threshold, the first light source point color-ratio coefficient is defined as actual light source point color-ratio coefficient greater than first amount threshold and gray pixels number of spots more than or equal to second luminance threshold, green pixel number of spots.
In conjunction with the 5th kind of possible implementation of first aspect,, describedly determine that 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 also comprises the 8th kind of possible implementation:
When scene brightness estimated value is not more than first luminance threshold and during greater than first amount threshold, judges according to secondary light source point color-ratio coefficient whether current light source is fluorescent light more than or equal to second luminance threshold, green pixel number of spots; When definite current light source is fluorescent light, be weighted calculating according to the red green proportionality coefficient in the first light source point color-ratio coefficient and the secondary light source point color-ratio coefficient, will be through the first light source point color-ratio coefficient of weighted calculation and the red green proportionality coefficient in the secondary light source point color-ratio coefficient red green proportionality coefficient as the 3rd light source point, and be weighted calculating according to the bluish-green proportionality coefficient in the first light source point color-ratio coefficient and the secondary light source point color-ratio coefficient, will be through the first light source point color-ratio coefficient of weighted calculation and the bluish-green proportionality coefficient in the secondary light source point color-ratio coefficient bluish-green proportionality coefficient as the 3rd light source point, and determine actual light source point color-ratio coefficient according to the red green proportionality coefficient and the bluish-green proportionality coefficient of the 3rd light source point.
In conjunction with the 5th kind of possible implementation of first aspect,, describedly determine that 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 also comprises the 9th kind of possible implementation:
When scene brightness estimated value less than second luminance threshold, the gray pixels number of spots is put the color-ratio coefficient with secondary light source and is defined as actual light source point color-ratio coefficient during more than or equal to second amount threshold.
Second aspect, the embodiment of the invention provide a kind of adjusting device of white balance, comprising:
Acquiring unit is used for obtaining the rgb pixel value of input picture pixel;
First determining unit is used for the rgb pixel value according to described pixel, determines green pixel point and gray pixels point from described pixel;
Second determining unit is used for determining the first light source point color-ratio coefficient according to the rgb pixel value of green pixel point, and determines secondary light source point color-ratio coefficient according to the rgb pixel value of gray pixels point;
The 3rd determining unit is used for determining actual light source point color-ratio coefficient according to described first light source point color-ratio coefficient and secondary light source point color-ratio coefficient.
The 4th determining unit is used for determining current Automatic white balance yield value according to described actual light source point color-ratio coefficient;
Adjustment unit is used for carrying out the white balance adjustment according to described current white balance gains value.
In conjunction with second aspect, in first kind of possible implementation, described first determining unit comprises:
First computing module is used for calculating according to the rgb pixel value of described pixel, obtains the red green proportionality coefficient of described pixel, bluish-green proportionality coefficient and brightness value;
First determination module, be used for one in whole combinations of the red green proportionality coefficient that is combined as default green object of the red green proportionality coefficient of pixel and bluish-green proportionality coefficient and bluish-green proportionality coefficient value, and, the brightness value of pixel is defined as the green pixel point with pixel in the luminance threshold scope.
In conjunction with second aspect, in second kind of possible implementation, described first determining unit comprises:
Second computing module is used for calculating according to the rgb pixel value of described pixel, obtains the red green proportionality coefficient of described pixel, bluish-green proportionality coefficient;
Second determination module, be used for as the red green proportionality coefficient of determining pixel one for the red green proportionality coefficient set of default grey object, and the bluish-green proportionality coefficient of pixel then is defined as pixel the gray pixels point during for one in the bluish-green proportionality coefficient set of default grey object.
In conjunction with second kind of second aspect possible implementation, in the third possible implementation, described second determining unit comprises:
The first average processing module is used for the red green proportionality coefficient and the bluish-green proportionality coefficient of all green pixel points are carried out the average processing respectively, obtains red green proportionality coefficient average and bluish-green proportionality coefficient average;
The 3rd computing module is used 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 be used 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 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 first light source point;
First composite module is used for the combination according to 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:
The second average processing module is used for the red green proportionality coefficient and the bluish-green proportionality coefficient of all gray pixels points are carried out the average processing respectively, obtains red green proportionality coefficient average and bluish-green proportionality coefficient average;
The 3rd determination module is used for that described red green proportionality coefficient average is defined as secondary light source and puts red green proportionality coefficient, and described bluish-green proportionality coefficient average is defined as secondary light source puts bluish-green proportionality coefficient;
Second composite module is used for putting the combination that red green proportionality coefficient and described secondary light source are put bluish-green proportionality coefficient according to described secondary light source, determines secondary light source point color-ratio coefficient.
In conjunction with any one possible implementation in second aspect or second aspect preceding four kinds, in the 5th kind of possible implementation, described the 3rd determining unit comprises:
The 4th calculates module, is used for calculating according to the rgb pixel value of described pixel, obtains the brightness average of described pixel; And the brightness average, exposure yield value and the aperture time that are used for according to described pixel calculate, and obtains the scene brightness estimated value; And be used for calculating current Automatic white balance yield value according to the red green proportionality coefficient and the bluish-green proportionality coefficient of the 3rd light source point;
The 4th determination module, be used for during less than second amount threshold, the first light source point color-ratio coefficient being defined as actual light source point color-ratio coefficient greater than first amount threshold and gray pixels number of spots greater than first luminance threshold, green pixel number of spots in the scene brightness estimated value;
Wherein, in the rgb pixel value according to described pixel, adding up when determining green pixel point and gray pixels point from described pixel obtains by described first determining unit for described green pixel number of spots and described gray pixels number of spots.
The 5th kind of possible implementation in conjunction with second aspect, the 6th kind of possible implementation, described the 4th determination module also is used for during more than or equal to second amount threshold, judging according to secondary light source point color-ratio coefficient whether current light source is fluorescent light greater than first amount threshold, gray pixels number of spots greater than first luminance threshold, green pixel number of spots when scene brightness estimated value; When definite current light source is fluorescent light, the first light source point color-ratio coefficient is defined as actual light source point color-ratio coefficient.
The 5th kind of possible implementation in conjunction with second aspect, the 7th kind of possible implementation, described the 4th determination module also is used for being not more than first luminance threshold and during less than second amount threshold, the first light source point color-ratio coefficient being defined as actual light source point color-ratio coefficient greater than first amount threshold and gray pixels number of spots more than or equal to second luminance threshold, green pixel number of spots when scene brightness estimated value.
The 5th kind of possible implementation in conjunction with second aspect, the 8th kind of possible implementation, described the 4th determination module also is used for being not more than first luminance threshold and during greater than first amount threshold, judging according to secondary light source point color-ratio coefficient whether current light source is fluorescent light more than or equal to second luminance threshold, green pixel number of spots when scene brightness estimated value; When definite 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 calculating, will be through the described first light source point color-ratio coefficient of weighted calculation and the red green proportionality coefficient in the secondary light source point color-ratio coefficient red green proportionality coefficient as the 3rd light source point, and be weighted calculating according to the bluish-green proportionality coefficient of the first light source point color-ratio coefficient and secondary light source point color-ratio coefficient, will be through the described first light source point color-ratio coefficient of weighted calculation and the bluish-green proportionality coefficient in the secondary light source point color-ratio coefficient bluish-green proportionality coefficient as the 3rd light source point, and determine actual light source point color-ratio coefficient according to the red green proportionality coefficient and the bluish-green proportionality coefficient of the 3rd light source point.
The 5th kind of possible implementation in conjunction with second aspect, the 9th kind of possible implementation, described the 4th determination module also is used for working as scene brightness estimated value less than second luminance threshold, the gray pixels number of spots is put the color-ratio coefficient with secondary light source and is defined as actual light source point color-ratio coefficient during more than or equal to second amount threshold.
The method of adjustment of a kind of white balance that the embodiment of the invention provides and device, by distinguishing green pixel point and gray pixels point with after obtaining corresponding rgb pixel value, put each self-corresponding rgb pixel value according to green pixel point and gray pixels respectively and determine possible light source point, carry out synthetic determination according to possible light source point again, to determine actual light source point color-ratio coefficient accurately, the type that can only provide current light source in the prior art is the fluorescent lamp or the technical scheme of daylight, the method that the embodiment of the invention provides can provide yield value accurately for equipment, to guarantee can both to carry out automatic white balance to each two field picture.
Description of drawings
In order to be illustrated more clearly in the embodiment of the invention or technical scheme of the prior art, to do to introduce simply to the accompanying drawing of required use in embodiment or the description of the Prior Art below, apparently, accompanying drawing in describing below only is some embodiments of the present invention, for those of ordinary skills, under the prerequisite of not paying creative work, can also obtain other accompanying drawing 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 invention;
The method of adjustment flow chart of the another kind of white balance that Fig. 2 provides for the embodiment of the invention;
The method of adjustment flow chart of the another kind of white balance that Fig. 3 provides for the embodiment of the invention;
The method of adjustment flow chart of the another kind of white balance that Fig. 4 provides for the embodiment of the invention;
The colour temperature line schematic diagram that Fig. 5 provides for the embodiment of the invention;
The schematic diagram of green object that Fig. 6 provides for the embodiment of the invention and the pixel value of grey object conversion line;
The method of adjustment flow chart of the another kind of white balance that Fig. 7 provides for the embodiment of the invention;
The method of adjustment flow chart of the another kind of white balance that Fig. 8 provides for the embodiment of the invention;
The composition frame chart of the adjusting device of a kind of white balance that Fig. 9 provides for the embodiment of the 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 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 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 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 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 invention;
The composition frame chart of a kind of electric terminal that Figure 15 provides for the embodiment of the invention.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the invention, the technical scheme in the embodiment of the invention is clearly and completely described, obviously, described embodiment only is the present invention's part embodiment, rather than whole embodiment.Based on the embodiment among the present invention, those of ordinary skills belong to the scope of protection of the invention not making the every other embodiment that is obtained under the creative work prerequisite.
The embodiment of the invention provides a kind of method of adjustment of white balance, as shown in Figure 1, comprising:
101, obtain the rgb pixel value of pixel in the input picture.
Wherein, described pixel is the pixel on the same frame input picture gathered of equipment, 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, determine green pixel point and gray pixels point.
Wherein, rgb pixel value according to described pixel, from described pixel, determine the implementation of green pixel point and according to the rgb pixel value of described pixel, the implementation of from described pixel, determining gray pixels point respectively reference as Fig. 2, method flow shown in Figure 3.
Method flow as shown in Figure 2 comprises:
A1021, calculate, obtain the red green proportionality coefficient of described pixel, bluish-green proportionality coefficient and brightness value according to the rgb pixel value of described pixel.
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, and 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 that is combined as default green object of the red green proportionality coefficient of fixation vegetarian refreshments and bluish-green proportionality coefficient and bluish-green proportionality coefficient value one, and, the brightness value of pixel then is defined as pixel the green pixel point in the luminance threshold scope time.
Concrete, in embodiments of the present invention, brightness value can be expressed as Lmin<L<Lmax in the luminance threshold scope, one in the red green proportionality coefficient that is combined as default green object of the red green proportionality coefficient of pixel and bluish-green proportionality coefficient and the whole combinations of 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 that configures, Lmin, Lmax is used to characterize the span of normal brightness, is generally positive integer, rx_c, bx_c, rad are used to be limited to the red green proportionality coefficient of the green object under the Different Light and whole combinations of bluish-green proportionality coefficient value.If this point that all is combined to form constitutes a circle, rx_c then, bx_c is central coordinate of circle, rad is a radius.
Method flow as shown in Figure 3 comprises:
B1021, calculate, obtain the red green proportionality coefficient of described pixel, bluish-green proportionality coefficient according to the rgb pixel value of described pixel.
Wherein, the computational methods of step b1021 and expression formula can be with reference to the associated description of step a1021.
B1022, be one in the red green proportionality coefficient set of default grey object when the red green proportionality coefficient of determining pixel, and the bluish-green proportionality coefficient of pixel then is defined as pixel the gray pixels point during for one in the bluish-green proportionality coefficient set of default grey object.
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 default grey object, the bluish-green proportionality coefficient of pixel is bx_gray1<bx<bx_gray2 in the bluish-green proportionality coefficient set of default grey object.Wherein, rx_gray1, rx_gray2, bx_gray1, bx_gray2 are the parameter that configures in order to the red green proportionality coefficient of expression grey object and the possible value of bluish-green proportionality coefficient.
103, calculate according to the rgb pixel value of green pixel point, obtain the first light source point color-ratio coefficient, and calculate, obtain secondary light source point color-ratio coefficient according to the rgb pixel value of gray pixels point.
Wherein, determine the first light source point color-ratio coefficient, and determine that according to the rgb pixel value of gray pixels point secondary light source point color-ratio coefficient can have Fig. 4 and method flow shown in Figure 5 to realize respectively according to the rgb pixel value of green pixel point.
Method flow as shown in Figure 4 comprises:
A1031, the red green proportionality coefficient of all green pixel points and bluish-green proportionality coefficient are carried out average respectively handle, 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, calculate, obtain red green proportionality coefficient projection value, bluish-green proportionality coefficient projection value according to red green proportionality coefficient average, bluish-green proportionality coefficient average and default green object colour temperature line.
Concrete, default green object colour temperature line is pre-set, in embodiments of the present invention, only enumerate a kind of possible establishing method at this, be included in the even brightness scene, photographic subjects is the colorchecker24 of an x-rite company colour atla, takes many images under the light source of different-colour.Get the r/g of the green object pixel in the captured image, the b/g value, and be input with r/g, b/g calculates a default green object colour temperature line, i.e. fitting a straight line among Fig. 5 for output.
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 be with reference 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 are respectively default green object colour temperature line and are being abscissa with rx, are being slope and the intercept in the direct coordinate system of ordinate with bx.
A1033, calculate, obtain the red green proportionality coefficient of first light source point according to described red green proportionality coefficient projection value and default red green proportionality coefficient mapping relations.
Concrete, in embodiments of the present invention, the red green proportionality coefficient rx_w of first light source point is k_r_line*rx_p+b_r_line.Wherein, k_r_line and b_r_line are the characteristic value of default red green proportionality coefficient mapping relations, its method to set up is for carrying out the green object rgb pixel value under Same Scene corresponding one by one with the pairing r/g value of grey object rgb pixel value, with the r/g value of green object rgb pixel value as input, the r/g value of grey object rgb pixel value is as output, the then corresponding linear feature value of fitting a straight line is k_r_line, and b_r_line can be with reference to straight line as shown in Figure 6.
A1034, calculate, obtain the bluish-green proportionality coefficient of first light source point according to described bluish-green proportionality coefficient projection value and default bluish-green proportionality coefficient mapping relations.
Concrete, in embodiments of the present invention, the bluish-green proportionality coefficient bx_w of first light source point is k_b_line*bx_p+b_b_line.Wherein, k_b_line and b_b_line are the characteristic value of default red green proportionality coefficient mapping relations, its method to set up is for carrying out the green object rgb pixel value under Same Scene corresponding one by one with the pairing b/g value of grey object rgb pixel value, with the b/g value of green object rgb pixel value as input, the b/g value of grey object rgb pixel value is as output, the then corresponding linear feature value of fitting a straight line is k_b_line, b_b_line.
A1035, according to the combination of 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, the above-mentioned Fig. 5 of reference and Fig. 6 are as can be known, and be for a pixel value, unique definite in rectangular coordinate system by its red green proportionality coefficient and bluish-green proportionality coefficient.Therefore, the first light source point color-ratio coefficient also is under the condition of pixel value, and red green proportionality coefficient of described first light source point and the bluish-green proportionality coefficient of described first light source point are made up, and can uniquely determine the first light source point color-ratio coefficient.
Method flow as shown in Figure 7 comprises:
B1031, the red green proportionality coefficient of all gray pixels points and bluish-green proportionality coefficient are carried out average respectively handle, obtain red green proportionality coefficient average and bluish-green proportionality coefficient average.
B1032, described red green proportionality coefficient average is defined as secondary light source puts red green proportionality coefficient, and described bluish-green proportionality coefficient average is defined as secondary light source puts bluish-green proportionality coefficient.
B1033, put the combination that red green proportionality coefficient and described secondary light source are put bluish-green proportionality coefficient, determine secondary light source point color-ratio coefficient according to described secondary light source.
104,, determine actual light source point color-ratio coefficient according to described first light source point color-ratio coefficient and secondary light source point color-ratio coefficient.
Concrete, in embodiments of the present invention, the specific implementation method of step 104 can be with reference 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, need to prove, the brightness value that obtains pixel according to the rgb pixel value of pixel is known, for example can adopt the formula of Y (brightness)=(0.299*R)+(0.587*G)+(0.114*B) to obtain the brightness value of pixel, and then the brightness of all pixels averaged to obtain the brightness average.The embodiment of the invention is not got rid of other modes that obtains the brightness average.
1042, brightness average, exposure yield value and the aperture time according to described pixel calculates, and obtains the scene brightness estimated value.When scene brightness estimated value greater than first luminance threshold, green pixel number of spots greater than first amount threshold and gray pixels number of spots during less than second amount threshold, execution in step 1043a then; When scene brightness estimated value greater than first luminance threshold, green pixel number of spots greater than first amount threshold, gray pixels number of spots during more than or equal to second amount threshold, execution in step 1043b then; When scene brightness estimated value be not more than first luminance threshold and more than or equal to second luminance threshold, green pixel number of spots greater than first amount threshold and gray pixels number of spots during less than second amount threshold, execution in step 1043c then; When scene brightness estimated value is not more than first luminance threshold and more than or equal to second luminance threshold, green pixel number of spots during greater than first amount threshold, execution in step 1043d then; When scene brightness estimated value less than second luminance threshold, the gray pixels number of spots is during more than or equal to second amount threshold, then execution in step 1043e.
Wherein, in the present embodiment, described green pixel number of spots and described gray pixels number of spots are the rgb pixel value of execution in step 102 according to described pixel, and adding up when determining green pixel point and gray pixels point from described pixel obtains.
Concrete, in embodiments of the present invention, scene brightness estimated value I=L_avg/ (gain*shutter), gain wherein, shutter is respectively exposure gain and shutter time value.Under preferred condition, require exposure accurately necessary, to guarantee the accurate of exposure gain and aperture time.
In the present embodiment, need to prove, the luminous intensity of the shooting environmental of scene brightness and this image is closely related, in identical luminous flux and identical time, light intensity is strong more, represent that then the light energy that comprises in the light is just big more, the light energy that arrives on the photo-sensitive cell is also just big more, and consequent image is just bright more; Light intensity is weak more, represents that then the light energy that comprises in the light is just more little, and the light energy that arrives on the photo-sensitive cell is also just more little, and consequent image is just dark more.
In the present embodiment, need to prove that aperture time is meant that shutter opens the time of imager chip sensitization.Under identical scene light intensity and identical luminous flux (also being identical f-number), aperture time is big more, and then image is just bright more; Aperture time is more little, and then image is just dark more.Therefore, in order to obtain a suitable image brightness, imaging system need be provided with a suitable aperture time.
In the present embodiment, need explanation to be, the exposure gain is meant that the analog picture signal by sensitive chip output is reaching the amplifier gain that ADC gathers this section signal of telecommunication between the conversion.The exposure gain is big more, and then image is just bright more, and signal gain is more little, and then image is just dark more.
In the present embodiment, need to prove, actual light source point color-ratio coefficient is the color-ratio coefficient with reference to white point (white point), this often is known as reference white color (reference white) or target white (target white) with reference to white point in technical documentation, be used to catch, encode at image and definition white when reproducing.The numerical value of white point is not constant, need make corresponding change to its numerical value according to the difference of use occasion.For example incandescent lamp commonly used throws light on when pickup, and the relative daylight of light colour temperature of incandescent lamp is lower, thereby presents the color of inclined to one side orange.If still use the white point numerical value that is as the criterion with daylight to define white in this case, the problem of colour cast will appear in the result of photography.
In the present embodiment, need to prove, utilize colour temperature to judge that light source is known.For example the colour temperature of light source commonly used is: standard candle is 1930K (kelvin degree unit); Tungsten lamp is 2760-2900K; Fluorescent lamp is 3000K; Photoflash lamp is 3800K; Noon, sunlight was 5600K; Flash tube 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 according to secondary light source point color-ratio coefficient whether current light source is fluorescent light; When definite 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 according to secondary light source point color-ratio coefficient whether current light source is fluorescent light; When definite 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 calculating, will be through the described first light source point color-ratio coefficient of weighted calculation and the red green proportionality coefficient in the secondary light source point color-ratio coefficient red green proportionality coefficient as the 3rd light source point, and be weighted calculating according to the bluish-green proportionality coefficient of the first light source point color-ratio coefficient and secondary light source point color-ratio coefficient, will be through the described first light source point color-ratio coefficient of weighted calculation and the bluish-green proportionality coefficient in the secondary light source point color-ratio coefficient bluish-green proportionality coefficient as the 3rd light source point, and determine actual light source point color-ratio coefficient according to the red green proportionality coefficient and the bluish-green proportionality coefficient of the 3rd light source point.
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 first luminance threshold, is used to be characterized in outdoor brightness under the solar radiation, and I_in is second luminance threshold, is used to be characterized in room brilliancy under the solar radiation.The weight of using during weighted calculation is w1=I-I_in, w2=I_out-I.
1043e, secondary light source is put the color-ratio coefficient be defined as actual light source point color-ratio coefficient.
What deserves to be explained is, all use identical parameter setting at above-mentioned steps 1043a in 1043e, that is to say, first luminance threshold, second luminance threshold, first amount threshold, second amount threshold are unified to be provided with.
105, determine current Automatic white balance yield value according to described actual light source point color-ratio coefficient.
Further, calculating the specific implementation of current Automatic white balance yield value according to the red green proportionality coefficient of the 3rd light source point and bluish-green proportionality coefficient can be with reference to formula once:
R_gain=1/rx_final,G_gain=1,B_gain=1/bx_final。
106, use described current white balance gains value to carry out the white balance adjustment.
The method of adjustment of a kind of white balance that the embodiment of the invention provides, by distinguishing green pixel point and gray pixels point with after obtaining corresponding rgb pixel value, put each self-corresponding rgb pixel value according to green pixel point and gray pixels respectively and determine possible light source point, carry out synthetic determination according to possible light source point again, to determine actual light source point color-ratio coefficient accurately, the type that can only provide current light source in the prior art is the fluorescent lamp or the technical scheme of daylight, the method that the embodiment of the invention provides can provide yield value accurately for equipment, to guarantee can both to carry out automatic white balance to each two field picture.
The embodiment of the invention provides a kind of adjusting device of white balance, can be used for realizing all method flows as Fig. 1 to Fig. 8, and as shown in Figure 9, this device comprises:
Acquiring unit 21 is used to obtain the rgb pixel value of described pixel, and described rgb pixel value is a rgb format.
First determining unit 22 is used for the rgb pixel value according to described pixel, determines green pixel point and gray pixels point from described pixel.
Second determining unit 23 is used for determining the first light source point color-ratio coefficient according to the rgb pixel value of green pixel point, and determines secondary light source point color-ratio coefficient according to the rgb pixel value of gray pixels point.
The 3rd determining unit 24 is used for determining actual light source point color-ratio coefficient according to described first light source point color-ratio coefficient and secondary light source point color-ratio coefficient.
The 4th determining unit 25 is used for determining current Automatic white balance yield value according to described actual light source point color-ratio coefficient.
Adjustment unit 26 is used for carrying out the white balance 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 is used for calculating according to the rgb pixel value of described pixel, obtains the red green proportionality coefficient of described pixel, bluish-green proportionality coefficient and brightness value.
First determination module 222, be used for one in whole combinations of the red green proportionality coefficient that is combined as default green object of the red green proportionality coefficient of pixel and bluish-green proportionality coefficient and bluish-green proportionality coefficient value, and, the brightness value of pixel is defined as the green pixel point with pixel in the luminance threshold scope.
Optionally, as shown in figure 11, described first determining unit 22 comprises:
Second computing module 223 is used for calculating according to the rgb pixel value of described pixel, obtains the red green proportionality coefficient of described pixel, bluish-green proportionality coefficient.
Second determination module 224, be used for as the red green proportionality coefficient of determining pixel one for the red green proportionality coefficient set of default grey object, and the bluish-green proportionality coefficient of pixel then is defined as pixel the gray pixels point during for one in the bluish-green proportionality coefficient set of default grey object.
Optionally, as shown in figure 12, described second determining unit 23 comprises:
The first average processing module 231 is used for the red green proportionality coefficient and the bluish-green proportionality coefficient of all green pixel points are carried out the average processing respectively, obtains red green proportionality coefficient average and bluish-green proportionality coefficient average.
The 3rd computing module 232 is used 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 be used 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 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 first light source point.
First composite module 233 is used for the combination according to 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:
The second average processing module 234 is used for the red green proportionality coefficient and the bluish-green proportionality coefficient of all gray pixels points are carried out the average processing respectively, obtains red green proportionality coefficient average and bluish-green proportionality coefficient average.
The 3rd determination module 235 is used for that described red green proportionality coefficient average is defined as secondary light source and puts red green proportionality coefficient, and described bluish-green proportionality coefficient average is defined as secondary light source puts bluish-green proportionality coefficient.
Second composite module 236 is used for putting the combination that red green proportionality coefficient and described secondary light source are put bluish-green proportionality coefficient according to described secondary light source, determines secondary light source point color-ratio coefficient.
Optionally, as shown in figure 14, described the 3rd determining unit 24 comprises:
The 4th computing module 241 is used for calculating according to the rgb pixel value of described pixel, obtains the brightness average of described pixel; And the brightness average, exposure yield value and the aperture time that are used for according to described pixel calculate, and obtains the scene brightness estimated value.
The 4th determination module 242, be used for during less than second amount threshold, the first light source point color-ratio coefficient being defined as actual light source point color-ratio coefficient greater than first amount threshold and gray pixels number of spots greater than first luminance threshold, green pixel number of spots in the scene brightness estimated value; And be used for during more than or equal to second amount threshold, judging according to secondary light source point color-ratio coefficient whether current light source is fluorescent light greater than first amount threshold, gray pixels number of spots greater than first luminance threshold, green pixel number of spots in the scene brightness estimated value; When definite 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 be used for being not more than first luminance threshold and during less than second amount threshold, the first light source point color-ratio coefficient being defined as actual light source point color-ratio coefficient greater than first amount threshold and gray pixels number of spots more than or equal to second luminance threshold, green pixel number of spots in the scene brightness estimated value; And be used for being not more than first luminance threshold and during greater than first amount threshold, judging according to secondary light source point color-ratio coefficient whether current light source is fluorescent light more than or equal to second luminance threshold, green pixel number of spots in the scene brightness estimated value; When definite current light source is fluorescent light, be weighted calculating according to the red green proportionality coefficient of the first light source point color-ratio coefficient and secondary light source point color-ratio coefficient, obtain the red green proportionality coefficient of the 3rd light source point; And be used in the scene brightness estimated value less than second luminance threshold, the gray pixels number of spots is put the color-ratio coefficient with secondary light source and is defined as actual light source point color-ratio coefficient during more than or equal to second amount threshold.
Wherein, in the rgb pixel value according to described pixel, adding up when determining green pixel point and gray pixels point from described pixel obtains by described first determining unit 22 for described green pixel number of spots and described gray pixels number of spots.
The adjusting device of a kind of white balance that the embodiment of the invention provides, by distinguishing green pixel point and gray pixels point with after obtaining corresponding rgb pixel value, put each self-corresponding rgb pixel value according to green pixel point and gray pixels respectively and determine possible light source point, carry out synthetic determination according to possible light source point again, to determine actual light source point color-ratio coefficient accurately, the type that can only provide current light source in the prior art is the fluorescent lamp or the technical scheme of daylight, the method that the embodiment of the invention provides can provide yield value accurately for equipment, to guarantee can both to carry out automatic white balance to each two field picture.
The embodiment of the invention also 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 is used to call the code of memory 32 stored, in order to realize as Fig. 1 to all method flows shown in Figure 6.And, pass through bus communication between described central processing unit 31 and the memory 32.
Wherein, described central processing unit 31 is used for obtaining the rgb pixel value of input picture pixel, and described rgb pixel value is a 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 is calculated, 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; Determine current Automatic white balance yield value according to described actual light source point color-ratio coefficient; Use described current white balance gains value to carry out the white balance adjustment.
Described memory 32 is used to store rgb pixel value, the first light source point color-ratio coefficient, secondary light source point color-ratio coefficient, the Automatic white balance yield value of described pixel.
Further, described central processing unit 31 is used for calculating according to the rgb pixel value of described pixel, obtains the red green proportionality coefficient of described pixel, bluish-green proportionality coefficient and brightness value; In whole combinations of the red green proportionality coefficient that is combined as default green object of the red green proportionality coefficient of pixel and bluish-green proportionality coefficient and bluish-green proportionality coefficient value one, and, the brightness value of pixel then is defined as pixel the green pixel point in the luminance threshold scope time.
Described memory 32 also is used to store the red green proportionality coefficient of described pixel, bluish-green proportionality coefficient and brightness value.
Further, described central processing unit 31 is used for calculating according to the rgb pixel value of described pixel, obtains the red green proportionality coefficient of described pixel, bluish-green proportionality coefficient; When the red green proportionality coefficient of determining pixel is one in the red green proportionality coefficient set of default grey object, and the bluish-green proportionality coefficient of pixel then is defined as pixel the gray pixels point during for one in the bluish-green proportionality coefficient set of default grey object.
Further, described central processing unit 31 is used for the red green proportionality coefficient of all green pixel points and bluish-green proportionality coefficient are carried out the average processing respectively, 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 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 first light source point; According to the combination of 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 is used to store 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 is used for the red green proportionality coefficient of all gray pixels points and bluish-green proportionality coefficient are carried out the average processing respectively, obtains red green proportionality coefficient average and bluish-green proportionality coefficient average; Described red green proportionality coefficient average is defined as secondary light source puts red green proportionality coefficient, and described bluish-green proportionality coefficient average is defined as secondary light source puts bluish-green proportionality coefficient; Put the combination that red green proportionality coefficient and described secondary light source are put bluish-green proportionality coefficient according to described secondary light source, determine secondary light source point color-ratio coefficient.
Further, described central processing unit 31 is used for calculating according to the rgb pixel value of described pixel, obtains the brightness average of described pixel; Brightness average, exposure yield value and aperture time according to described pixel calculate, and obtain the scene brightness estimated value; When scene brightness estimated value greater than first luminance threshold, green pixel number of spots greater than first amount threshold and gray pixels number of spots during less than second amount threshold, the first light source point color-ratio coefficient is defined as actual light source point color-ratio coefficient, and calculates current Automatic white balance yield value according to the red green proportionality coefficient and the bluish-green proportionality coefficient of the 3rd light source point; When scene brightness estimated value during more than or equal to second amount threshold, judges according to secondary light source point color-ratio coefficient whether current light source is fluorescent light greater than first amount threshold, gray pixels number of spots greater than first luminance threshold, green pixel number of spots; When definite 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 Automatic white balance yield value according to the red green proportionality coefficient and the bluish-green proportionality coefficient of the 3rd light source point; When scene brightness estimated value be not more than first luminance threshold and more than or equal to second luminance threshold, green pixel number of spots greater than first amount threshold and gray pixels number of spots during less than second amount threshold, the first light source point color-ratio coefficient is defined as actual light source point color-ratio coefficient, and calculates current Automatic white balance yield value according to the red green proportionality coefficient and the bluish-green proportionality coefficient of the 3rd light source point; When scene brightness estimated value is not more than first luminance threshold and during greater than first amount threshold, judges according to secondary light source point color-ratio coefficient whether current light source is fluorescent light more than or equal to second luminance threshold, green pixel number of spots; When definite 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 calculating, will be through the described first light source point color-ratio coefficient of weighted calculation and the red green proportionality coefficient in the secondary light source point color-ratio coefficient red green proportionality coefficient as the 3rd light source point, and be weighted calculating according to the bluish-green proportionality coefficient of the first light source point color-ratio coefficient and secondary light source point color-ratio coefficient, will be through the described first light source point color-ratio coefficient of weighted calculation and the bluish-green proportionality coefficient in the secondary light source point color-ratio coefficient bluish-green proportionality coefficient as the 3rd light source point, calculate current Automatic white balance yield value according to the red green proportionality coefficient and the bluish-green proportionality coefficient of the 3rd light source point; When scene brightness estimated value less than second luminance threshold, the gray pixels number of spots is during more than or equal to second amount threshold, secondary light source is put the color-ratio coefficient be defined as actual light source point color-ratio coefficient, and calculate current Automatic white balance yield value according to the red green proportionality coefficient and the bluish-green proportionality coefficient of the 3rd light source point.
Wherein, described green pixel number of spots and gray pixels number of spots are the rgb pixel values of described central processing unit 31 execution in step according to described pixel, and adding up when determining green pixel point and gray pixels point from described pixel obtains.
Described memory 32 also is used to store brightness average, exposure yield value, aperture time, scene brightness estimated value, first luminance threshold, second luminance threshold, first amount threshold, second amount threshold of described pixel.
A kind of electric terminal that the embodiment of the invention provides, by distinguishing green pixel point and gray pixels point with after obtaining corresponding rgb pixel value, put each self-corresponding rgb pixel value according to green pixel point and gray pixels respectively and determine possible light source point, carry out synthetic determination according to possible light source point again, to determine actual light source point color-ratio coefficient accurately, the type that can only provide current light source in the prior art is the fluorescent lamp or the technical scheme of daylight, the method that the embodiment of the invention provides can provide yield value accurately for equipment, to guarantee can both to carry out automatic white balance to each two field picture.
The present invention is contained method and apparatus as herein described and for example can be implemented in (but being not limited to) following various electronic installations with image, video processing function or with it and be associated: mobile phone, wireless device, personal digital assistant (PDA), hand-hold type or portable computer, white balance detection and adjusting device, camera, video camera, televimonitor, flat-panel monitor, computer monitor, electronic photo etc.Device as herein described can be configured to from as non-display unit but be independent display unit output shows signal, also can be configured to and the combining of display unit.
Through the above description of the embodiments, the those skilled in the art can be well understood to the present invention and can realize by the mode that software adds essential common hardware, can certainly pass through hardware, but the former is better execution mode under a lot of situation.Based on such understanding, the part that technical scheme of the present invention contributes to prior art in essence in other words can embody with the form of software product, this computer software product is stored in the storage medium that can read, floppy disk as computer, hard disk or CD etc., comprise some instructions with so that computer equipment (can be personal computer, server, the perhaps network equipment etc.) carry out the described method of each embodiment of the present invention.
The above; only be the specific embodiment of the present invention, but protection scope of the present invention is not limited thereto, anyly is familiar with those skilled in the art in the technical scope that the present invention discloses; can expect easily changing or replacing, 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 range of described claim.

Claims (20)

1. the method for adjustment of a white balance is characterized in that, comprising:
Obtain the rgb pixel value of pixel in the input picture;
According to the rgb pixel value of described pixel, from described pixel, determine green pixel point and gray pixels point;
Determine the first light source point color-ratio coefficient according to the rgb pixel value of green pixel point, and determine secondary light source point color-ratio coefficient according to the rgb pixel value of gray pixels point;
Determine actual 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 current white balance gains value according to described actual light source point color-ratio coefficient;
Use described current white balance gains value to carry out the white balance adjustment.
2. method according to claim 1 is characterized in that, described rgb pixel value according to pixel in the described input picture determines that from described pixel the green pixel point comprises:
Rgb pixel value according to described pixel is calculated, and obtains the red green proportionality coefficient of described pixel, bluish-green proportionality coefficient and brightness value;
In whole combinations of the red green proportionality coefficient that is combined as default green object of the red green proportionality coefficient of determining described pixel and bluish-green proportionality coefficient and bluish-green proportionality coefficient value one, and, the brightness value of described pixel then is defined as described pixel the green pixel point in the luminance threshold scope time.
3. method according to claim 1 is characterized in that, described rgb pixel value according to described pixel determines that from described pixel the gray pixels point comprises:
Rgb pixel value according to described pixel is calculated, and obtains the red green proportionality coefficient of described pixel, bluish-green proportionality coefficient;
When the red green proportionality coefficient of determining described pixel is one in the red green proportionality coefficient set of default grey object, and the bluish-green proportionality coefficient of described pixel then is defined as described pixel the gray pixels point during for one in the bluish-green proportionality coefficient set of default grey object.
4. method according to claim 2 is characterized in that, described rgb pixel value according to green pixel point determines that the first light source point color-ratio coefficient comprises:
Red green proportionality coefficient and bluish-green proportionality coefficient to all green pixel points carry out the average processing respectively, obtain 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 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 first light source point;
According to the combination of 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, described rgb pixel value according to gray pixels point determines that secondary light source point color-ratio coefficient comprises:
Red green proportionality coefficient and bluish-green proportionality coefficient to all gray pixels points carry out the average processing respectively, obtain red green proportionality coefficient average and bluish-green proportionality coefficient average;
Described red green proportionality coefficient average is defined as secondary light source puts red green proportionality coefficient, and described bluish-green proportionality coefficient average is defined as secondary light source puts bluish-green proportionality coefficient;
Put the combination that red green proportionality coefficient and described secondary light source are put bluish-green proportionality coefficient according to described secondary light source, determine secondary light source point color-ratio coefficient.
6. according to any described method of claim 1-5, it is characterized in that, describedly determine that 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 comprises:
Rgb pixel value according to described pixel is calculated, and obtains the brightness average of described pixel;
Brightness average, exposure yield value and aperture time according to described pixel calculate, and obtain the scene brightness estimated value;
When scene brightness estimated value during less than second amount threshold, is defined as actual light source point color-ratio coefficient with the first light source point color-ratio coefficient greater than first amount threshold and gray pixels number of spots greater than first luminance threshold, green pixel number of spots;
Wherein, described green pixel number of spots and gray pixels number of spots are the rgb pixel value of execution in step according to described pixel, and adding up when determining green pixel point and gray pixels point from described pixel obtains.
7. method according to claim 6 is characterized in that, describedly determines that 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 also comprises:
When scene brightness estimated value during more than or equal to second amount threshold, judges according to secondary light source point color-ratio coefficient whether current light source is fluorescent light greater than first amount threshold, gray pixels number of spots greater than first luminance threshold, green pixel number of spots; When definite 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 determines that 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 also comprises:
When scene brightness estimated value is not more than first luminance threshold and during less than second amount threshold, the first light source point color-ratio coefficient is defined as actual light source point color-ratio coefficient greater than first amount threshold and gray pixels number of spots more than or equal to second luminance threshold, green pixel number of spots.
9. method according to claim 6 is characterized in that, describedly determines that 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 also comprises:
When scene brightness estimated value is not more than first luminance threshold and during greater than first amount threshold, judges according to secondary light source point color-ratio coefficient whether current light source is fluorescent light more than or equal to second luminance threshold, green pixel number of spots; When definite current light source is fluorescent light, be weighted calculating according to the red green proportionality coefficient in the first light source point color-ratio coefficient and the secondary light source point color-ratio coefficient, will be through the described first light source point color-ratio coefficient of weighted calculation and the red green proportionality coefficient in the secondary light source point color-ratio coefficient red green proportionality coefficient as the 3rd light source point, and be weighted calculating according to the bluish-green proportionality coefficient in the first light source point color-ratio coefficient and the secondary light source point color-ratio coefficient, will be through the described first light source point color-ratio coefficient of weighted calculation and the bluish-green proportionality coefficient in the secondary light source point color-ratio coefficient bluish-green proportionality coefficient as the 3rd light source point, and determine actual light source point color-ratio coefficient according to the red green proportionality coefficient and the bluish-green proportionality coefficient of the 3rd light source point.
10. method according to claim 6 is characterized in that, describedly determines that 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 also comprises:
When scene brightness estimated value less than second luminance threshold, the gray pixels number of spots is put the color-ratio coefficient with secondary light source and is defined as actual light source point color-ratio coefficient when the gray pixels number of spots is more than or equal to second amount threshold during more than or equal to second amount threshold.
11. the adjusting device of a white balance is characterized in that, comprising:
Acquiring unit is used for obtaining the rgb pixel value of input picture pixel;
First determining unit is used for the rgb pixel value according to described pixel, determines green pixel point and gray pixels point from described pixel;
Second determining unit is used for determining the first light source point color-ratio coefficient according to the rgb pixel value of green pixel point, and determines secondary light source point color-ratio coefficient according to the rgb pixel value of gray pixels point;
The 3rd determining unit is used for determining actual light source point color-ratio coefficient according to described first light source point color-ratio coefficient and secondary light source point color-ratio coefficient;
The 4th determining unit is used for determining current Automatic white balance yield value according to described actual light source point color-ratio coefficient;
Adjustment unit is used for carrying out the white balance adjustment according to described current white balance gains value.
12. device according to claim 11 is characterized in that, described first determining unit comprises:
First computing module is used for calculating according to the rgb pixel value of described pixel, obtains the red green proportionality coefficient of described pixel, bluish-green proportionality coefficient and brightness value;
First determination module, be used for one in whole combinations of the red green proportionality coefficient that is combined as default green object of the red green proportionality coefficient of pixel and bluish-green proportionality coefficient and bluish-green proportionality coefficient value, and, the brightness value of pixel is defined as the green pixel point with pixel in the luminance threshold scope time.
13. device according to claim 11 is characterized in that, described first determining unit comprises:
Second computing module is used for calculating according to the rgb pixel value of described pixel, obtains the red green proportionality coefficient of described pixel, bluish-green proportionality coefficient;
Second determination module, be used for as the red green proportionality coefficient of determining pixel one for the red green proportionality coefficient set of default grey object, and the bluish-green proportionality coefficient of pixel then is defined as pixel the gray pixels point during for one in the bluish-green proportionality coefficient set of default grey object.
14. device according to claim 12 is characterized in that, described second determining unit comprises:
The first average processing module is used for the red green proportionality coefficient and the bluish-green proportionality coefficient of all green pixel points are carried out the average processing respectively, obtains red green proportionality coefficient average and bluish-green proportionality coefficient average;
The 3rd computing module is used 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 be used 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 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 first light source point;
First composite module is used for the combination according to 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. device according to claim 13 is characterized in that, described second determining unit comprises:
The second average processing module is used for the red green proportionality coefficient and the bluish-green proportionality coefficient of all gray pixels points are carried out the average processing respectively, obtains red green proportionality coefficient average and bluish-green proportionality coefficient average;
The 3rd determination module is used for that described red green proportionality coefficient average is defined as secondary light source and puts red green proportionality coefficient, and described bluish-green proportionality coefficient average is defined as secondary light source puts bluish-green proportionality coefficient;
Second composite module is used for putting the combination that red green proportionality coefficient and described secondary light source are put bluish-green proportionality coefficient according to described secondary light source, determines secondary light source point color-ratio coefficient.
16., it is characterized in that described the 3rd determining unit comprises according to any described device of claim 11-15:
The 4th computing module is used for calculating according to the rgb pixel value of described pixel, obtains the brightness average of described pixel; And the brightness average, exposure yield value and the aperture time that are used for according to described pixel calculate, and obtains the scene brightness estimated value;
The 4th determination module, be used for during less than second amount threshold, the first light source point color-ratio coefficient being defined as actual light source point color-ratio coefficient greater than first amount threshold and gray pixels number of spots greater than first luminance threshold, green pixel number of spots in the scene brightness estimated value;
Wherein, in the rgb pixel value according to described pixel, adding up when determining green pixel point and gray pixels point from described pixel obtains by described first determining unit for described green pixel number of spots and described gray pixels number of spots.
17. device according to claim 16, it is characterized in that, described the 4th determination module also is used for during more than or equal to second amount threshold, judging according to secondary light source point color-ratio coefficient whether current light source is fluorescent light greater than first amount threshold, gray pixels number of spots greater than first luminance threshold, green pixel number of spots when scene brightness estimated value; When definite 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. device according to claim 16, it is characterized in that, described the 4th determination module also is used for being not more than first luminance threshold and during less than second amount threshold, the first light source point color-ratio coefficient being defined as actual light source point color-ratio coefficient greater than first amount threshold and gray pixels number of spots more than or equal to second luminance threshold, green pixel number of spots when scene brightness estimated value.
19. device according to claim 16, it is characterized in that, described the 4th determination module also is used for being not more than first luminance threshold and during greater than first amount threshold, judging according to secondary light source point color-ratio coefficient whether current light source is fluorescent light more than or equal to second luminance threshold, green pixel number of spots when scene brightness estimated value; When definite 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 calculating, will be through the described first light source point color-ratio coefficient of weighted calculation and the red green proportionality coefficient in the secondary light source point color-ratio coefficient red green proportionality coefficient as the 3rd light source point, and be weighted calculating according to the bluish-green proportionality coefficient in the first light source point color-ratio coefficient and the secondary light source point color-ratio coefficient, will be through the described first light source point color-ratio coefficient of weighted calculation and the bluish-green proportionality coefficient in the secondary light source point color-ratio coefficient bluish-green proportionality coefficient as the 3rd light source point, and determine actual light source point color-ratio coefficient according to the red green proportionality coefficient and the bluish-green proportionality coefficient of the 3rd light source point.
20. device according to claim 16, it is characterized in that, described the 4th determination module also is used for working as scene brightness estimated value less than second luminance threshold, the gray pixels number of spots is put the color-ratio coefficient with secondary light source and is defined as actual light source point color-ratio coefficient during more than or equal to second amount threshold.
CN201310109918.5A 2013-03-29 2013-03-29 White balance adjusting method and device Active CN103227928B (en)

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 true CN103227928A (en) 2013-07-31
CN103227928B 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)

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103546732A (en) * 2013-10-18 2014-01-29 广州市浩云安防科技股份有限公司 Image processing method and system
CN104954772A (en) * 2015-06-26 2015-09-30 济南中维世纪科技有限公司 Image adjacent-grey pixel selection algorithm applied to automatic white balance algorithm
CN105100764A (en) * 2015-06-26 2015-11-25 小米科技有限责任公司 Photographing method and device
CN105635593A (en) * 2014-10-13 2016-06-01 广达电脑股份有限公司 Multiple exposure imaging system and white balance method thereof
CN105872510A (en) * 2016-04-25 2016-08-17 浙江大华技术股份有限公司 Image white balance processing method and device
CN105898263A (en) * 2016-05-24 2016-08-24 厦门美图之家科技有限公司 Method and device for white balance of image and computing device
CN107564047A (en) * 2017-09-12 2018-01-09 北京小米移动软件有限公司 Image processing method and device, electronic equipment and computer-readable recording medium
CN107801012A (en) * 2017-10-30 2018-03-13 广东欧珀移动通信有限公司 White balancing treatment method and device, electronic installation and computer-readable recording medium
CN109215612A (en) * 2017-06-30 2019-01-15 北京小米移动软件有限公司 Adjusting method and device that screen is shown, electronic equipment, storage medium
US10805588B2 (en) 2016-04-25 2020-10-13 Zhejiang Dahua Technology Co., Ltd. Methods, systems, and media for image white balance adjustment
CN111955004A (en) * 2018-06-18 2020-11-17 Jvc建伍株式会社 Color correction device

Citations (5)

* Cited by examiner, † Cited by third party
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

Patent Citations (5)

* Cited by examiner, † Cited by third party
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

Cited By (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103546732B (en) * 2013-10-18 2016-05-18 广州市浩云安防科技股份有限公司 Image processing method and system
CN103546732A (en) * 2013-10-18 2014-01-29 广州市浩云安防科技股份有限公司 Image processing method and system
CN105635593A (en) * 2014-10-13 2016-06-01 广达电脑股份有限公司 Multiple exposure imaging system and white balance method thereof
CN105635593B (en) * 2014-10-13 2018-09-11 广达电脑股份有限公司 Multiple exposure imaging system and white balance method thereof
CN104954772A (en) * 2015-06-26 2015-09-30 济南中维世纪科技有限公司 Image adjacent-grey pixel selection algorithm applied to automatic white balance algorithm
CN105100764A (en) * 2015-06-26 2015-11-25 小米科技有限责任公司 Photographing method and device
US10805588B2 (en) 2016-04-25 2020-10-13 Zhejiang Dahua Technology Co., Ltd. Methods, systems, and media for image white balance adjustment
CN105872510A (en) * 2016-04-25 2016-08-17 浙江大华技术股份有限公司 Image white balance processing method and device
US11363244B2 (en) 2016-04-25 2022-06-14 Zhejiang Dahua Technology Co., Ltd. Methods, systems, and media for image white balance adjustment
CN105898263A (en) * 2016-05-24 2016-08-24 厦门美图之家科技有限公司 Method and device for white balance of image and computing device
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
CN107564047A (en) * 2017-09-12 2018-01-09 北京小米移动软件有限公司 Image processing method and device, electronic equipment and computer-readable recording medium
CN107564047B (en) * 2017-09-12 2020-10-20 北京小米移动软件有限公司 Image processing method and device, electronic equipment and computer readable storage medium
US10674128B2 (en) 2017-10-30 2020-06-02 Guangdong Oppo Mobile Telecommunications Corp., Ltd. White balance processing method, electronic device and computer readable storage medium
US10616544B2 (en) 2017-10-30 2020-04-07 Guangdong Oppo Mobile Telecommunications Corp., Ltd. White balance processing method, electronic device and computer readable storage medium
CN107801012A (en) * 2017-10-30 2018-03-13 广东欧珀移动通信有限公司 White balancing treatment method and device, electronic installation and computer-readable recording medium
CN111955004A (en) * 2018-06-18 2020-11-17 Jvc建伍株式会社 Color correction device

Also Published As

Publication number Publication date
CN103227928B (en) 2015-04-29

Similar Documents

Publication Publication Date Title
CN103227928B (en) White balance adjusting method and device
JP6258555B2 (en) Multi LED camera flash for color temperature adjustment
CN109151426B (en) White balance adjusting method and device, camera and medium
JP5497151B2 (en) Automatic backlight detection
CN108174172B (en) Image pickup method and device, computer readable storage medium and computer equipment
CN106101549B (en) Automatic switching method, apparatus and system round the clock
CN110572637B (en) Image anomaly detection method, terminal device and storage medium
KR100478064B1 (en) Illumination light color estimating method of obtaining white balance and image sensing apparatus
US8810681B2 (en) Image processing apparatus and image processing method
CN110213502A (en) Image processing method, device, storage medium and electronic equipment
CN105578062A (en) Light metering mode selection method and image acquisition device utilizing same
CN113676715B (en) Image processing method and device
CN102238394A (en) Image processing apparatus, control method thereof, and image-capturing apparatus
US20200029016A1 (en) Moving object monitoring device and moving object monitoring system
JP2013128259A (en) Imaging apparatus, image processing apparatus, image processing program, and image processing method
US9854218B2 (en) Electronic system and image processing method
CN111918047A (en) Photographing control method and device, storage medium and electronic equipment
CN116506737A (en) Method, device, equipment and storage medium for determining exposure parameters
US20130266220A1 (en) Color signal processing circuit, color signal processing method, color reproduction evaluating method, imaging apparatus, electronic apparatus and testing device
KR100691250B1 (en) Apparatus and method for auto white balancing in portable terminal
JP3466167B2 (en) Light source color estimation method for white balance and imaging apparatus using the estimation method
CN114125311A (en) Automatic switching method and device for wide dynamic mode
CN111510636A (en) Method and device for acquiring brightness evaluation value and computer storage medium
CN108053384B (en) Lens shadow calibration method, user terminal and related medium product
CN115190282B (en) Method for avoiding white balance distortion of camera module under high color temperature

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