CN100551081C - A kind of method and device of realizing white balance correction - Google Patents

A kind of method and device of realizing white balance correction Download PDF

Info

Publication number
CN100551081C
CN100551081C CNB2007100986345A CN200710098634A CN100551081C CN 100551081 C CN100551081 C CN 100551081C CN B2007100986345 A CNB2007100986345 A CN B2007100986345A CN 200710098634 A CN200710098634 A CN 200710098634A CN 100551081 C CN100551081 C CN 100551081C
Authority
CN
China
Prior art keywords
light source
chromatic value
picture element
value
distributed areas
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CNB2007100986345A
Other languages
Chinese (zh)
Other versions
CN101039439A (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.)
Beijing Vimicro Ai Chip Technology Co Ltd
Original Assignee
Vimicro Corp
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 Vimicro Corp filed Critical Vimicro Corp
Priority to CNB2007100986345A priority Critical patent/CN100551081C/en
Publication of CN101039439A publication Critical patent/CN101039439A/en
Application granted granted Critical
Publication of CN100551081C publication Critical patent/CN100551081C/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 discloses a kind of method that realizes white balance correction, this method comprises: gather the color image that each light source irradiation produces when each color material, determine the chromatic value distributed areas of described picture element according to the chromatic value of picture element in the described color image; Determine the chromatic value of picture element in the pending image; Determine picture element number in the described pending image of the chromatic value correspondence in the chromatic value distributed areas of same light source, determine current light source according to described number; Parameter according to described current light source is carried out white balance correction.By the present invention, avoided makeing mistakes owing to ignoring the Automatic white balance that the influence of light source to correction parameter cause, make image fault few, quality is better, and it is better that the user experiences.The present invention also provides a kind of device of realizing white balance correction.

Description

A kind of method and device of realizing white balance correction
Technical field
The present invention relates to image processing techniques, relate in particular to a kind of method and device of realizing white balance correction.
Background technology
Video camera apparatus such as Digital Video and digital camera generally comprises optical lens, imageing sensor, picture processing chip, image transmission module and image display.In fact, a kind of color can present different colors under the irradiation of Different Light, and for example, grey can present yellow under the incandescent lamp irradiation, and can present cyan under the cold light irradiation.Human eye has self-regulating function, even under different light sources, also can distinguish grey and color body, but, color relation that this grey object is exported after through optical lens and imageing sensor is grey not necessarily, experiment shows that the original image of exporting presents significantly orange after grey object under the A rayed is by imageing sensor.Therefore, must handle the color of original image of input, make it to present normal grey under different light source irradiation, at present, more general bearing calibration is a white balance correction.
In the method for existing realization white balance correction, the influence of parameter when not considering light source to white balance correction.When the image of catching when camera is the less monochromatic object of saturation, as the broca scale picture, during then by white balance algorithm, this class color can be considered as grey, be about to the colour of skin and be considered as grey, make Automatic white balance proofread and correct and make mistakes the image fault that the user views at last, picture quality is relatively poor, and user experience is relatively poor.
Summary of the invention
The invention provides a kind of method and device of realizing white balance correction, to solve in the prior art owing to the influence of not considering light source exists image fault, the relatively poor problem of picture quality.
The invention provides a kind of method that realizes white balance correction, this method comprises:
Gather the color image that each light source irradiation produces when each color material, determine the chromatic value distributed areas of described picture element according to the chromatic value of picture element in the described color image;
Determine the chromatic value of picture element in the pending image;
Determine picture element number in the described pending image of the chromatic value correspondence in the chromatic value distributed areas of same light source, determine current light source according to described number;
Parameter according to described current light source is carried out white balance correction.
Described chromatic value according to picture element in the described color image determines that the chromatic value distributed areas of described picture element comprise:
Statistics is determined the histogram of the chromatic value of picture element in the described color image;
As described chromatic value distributed areas, the scope that maybe will comprise picture element chromatic value mean value in this histogram is as described chromatic value distributed areas with picture element chromatic value distribution in this histogram.
Described picture element chromatic value distribution in this histogram is comprised as described chromatic value distributed areas:
To comprise picture element chromatic value in the described color image, and the rectangular area of area minimum is as described chromatic value distributed areas.
After the color image that each light source irradiation of described collection produces, determine that according to the chromatic value of picture element in the described color image chromatic value distributed areas of described picture element comprise before when each color material:
Determine the chromatic value of picture element according to the color component of picture element in the described color image.
With the ratio of picture element color component in the described color image as described chromatic value, or, with the logarithm of the ratio of picture element color component in the described color image as described chromatic value.
The picture element number comprises in the described pending image of the chromatic value correspondence in the chromatic value distributed areas of described definite same light source:
If the chromatic value of a picture element is arranged in described chromatic value distributed areas in the described pending image, then the light source irradiation value with this distributed areas correspondence adds 1, picture element number in the described pending image of the chromatic value correspondence in the chromatic value distributed areas of the same light source of described light source irradiation value representation.
Describedly determine that according to described number current light source comprises:
Determine with described pending image in the ratio of number of picture element reach the light source irradiation value of threshold value, with one of light source of this light source irradiation value correspondence as described current light source.
Have two at least if reach the light source irradiation value of threshold value with the ratio of number of picture element in the described pending image, then select the light source of maximum light source irradiation value correspondence as described current light source.
If the light source irradiation value maximum of the first light source correspondence, the light source irradiation value of secondary light source correspondence is inferior big, whether the difference of then judging two described light source irradiation values reaches set point, if, then with described first light source as current light source, otherwise, with colour temperature in described first light source and the secondary light source higher as current light source.
Described parameter according to described current light source is carried out white balance correction and is comprised:
Determine picture element chromatic value mean value in the color image of described current light source correspondence, utilize this chromatic value mean value to determine the correction parameter of white balance of this light source correspondence, and carry out white balance correction according to this correction parameter of white balance.
Described picture element chromatic value mean value is according to formula
Figure C20071009863400081
Realize.
The present invention also provides a kind of device of realizing white balance correction, and this device comprises:
Collecting unit is used to gather the color image that each light source irradiation produces when each color material;
The distributed areas determining unit is used for determining according to the chromatic value of described color image picture element the chromatic value distributed areas of described picture element;
The first chromatic value determining unit is used for determining the chromatic value of pending image picture element;
The number determining unit is used for determining picture element number in the described pending image of chromatic value correspondence of chromatic value distributed areas of same light source;
The light source determining unit is used for determining current light source according to described number;
Correcting unit is used for carrying out white balance correction according to the parameter of this current light source.
Described distributed areas determining unit comprises:
Statistic unit is used for adding up the histogram of the chromatic value of determining described color image picture element;
Performance element is used for this histogram picture element chromatic value distribution as described chromatic value distributed areas, and the scope that maybe will comprise picture element chromatic value mean value in this histogram is as described chromatic value distributed areas.
Described performance element comprises:
Search the unit, be used for finding out the chromatic value of described color image picture element;
The rectangular area determining unit is used for and will comprises described color image picture element chromatic value, and the rectangular area of area minimum is as described chromatic value distributed areas.
Described device also comprises:
The second chromatic value determining unit is used for determining according to the color component of described color image picture element the chromatic value of picture element.
The described second chromatic value determining unit comprises:
The color component determining unit is used for determining described color image picture element color component;
Operating unit is used for ratio with described color image picture element color component as described chromatic value, or, with the logarithm of the ratio of picture element color component in the described color image as described chromatic value.
Described number determining unit comprises judging unit and counting unit, wherein,
Described judging unit is used for judging whether the chromatic value of described pending image one picture element is arranged in described chromatic value distributed areas, and judged result is sent to described counting unit;
Described counting unit, be used for if described judged result is for being positioned at described chromatic value distributed areas, then the light source irradiation value with this distributed areas correspondence adds 1, picture element number in the described pending image of the chromatic value correspondence in the chromatic value distributed areas of the same light source of described light source irradiation value representation.
Described light source determining unit comprises:
The threshold value determining unit is used for determining that the ratio with the number of described pending image picture element reaches the light source irradiation value of threshold value;
Realize the unit, be used for one of light source as described current light source with described light source irradiation value correspondence.
Described realization unit comprises:
Comparing unit is used for if the light source irradiation value that reaches threshold value with the ratio of the number of described pending image picture element has two at least, then the size of each light source irradiation value relatively;
Selected cell is used to select the light source of maximum light source irradiation value correspondence as described current light source.
Described correcting unit comprises:
Chromatic value mean value determining unit is used for determining the color image picture element chromatic value mean value of described current light source correspondence;
Parameter correction unit is used to utilize described chromatic value mean value to determine the correction parameter of white balance of this light source correspondence, and carries out white balance correction according to this correction parameter of white balance.
Described device also comprises:
Preserve the unit, be used to preserve picture element chromatic value mean value calculation formula:
Figure C20071009863400101
The present invention is by picture element number in the pending image of the chromatic value correspondence in the chromatic value distributed areas of determining same light source, determine current light source according to described number, and utilize the parameter adjustment white balance parameter of this current light source, then realize the method for white balance correction, avoided in the Automatic white balance process owing to having ignored the distortion that current light source is made mistakes and caused the shadow of correction parameter, make picture quality better, it is better that the user experiences.
Description of drawings
Fig. 1 is an embodiment of the invention steps flow chart schematic diagram;
Fig. 2 is training light source and a white balance correction schematic flow sheet in the embodiment of the invention;
Fig. 3 is the histogram of picture element when gray image is by the A rayed in the embodiment of the invention;
Fig. 4 is the histogram after the rotation 45 of picture element when gray image is by the A rayed in the embodiment of the invention is spent;
The rectangle frame combination schematic diagram of Fig. 5 for obtaining during 5 kinds of light source irradiation gray images in the embodiment of the invention;
Fig. 6 (a) is in the embodiment of the invention, the coloured image before proofreading and correct during the A rayed;
Fig. 6 (b) is for after utilizing the embodiment of the invention, with the coloured image after Fig. 6 (a) correction;
Fig. 7 is apparatus of the present invention structural representation.
Embodiment
In the present invention, at first need to train the chromatic value distributed areas: gather the color image that each light source irradiation produces when each color material, determine the chromatic value distributed areas of described picture element according to the chromatic value of picture element in the described color image; Determine the chromatic value of picture element in the pending image then, and then picture element number in the described pending image of the chromatic value correspondence in the chromatic value distributed areas of definite same light source; At last, determine current light source, and carry out white balance correction according to the parameter of this current light source according to described number.
With the grey is example, can present different colors after by imageing sensor under the irradiation of Different Light, and light source generally is to quantize performance with colour temperature.Colour temperature is defined as: the color of source emissioning light and black matrix be the radiant light form and aspect while under a certain temperature, and the temperature of black matrix is called the colour temperature of this light source.Because the light that most of light source sent can be referred to as white light, so the colour temperature of light source also can be in order to censure the degree of its photochromic phase dialogue.Photochromic inclined to one side more indigo plant, colour temperature is high more, and color is cold more; Red partially then colour temperature is low more, and color is warm more.Standard sources (D65) colour temperature is 6500K, and cold light (CW) then is 4000~5000K, and A light is about 3000K.Concerning imageing sensor, under the light source of certain colour temperature, grey all presents certain fixing color.If can identify the light source of current scene thus, then can determine the correction parameter of white balance by the color of this light source, input picture is proofreaied and correct.As after identifying current light and being A light, consider in the three primary colors RGB, orange feature be red, green component is higher, blue on the low side, we just can reduce red in the image, green component, improve blue component, with the orange grey that is adjusted to, reach the purpose of Automatic white balance.
Describe the inventive method in detail below in conjunction with specific embodiment.
As shown in Figure 1, be embodiment of the invention method step schematic flow sheet, this method comprises:
Step 101: gather the color image that each light source irradiation produces when each color material, determine the chromatic value distributed areas of described picture element according to the chromatic value of picture element in the described color image.
In embodiments of the present invention, can utilize training method to determine that each light source is radiated at the chromatic value distributed areas of each color image respectively, concrete implementation step as shown in Figure 2, this training step comprises:
At first, determine light source and color material.
Obtain the chromatic value distributed areas of the color image that produces when multiple light source is radiated at multiple color material respectively, then at first will determine the multiple light source and the color material that participate in training.Here, so-called multiple light source can be to divide according to different colour temperatures, for example, can be according to colour temperature mark off 5 kinds of light sources from high to low, they are respectively: D65, indoor fluorescent lamp (Indoor), CW, TL84 and A, and multiple color material also can comprise: grey material, green material and colour of skin material etc.With D65 is example, can obtain the chromatic value distributed areas of the color image that produces when D65 is radiated at grey material, green material and colour of skin material respectively.More accurate for light source is determined, can train the chromatic value distributed areas that obtain the color image that produces when more kinds of light sources are radiated at multiple color material respectively.
Secondly, gather the color image that a light source irradiation produces when a material.
With three kinds of color materials determining in the steps A: grey material, green material and colour of skin material are placed on respectively under 5 kinds of light sources, by the color image data that imageing sensor and computer acquisition produce, can gather 15 width of cloth color images altogether.Certainly, gather the method that also can utilize other in the color card process, for example, provide two samples, collect methods such as 30 width of cloth training images every kind of picture material.
Moreover, utilize the color image training picture element chromatic value distributed areas that collect.
Present embodiment is example on gray image with the A rayed, in the color image that the A rayed that collects can be produced when the grey material logarithm of the ratio of picture element color component or this ratio as color image in the chromatic value of picture element.Adopt the logarithm of the ratio of color component to be in the present embodiment: because colour brightness does not comprise chromatic value information, so utilize the ratio of the color component (RGB) of image pixel point to weigh chromatic value information as the reason of picture element chromatic value.These three color components are divided by can obtain two chromatic value: r/b and g/b, has promptly obtained the chromatic value information of this picture element, certainly, also can be r/g and b/g, or b/r and g/r.In the white balance hardware operation of reality, division is more unmanageable, in order to realize the realization fast algorithm of tabling look-up, then r/b and g/b are converted into log (r/b) and log (g/b), these two expression formulas can be reduced to log (r)-log (b) and log (g)-log (b).Because the integer of size between 0 to 255 of R, G and three color component value of B, therefore can set the corresponding relation of the value that each integer and this integer are taken the logarithm between 0 to 255, for the chromatic value of arbitrary pixel point, utilize this corresponding relation can obtain easily to chromatic value log (r/b) and log (g/b).By the method, can obtain two chromatic values of each picture element in this gray image.
Statistics is determined the histogram of two chromatic values of picture element in this color image, with above-mentioned log (r)-log (b) and log (g)-log (b) respectively as the x coordinate and the y coordinate of picture element chromatic value in the described histogram, as shown in Figure 3, because the not equal factor of imageing sensor noise jamming, brightness, the chromatic value of each point is not in full accord after the imaging, but be distributed in one narrow rectangular in, promptly the white brightness zone is the distributed areas of picture element chromatic value among the figure.As can be seen from Figure 3, roughly there is miter angle in the distribution arrangement of picture element chromatic value with trunnion axis in the described gray image, in order to make hardware effort easier, distribution arrangement rotation 45 degree with the picture element chromatic value among Fig. 3, after the rotation as shown in Figure 4, the x coordinate of then postrotational picture element chromatic value and y coordinate become log (r)+log (g)-2log (b) and log (r)-log (g), then with picture element chromatic value distribution in this histogram as described chromatic value distributed areas.
Certainly, also can utilize alternate manner to determine the distributed areas of colourity, for example, utilize following formula (1) to determine picture element colourity mean value among Fig. 4, then, will comprise the scope of picture element chromatic value mean value in this histogram as described chromatic value distributed areas.
Figure C20071009863400131
Chromatic value information can be analyzed the picture element chromatic value distribution histogram of Fig. 4 in order to obtain reflecting that the A light source irradiation is on gray image, finds suitable expression formula statement.For example, can utilize two-dimentional Gaussian Profile that chromatic value among Fig. 4 is analyzed, but, the calculating more complicated of Gaussian Profile, difficult in the hardware realization, to this, can use the method for relatively simplifying, when describing as rectangle of direct usefulness that the A light source irradiation is on gray image among Fig. 4, the chromatic value of picture element distributes.If the coordinate on these four summits of rectangle is (L Xleft, L Ytop, L Xright, L Ybottom), the setting principle of 4 values in this coordinate is: comprise picture element chromatic value among described Fig. 4, and this rectangular area minimum.For example, utilize above-mentioned formula (1) to calculate the average of chromatic value in the color image that the A rayed produces: L when the grey material xAnd L y, the then length of rectangle and wide H and W, the then L of being fixed as respectively Xleft=L x-W/2, L Ytop=L y-H/2, L Xright=L x+ W/2, L Ybottom=L y+ H/2, wherein, the value of H and W can be determined according to priori.
Can determine the chromatic value distributed areas of the color image that each light source produces when being radiated at each color material respectively by said method, certainly, also can adopt alternate manner to embody chromatic value information, or the chromatic value that utilizes other shape to describe picture element in the color image that the A light source irradiation produces among Fig. 4 when the grey material distribute.The chromatic value distributed areas that obtain are plotted in the histogram, obtain a colour temperature curve.For example, the chromatic value distribution of the color image that can produce when being radiated at the grey material respectively according to the order of D65, Indoor, CW, TL84 and A couples together, obtain the curve that several broken lines are formed, this curve approximation described current sensor acquisition to color image in picture element chromatic value distribution curve, i.e. transducer logarithm colour temperature curve.After having determined the colour temperature curve, will select suitable rectangle for every kind of light source, the main principle of this selection is: make the common factor of rectangle can cover points all on the colour temperature curve, and rectangle is less, certainly, can be that rectangle is minimum as much as possible among the more excellent embodiment, as shown in Figure 5.
In addition, also can utilize method training green or colour of skin sample calculation chromatic value in the present embodiment, and then determine the chromatic value distributed areas of green or grey respectively.
At last, preserve above-mentioned chromatic value distributed areas.
When by after the above-mentioned steps, determined the colour temperature curve of each light source, and then determined the chromatic value distributed areas of same light source that then the chromatic value distributed areas of this each light source are preserved, at this moment, the training of chromatic value distributed areas finishes.
Step 102: the chromatic value of determining picture element in the pending image.
If the training of the chromatic value distributed areas of various light source correspondences finishes, then can carry out follow-up correction.As shown in Figure 2, at first import pending image, as utilize imageing sensor to capture current pending image.Calculate the chromatic value of picture element in the pending image then.Promptly utilize the method in the step 101, obtain two chromatic value: log (the r)-log (b) and log (the g)-log (b) of picture element in the pending image, certainly, if in the step 101 with postrotational Fig. 4 histogram as a reference, then in this step in the pending image two of picture element chromatic values also can be log (r)-log (g) and log (r)+log (g)-2log (b).
Step 103: determine picture element number in the described pending image of the chromatic value correspondence in the chromatic value distributed areas of same light source, determine current light source according to described number.
In the present embodiment, preserved in above-mentioned 5 kinds of light sources, the reference histograms of the color image that each light source produces when being radiated at grey, green and colour of skin material respectively, and utilize rectangle to describe the chromatic value distributed areas of same light source, can determine an average (L when each color image for each light source irradiation x, L y), a point in this average corresponding diagram 4 in the xy coordinate.
By having determined the chromatic value of picture element in the pending image in the step 102, i.e. log (r)+log (g)-2log (b) and log (r)-log (g), then with these two chromatic values respectively as x coordinate and y coordinate.If judge the chromatic value distributed areas that the chromatic value of a picture element in the pending image is arranged in the training gained, then the light source irradiation value with this distributed areas correspondence adds 1, picture element number in the described pending image of the chromatic value correspondence in the chromatic value distributed areas of the same light source of described light source irradiation value representation.Certainly, also can work as judge the chromatic value that 10 picture elements are arranged in the pending image be positioned at the training gained the chromatic value distributed areas time, the light source irradiation value with this distributed areas correspondence adds 10 again.
All picture elements in will working as pending image are all searched and are finished, count picture element number in the described pending image of the chromatic value correspondence in the chromatic value distributed areas of same light source then, determine with described pending image in the ratio of number of picture element reach the light source irradiation value of threshold value, with one of light source of this light source irradiation value correspondence as described current light source.For example, if counting the ratio of Indoor light source irradiation value and the picture element number of pending image is 50%, D65 light source irradiation value is 45% with the ratio of the picture element number of pending image, and this threshold setting is 40%, then can select one as current light source from D65 or Indoor.In order to reach best effect, then select the light source of maximum light source irradiation value correspondence as described current light source.But, if the light source irradiation value maximum of Indoor correspondence, the light source irradiation value of D65 correspondence is inferior big, then further, can judge whether the difference of two described light source irradiation values reaches set point, if, then with D65 as current light source, otherwise, with colour temperature among Indoor and the D65 higher as current light source, be about to D65 as current light source.
The process whether concrete chromatic value of judging picture element in the pending image is arranged in the chromatic value distributed areas can comprise: establishing the rectangular coordinates that the A rayed preserves in the color image chromatic value distributed areas that grey pigment produces just the time is (L Xleft1, L Ytop1, L Xright1, L Ybottom1), the rectangular coordinates that preserve the chromatic value distributed areas in the color image that produces when colour of skin material of A rayed is (L Xleft2, L Ytop2, L Xright2, L Ybottom2), if exist two chromatic values of picture element a in the pending image to satisfy: L Ybottom1≤y≤L Ytop1, and L Xleft1≤x≤L Xright1, think that then the chromatic value of this picture element a drops in the grey rectangle of A light, then the picture element number adds 1 in the pending image of the chromatic value correspondence in the chromatic value distributed areas of A light, and promptly the light source irradiation value of A light adds 1; If exist two chromatic values of picture element b in the pending image to satisfy: L Ybottom2≤y≤L Ytop2, and L Xleft2≤x≤L Xright2, think that then the chromatic value of this picture element b drops in the colour of skin rectangle of A light, same, the light source irradiation value of A light is added 1 once more.
Step 104: the parameter according to described current light source is carried out white balance correction.
By aforesaid description, can be easily determine the colourity mean value of the color image that each light source irradiation produces when each color material: L according to formula (1) xAnd L y, and go out the correction parameter of white balance of this light source correspondence according to this colourity mean value calculation, and be respectively: gr_gain and gb_gain, and utilize these two gr_gain and gb_gain that pending image is carried out white balance correction.Gr_gain and gb_gain determine according to formula (2):
gr _ gain = exp [ - L ‾ y ] gb _ gain = exp [ 0.5 × ( - L ‾ x - L ‾ y ) - - - ( 2 )
Gr_gain and gb_gain can regulate the chromatic value of each picture element in the image, concrete control method is to keep the G of R, G and three components of B constant, according to gr_gain parameter regulation R component,, obtain distortionless correcting image according to gb_gain parameter regulation B component, if the color component of certain picture element is R1, G1 and B1 before proofreading and correct, the color component that changes picture element after then proofreading and correct is: R2=R1 * gr_gain, G2=G1, B2=B1 * gb_gain, so far, white balance correction finishes.
Experiment shows, if judging current light source is Indoor light, pending image is a gray image, then proofread and correct according to the inventive method, and figure kine bias cyan before correction, the obvious grey partially of image after correction, the image fault after utilizing the present invention to proofread and correct is less; If to judge current light source is A light, pending image is a green image, then proofread and correct according to the inventive method, and figure kine bias khaki before correction, the figure kine bias green after utilizing the present invention to proofread and correct, the image fault after the correction is less.And if current light source is an A light, present image is the coloured image of many colors, and shown in Fig. 6 (a) and Fig. 6 (b), shades of colour is all yellow partially before then proofreading and correct, and whiter after the correction, distortion is less.
By above-mentioned description to the inventive method, the present invention also provides a kind of device of realizing white balance correction, as shown in Figure 7, this device comprises collecting unit 11, distributed areas determining unit 12, the first chromatic value determining unit 13, number determining unit 14, light source determining unit 15 and correcting unit 16, wherein, collecting unit 11 is used to gather the color image that each light source irradiation produces when each color material; Distributed areas determining unit 12 is used for determining according to the chromatic value of described color image picture element the chromatic value distributed areas of described picture element; The first chromatic value determining unit 13 is used for determining the chromatic value of pending image picture element; Number determining unit 14 is used for determining picture element number in the described pending image of chromatic value correspondence of chromatic value distributed areas of same light source; Light source determining unit 15 is used for determining current light source according to described number; Correcting unit 16 is used for carrying out white balance correction according to the parameter of this current light source.
Described distributed areas determining unit 12 comprises statistic unit 20 and performance element 21, and wherein, statistic unit 20 is used for adding up the histogram of the chromatic value of determining described color image picture element; Performance element 21 is used for this histogram picture element chromatic value distribution as described chromatic value distributed areas, and the scope that maybe will comprise picture element chromatic value mean value in this histogram is as described chromatic value distributed areas.
Described performance element 21 comprises searches unit 31 and rectangular area determining unit 32, wherein, searches the chromatic value that unit 31 is used for finding out described color image picture element; Rectangular area determining unit 32 is used for and will comprises described color image picture element chromatic value, and the rectangular area of area minimum is as described chromatic value distributed areas.
Described device also comprises the second chromatic value determining unit 17, is used for determining according to the color component of described color image picture element the chromatic value of picture element.
The described second chromatic value determining unit 17 comprises color component determining unit 22 and operating unit 23, and wherein, color component determining unit 22 is used for determining described color image picture element color component; Operating unit 23 is used for ratio with described color image picture element color component as described chromatic value, or, with the described chromatic value of logarithm of the ratio of picture element color component in the described color image.
Described number determining unit 14 comprises judging unit 24 and counting unit 25, wherein, judging unit 24 is used for judging whether the chromatic value of described pending image one picture element is arranged in described chromatic value distributed areas, and judged result is sent to described counting unit 25; Counting unit 25 is used for if described judged result is for being positioned at described chromatic value distributed areas, then the light source irradiation value with this distributed areas correspondence adds 1, picture element number in the described pending image of the chromatic value correspondence in the chromatic value distributed areas of the same light source of described light source irradiation value representation.
Described light source determining unit 15 comprises threshold value determining unit 26 and realizes unit 27, and wherein, threshold value determining unit 26 is used for determining that the ratio with the number of described pending image picture element reaches the light source irradiation value of threshold value; Realize that unit 27 is used for one of light source with described light source irradiation value correspondence as described current light source.
Described realization unit 27 comprises comparing unit 33 and selected cell 34, and wherein, comparing unit 33 is used for if the light source irradiation value that reaches threshold value with the ratio of the number of described pending image picture element has two at least, then the size of each light source irradiation value relatively; Selected cell 34 is used to select the light source of maximum light source irradiation value correspondence as described current light source.
Described correcting unit 16 comprises chromatic value mean value determining unit 28 and parameter correction unit 29, and wherein, chromatic value mean value determining unit 28 is used for determining the color image picture element chromatic value mean value of described current light source correspondence; Parameter correction unit 29 is used to utilize described chromatic value mean value to determine the correction parameter of white balance of this light source correspondence, and carries out white balance correction according to this correction parameter of white balance.
Described device also comprises preserves unit 18, is used to preserve picture element chromatic value mean value calculation formula:
Figure C20071009863400181
By the inventive method and device, avoided Automatic white balance owing to ignoring the distortion that the influence of light source to correction parameter makes mistakes and cause, make picture quality better, it is better that the user experiences.
Obviously, those skilled in the art can carry out various changes and modification to the present invention and not break away from the spirit and scope of the present invention.Like this, if of the present invention these are revised and modification belongs within the scope of claim of the present invention and equivalent technologies thereof, then the present invention also is intended to comprise these changes and modification interior.

Claims (21)

1, a kind of method that realizes white balance correction is characterized in that, this method comprises:
Gather the color image that each light source irradiation produces when each color material, determine the chromatic value distributed areas of described picture element according to the chromatic value of picture element in the described color image;
Determine the chromatic value of picture element in the pending image;
Determine picture element number in the described pending image of the chromatic value correspondence in the chromatic value distributed areas of same light source, determine current light source according to described number;
Parameter according to described current light source is carried out white balance correction.
2, the method for claim 1 is characterized in that, described chromatic value according to picture element in the described color image determines that the chromatic value distributed areas of described picture element comprise:
Statistics is determined the histogram of the chromatic value of picture element in the described color image;
As described chromatic value distributed areas, the scope that maybe will comprise picture element chromatic value mean value in this histogram is as described chromatic value distributed areas with picture element chromatic value distribution in this histogram.
3, method as claimed in claim 2 is characterized in that, described picture element chromatic value distribution in this histogram is comprised as described chromatic value distributed areas:
To comprise picture element chromatic value in the described color image, and the rectangular area of area minimum is as described chromatic value distributed areas.
4, the method for claim 1, it is characterized in that, after the color image that each light source irradiation of described collection produces, determine that according to the chromatic value of picture element in the described color image chromatic value distributed areas of described picture element comprise before when each color material:
Determine the chromatic value of picture element according to the color component of picture element in the described color image.
5, method as claimed in claim 4 is characterized in that,
With the ratio of picture element color component in the described color image as described chromatic value, or, with the logarithm of the ratio of picture element color component in the described color image as described chromatic value.
6, the method for claim 1 is characterized in that, the picture element number comprises in the described pending image of the chromatic value correspondence in the chromatic value distributed areas of described definite same light source:
If the chromatic value of a picture element is arranged in described chromatic value distributed areas in the described pending image, then the light source irradiation value with this distributed areas correspondence adds 1, picture element number in the described pending image of the chromatic value correspondence in the chromatic value distributed areas of the same light source of described light source irradiation value representation.
7, method as claimed in claim 6 is characterized in that, describedly determines that according to described number current light source comprises:
Determine with described pending image in the ratio of number of picture element reach the light source irradiation value of threshold value, with one of light source of this light source irradiation value correspondence as described current light source.
8, method as claimed in claim 7 is characterized in that, if with described pending image in the ratio of number of the picture element light source irradiation value that reaches threshold value have two at least, then select the light source of maximum light source irradiation value correspondence as described current light source.
9, method as claimed in claim 7, it is characterized in that, if the light source irradiation value maximum of the first light source correspondence, the light source irradiation value of secondary light source correspondence is inferior big, whether the difference of then judging two described light source irradiation values reaches set point, if, then with described first light source as current light source, otherwise, with colour temperature in described first light source and the secondary light source higher as current light source.
10, the method for claim 1 is characterized in that, described parameter according to described current light source is carried out white balance correction and comprised:
Determine picture element chromatic value mean value in the color image of described current light source correspondence, utilize this chromatic value mean value to determine the correction parameter of white balance of this light source correspondence, and carry out white balance correction according to this correction parameter of white balance.
As claim 2 or 10 described methods, it is characterized in that 11, described picture element chromatic value mean value is according to formula
Figure C2007100986340003C1
Realize.
12, a kind of device of realizing white balance correction is characterized in that, this device comprises:
Collecting unit is used to gather the color image that each light source irradiation produces when each color material;
The distributed areas determining unit is used for determining according to the chromatic value of described color image picture element the chromatic value distributed areas of described picture element;
The first chromatic value determining unit is used for determining the chromatic value of pending image picture element;
The number determining unit is used for determining picture element number in the described pending image of chromatic value correspondence of chromatic value distributed areas of same light source;
The light source determining unit is used for determining current light source according to described number;
Correcting unit is used for carrying out white balance correction according to the parameter of this current light source.
13, as device as described in the claim 12, it is characterized in that described distributed areas determining unit comprises:
Statistic unit is used for adding up the histogram of the chromatic value of determining described color image picture element;
Performance element is used for this histogram picture element chromatic value distribution as described chromatic value distributed areas, and the scope that maybe will comprise picture element chromatic value mean value in this histogram is as described chromatic value distributed areas.
14, as device as described in the claim 13, it is characterized in that described performance element comprises:
Search the unit, be used for finding out the chromatic value of described color image picture element;
The rectangular area determining unit is used for and will comprises described color image picture element chromatic value, and the rectangular area of area minimum is as described chromatic value distributed areas.
15, as device as described in the claim 12, it is characterized in that described device also comprises:
The second chromatic value determining unit is used for determining according to the color component of described color image picture element the chromatic value of picture element.
16, as device as described in the claim 15, it is characterized in that the described second chromatic value determining unit comprises:
The color component determining unit is used for determining described color image picture element color component;
Operating unit is used for ratio with described color image picture element color component as described chromatic value, or, with the logarithm of the ratio of picture element color component in the described color image as described chromatic value.
17, as device as described in the claim 12, it is characterized in that described number determining unit comprises judging unit and counting unit, wherein,
Described judging unit is used for judging whether the chromatic value of described pending image one picture element is arranged in described chromatic value distributed areas, and judged result is sent to described counting unit;
Described counting unit, be used for if described judged result is for being positioned at described chromatic value distributed areas, then the light source irradiation value with this distributed areas correspondence adds 1, picture element number in the described pending image of the chromatic value correspondence in the chromatic value distributed areas of the same light source of described light source irradiation value representation.
18, as device as described in the claim 17, it is characterized in that described light source determining unit comprises:
The threshold value determining unit is used for determining that the ratio with the number of described pending image picture element reaches the light source irradiation value of threshold value;
Realize the unit, be used for one of light source as described current light source with described light source irradiation value correspondence.
19, as device as described in the claim 18, it is characterized in that described realization unit comprises:
Comparing unit is used for if the light source irradiation value that reaches threshold value with the ratio of the number of described pending image picture element has two at least, then the size of each light source irradiation value relatively;
Selected cell is used to select the light source of maximum light source irradiation value correspondence as described current light source.
20, as device as described in the claim 12, it is characterized in that described correcting unit comprises:
Chromatic value mean value determining unit is used for determining the color image picture element chromatic value mean value of described current light source correspondence;
Parameter correction unit is used to utilize described chromatic value mean value to determine the correction parameter of white balance of this light source correspondence, and carries out white balance correction according to this correction parameter of white balance.
21, as device as described in claim 13 or 20, it is characterized in that described device also comprises:
Preserve the unit, be used to preserve picture element chromatic value mean value calculation formula:
Figure C2007100986340005C1
CNB2007100986345A 2007-04-23 2007-04-23 A kind of method and device of realizing white balance correction Active CN100551081C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB2007100986345A CN100551081C (en) 2007-04-23 2007-04-23 A kind of method and device of realizing white balance correction

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB2007100986345A CN100551081C (en) 2007-04-23 2007-04-23 A kind of method and device of realizing white balance correction

Publications (2)

Publication Number Publication Date
CN101039439A CN101039439A (en) 2007-09-19
CN100551081C true CN100551081C (en) 2009-10-14

Family

ID=38890029

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB2007100986345A Active CN100551081C (en) 2007-04-23 2007-04-23 A kind of method and device of realizing white balance correction

Country Status (1)

Country Link
CN (1) CN100551081C (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104469334A (en) * 2014-12-10 2015-03-25 深圳市理邦精密仪器股份有限公司 Method and device for processing image data obtained by medical device

Families Citing this family (24)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101448085B (en) * 2008-12-26 2013-08-21 北京中星微电子有限公司 Videography processing method and system supporting face detection
CN101577831B (en) * 2009-03-10 2013-08-21 北京中星微电子有限公司 Control method and control device for starting white balance adjustment
CN102244790A (en) * 2011-06-27 2011-11-16 展讯通信(上海)有限公司 Device and method for adaptively adjusting supporting parameters of image signal processor
CN103177694B (en) * 2013-04-18 2015-03-04 广州市观泰数字显示设备有限公司 White balance adjusting method of LED (Light Emitting Diode) display screen
CN103297789B (en) * 2013-05-20 2015-04-29 周宇 White balance correcting method and white balance correcting device
CN103826113B (en) * 2014-03-12 2016-02-17 中国科学院上海高等研究院 A kind of color rendition method and device
CN104936334B (en) * 2014-03-20 2018-03-27 联想(北京)有限公司 Lamp light control method and device
KR101594258B1 (en) * 2014-09-24 2016-02-16 주식회사 넥서스칩스 APPARATUS AND METHOD FOR CORRECTING AND CONTROLLING IMAGE of camera using color/light sensor
CN104780353B (en) * 2015-03-26 2017-11-07 广东欧珀移动通信有限公司 A kind of image processing method and device
CN105554489A (en) * 2015-07-10 2016-05-04 宇龙计算机通信科技(深圳)有限公司 White balance adjusting method and shooting terminal
CN106791757B (en) * 2015-11-23 2018-11-30 创意电子股份有限公司 Image correction system and method thereof
CN105959662B (en) * 2016-05-24 2017-11-24 深圳英飞拓科技股份有限公司 Self-adapted white balance method of adjustment and device
CN106231193A (en) * 2016-08-05 2016-12-14 深圳市金立通信设备有限公司 A kind of image processing method and terminal
CN106357988B (en) * 2016-11-09 2020-03-06 Oppo广东移动通信有限公司 White balance adjusting method and device and terminal equipment
CN107197225B (en) * 2017-06-13 2019-04-05 浙江大学 Color digital camera white balance correcting based on chromatic adaptation model
CN108111831B (en) * 2017-12-25 2020-01-10 Oppo广东移动通信有限公司 Photographing method, imaging apparatus, computer-readable storage medium, and computer device
CN107959843B (en) * 2017-12-25 2019-07-05 Oppo广东移动通信有限公司 Image processing method and device, computer readable storage medium and computer equipment
CN108156379A (en) * 2017-12-28 2018-06-12 努比亚技术有限公司 A kind of optimization method of automatic white balance, terminal and computer readable storage medium
CN110392245B (en) * 2018-04-20 2021-07-16 瑞昱半导体股份有限公司 White balance correction method based on skin color information and image processing device thereof
CN108616691B (en) * 2018-04-28 2020-07-10 北京小米移动软件有限公司 Photographing method and device based on automatic white balance, server and storage medium
CN111587573B (en) * 2018-05-30 2021-06-15 华为技术有限公司 Image processing method and device and computer storage medium
CN109118549A (en) * 2018-07-20 2019-01-01 上海电力学院 A method of making object of reference with white printing paper and restores object color
CN109714582B (en) * 2019-01-04 2021-08-06 Oppo广东移动通信有限公司 White balance adjusting method, device, storage medium and terminal
CN111787299B (en) * 2019-10-18 2022-06-14 西安宇视信息科技有限公司 Method, device, medium and electronic equipment for determining special light source

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104469334A (en) * 2014-12-10 2015-03-25 深圳市理邦精密仪器股份有限公司 Method and device for processing image data obtained by medical device
CN104469334B (en) * 2014-12-10 2016-08-17 深圳市理邦精密仪器股份有限公司 A kind of Medical Devices obtain the processing method and processing device of view data

Also Published As

Publication number Publication date
CN101039439A (en) 2007-09-19

Similar Documents

Publication Publication Date Title
CN100551081C (en) A kind of method and device of realizing white balance correction
CN100563297C (en) Realize the method and the device of white balance correction
CN101283604B (en) Image processing device with automatic white balance
CA2462486C (en) Automatic color correction for sequences of images
Wang et al. An optimized tongue image color correction scheme
Jacobson et al. Design goals and solutions for display of hyperspectral images
US7783127B1 (en) Determining parameters for adjusting images
US7936377B2 (en) Method and system for optimizing an image for improved analysis of material and illumination image features
RU2450476C2 (en) Device and method to determine optimal backlighting
Magnusson et al. Creating RGB images from hyperspectral images using a color matching function
CN102138157B (en) Color constancy method and system
CN105915816B (en) Method and apparatus for determining the brightness of given scenario
US8064691B2 (en) Method for identifying color in machine and computer vision applications
JP2000171304A (en) Detecting method of color illumination color temperature and device therefor
CN101933321A (en) Image sensor apparatus and method for scene illuminant estimation
CN102244757A (en) Color calibration method of large multi-projection screen based on projector-camera system
CN101088277A (en) Method of electronic color image saturation processing
JP2015501037A (en) Color analysis for digital images
Barnard Computational color constancy: taking theory into practice
Ji et al. An efficient nonlinear polynomial color characterization method based on interrelations of color spaces
US7437016B2 (en) Image enhancement
Daul et al. Building a color classification system for textured and hue homogeneous surfaces: system calibration and algorithm
JP2002117402A (en) Image processing method and device thereof
CN114866755B (en) Automatic white balance method and device, computer storage medium and electronic equipment
Raksha et al. Color image enhancement using metamer mismatch through profile mapping

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
TR01 Transfer of patent right

Effective date of registration: 20180410

Address after: 100191 Xueyuan Road, Haidian District, Haidian District, Beijing, No. 607, No. six

Patentee after: Beijing Vimicro AI Chip Technology Co Ltd

Address before: 100083, Haidian District, Xueyuan Road, Beijing No. 35, Nanjing Ning building, 15 Floor

Patentee before: Beijing Vimicro Corporation

TR01 Transfer of patent right