CN105933687A - Automatic white balance processing method and device for images - Google Patents

Automatic white balance processing method and device for images Download PDF

Info

Publication number
CN105933687A
CN105933687A CN201610518732.9A CN201610518732A CN105933687A CN 105933687 A CN105933687 A CN 105933687A CN 201610518732 A CN201610518732 A CN 201610518732A CN 105933687 A CN105933687 A CN 105933687A
Authority
CN
China
Prior art keywords
value
target image
correction
average
color difference
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.)
Pending
Application number
CN201610518732.9A
Other languages
Chinese (zh)
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.)
Luster LightTech Co Ltd
Original Assignee
Luster LightTech 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 Luster LightTech Co Ltd filed Critical Luster LightTech Co Ltd
Priority to CN201610518732.9A priority Critical patent/CN105933687A/en
Publication of CN105933687A publication Critical patent/CN105933687A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N9/00Details of colour television systems
    • H04N9/64Circuits for processing colour signals
    • H04N9/73Colour balance circuits, e.g. white balance circuits or colour temperature control

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Image Processing (AREA)

Abstract

The invention discloses an automatic white balance processing method and device for images. The method comprises the following steps: determining a blue chromatic aberration mean and a red chromatic aberration mean of a target pixel point based on a YCbCr color space of a target image after ith correction according to a RGB value of the target image after the ith correction; determining a gain adjustment function after the ith correction according to the chromatic aberration means; substituting the values of n1+i in the function, and determining the values of actual gain coefficients of a R channel and a B channel; correcting the RGB value by using the values to obtain the RGB value of the target image after (i+1)th correction; and judging whether the value of n1+i is larger than a preset gain coefficient adjustment parameter threshold, and if the value of n1+i is larger than the preset gain coefficient adjustment parameter threshold, using the RGB value obtained after the (i+1)th correction as the RGB value of the target image after automatic white balance processing. By adopting the method, the accuracy of the automatic white balance processing can be greatly improved.

Description

A kind of method and device that image is carried out AWB process
Technical field
The present invention relates to technical field of image processing, particularly relate to a kind of method that image is carried out AWB process and Device.
Background technology
During light source luminescent, one group of spectrum can be produced, when a black matrix is heated to a certain temperature, also can produce one group of spectrum, When two groups of spectrum are identical, corresponding temperature is defined as the colour temperature of this light source.Different light sources has different spectrum and becomes Point, thus there is different colour temperatures.
For the object of same white, under the light source of low colour temperature irradiates, reflection light can be partially red, at the light of high color temperature Under source is irradiated, reflection light can be partially blue.Based on this, image capturing system, can be by light source in environment when gathering image Impact, cause in the image collected, there is a certain degree of deviation in the color value of each pixel.
In existing acquisition technology, through frequently with the method that image is carried out AWB process, to each in image The deviation of the color value of pixel is corrected so that the color that the color of the image collected remains original is constant.Such as Gray world method and maximum value process etc..When using gray world method that the color value deviation of image is corrected, by whole The color value of all pixels of width target image, asks for the meansigma methods of the component of tri-passages of R, G, B, and then according to This meansigma methods determines the gain coefficient of tri-passages of R, G, B, uses the gain coefficient the tried to achieve color value to image afterwards Calibrate;When using maximum value process that the color value deviation of image is corrected, by view picture target image is owned The color value of pixel, asks for the maximum of the component of tri-passages of R, G, B, so according to this maximum determine R, The gain coefficient of tri-passages of G, B, uses the gain coefficient tried to achieve to calibrate the color value of image afterwards.Thus may be used Know, in the existing method that image is carried out AWB process, owing to asking for the gain system of tri-passages of R, G, B During number, for once averaging or the process of maximum so that in calculating process, degree of accuracy ratio is relatively low, it is right to cause In image, the color value correction for drift ratio of precision of each pixel is relatively low, and existing to image, these are carried out AWB When the method processed is applied in acquisition technology, still can there is certain colour cast, nothing in the color of the image collected Method collects color and keeps the image that primitive color is constant.
So, in the existing method that image is carried out AWB process, the color value correction for drift to image, Degree of accuracy is relatively low.
Summary of the invention
The purpose of the embodiment of the present invention is to provide a kind of method that image is carried out AWB process, to solve existing skill In art, image is carried out in the method for AWB process, the color value correction for drift to image, relatively low the asking of degree of accuracy Topic.
In order to solve above-mentioned technical problem, the embodiment of the invention discloses following technical scheme:
First aspect, embodiments provides a kind of method that image is carried out AWB process, the method bag Include:
The rgb value of the target image obtained after correcting according to i & lt, after determining i & lt correction, target image is based on YCbCr The blue color difference average of the target pixel points of color space and red color average, wherein, described target pixel points is preset for meeting The pixel of condition, i=0,1,2 ..., k1, k1 are positive integer;
According to described blue color difference average and red color average, determine the gain adjustment function of target image after i & lt correction, Described gain adjustment function be correct about i & lt after the gain coefficient of target image adjust parameter and the R passage of target image or The function of the actual gain coefficient of channel B;
The value of n1+i is adjusted as the gain coefficient in described gain adjustment function the value of parameter, determines target after i & lt correction The R passage of image and the value of the actual gain coefficient of channel B, wherein, n1 is less than preset gain coefficient adjustment parameter threshold Positive integer;
Value according to described R passage and the actual gain coefficient of channel B corrects described rgb value, it is thus achieved that after i+1 time correction The rgb value of target image;
Judge whether the value of described n1+i is more than described preset gain coefficient adjustment parameter threshold, if the value of described n1+i is more than Described preset gain coefficient adjustment parameter threshold, then using the rgb value of the target image of acquisition after i+1 time correction as target figure As the rgb value after AWB processes.
In conjunction with first aspect, in the first possible implementation of first aspect, described correct according to i & lt after obtain The rgb value of target image, determines the blueness of target image target pixel points based on YCbCr color space after i & lt correction Color difference typical value and the process of red color average, specifically include:
According to the following equation, the rgb value of the target image obtained after correcting according to i & lt, determine target figure after i & lt correction Each pixel color value based on YCbCr color space in Xiang;
Y C b C r = 0.299 0.587 0.114 - 0.1687 - 0.3313 0.5 0.5 - 0.4187 - 0.0813 · R G B ;
According to described color value, according to the following pre-conditioned target pixel points determined after i & lt correction in target image;
According to described color value, determine the sum of the blue color difference value of all described target pixel points according to the following equation;
C 1 = Σ p = 1 m C b ( p ) ;
According to described color value, determine the sum of the red color value of all described target pixel points according to the following equation;
C 2 = Σ p = 1 m C r ( p ) ;
According to the sum of described blue color difference value, determine the blue color difference average of all described target pixel points according to the following equation;
C 3 = C 1 m ;
According to the sum of described red color value, determine the red color average of all described target pixel points according to the following equation;
C 4 = C 2 m ;
Wherein, any pixel point brightness value based on YCbCr color space in target image after Y represents i & lt correction;CbGeneration Blue color difference based on the YCbCr color space value of pixel described in table;CrRepresent described pixel based on YCbCr color space Red color value;R represents the red component of described pixel rgb value;G represents the green of described pixel rgb value and divides Amount;B represents the blue component of described pixel rgb value;Represent in target image the pre-set color for a pixel to divide Amount difference;C1 represents after i & lt correction the sum of the blue color difference value of all target pixel points in target image;C2 represents i & lt The sum of the red color value of all target pixel points in target image after correction;C3 represents after i & lt corrects all in target image The blue color difference average of target pixel points;It is equal that C4 represents after i & lt correction the red color of all target pixel points in target image Value;M represents after i & lt correction the number of all target pixel points in target image;P represents target image after i & lt correction The variable of middle target pixel points number.
In conjunction with the first possible implementation of first aspect, in the implementation that the second of first aspect is possible, described According to described blue color difference average and red color average, determine the process of the gain adjustment function of target image after i & lt correction, Specifically include:
Judge that whether described blue color difference average is more than described red color average;
If described blue color difference average is more than described red color average, then determine i & lt school according to described blue color difference average The gain adjustment function of target image after just;Or,
If described blue color difference average is less than or equal to described red color average, then determine i-th according to described red color average The gain adjustment function of target image after secondary correction.
In conjunction with the implementation that the second of first aspect is possible, in the third possible implementation of first aspect, sentencing Whether disconnected described blue color difference average is more than before described red color average, and the method also includes:
According to described blue color difference average and red color average, determine the total of target image after i & lt correction according to the following equation Color difference typical value;
M=| C3 |+| C4 |;
According to default aberration reference value, determine the actual aberration reference value of target image after i & lt correction according to the following equation;
θ q i = θ 2 q i ;
Judge whether described total color difference average is more than described actual aberration reference value, if described total color difference average is more than described reality Aberration reference value, determines the value of n1 the most according to the following equation;
N1=n0+q0+q1+q2+…+qi
Wherein, qi=0,1,2 ..., k2, k2 are positive integer;θ is for presetting aberration reference value;After correcting for i & lt The actual aberration reference value of target image;N0 is the preset initial value that gain coefficient adjusts parameter;M is described total color difference average.
In conjunction with the second or the third possible implementation of first aspect, in the 4th kind of possible implementation of first aspect In, described determine the process of gain adjustment function of target image after i & lt correction according to described blue color difference average, specifically wrap Include:
If described blue color difference average is more than zero, then following function is defined as described gain adjustment function;
U=u0-2-n2;Or,
If described blue color difference average is less than zero, then following function is defined as described gain adjustment function;
U=u0+2-n2;Or,
If described blue color difference average is equal to zero, then following function is defined as described gain adjustment function;
U=u0
Wherein, the actual gain coefficient of the channel B of target image after u represents i & lt correction;u0Represent the gain system of channel B The preset initial value of number;N2 represents the gain coefficient of target image after i & lt corrects and adjusts parameter.
In conjunction with the second or the third possible implementation of first aspect, in the 5th kind of possible implementation of first aspect In, described determine the process of gain adjustment function of target image after i & lt correction according to described red color average, specifically wrap Include:
If described red color average is more than zero, then following function is defined as described gain adjustment function;
V=v0-2-n2;Or,
If described red color average is less than zero, then following function is defined as described gain adjustment function;
V=v0+2-n2;Or,
If described red color average is equal to zero, then following function is defined as described gain adjustment function;
V=v0
Wherein, the actual gain coefficient of the R passage of target image after v represents i & lt correction;v0Represent the gain system of R passage The preset initial value of number;N2 represents the gain coefficient of target image after i & lt corrects and adjusts parameter.
Second aspect, embodiments provides a kind of device that image carries out AWB process, and this device includes:
Color difference typical value determines module, the rgb value of the target image obtained after correcting according to i & lt, determines that i & lt corrects The blue color difference average of rear target image target pixel points based on YCbCr color space and red color average, wherein, described Target pixel points is to meet pre-conditioned pixel, i=0,1,2 ..., k1, k1 are positive integer;
Tuning function determines module, for according to described blue color difference average and red color average, determines mesh after i & lt correction The gain adjustment function of logo image, described gain adjustment function is to adjust ginseng about the gain coefficient of target image after i & lt correction The function of the actual gain coefficient of number and the R passage of target image or channel B;
Gain coefficient determines module, for the value of n1+i to be adjusted the value of parameter as the gain coefficient in described gain adjustment function, Determining the value of the actual gain coefficient of the R passage of target image and channel B after i & lt correction, wherein, n1 is for increasing less than presetting The positive integer of benefit coefficient adjustment parameter threshold;
Correction module, corrects described rgb value for the value according to described R passage and the actual gain coefficient of channel B, it is thus achieved that The rgb value of target image after i+1 time correction;
Analyze module, for judging whether the value of described n1+i is more than described preset gain coefficient adjustment parameter threshold, if described The value of n1+i is more than described preset gain coefficient adjustment parameter threshold, then by the RGB of the target image of acquisition after i+1 time correction Be worth as target image through AWB process after rgb value.
In conjunction with second aspect, in the first possible implementation of second aspect, described color difference typical value determines that module is specifically used In:
According to the following equation, the rgb value of the target image obtained after correcting according to i & lt, determine target figure after i & lt correction Each pixel color value based on YCbCr color space in Xiang;
Y C b C r = 0.299 0.587 0.114 - 0.1687 - 0.3313 0.5 0.5 - 0.4187 - 0.0813 · R G B ;
According to described color value, according to the following pre-conditioned target pixel points determined after i & lt correction in target image;
According to described color value, determine the sum of the blue color difference value of all described target pixel points according to the following equation;
C 1 = Σ p = 1 m C b ( p ) ;
According to described color value, determine the sum of the red color value of all described target pixel points according to the following equation;
C 2 = Σ p = 1 m C r ( p ) ;
According to the sum of described blue color difference value, determine the blue color difference average of all described target pixel points according to the following equation;
C 3 = C 1 m ;
According to the sum of described red color value, determine the red color average of all described target pixel points according to the following equation;
C 4 = C 2 m ;
Wherein, any pixel point brightness value based on YCbCr color space in target image after Y represents i & lt correction;CbGeneration Blue color difference based on the YCbCr color space value of pixel described in table;CrRepresent described pixel based on YCbCr color space Red color value;R represents the red component of described pixel rgb value;G represents the green of described pixel rgb value and divides Amount;B represents the blue component of described pixel rgb value;Represent in target image the pre-set color for a pixel to divide Amount difference;C1 represents after i & lt correction the sum of the blue color difference value of all target pixel points in target image;C2 represents i & lt The sum of the red color value of all target pixel points in target image after correction;C3 represents after i & lt corrects all in target image The blue color difference average of target pixel points;It is equal that C4 represents after i & lt correction the red color of all target pixel points in target image Value;M represents after i & lt correction the number of all target pixel points in target image;P represents after i & lt correction in target image The variable of target pixel points number.
In conjunction with the first possible implementation of second aspect, in the implementation that the second of second aspect is possible, described Tuning function determines that module includes:
Judging unit, is used for judging that whether described blue color difference average is more than described red color average;
First Tuning function determines unit, if described blue color difference average is more than described red color average, then for according to institute State blue color difference average and determine the gain adjustment function of target image after i & lt correction;
Second Tuning function determines unit, if described blue color difference average is less than or equal to described red color average, then for root The gain adjustment function of target image after i & lt correction is determined according to described red color average.
In conjunction with the implementation that the second of second aspect is possible, in the third possible implementation of second aspect, this dress Put and also include:
First computing module, for according to described blue color difference average and red color average, determines i & lt according to the following equation The total color difference average of target image after correction;
M=| C3 |+| C4 |;
Second computing module, for according to presetting aberration reference value, determines target image after i & lt correction according to the following equation Actual aberration reference value;
θ q i = θ 2 q i ;
3rd computing module, is used for judging whether described total color difference average is more than described actual aberration reference value, if described total color Difference average, more than described actual aberration reference value, determines the value of n1 the most according to the following equation;
N1=n0+q0+q1+q2+…+qi
Wherein, qi=0,1,2 ..., k2, k2 are positive integer;θ is for presetting aberration reference value;After correcting for i & lt The actual aberration reference value of target image;N0 is the preset initial value that gain coefficient adjusts parameter;M is described total color difference average.
In conjunction with the second or the third possible implementation of second aspect, in the 4th kind of possible implementation of second aspect In, described first Tuning function determine unit specifically for:
If described blue color difference average is more than zero, then following function is defined as described gain adjustment function;
U=u0-2-n2;Or,
If described blue color difference average is less than zero, then following function is defined as described gain adjustment function;
U=u0+2-n2;Or,
If described blue color difference average is equal to zero, then following function is defined as described gain adjustment function;
U=u0
Wherein, the actual gain coefficient of the channel B of target image after u represents i & lt correction;u0Represent the gain coefficient of channel B Preset initial value;N2 represents the gain coefficient of target image after i & lt corrects and adjusts parameter.
In conjunction with the second or the third possible implementation of second aspect, in the 5th kind of possible implementation of second aspect In, described second Tuning function determine unit specifically for:
If described red color average is more than zero, then following function is defined as described gain adjustment function;
V=v0-2-n2;Or,
If described red color average is less than zero, then following function is defined as described gain adjustment function;
V=v0+2-n2;Or,
If described red color average is equal to zero, then following function is defined as described gain adjustment function;
V=v0
Wherein, the actual gain coefficient of the R passage of target image after v represents i & lt correction;v0Represent the gain coefficient of R passage Preset initial value;N2 represents the gain coefficient of target image after i & lt corrects and adjusts parameter.
The technical scheme that embodiments of the invention provide can include following beneficial effect: in method disclosed by the invention, logical Cross and preset gain coefficient adjustment parameter threshold is set, value and the increasing of channel B to the gain coefficient of the R passage of target image The value of benefit coefficient is iterated adjusting (repeatedly adjusting the gain coefficient of R passage and the gain coefficient of channel B), After adjusting, the color value of target image corresponding before using the value of the gain coefficient obtained to adjust this carries out calibration every time, After repeatedly correcting, the color value of target image no longer produces deviation, and image carries out the essence of AWB process Degree is more accurate, and the suitability is more preferable.
The embodiment of the present invention is it should be appreciated that it is only exemplary and explanation that above general description and details hereinafter describe Property, the disclosure can not be limited.
Accompanying drawing explanation
Accompanying drawing herein is merged in description and constitutes the part of this specification, it is shown that meet embodiments of the invention, And for explaining the principle of the present invention together with description.
In order to be illustrated more clearly that the embodiment of the present invention or technical scheme of the prior art, below will be to embodiment or existing In technology description, the required accompanying drawing used is briefly described, it should be apparent that, for those of ordinary skill in the art Speech, on the premise of not paying creative work, it is also possible to obtain other accompanying drawing according to these accompanying drawings.
The schematic flow sheet of a kind of method that image is carried out AWB process that Fig. 1 provides for the embodiment of the present invention;
The another kind that Fig. 2 provides for the embodiment of the present invention carries out the flow process signal of the method for AWB process to image Figure;
The structured flowchart of a kind of device that image is carried out AWB process that Fig. 3 provides for the embodiment of the present invention;
The another kind that Fig. 4 provides for the embodiment of the present invention carries out the structured flowchart of the device of AWB process to image.
Detailed description of the invention
For the technical scheme making those skilled in the art be more fully understood that in the present invention, implement below in conjunction with the present invention Accompanying drawing in example, is clearly and completely described the technical scheme in the embodiment of the present invention, it is clear that described reality Executing example is only a part of embodiment of the present invention rather than whole embodiments.Based on the embodiment in the present invention, ability The every other embodiment that territory those of ordinary skill is obtained under not making creative work premise, all should belong to this The scope of invention protection.
The invention provides a kind of method that image is carried out AWB process, method disclosed by the invention, by repeatedly In generation, adjusts the R passage of target image and the value of the gain coefficient of channel B, then uses the actual increasing obtained after every time adjusting The rgb value of target image is corrected, it is achieved thereby that target image is carried out repeatedly AWB by the value of benefit coefficient The effect processed, by processing the repeatedly AWB of target image so that the precision that AWB processes is more Accurately, the rgb value of the target image after AWB processes finally obtained, it is substantially not present deviation, incite somebody to action this The method of invention is applied in acquisition technology, and the image collected maintains primary colors substantially, and the suitability is more preferable.
Below in conjunction with the accompanying drawings, the specific embodiment of the present invention is discussed in detail.
As it is shown in figure 1, Fig. 1 is illustrated that a kind of method that image carries out AWB process that the present invention provides Flow chart, the method includes:
Step 101, correct according to i & lt after the rgb value of target image that obtains, determine target image base after i & lt correction The blue color difference average of target pixel points and red color average in YCbCr color space.
Target image is the image that pending AWB processes, and when being embodied as, can arbitrarily select a frame pending automatically The image that white balance processes is as target image.After obtaining target image, it is possible to obtain the rgb value of this target image, wherein wrap Include the rgb value of all pixels in target image.
In order to improve the precision that the AWB to target image processes, in the method that the present embodiment provides, have employed repeatedly The mode that generation adjusts, has carried out repeatedly adjusting to the rgb value of target image, i.e. processes and starts, the first RGB to target image Value carries out correcting for the first time the rgb value of the target image after obtaining the 1st correction, afterwards to the target obtained after correction for the first time The rgb value of image carries out second-order correction, is repeated in, and obtains the rgb value of target image after i & lt correction, wherein, I=0,1,2 ..., k1, k1 are positive integer, and i represents during target image is carried out AWB process, to mesh The rgb value of logo image is iterated the number of times of correction.
Obtain i & lt correction after target image rgb value after, it is possible to according to this rgb value, determine i & lt correction after The blue color difference average of target image target pixel points based on YCbCr color space and red color average, determining i & lt After correction before the blue color difference average of target image target pixel points based on YCbCr color space and red color average, need First to determine the target pixel points in target image after i & lt correction, target pixel points is to meet in this target image to preset bar The pixel of part.Owing to the rgb value of white pixel point and mellow lime pixel is satisfied by following condition: R=G=B, that is white The rgb value of pixel and mellow lime pixel is provided with the feature that red component, blue component and green component are equal to each other, right During image carries out AWB process, generally by white pixel point or do not have coloured mellow lime pixel to be defined as target Pixel.
In the method for the invention, due to it needs to be determined that i & lt correction after target image target based on YCbCr color space picture The blue color difference average of vegetarian refreshments and red color average, accordingly, it would be desirable to by all pixels in target image after i & lt correction Rgb value is all converted into color value based on YCbCr color space, so, needs meet to preset at target setting pixel During condition, can be set pre-conditioned in the following manner: the first setting means, can according to white pixel point or The feature that the rgb value of mellow lime pixel possesses is set;The second setting means, can be according to white pixel point or middle spodogram The feature that vegetarian refreshments color value based on YCbCr color space possesses is set.
Herein, each pixel based on YCbCr color space (Y, Cb, Cr) in target image after i & lt being corrected Value is defined as this pixel color value based on YCbCr color space.Equal by the Cb value of the color value of all target pixel points Value is defined as the blue color difference average of target pixel points, and the average of the Cr value of the color value of all target pixel points is defined as target The red color average of pixel.
Step 102, according to described blue color difference average and red color average, after determining i & lt correction, the gain of target image is adjusted Integral function.
Gain adjustment function be correct about i & lt after the gain coefficient of target image adjust parameter and the R passage of target image or The function of the actual gain coefficient of channel B.Wherein, gain coefficient adjust parameter for i & lt correct after target image R, The value of the one or more gain coefficients in the gain coefficient of tri-passages of G, B is adjusted, actual gain coefficient refer to through Gain coefficient after adjustment, passes through gain adjustment function, it is possible to obtained mesh after i & lt corrects by the preset initial value of gain coefficient The R passage of logo image and the value of the actual gain coefficient of channel B.
After obtaining blue color difference average and red color average, by judge blue color difference average and red color average with zero big Little relation, it is possible to determine after i & lt correction that in the color value of target pixel points, blue component and red component are inclined in target image Big or less than normal, so that it is determined that go out to need which color component of pixel in target image after i & lt correction is adjusted, And determine color component to be adjusted is tuned up or turned down, and then the gain of target image is adjusted after determining i & lt correction Integral function.
According to blue color difference average and red color average, determine the mode of the gain adjustment function of target image after i & lt correction Including multiple: such as first kind of way, first determine whether whether blue color difference average is more than red color average, if it is, will The gain adjustment function relevant to channel B gain coefficient is defined as the gain adjustment function of target image after i & lt corrects, if No, then the gain adjustment function relevant to R channel gain coefficient is defined as the Gain tuning letter of target image after i & lt corrects Number;The second way, it is judged that red color average and blue color difference average and the magnitude relationship of zero, if both is not equal to zero, Then the gain adjustment function relevant to R channel gain coefficient and the gain adjustment function relevant with channel B gain coefficient are all determined The gain adjustment function of target image after correcting for i & lt;Or, if the two has one equal to zero, then will be not equal to zero The gain adjustment function that corresponding channel gain coefficient is relevant is defined as the gain adjustment function of target image after i & lt corrects.Under Can introduce another kind in the embodiment in face and optionally determine mode, detailed content is referred to the following examples.
Step 103, using the value of n1+i as in described gain adjustment function gain coefficient adjust parameter value, determine i & lt The value of the actual gain coefficient of the R passage of target image and channel B after correction, wherein, n1 is less than preset gain coefficient adjustment The positive integer of parameter threshold.
Target image is being carried out the initial of AWB process, is adjusting less than the gain coefficient preset in processing system for optional one The positive integer n 1 (such as making n1=4) of whole parameter threshold adjusts the value of parameter as gain coefficient, and the gain substituting into target image is adjusted In integral function, the initial value of the R passage preset in processing system and the gain coefficient of channel B is adjusted, obtains R passage With the value of the actual gain coefficient after the adjustment first of channel B, it is used for afterwards the initial RGB values of target image being corrected, Thus the rgb value of target image after obtaining correcting for the first time.
After obtaining correcting for the first time after the rgb value of target image, again this rgb value is corrected, so repeats, can obtain The rgb value of target image after correcting to i & lt, during repeating, adjusts the value of parameter upper one every time by gain coefficient 1 is increased on the basis of sub-value, it follows that during the rgb value of target image is carried out i+1 time correction, gain The value of coefficient adjustment parameter is the value of n1+i, the value of n1+i is substituted into after i & lt corrects in the gain adjustment function of target image, The value of the actual gain coefficient of R passage and the channel B used in i+1 time correction can be obtained, obtain after i & lt is corrected The rgb value of the target image obtained is corrected.
Step 104, correct described rgb value according to the value of described R passage and the actual gain coefficient of channel B, it is thus achieved that i+1 The rgb value of target image after secondary correction.
After obtaining the value of actual gain coefficient of R passage and the channel B used in i+1 time correction, by the actual increasing of R passage The R component (red component) of the rgb value of the target image that the value of benefit coefficient obtains after acting on i & lt correction, will both It is multiplied, it is thus achieved that the R component of the rgb value of target image after i+1 time correction;In like manner, by the actual gain coefficient of channel B Value and i & lt correct after the B component (blue component) of the rgb value of target image that obtains be multiplied, it is thus achieved that i+1 time school The B component of the rgb value of target image after just.During the correction each time of the rgb value to target image, G passage The value of actual gain coefficient remain 1, the G component (green component) of the rgb value of target image keeps constant.By This, it may be determined that go out the rgb value of target image after i+1 time corrects.
Step 105, judge the value of described n1+i whether more than described preset gain coefficient adjustment parameter threshold, if described n1+i Value more than described preset gain coefficient adjustment parameter threshold, then the rgb value of the target image obtained after i+1 time correction is made For target image rgb value after AWB processes.
The rgb value of target image is being carried out timing for the first time, arbitrarily have selected one less than preset gain coefficient adjustment The positive integer n 1 of parameter threshold adjusts the value of parameter as gain coefficient, and later in each trimming process, gain coefficient is adjusted The value of whole parameter can increase by 1 on the basis of previous, during increasing every time, it is judged that whether its value is more than presetting Gain coefficient adjusts parameter threshold, when being embodied as, preset gain coefficient adjustment parameter threshold can be designated as Nmax, sentence Whether the value of disconnected n1+i is more than Nmax, when confirming that in certain trimming process, the value of gain coefficient adjustment parameter increases more than presetting During benefit coefficient adjustment parameter threshold Nmax, using the rgb value of the target image of acquisition after this correction as target image warp Cross and finally export rgb value after AWB processes, and stop continuing the running of correction.
Paint according to the last rgb value (finally exporting rgb value) of target image after AWB processes obtained Imaged, i.e. can get color and keep the image that primary colors is constant, i.e. obtain and there is no the original image of aberration.
In the method that the present embodiment provides, by value and the gain of channel B of the gain coefficient of the R passage to target image The value of coefficient is iterated adjusting, it is achieved that target image carries out repeatedly the effect that AWB processes so that obtain The basic zero deflection of final rgb value of target image, after using final rgb value drawing image, it is possible to obtain there is no color The original image of difference, the precision that AWB processes is more accurate, more accurately, the method is applied to image acquisition In system, it is possible to collect the original image of no color differnece, the suitability is more preferably.
As in figure 2 it is shown, Fig. 2 is illustrated that the method that the another kind that the present invention provides carries out AWB process to image Flow chart, the method includes:
Step 201, correct according to i & lt after the rgb value of target image that obtains, determine after i & lt correction in target image Each pixel color value based on YCbCr color space.
In specific implementation process, according to the following equation, the rgb value of each pixel in target image after i & lt is corrected, It is converted into color value based on YCbCr color space;
Y C b C r = 0.299 0.587 0.114 - 0.1687 - 0.3313 0.5 0.5 - 0.4187 - 0.0813 · R G B .
Wherein, i=0,1,2 ..., k1, k1 are positive integer;Y represents after i & lt correction any pixel point in target image Brightness value based on YCbCr color space;CbRepresent described pixel blue color difference based on YCbCr color space value;Cr Represent described pixel red color based on YCbCr color space value;R represents the red component of described pixel rgb value; G represents the green component of described pixel rgb value;B represents the blue component of described pixel rgb value.
Step 202, according to described color value, according to the pre-conditioned target pixel points determined after i & lt correction in target image.
In specific implementation process, it is set as pre-conditioned:Wherein,Represent in target image for The pre-set color component difference of one pixel, that is for the color value of a pixel, preset a color component difference, When the difference of each color component of certain pixel is more than this pre-set color component difference, this pixel is defined as target pixel points.
Step 203, according to described color value, determine the sum of the blue color difference value of all described target pixel points.
In specific implementation process, according to formulaDetermine the sum of the blue color difference value of all target pixel points.Wherein, C1 represents after i & lt correction sum of the blue color difference value of all target pixel points in target image, and m represents mesh after i & lt corrects The number of all target pixel points in logo image;P represents after i & lt correction the variable of target pixel points number in target image, CbP () represents after i & lt correction the blue color difference value of pth target pixel points, the indigo plant to all target pixel points in target image After color value of chromatism is sued for peace, obtain target pixel points blue color difference value and C1.
Step 204, according to described color value, determine the sum of the red color value of all described target pixel points.
In specific implementation process, according to formulaDetermine the sum of the red color value of all target pixel points.Wherein, C2 represents after i & lt correction sum of the red color value of all target pixel points in target image, and m represents mesh after i & lt corrects The number of all target pixel points in logo image;P represents after i & lt correction the variable of target pixel points number in target image, CrP () represents after i & lt correction the red color value of pth target pixel points in target image, red to all target pixel points After color value of chromatism is sued for peace, obtain target pixel points red color value and C2.
Step 205, sum according to described blue color difference value, determine the blue color difference average of all described target pixel points.
In specific implementation process, according to formulaDetermine the blue color difference average of all target pixel points.Wherein, C3 generation The blue color difference average of all target pixel points in target image after the correction of table i & lt.
Step 206, sum according to described red color value, determine the red color average of all described target pixel points.
In specific implementation process, according to formulaDetermine the red color average of all target pixel points.Wherein, C4 generation The red color average of all target pixel points in target image after the correction of table i & lt.
Step 207, according to described blue color difference average and red color average, determine the total color difference of target image after i & lt correction Average.
In specific implementation process, determine the total color difference average of target image according to formula M=| C3 |+| C4 |.Wherein, M is described Total color difference average.
Step 208, basis preset aberration reference value, meet according to default actual aberration reference value and default aberration reference value Functional relationship, determines the actual aberration reference value of target image after i & lt correction.
Judging whether target image occurs misalignment, when whether there is aberration with the color of original image, it will usually set in advance A fixed default aberration reference value, compares the total color difference average of target pixel points in target image with default aberration reference value, If total color difference average is more than presetting aberration reference value, then can determine that target image there occurs misalignment, i.e. at current environment Under the irradiation of light source, target image has certain aberration with the color of original image.
In order to can more accurately the rgb value of target image be corrected afterwards so that the target image finally obtained Rgb value recovers the rgb value to original image, default aberration reference value can be gradually reduced, obtain actual aberration reference value, It is defined as judging the foundation whether target image occurs misalignment by actual aberration reference value afterwards, the rgb value to target image It is corrected, and then obtains the rgb value being more nearly original image, greatly improve precision and the accuracy of correction.
The mode that default aberration reference value is gradually reduced is included multiple, such as first kind of way, can be with default adjustment amplitude It is gradually reduced default aberration reference value;The second way, can preset aberration reference value with irregular random reduction;Other reduces Mode equally realizes.The present invention provides a kind of optional mode, when being embodied as, according to formulaDetermine i-th The actual aberration reference value of target image after secondary correction.Wherein, qi=0,1,2 ..., k2, k2 are positive integer;θ is pre- Fill in colors on a sketch poor reference value;The actual aberration reference value of target image after correcting for i & lt.The actual aberration obtained in this mode Reference value, it is possible to ensure the correction of the rgb value to target image, result i.e. will not be too rough, and process also will not be the most loaded down with trivial details, Under the conditions of process is simple, it is ensured that the accuracy of correction, the suitability is more preferable.
Step 209, judge described total color difference average whether more than described actual aberration reference value, if described total color difference average is big In described actual aberration reference value, then determine the value of n1 according to parameter preset regularization condition.
With reference to previous embodiment, during carrying out correcting for the first time to the rgb value of target image, optional one less than processing The gain coefficient preset in system adjusts the positive integer n 1 of parameter threshold and adjusts the value of parameter as gain coefficient.In order to make whole place Reason process is simpler, reduces unnecessary tedious steps, can guarantee that again the degree of accuracy of result simultaneously, fills in colors on a sketch in advance reducing During difference reference value, the value of n1 can be gradually increased.
The mode of the value increasing n1 includes multiple, in the present embodiment, in specific implementation process, is set by parameter preset regularization condition For following formula: n1=n0+q0+q1+q2+…+qi, the value of n1 is i.e. adjusted according to this formula, wherein, n0 is gain coefficient Adjust the preset initial value (such as the value of n0 being set to 4) of parameter.
Step 210, judge that described blue color difference average is whether more than described red color average.
If step 211 described blue color difference average is more than described red color average, then determine according to described blue color difference average The gain adjustment function of target image after i & lt correction.
After determining i & lt correction according to blue color difference average, the process of the gain adjustment function of target image specifically includes:
If described blue color difference average is more than zero, then following function is defined as described gain adjustment function;
U=u0-2-n2;Or,
If described blue color difference average is less than zero, then following function is defined as described gain adjustment function;
U=u0+2-n2;Or,
If described blue color difference average is equal to zero, then following function is defined as described gain adjustment function;
U=u0
Wherein, the actual gain coefficient of the channel B of target image after u represents i & lt correction;u0Represent the gain coefficient of channel B Preset initial value;N2 represents the gain coefficient of target image after i & lt corrects and adjusts parameter.
If step 212 described blue color difference average is less than or equal to described red color average, then equal according to described red color Value determines the gain adjustment function of target image after i & lt correction.
Determine the process of gain adjustment function of target image after i & lt correction according to red color average, specifically include:
If described red color average is more than zero, then following function is defined as described gain adjustment function;
V=v0-2-n2;Or,
If described red color average is less than zero, then following function is defined as described gain adjustment function;
V=v0+2-n2;Or,
If described red color average is equal to zero, then following function is defined as described gain adjustment function;
V=v0
Wherein, the actual gain coefficient of the R passage of target image after v represents i & lt correction;v0Represent the gain coefficient of R passage Preset initial value;N2 represents the gain coefficient of target image after i & lt corrects and adjusts parameter.
Step 213, using the value of n1+i as i & lt correct after target image gain coefficient adjust parameter value, determine i-th The value of the actual gain coefficient of the R passage of target image and channel B after secondary correction.
In specific implementation process, the value of n2, generation in the gain adjustment function of target image after the value of n1+i is corrected as i & lt Enter in this gain adjustment function, carry out computing.
Step 214, correct described rgb value according to the value of described R passage and the actual gain coefficient of channel B, it is thus achieved that i+1 The rgb value of target image after secondary correction.
Step 215, judge the value of described n1+i whether more than described preset gain coefficient adjustment parameter threshold, if described n1+i Value more than described preset gain coefficient adjustment parameter threshold, then the rgb value of the target image obtained after i+1 time correction is made For target image rgb value after AWB processes.
In the method that the present embodiment provides, preset aberration reference value by constantly reducing, improve the colour cast to target image The accurate judgement of situation, the determination of the most accurate value that gain coefficient is adjusted parameter so that processing procedure decreases The value using more gain coefficient to adjust parameter carries out the step processed, and improves processing speed, improves processing procedure Efficiency, meanwhile, improves the degree of accuracy of result.
Corresponding with the above-mentioned method that image is carried out AWB process, the embodiment of the invention also discloses a kind of to figure As carrying out the device of AWB process.
As it is shown on figure 3, Fig. 3 be illustrated that the embodiment of the present invention provides a kind of image is carried out AWB process The structured flowchart of device, this device includes:
Color difference typical value determines module 301, the rgb value of the target image obtained after correcting according to i & lt, determines i & lt The blue color difference average of target image target pixel points based on YCbCr color space and red color average after correction, wherein, Described target pixel points is to meet pre-conditioned pixel, i=0,1,2 ..., k1, k1 are positive integer;
Tuning function determines module 302, is used for according to described blue color difference average and red color average, after determining i & lt correction The gain adjustment function of target image, described gain adjustment function is to adjust about the gain coefficient of target image after i & lt correction The R passage of parameter and target image or the function of the actual gain coefficient of channel B;
Gain coefficient determines module 303, for the value of n1+i is adjusted parameter as the gain coefficient in described gain adjustment function Value, determine the value of the actual gain coefficient of the R passage of target image and channel B after i & lt correction, wherein, n1 is for being less than The positive integer of preset gain coefficient adjustment parameter threshold;
Correction module 304, corrects described rgb value for the value according to described R passage and the actual gain coefficient of channel B, obtains Obtain the rgb value of target image after i+1 time corrects;
Analyze module 305, for judging whether the value of described n1+i is more than described preset gain coefficient adjustment parameter threshold, if The value of described n1+i is more than described preset gain coefficient adjustment parameter threshold, then by the target image of acquisition after i+1 time correction Rgb value as target image through AWB process after rgb value.
The device that the present embodiment provides, by value and the gain system of channel B of the gain coefficient of the R passage to target image The value of number is iterated adjusting, it is achieved that target image carries out repeatedly the effect that AWB processes so that obtain The basic zero deflection of final rgb value of target image, after using final rgb value drawing image, it is possible to obtain not having aberration Original image, the precision that AWB processes is more accurate, more accurately, this device is applied to image acquisition system In system, it is possible to collect the original image of no color differnece, the suitability is more preferably.
As shown in Figure 4, Fig. 4 is illustrated that the another kind that the embodiment of the present invention provides carries out AWB process to image The structured flowchart of device, this device includes: color difference typical value determines module 301, and Tuning function determines module 302, gain Coefficient determination module 303, correction module 304, analyze module 305, the first computing module 306, the second computing module 307 With the 3rd computing module 308.
Wherein, color difference typical value determine module 301 specifically for:
According to the following equation, the rgb value of the target image obtained after correcting according to i & lt, determine target figure after i & lt correction Each pixel color value based on YCbCr color space in Xiang;
Y C b C r = 0.299 0.587 0.114 - 0.1687 - 0.3313 0.5 0.5 - 0.4187 - 0.0813 · R G B ;
According to described color value, according to the following pre-conditioned target pixel points determined after i & lt correction in target image;
According to described color value, determine the sum of the blue color difference value of all described target pixel points according to the following equation;
C 1 = Σ p = 1 m C b ( p ) ;
According to described color value, determine the sum of the red color value of all described target pixel points according to the following equation;
C 2 = Σ p = 1 m C r ( p ) ;
According to the sum of described blue color difference value, determine the blue color difference average of all described target pixel points according to the following equation;
C 3 = C 1 m ;
According to the sum of described red color value, determine the red color average of all described target pixel points according to the following equation;
C 4 = C 2 m ;
Wherein, any pixel point brightness value based on YCbCr color space in target image after Y represents i & lt correction;CbGeneration Blue color difference based on the YCbCr color space value of pixel described in table;CrRepresent described pixel based on YCbCr color space Red color value;R represents the red component of described pixel rgb value;G represents the green of described pixel rgb value and divides Amount;B represents the blue component of described pixel rgb value;Represent in target image the pre-set color for a pixel to divide Amount difference;C1 represents after i & lt correction the sum of the blue color difference value of all target pixel points in target image;C2 represents i & lt The sum of the red color value of all target pixel points in target image after correction;C3 represents after i & lt corrects all in target image The blue color difference average of target pixel points;It is equal that C4 represents after i & lt correction the red color of all target pixel points in target image Value;M represents after i & lt correction the number of all target pixel points in target image;P represents after i & lt correction in target image The variable of target pixel points number.
Tuning function determines that module 302 includes:
Judging unit 3021, is used for judging that whether described blue color difference average is more than described red color average;
First Tuning function determines unit 3022, if described blue color difference average is more than described red color average, then for root The gain adjustment function of target image after i & lt correction is determined according to described blue color difference average;
Second Tuning function determines unit 3023, if described blue color difference average is less than or equal to described red color average, then uses The gain adjustment function of target image after determine i & lt correction according to described red color average.
First computing module 306, for according to described blue color difference average and red color average, determines i-th according to the following equation The total color difference average of target image after secondary correction;
M=| C3 |+| C4 |.
Second computing module 307, for according to presetting aberration reference value, determines target image after i & lt correction according to the following equation Actual aberration reference value;
θ q i = θ 2 q i .
3rd computing module 308, is used for judging whether described total color difference average is more than described actual aberration reference value, if described Total color difference average is more than described actual aberration reference value, determines the value of n1 the most according to the following equation;
N1=n0+q0+q1+q2+…+qi
Wherein, qi=0,1,2 ..., k2, k2 are positive integer;θ is for presetting aberration reference value;After correcting for i & lt The actual aberration reference value of target image;N0 is the preset initial value that gain coefficient adjusts parameter;M is described total color difference average.
Further, the first Tuning function determine unit 3022 specifically for:
If described blue color difference average is more than zero, then following function is defined as described gain adjustment function;
U=u0-2-n2;Or,
If described blue color difference average is less than zero, then following function is defined as described gain adjustment function;
U=u0+2-n2;Or,
If described blue color difference average is equal to zero, then following function is defined as described gain adjustment function;
U=u0
Wherein, the actual gain coefficient of the channel B of target image after u represents i & lt correction;u0Represent the gain coefficient of channel B Preset initial value;N2 represents the gain coefficient of target image after i & lt corrects and adjusts parameter.
Second Tuning function determine unit 3023 specifically for:
If described red color average is more than zero, then following function is defined as described gain adjustment function;
V=v0-2-n2;Or,
If described red color average is less than zero, then following function is defined as described gain adjustment function;
V=v0+2-n2;Or,
If described red color average is equal to zero, then following function is defined as described gain adjustment function;
V=v0
Wherein, the actual gain coefficient of the R passage of target image after v represents i & lt correction;v0Represent the gain coefficient of R passage Preset initial value;N2 represents the gain coefficient of target image after i & lt corrects and adjusts parameter.
The device that the present embodiment provides, it is possible to constantly reduce and preset aberration reference value, improve the essence of the colour cast situation to target image Really judge that the determination of the most accurate value that gain coefficient adjusts parameter decreases the more gain coefficients of employing and adjusts parameter Value carry out the step that processes, improve processing speed, meanwhile, improve the degree of accuracy of result.
Each embodiment in this specification all uses the mode gone forward one by one to describe, identical similar part between each embodiment Seeing mutually, what each embodiment stressed is the difference with other embodiments.Especially for device Or for system embodiment, owing to it is substantially similar to embodiment of the method, so describing fairly simple, relevant part ginseng See that the part of embodiment of the method illustrates.Apparatus and system embodiment described above is only schematically, wherein The unit illustrated as separating component can be or may not be physically separate, and the parts shown as unit can To be or to may not be physical location, i.e. may be located at a place, or multiple NE can also be distributed to On.Some or all of module therein can be selected according to the actual needs to realize the purpose of the present embodiment scheme.This Field those of ordinary skill, in the case of not paying creative work, is i.e. appreciated that and implements.
It should be noted that in this article, such as the relational terms of " first " and " second " or the like is used merely to one Entity or operation separate with another entity or operating space, and not necessarily require or imply these entities or operate it Between exist any this reality relation or order.And, term " includes ", " comprising " or its any other variant It is intended to comprising of nonexcludability, so that include the process of a series of key element, method, article or equipment not only Including those key elements, but also include other key elements being not expressly set out, or also include for this process, method, Article or the intrinsic key element of equipment.In the case of there is no more restriction, statement " including ... " limit Key element, it is not excluded that there is also other identical element in including the process of key element, method, article or equipment.
Below it is only the detailed description of the invention of the present invention, it is noted that for those skilled in the art, Under the premise without departing from the principles of the invention, it is also possible to make some improvements and modifications, these improvements and modifications also should be regarded as Protection scope of the present invention.

Claims (12)

1. the method that image is carried out AWB process, it is characterised in that including:
The rgb value of the target image obtained after correcting according to i & lt, after determining i & lt correction, target image is based on YCbCr The blue color difference average of the target pixel points of color space and red color average, wherein, described target pixel points is preset for meeting The pixel of condition, i=0,1,2 ..., k1, k1 are positive integer;
According to described blue color difference average and red color average, determine the gain adjustment function of target image after i & lt correction, Described gain adjustment function be correct about i & lt after the gain coefficient of target image adjust parameter and the R passage of target image or The function of the actual gain coefficient of channel B;
The value of n1+i is adjusted as the gain coefficient in described gain adjustment function the value of parameter, determines target after i & lt correction The R passage of image and the value of the actual gain coefficient of channel B, wherein, n1 is less than preset gain coefficient adjustment parameter threshold Positive integer;
Value according to described R passage and the actual gain coefficient of channel B corrects described rgb value, it is thus achieved that after i+1 time correction The rgb value of target image;
Judge whether the value of described n1+i is more than described preset gain coefficient adjustment parameter threshold, if the value of described n1+i is more than Described preset gain coefficient adjustment parameter threshold, then using the rgb value of the target image of acquisition after i+1 time correction as target figure As the rgb value after AWB processes.
Method the most according to claim 1, it is characterised in that described correct according to i & lt after the target image that obtains Rgb value, determines after i & lt correction the blue color difference average of target image target pixel points based on YCbCr color space and red The process of color color difference typical value, specifically includes:
According to the following equation, the rgb value of the target image obtained after correcting according to i & lt, determine target figure after i & lt correction Each pixel color value based on YCbCr color space in Xiang;
Y C b C r = 0.299 0.587 0.114 - 0.1687 - 0.3313 0.5 0.5 - 0.4187 - 0.0813 · R G B ;
According to described color value, according to the following pre-conditioned target pixel points determined after i & lt correction in target image;
According to described color value, determine the sum of the blue color difference value of all described target pixel points according to the following equation;
C 1 = Σ p = 1 m C b ( p ) ;
According to described color value, determine the sum of the red color value of all described target pixel points according to the following equation;
C 2 = Σ p = 1 m C r ( p ) ;
According to the sum of described blue color difference value, determine the blue color difference average of all described target pixel points according to the following equation;
C 3 = C 1 m ;
According to the sum of described red color value, determine the red color average of all described target pixel points according to the following equation;
C 4 = C 2 m ;
Wherein, any pixel point brightness value based on YCbCr color space in target image after Y represents i & lt correction;CbGeneration Blue color difference based on the YCbCr color space value of pixel described in table;CrRepresent described pixel based on YCbCr color space Red color value;R represents the red component of described pixel rgb value;G represents the green of described pixel rgb value and divides Amount;B represents the blue component of described pixel rgb value;Represent in target image the pre-set color for a pixel to divide Amount difference;C1 represents after i & lt correction the sum of the blue color difference value of all target pixel points in target image;C2 represents i & lt The sum of the red color value of all target pixel points in target image after correction;C3 represents after i & lt corrects all in target image The blue color difference average of target pixel points;It is equal that C4 represents after i & lt correction the red color of all target pixel points in target image Value;M represents after i & lt correction the number of all target pixel points in target image;P represents target image after i & lt correction The variable of middle target pixel points number.
Method the most according to claim 2, it is characterised in that described equal according to described blue color difference average and red color Value, determines the process of gain adjustment function of target image after i & lt correction, specifically includes:
Judge that whether described blue color difference average is more than described red color average;
If described blue color difference average is more than described red color average, then determine i & lt school according to described blue color difference average The gain adjustment function of target image after just;Or,
If described blue color difference average is less than or equal to described red color average, then determine i-th according to described red color average The gain adjustment function of target image after secondary correction.
Method the most according to claim 3, it is characterised in that judging that whether described blue color difference average is more than described red Before color color difference typical value, the method also includes:
According to described blue color difference average and red color average, determine the total of target image after i & lt correction according to the following equation Color difference typical value;
M=| C3 |+| C4 |;
According to default aberration reference value, determine the actual aberration reference value of target image after i & lt correction according to the following equation;
θ q i = θ 2 q i ;
Judge whether described total color difference average is more than described actual aberration reference value, if described total color difference average is more than described reality Aberration reference value, determines the value of n1 the most according to the following equation;
N1=n0+q0+q1+q2+…+qi
Wherein, qi=0,1,2 ..., k2, k2 are positive integer;θ is for presetting aberration reference value;After correcting for i & lt The actual aberration reference value of target image;N0 is the preset initial value that gain coefficient adjusts parameter;M is described total color difference average.
5. according to the method described in claim 3 or 4, it is characterised in that described determine i-th according to described blue color difference average The process of the gain adjustment function of target image after secondary correction, specifically includes:
If described blue color difference average is more than zero, then following function is defined as described gain adjustment function;
U=u0-2-n2;Or,
If described blue color difference average is less than zero, then following function is defined as described gain adjustment function;
U=u0+2-n2;Or,
If described blue color difference average is equal to zero, then following function is defined as described gain adjustment function;
U=u0
Wherein, the actual gain coefficient of the channel B of target image after u represents i & lt correction;u0Represent the gain system of channel B The preset initial value of number;N2 represents the gain coefficient of target image after i & lt corrects and adjusts parameter.
6. according to the method described in claim 3 or 4, it is characterised in that described determine i-th according to described red color average The process of the gain adjustment function of target image after secondary correction, specifically includes:
If described red color average is more than zero, then following function is defined as described gain adjustment function;
V=v0-2-n2;Or,
If described red color average is less than zero, then following function is defined as described gain adjustment function;
V=v0+2-n2;Or,
If described red color average is equal to zero, then following function is defined as described gain adjustment function;
V=v0
Wherein, the actual gain coefficient of the R passage of target image after v represents i & lt correction;v0Represent the gain system of R passage The preset initial value of number;N2 represents the gain coefficient of target image after i & lt corrects and adjusts parameter.
7. the device that image is carried out AWB process, it is characterised in that including:
Color difference typical value determines module, the rgb value of the target image obtained after correcting according to i & lt, determines that i & lt corrects The blue color difference average of rear target image target pixel points based on YCbCr color space and red color average, wherein, described Target pixel points is to meet pre-conditioned pixel, i=0,1,2 ..., k1, k1 are positive integer;
Tuning function determines module, for according to described blue color difference average and red color average, determines mesh after i & lt correction The gain adjustment function of logo image, described gain adjustment function is to adjust ginseng about the gain coefficient of target image after i & lt correction The function of the actual gain coefficient of number and the R passage of target image or channel B;
Gain coefficient determines module, for the value of n1+i to be adjusted the value of parameter as the gain coefficient in described gain adjustment function, Determining the value of the actual gain coefficient of the R passage of target image and channel B after i & lt correction, wherein, n1 is for increasing less than presetting The positive integer of benefit coefficient adjustment parameter threshold;
Correction module, corrects described rgb value for the value according to described R passage and the actual gain coefficient of channel B, it is thus achieved that The rgb value of target image after i+1 time correction;
Analyze module, for judging whether the value of described n1+i is more than described preset gain coefficient adjustment parameter threshold, if described The value of n1+i is more than described preset gain coefficient adjustment parameter threshold, then by the RGB of the target image of acquisition after i+1 time correction Be worth as target image through AWB process after rgb value.
Device the most according to claim 7, it is characterised in that described color difference typical value determine module specifically for:
According to the following equation, the rgb value of the target image obtained after correcting according to i & lt, determine target figure after i & lt correction Each pixel color value based on YCbCr color space in Xiang;
Y C b C r = 0.299 0.587 0.114 - 0.1687 - 0.3313 0.5 0.5 - 0.4187 - 0.0813 · R G B ;
According to described color value, according to the following pre-conditioned target pixel points determined after i & lt correction in target image;
According to described color value, determine the sum of the blue color difference value of all described target pixel points according to the following equation;
C 1 = Σ p = 1 m C b ( p ) ;
According to described color value, determine the sum of the red color value of all described target pixel points according to the following equation;
C 2 = Σ p = 1 m C r ( p ) ;
According to the sum of described blue color difference value, determine the blue color difference average of all described target pixel points according to the following equation;
C 3 = C 1 m ;
According to the sum of described red color value, determine the red color average of all described target pixel points according to the following equation;
C 4 = C 2 m ;
Wherein, any pixel point brightness value based on YCbCr color space in target image after Y represents i & lt correction;CbGeneration Blue color difference based on the YCbCr color space value of pixel described in table;CrRepresent described pixel based on YCbCr color space Red color value;R represents the red component of described pixel rgb value;G represents the green of described pixel rgb value and divides Amount;B represents the blue component of described pixel rgb value;Represent in target image the pre-set color for a pixel to divide Amount difference;C1 represents after i & lt correction the sum of the blue color difference value of all target pixel points in target image;C2 represents i & lt The sum of the red color value of all target pixel points in target image after correction;C3 represents after i & lt corrects all in target image The blue color difference average of target pixel points;It is equal that C4 represents after i & lt correction the red color of all target pixel points in target image Value;M represents after i & lt correction the number of all target pixel points in target image;P represents after i & lt correction in target image The variable of target pixel points number.
Device the most according to claim 8, it is characterised in that described Tuning function determines that module includes:
Judging unit, is used for judging that whether described blue color difference average is more than described red color average;
First Tuning function determines unit, if described blue color difference average is more than described red color average, then for according to institute State blue color difference average and determine the gain adjustment function of target image after i & lt correction;
Second Tuning function determines unit, if described blue color difference average is less than or equal to described red color average, then for root The gain adjustment function of target image after i & lt correction is determined according to described red color average.
Device the most according to claim 9, it is characterised in that this device also includes:
First computing module, for according to described blue color difference average and red color average, determines i & lt according to the following equation The total color difference average of target image after correction;
M=| C3 |+| C4 |;
Second computing module, for according to presetting aberration reference value, determines target image after i & lt correction according to the following equation Actual aberration reference value;
θ q i = θ 2 q i ;
3rd computing module, is used for judging whether described total color difference average is more than described actual aberration reference value, if described total color Difference average, more than described actual aberration reference value, determines the value of n1 the most according to the following equation;
N1=n0+q0+q1+q2+…+qi
Wherein, qi=0,1,2 ..., k2, k2 are positive integer;θ is for presetting aberration reference value;After correcting for i & lt The actual aberration reference value of target image;N0 is the preset initial value that gain coefficient adjusts parameter;M is described total color difference average.
11. according to the device described in claim 9 or 10, it is characterised in that described first Tuning function determines that unit is specifically used In:
If described blue color difference average is more than zero, then following function is defined as described gain adjustment function;
U=u0-2-n2;Or,
If described blue color difference average is less than zero, then following function is defined as described gain adjustment function;
U=u0+2-n2;Or,
If described blue color difference average is equal to zero, then following function is defined as described gain adjustment function;
U=u0
Wherein, the actual gain coefficient of the channel B of target image after u represents i & lt correction;u0Represent the gain coefficient of channel B Preset initial value;N2 represents the gain coefficient of target image after i & lt corrects and adjusts parameter.
12. according to the device described in claim 9 or 10, it is characterised in that described second Tuning function determines that unit is specifically used In:
If described red color average is more than zero, then following function is defined as described gain adjustment function;
V=v0-2-n2;Or,
If described red color average is less than zero, then following function is defined as described gain adjustment function;
V=v0+2-n2;Or,
If described red color average is equal to zero, then following function is defined as described gain adjustment function;
V=v0
Wherein, the actual gain coefficient of the R passage of target image after v represents i & lt correction;v0Represent the gain coefficient of R passage Preset initial value;N2 represents the gain coefficient of target image after i & lt corrects and adjusts parameter.
CN201610518732.9A 2016-07-04 2016-07-04 Automatic white balance processing method and device for images Pending CN105933687A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610518732.9A CN105933687A (en) 2016-07-04 2016-07-04 Automatic white balance processing method and device for images

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610518732.9A CN105933687A (en) 2016-07-04 2016-07-04 Automatic white balance processing method and device for images

Publications (1)

Publication Number Publication Date
CN105933687A true CN105933687A (en) 2016-09-07

Family

ID=56829852

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610518732.9A Pending CN105933687A (en) 2016-07-04 2016-07-04 Automatic white balance processing method and device for images

Country Status (1)

Country Link
CN (1) CN105933687A (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106709887A (en) * 2017-01-06 2017-05-24 凌云光技术集团有限责任公司 Image gray-world white balance adjustment method and device based on color temperature curve
CN107564047A (en) * 2017-09-12 2018-01-09 北京小米移动软件有限公司 Image processing method and device, electronic equipment and computer-readable recording medium
CN108184111A (en) * 2017-12-29 2018-06-19 上海安翰医疗技术有限公司 White balance correcting, endoscope and storage medium based on FPGA registers
CN110290371A (en) * 2018-03-19 2019-09-27 株式会社东芝 Image signal processing apparatus and image processing circuit
CN110785772A (en) * 2019-03-11 2020-02-11 深圳市大疆创新科技有限公司 Image processing method, device, system and storage medium
CN112422940A (en) * 2020-10-25 2021-02-26 中国航空工业集团公司洛阳电光设备研究所 Self-adaptive color correction method
CN116600212A (en) * 2023-07-17 2023-08-15 中国科学院光电技术研究所 White balance calibration method based on atmospheric external environment spectrum

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040120575A1 (en) * 2002-12-20 2004-06-24 Cheng Nai-Sheng Automatic white balance correction method for image capturing apparatus
CN101610420A (en) * 2008-06-20 2009-12-23 睿致科技股份有限公司 The method of Automatic white balance
CN101917633A (en) * 2010-09-01 2010-12-15 杭州海康威视软件有限公司 Image white balance processing method, device and camera thereof
CN103037224A (en) * 2012-12-07 2013-04-10 珠海全志科技股份有限公司 Image white balance processing method and device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040120575A1 (en) * 2002-12-20 2004-06-24 Cheng Nai-Sheng Automatic white balance correction method for image capturing apparatus
CN101610420A (en) * 2008-06-20 2009-12-23 睿致科技股份有限公司 The method of Automatic white balance
CN101917633A (en) * 2010-09-01 2010-12-15 杭州海康威视软件有限公司 Image white balance processing method, device and camera thereof
CN103037224A (en) * 2012-12-07 2013-04-10 珠海全志科技股份有限公司 Image white balance processing method and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
田立坤等: "自适应自动白平衡算法的改进与实现", 《电光与控制》 *

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106709887A (en) * 2017-01-06 2017-05-24 凌云光技术集团有限责任公司 Image gray-world white balance adjustment method and device based on color temperature curve
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
CN108184111A (en) * 2017-12-29 2018-06-19 上海安翰医疗技术有限公司 White balance correcting, endoscope and storage medium based on FPGA registers
CN108184111B (en) * 2017-12-29 2021-04-02 上海安翰医疗技术有限公司 White balance correction method based on FPGA register, endoscope and storage medium
CN110290371A (en) * 2018-03-19 2019-09-27 株式会社东芝 Image signal processing apparatus and image processing circuit
CN110785772A (en) * 2019-03-11 2020-02-11 深圳市大疆创新科技有限公司 Image processing method, device, system and storage medium
CN112422940A (en) * 2020-10-25 2021-02-26 中国航空工业集团公司洛阳电光设备研究所 Self-adaptive color correction method
CN116600212A (en) * 2023-07-17 2023-08-15 中国科学院光电技术研究所 White balance calibration method based on atmospheric external environment spectrum
CN116600212B (en) * 2023-07-17 2023-11-17 中国科学院光电技术研究所 White balance calibration method based on atmospheric external environment spectrum

Similar Documents

Publication Publication Date Title
CN105933687A (en) Automatic white balance processing method and device for images
CN100563297C (en) Realize the method and the device of white balance correction
US8165419B2 (en) Histogram stretching apparatus and histogram stretching method for enhancing contrast of image
CN104182949B (en) Image inking and fusing method and system based on histogram feature point registration
CN100551081C (en) A kind of method and device of realizing white balance correction
DE2844158C3 (en) Process for the reproduction of original documents which are scanned for their color content according to a three-range process
DE10314071B3 (en) Procedure for the qualitative assessment of a material with at least one identifier
CN102867295B (en) A kind of color correction method for color image
CN107507145A (en) A kind of underwater picture Enhancement Method based on the stretching of different colours spatially adaptive histogram
CN104917975A (en) Adaptive automatic exposure method based on object characteristics
CN101489022B (en) Color recovery method and system
US20080240605A1 (en) Image Processing Apparatus, Image Processing Method, and Image Processing Program
US8649625B2 (en) Method, device and program for measuring image quality adjusting ability, and method, device and program for adjusting image quality
US20090097745A1 (en) Method of performing robust auto white balance
CN106056559A (en) Dark-channel-prior-method-based non-uniform-light-field underwater target detection image enhancement method
CN104702849A (en) Infrared camera and adjusting method of infrared light brightness thereof
CN107730493A (en) Product colour difference detecting method, device, medium and computer equipment
CN106056629A (en) High dynamic range imaging method for removing ghosts through moving object detection and extension
CN107680056A (en) A kind of image processing method and device
CN102938145A (en) Consistency regulating method and system of splicing panoramic picture
CN104935900A (en) Image sensing device, color correction matrix correction method and lookup table establishment method
CN106204662A (en) A kind of color of image constancy method under multiple light courcess environment
CN104408709A (en) Rapid correction method of image with non-uniform gray scale of linear-array CCD camera
US7999863B2 (en) Image correction apparatus and method
US20090220151A1 (en) Device for adjusting image color difference value and adjusting method thereof

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20160907

WD01 Invention patent application deemed withdrawn after publication