CN107396079A - White balance adjustment method and device - Google Patents
White balance adjustment method and device Download PDFInfo
- Publication number
- CN107396079A CN107396079A CN201710776063.XA CN201710776063A CN107396079A CN 107396079 A CN107396079 A CN 107396079A CN 201710776063 A CN201710776063 A CN 201710776063A CN 107396079 A CN107396079 A CN 107396079A
- Authority
- CN
- China
- Prior art keywords
- white balance
- value
- balance gains
- gains value
- image
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N23/00—Cameras or camera modules comprising electronic image sensors; Control thereof
- H04N23/80—Camera processing pipelines; Components thereof
- H04N23/84—Camera processing pipelines; Components thereof for processing colour signals
- H04N23/88—Camera processing pipelines; Components thereof for processing colour signals for colour balance, e.g. white-balance circuits or colour temperature control
Abstract
The present invention proposes a kind of white balance adjustment method and device, wherein, method includes:Using face white balance algorithm, the first white balance gains value of image is calculated, if when calculating that imaging obtains image under various light sources respectively, image distinguish corresponding to multiple second white balance gains values;According to the first white balance gains value, chosen from multiple second white balance gains values and obtain the target white balance gains value close with the first white balance gains value;Using target white balance gains value, blank level adjustment is carried out to image.Solve in the prior art, when having face under identical scene, in image and not having face, the technical problem of white balance gains value mutation.
Description
Technical field
The present invention relates to technical field of imaging, more particularly to a kind of white balance adjustment method and device.
Background technology
In correlation technique, when the capture apparatus of using terminal equipment is taken pictures, obtained in the Color Image Acquisition of reality
To color-values and the realistic colour of object can produce deviation, cause the deviation the reason for mainly have two, one is light source ring
The colour temperature in border changes, and in the case of different-colour, the spectrum of the reflection of same object is different, so as to cause object not homochromy
Blueness is presented in the lower color difference presented of the light source irradiation of temperature, such as white object under high color temperature environment, and in low colour temperature
Presented in environment red.Another is due to the deviation of the capture apparatus gain of intrinsic color channel in itself, such as
The manual gain values of GC0307 channel B are 0x98, and the manual gain values of R, G passage are 0x80.
Thus, in correlation technique, in order to compensate the deviation of this color, shooting is changed by the white balance algorithm of correlation and set
The white balance gains value of standby color gain passage, to the misalignment caused by colour temperature environment and capture apparatus in itself it is intrinsic
The deviations of color channel gains carry out unified compensation, so as to allow the image of acquisition correctly to react the realistic colour of object.
Wherein, white balance algorithm has a variety of, is used equally for calculating white balance gains value, is carried out at portrait scene
Under, in order to play preferable treatment effect, based on having face and carry out white balance using different white balance algorithm without face
Processing, causes when being taken pictures, and under same scene, when having face and not having face, obtained white balance gains value becomes
Change substantially, so as to cause image color to be mutated.
The content of the invention
The present invention provides a kind of white balance adjustment method and device, to solve in the prior art, under identical scene, and figure
When having face as in and not having face, white balance gains value mutation, so as to cause the technical problem that color is mutated.
The embodiment of the present invention provides a kind of white balance adjustment method, comprises the following steps:Using face white balance algorithm, meter
Calculation obtains the first white balance gains value of image;If calculating respectively, imaging is when obtaining described image under various light sources, the figure
Multiple second white balance gains values as corresponding to distinguishing;It is white from the multiple second according to the first white balance gains value
Chosen in balancing gain value and obtain the target white balance gains value close with the first white balance gains value;Using the target
White balance gains value, blank level adjustment is carried out to described image.
Another embodiment of the present invention provides a kind of white balance adjustment device, including:First computing module, for using face
White balance algorithm, the first white balance gains value of image is calculated;Second computing module, for calculating respectively in various light sources
Lower imaging is when obtaining described image, described image distinguish corresponding to multiple second white balance gains values;Module is chosen, for root
According to the first white balance gains value, chosen from the multiple second white balance gains value and obtain increasing with first white balance
Benefit is worth close target white balance gains value;Adjusting module, for using the target white balance gains value, described image is entered
Row blank level adjustment.
Further embodiment of this invention provides a kind of computer equipment, including memory and processor, is stored up in the memory
There is computer-readable instruction, when the instruction is by the computing device so that the above-mentioned reality of the computing device present invention
Apply the white balance adjustment method described in example.
A further embodiment of the present invention provides a kind of non-transitorycomputer readable storage medium, is stored thereon with computer journey
Sequence, white balance adjustment method as described in the above embodiment the present invention is realized when the computer program is executed by processor.
Technical scheme provided in an embodiment of the present invention can include the following benefits:
Using face white balance algorithm, the first white balance gains value of image is calculated, if calculating respectively in a variety of light
Imaging is when obtaining image under source, image distinguish corresponding to multiple second white balance gains values, according to the first white balance gains value,
Chosen from multiple second white balance gains values and obtain the target white balance gains value close with the first white balance gains value, used
Target white balance gains value, blank level adjustment is carried out to image.Thus, it is suppressed that under same scene, have face and do not have
During face, the problem of white balance gains value mutation is so as to cause screen flicker, the injury to human eye is avoided.
Brief description of the drawings
Of the invention above-mentioned and/or additional aspect and advantage will become from the following description of the accompanying drawings of embodiments
Substantially and it is readily appreciated that, wherein:
Fig. 1 is the flow chart of white balance adjustment method according to an embodiment of the invention;
Fig. 2 is the flow chart of white balance adjustment method in accordance with another embodiment of the present invention;
Fig. 3 is the structural representation of white balance adjustment device according to an embodiment of the invention;
Fig. 4 is the structural representation of white balance adjustment device in accordance with another embodiment of the present invention;
Fig. 5 is the structural representation according to the white balance adjustment device of another embodiment of the invention;And
Fig. 6 is the structural representation of the image processing circuit in the computer equipment that one embodiment of the invention proposes.
Embodiment
Embodiments of the invention are described below in detail, the example of the embodiment is shown in the drawings, wherein from beginning to end
Same or similar label represents same or similar element or the element with same or like function.Below with reference to attached
The embodiment of figure description is exemplary, it is intended to for explaining the present invention, and is not considered as limiting the invention.
It is appreciated that under many application scenarios in actual applications, user is used in the terminal devices such as smart mobile phone
Application program is taken pictures, wherein, under the pattern that preposition exposal model or portrait exposal model of terminal device etc. claps portrait
Take pictures, and, put after use when being taken pictures under the non-portrait exposal model such as exposal model, used white balance algorithm is not
With, because the color composition with non-face pattern hypograph under face exposal model is different.Specifically, exist
Face white balance (Face Automatic White Balance, FaceAWB) algorithm is used under portrait exposal model, works as image
In when personage be present, because the colour of skin of a kind of ethnic group varies less, in the range of one can estimate.Therefore, can be according to people
The feature of the face colour of skin, it is determined that corresponding corrector, and then obtain more accurately white balance result of calculation.It is especially pure in large area
Under the conditions of color background and/or mixed light, the white balance effect of image can effectively improve.
Gray world (Simple Gray World) algorithm, gray world (Simple are used under non-portrait exposal model
Gray World) algorithm is based on gray world is assumed, the hypothesis thinks:There is the figure of a large amount of color changes for a width
The average value of the saturation degree of picture, red (Red, R), green (Green, G) and blue (Blue, B) three components tends to same ash
Angle value.I.e. gray world algorithm assumes that nature scenery is a definite value on the whole for the average of the average reflection of light, this
The saturation degree of tri- components of R, G, B reaches unanimity in individual definite value.When abundant color in image be present, pass through the gray world
Algorithm is handled image, can preferably eliminate the influence of ambient light.
However, using the white balance gains value difference acquired in different white balance algorithms away from larger, in same applied field
Under scape, when terminal device is moved under the scene of no face from the scene for having face, the white balance gains value difference that is obtained
Away from larger, so as to cause color to be undergone mutation, there is injury to human eye, visual effect is bad.
In order to solve the above-mentioned technical problem, the present invention proposes a kind of white balance adjustment method and device, can suppress white
The problem of balancing gain value mutation.
Below with reference to the accompanying drawings the white balance adjustment method and device of the embodiment of the present invention are described.
Fig. 1 is the flow chart of white balance adjustment method according to an embodiment of the invention, as shown in figure 1, this method bag
Include following steps:
Step 101, using face white balance algorithm, the first white balance gains value of image is calculated.
Specifically, in order to for facial image from suitable yield value to image carry out white balance processing so that at image
Manage in result, the color and ratio of skin tone of face are relatively coincide, and image can be calculated the first according to the face white balance algorithm
One yield value is standby to make.
Step 102, if calculating imaging when obtaining image under various light sources respectively, image distinguish corresponding to multiple second
White balance gains value.
Wherein, light source includes:One or more of daylight source, fluorescence light source, tungsten filament lamp sources and F-A-H light sources group
Close, wherein, F-A-H light sources are the light sources between A light and H light, and A light color temperatures are 2850K, and H light color temperatures are 2350K.
Specifically, in order to for inhuman face image from suitable yield value to image carry out white balance processing so that image
In result, the color and Natural color in non-face region are relatively coincide, if calculating respectively, imaging obtains figure under various light sources
During picture, corresponding multiple second white balance gains values are standby to make respectively for image institute, the second white balance gains value and gray scale generation
The arithmetic result on boundary is closer to.
Step 103, according to the first white balance gains value, chosen from multiple second white balance gains values obtain with it is first white
The close target white balance gains value of balancing gain value.
Step 104, using target white balance gains value, blank level adjustment is carried out to image.
Specifically, in order to avoid the white balance gains value difference under face exposal model and non-face exposal model it is different compared with
Greatly, according to the first white balance gains value, chosen from multiple second white balance gains values and obtain connecing with the first white balance gains value
Near target white balance gains value, so as to carry out blank level adjustment to image according to the target white balance gains value, on the one hand examine
Face complexion has been measured, the abundant color (gray world) of nature has on the other hand been considered, can not only improve image procossing
Visual effect, and the white balance gains value based on target white balance gains value and gray world is closer to, and is avoided white flat
The problem of gain value mutation weigh so as to cause screen flicker.
It should be noted that according to the difference of application scenarios, different implementations can be used, is increased according to the first white balance
Benefit value, chosen from multiple second white balance gains values and obtain the target white balance gains close with the first white balance gains value
Value, is illustrated below:
The first example, determine in the first white balance gains value, the first yield value of each color component, for each
Two white balance gains values, the second yield value of each color component is determined, it is white flat with first to each second white balance gains value
Difference value between weighing apparatus yield value is calculated, and difference value is to the first yield value in same color component and the second yield value exhausted
After mathematic interpolation, what is obtained is summed to the absolute difference of each color component, from multiple second white balance gains values, choose with
The target white balance gains value of difference value minimum between first yield value.
Second of example, according to first yield value of the first white balance gains value on each color component, generation first to
Amount, according to each second yield value of the second white balance gains value on each color component, corresponding to generation multiple second to
Amount, calculate the vector distance between primary vector and each secondary vector, vector distance includes Euclidean distance, according to
Span is from from multiple second white balance gains values, selection obtains the minimum target white balance gains value of vector distance.
In summary, the white balance adjustment method of the embodiment of the present invention, using face white balance algorithm, image is calculated
The first white balance gains value, if calculating imaging when obtaining image under various light sources respectively, image distinguish corresponding to it is multiple
Second white balance gains value, according to the first white balance gains value, choose and obtain and first from multiple second white balance gains values
The close target white balance gains value of white balance gains value, using target white balance gains value, blank level adjustment is carried out to image.
Thus, it is suppressed that under same scene, when having face and not having face, white balance gains value mutation is so as to causing screen flicker
The problem of, avoid the injury to human eye.
Based on above example, for further detailed description, how according to the first white balance gains value, from multiple
Chosen in two white balance gains values and obtain the target white balance gains value close with the first white balance gains value, with reference to above-mentioned
Exemplified by the vector based on yield value shown in second of example determines target white balance gains value, illustrate.
Fig. 2 is the flow chart of white balance adjustment method in accordance with another embodiment of the present invention, as shown in Fig. 2 this method
Including:
Step 201, using face white balance algorithm, the first white balance gains value of image is calculated.
Specifically, recognition of face can be carried out, to determine to include face area in image to image by face recognition technology
Domain, such as, face recognition technology can be first passed through, the face in image is identified, obtains the coordinate section of human face region,
Wherein, face recognition algorithms, there are a variety of implementations in the prior art, for example, being carried out using Adaboost model algorithms
Recognition of face, the algorithm of other energy express delivery identification human face regions can also be used, carries out the identification of human face region.Corresponding face is known
Other implementation, do not limit in the present embodiment.
After human face region is obtained, because the colour of skin of a kind of ethnic group varies less.For example, according to statistics, colour of skin rgb color is empty
Between be transformed into YCbCr space after, Cb, Cr scope of face is respectively [133,173], [77,127].As long as it can determine that out people
Skin color range, it is possible to according to the skin color range correction chart picture.Therefore, can be by contrasting the face of human face region in the image
Color and default skin color range, calculate the first yield value of the image.
Certainly, above-described embodiment carries out the purpose that recognition of face determines the first yield value, is to be taken pictures to obtain in face
Under pattern based on the colour of skin carry out white balance processing when the first yield value, in fact, front camera exposal model or
Under the exposal model of rear camera, it is all based on face white balance algorithm and carries out white balance processing, and hence it is also possible to determine to scheme
During as using front camera imaging, using face white balance algorithm, the first white balance gains value of image is calculated, or
Person, determine image using rear camera portrait mode of figure imaging when, using face white balance algorithm, be calculated the of image
One white balance gains value etc..
Step 202, if calculating imaging when obtaining image under various light sources respectively, image distinguish corresponding to multiple second
White balance gains value.
Specifically, respectively under various light sources, white balance processing is carried out using gray world algorithm, wherein, gray world
What algorithm was based on is assumed to be:There is the image of a large amount of color changes for a width, the saturation degree of tri- components of R, G, B is averaged
Value tends to same gray value G.In actual applications, two methods generally determine gray value G.
As a kind of possible implementation, fixed value can be taken.For example, the half of most bright gray value can be taken, that is, work as
When most bright gray value is 255, gray value G can be 128.As alternatively possible implementation, can be schemed by calculating
Tri- kinds of respective average values of color of R, G, B as in, take the average of these three average values as gray value G.It is determined that the gray scale
After value G, can by by tri- kinds of respective average values of color of gray value G and R, G, B respectively compared with, so as to calculate pair
Answer the second yield value of the image under light source.
Step 203, the first yield value according to the first white balance gains value on each color component, primary vector is generated.
Step 204, it is corresponding according to each second yield value of the second white balance gains value on each color component, generation
Multiple secondary vectors.
In actual applications, the vector in color space can be utilized accurately to characterize first yield value and second increasing
Benefit value.Color space can by a variety of, such as:RGB (red, green, blue) color space, the i.e. face based on equipment three primary colours
The colour space.Furthermore it is also possible to be HSI color spaces, the HSI color spaces are the vision systems from people, use tone
(Hue), color saturation (Saturation or Chroma) and brightness (Intensity or Brightness) describes color.HSI
Color space can be described with a conical space model.It is, of course, also possible to it is described using other color spaces, this reality
Apply in example and this is repeated no more.As a kind of possible implementation, the RGB models in color space can be used to characterize first
Yield value and the second yield value.
Specifically, in RGB models, each color is appeared in tri- color components of R, G, B, and this model is based on flute card
That coordinate system, the color space considered is a cube.A cubical summit can be used as origin, and black is located at
At the origin, white is located at apex farthest from origin in the cube.In the model, different colors is in cube
Above or it is in inside cube, and can be characterized with the vector being distributed from origin.
As a kind of possible implementation, it is assumed that all colors all normalize, then the cube is a unit
Cube, i.e., all R, G, B value value all in the range of [0,1].Therefore, first yield value and the second yield value R,
G, the value in B on each color component can also all in the range of [0,1] value.By the first yield value in each color point
Valued combinations in amount together, can be to generate primary vector, by value group of second yield value on each color component
It is combined, can be to generate secondary vector.For example, if value of first yield value in R component is 0.1, on G components
Value is 0.2, and the value on B component is 0.3, then value that can be according to the first yield value on each color component is raw
Into primary vector [0.1,0.2,0.3].If value of second yield value in R component is 0.2, the value on G components is
0.2, value on B component is 0.2, then value that can be according to the second yield value on each color component, generation first
Vectorial [0.2,0.2,0.2].
Step 205, the vector distance between primary vector and each secondary vector is calculated, wherein, vector distance includes
Euclidean distance.
Specifically, after generation primary vector and secondary vector, just realize to the first yield value and the second yield value
Quantization signifying.When calculating the vector distance between primary vector and secondary vector, this can be described using Euclidean distance
Vector distance between two vectors, the modes such as COS distance, Pearson correlation coefficient can also be used to describe the two vectors
Between vector distance., can exemplified by describing the vector distance between primary vector and secondary vector using Euclidean distance
To pass through following Euclidean distance formula:
Calculate the vector distance between primary vector and secondary vector.Wherein, d (x, y) is primary vector and secondary vector
Between vector distance, xR、xG、xBValue respectively in primary vector on each color component, yR、yG、yBRespectively second
Value in vector on each color component.
And then after the vector distance being calculated between primary vector and secondary vector, it can be determined that the primary vector
Vector distance between the secondary vector, the vector distance between primary vector and the secondary vector are bigger, it may be determined that the
One yield value and the second yield value are more dissimilar.If the vector distance between the primary vector and the secondary vector is closer,
It can determine that the first yield value and the second yield value are similar.
Step 206, according to vector distance, from multiple second white balance gains values, choose and obtain vector distance minimum
Target white balance gains value.
Step 207, using target white balance gains value, blank level adjustment is carried out to image.
Specifically, according to vector distance, from multiple second white balance gains values, choose and obtain the minimum mesh of vector distance
White balance gains value is marked, image is carried out using the target white balance gains value that gray world algorithm is calculated accurately white flat
Weighing apparatus processing, has on the one hand considered face complexion, has on the other hand considered the abundant color of nature, can not only improve at image
The visual effect of reason, and image procossing is carried out based on unified target white balance gains value, avoid white balance gains value and dash forward
The problem of becoming so as to cause screen flicker.
In summary, the white balance adjustment method of the embodiment of the present invention, according to be used for by the face in image adjust to
The face white balance algorithm of the colour of skin, to the image calculate the first yield value, and if calculate be imaged respectively under various light sources
During to image, image distinguish corresponding to multiple second white balance gains values, according to the first white balance gains value in each color point
The first yield value in amount, generate primary vector, according to each second white balance gains value on each color component second
Yield value, multiple secondary vectors corresponding to generation, and calculate the vector distance between primary vector and each secondary vector;To
Span is from including Euclidean distance, and according to vector distance, from multiple second white balance gains values, selection obtains vector distance
Minimum target white balance gains value, and then, using target white balance gains value, blank level adjustment is carried out to image, so as to match somebody with somebody
Slower white balance convergence rate is closed, when can be effectively improved using face white balance algorithm progress blank level adjustment, whether there is face
When the problem of flashing.
In order to realize above-described embodiment, the present invention also proposes a kind of white balance adjustment device, and Fig. 3 is according to of the invention one
The structural representation of the white balance adjustment device of embodiment, as shown in figure 3, the white balance adjustment device includes the first computing module
100th, the second computing module 200, selection module 300 and adjusting module 400.
Wherein, the first computing module 100, for using face white balance algorithm, the first white balance of image is calculated
Yield value.
Second computing module 200, when for calculating, imaging obtains image under various light sources respectively, image corresponds to respectively
Multiple second white balance gains values.
Module 300 is chosen, for according to the first white balance gains value, choosing and obtaining from multiple second white balance gains values
The target white balance gains value close with the first white balance gains value.
Adjusting module 400, for using target white balance gains value, blank level adjustment is carried out to image.
Based on above-described embodiment, Fig. 4 is the structural representation of white balance adjustment device in accordance with another embodiment of the present invention
Figure, as shown in figure 4, on the basis of as shown in Figure 3, the selection module 300 includes the first computing unit 310 and first and chooses list
Member 320.
Wherein, the first computing unit 310, for determining in the first white balance gains value, the first gain of each color component
Value;For each the second white balance gains value, the second yield value of each color component is determined;Each second white balance is increased
Difference value between beneficial value and the first white balance gains value is calculated, difference value be to the first yield value in same color component and
After the absolute difference of second yield value calculates, what is obtained is summed to the absolute difference of each color component.
First chooses unit 320, for from multiple second white balance gains values, choosing the difference between the first yield value
The minimum target white balance gains value of different value.
Based on above-described embodiment, Fig. 5 is the structural representation according to the white balance adjustment device of another embodiment of the invention
Figure, as shown in figure 5, on the basis of as shown in Figure 3, the selection module 300 includes the second computing unit 330 and second and chooses list
Member 340.
Wherein, the second computing unit 330, for the first gain according to the first white balance gains value on each color component
Value, generate primary vector;It is corresponding according to each second yield value of the second white balance gains value on each color component, generation
Multiple secondary vectors;Calculate the vector distance between primary vector and each secondary vector.
Second chooses unit 340, for according to vector distance, from multiple second white balance gains values, selection obtain to
Target white balance gains value of the span from minimum.
It should be noted that the foregoing description to embodiment of the method, is also applied for the device of the embodiment of the present invention, it is realized
Principle is similar, will not be repeated here.
The division of modules is only used for for example, in other embodiments, can incite somebody to action in above-mentioned white balance adjustment device
White balance adjustment device is divided into different modules as required, to complete all or part of work(of above-mentioned white balance adjustment device
Energy.
In summary, the white balance adjustment device of the embodiment of the present invention, using face white balance algorithm, image is calculated
The first white balance gains value, if calculating imaging when obtaining image under various light sources respectively, image distinguish corresponding to it is multiple
Second white balance gains value, according to the first white balance gains value, choose and obtain and first from multiple second white balance gains values
The close target white balance gains value of white balance gains value, using target white balance gains value, blank level adjustment is carried out to image.
Thus, it is suppressed that under same scene, when having face and not having face, white balance gains value mutation is so as to causing screen flicker
The problem of, avoid the injury to human eye.
To achieve the above object, the embodiment of the present invention also provides a kind of computer equipment.Above computer equipment includes
Image processing circuit, image processing circuit can utilize hardware and/or component software to realize, it may include define ISP (Image
Signal Processing, picture signal processing) pipeline various processing units.Fig. 6 is image procossing electricity in one embodiment
The schematic diagram on road.As shown in fig. 6, for purposes of illustration only, each of the image processing techniques related to the embodiment of the present invention is only shown
Aspect.
As shown in fig. 6, image processing circuit includes ISP processors 1040 and control logic device 1050.Imaging device 1010
The view data of seizure is handled by ISP processors 1040 first, and ISP processors 1040 are analyzed view data can with seizure
For determination and/or the image statistics of one or more control parameters of imaging device 1010.Imaging device 1010 can wrap
Include the camera with one or more lens 1012 and imaging sensor 1014.Imaging sensor 1014 may include colour filter
Array (such as Bayer filters), imaging sensor 1014 can obtain the light caught with each imaging pixel of imaging sensor 1014
Intensity and wavelength information, and the one group of raw image data that can be handled by ISP processors 1040 is provided.Sensor 1020 can be based on
Raw image data is supplied to ISP processors 1040 by the interface type of sensor 1020.The interface of sensor 1020 can utilize
SMIA (Standard Mobile Imaging Architecture, Standard Mobile Imager framework) interface, it is other serially or simultaneously
The combination of row camera interface or above-mentioned interface.
ISP processors 1040 handle raw image data pixel by pixel in various formats.For example, each image pixel can
Bit depth with 8,10,12 or 14 bits, ISP processors 1040 can be carried out at one or more images to raw image data
Reason operation, statistical information of the collection on view data.Wherein, image processing operations can be by identical or different bit depth precision
Carry out.
ISP processors 1040 can also receive pixel data from video memory 1030.For example, will from the interface of sensor 1020
Raw pixel data is sent to video memory 1030, and the raw pixel data in video memory 1030 is available at ISP
It is for processing to manage device 1040.Video memory 1030 can be in a part, storage device or electronic equipment for storage arrangement
Independent private memory, and may include DMA (Direct Memory Access, direct direct memory access (DMA)) feature.
When receiving the raw image data from the interface of sensor 1020 or from video memory 1030, at ISP
Reason device 1040 can carry out one or more image processing operations, such as time-domain filtering.View data after processing can be transmitted to image
Memory 1030, to carry out other processing before shown.ISP processors 1040 are from the receiving area of video memory 1030
Data are managed, and the image real time transfer in original domain and in RGB and YCbCr color spaces is carried out to the processing data.Place
View data after reason may be output to display 1070, so that user watches and/or by graphics engine or GPU (Graphics
Processing Unit, graphics processor) further processing.In addition, the output of ISP processors 1040 also can be transmitted to image
Memory 1030, and display 1070 can read view data from video memory 1030.In one embodiment, image stores
Device 1030 can be configured as realizing one or more frame buffers.In addition, the output of ISP processors 1040 can be transmitted to coding
Device/decoder 1060, so as to encoding/decoding image data.The view data of coding can be saved, and be shown in display
Decompressed before in 1070 equipment.Encoder/decoder 1060 can be realized by CPU or GPU or coprocessor.
The statistics that ISP processors 1040 determine, which can be transmitted, gives the unit of control logic device 1050.For example, statistics can
Passed including the image such as automatic exposure, AWB, automatic focusing, flicker detection, black level compensation, the shadow correction of lens 1012
The statistical information of sensor 1014.Control logic device 1050 may include the processor for performing one or more routines (such as firmware) and/or
Microcontroller, one or more routines according to the statistics of reception, can determine imaging device 1010 control parameter and
Control parameter.For example, control parameter may include the control parameter of sensor 1020 (such as gain, time of integration of spectrum assignment),
The combination of camera flash control parameter, the control parameter of lens 1012 (such as focusing or zoom focal length) or these parameters.
ISP control parameters may include the gain level and color for being used for AWB and color adjustment (for example, during RGB processing)
Correction matrix, and the shadow correction parameter of lens 1012.
It it is below the step of realizing white balance adjustment method with image processing techniques in Fig. 6:
Step 101 ', using face white balance algorithm, the first white balance gains value of image is calculated.
Step 102 ', if calculating is imaged under various light sources when obtaining described image respectively, described image corresponds to respectively
Multiple second white balance gains values.
Step 103 ', according to the first white balance gains value, chosen from the multiple second white balance gains value
To the target white balance gains value close with the first white balance gains value.
Step 104 ', using the target white balance gains value, blank level adjustment is carried out to described image.
It should be noted that the foregoing explanation to embodiment of the method is also applied for the terminal device of the present embodiment, its
Realization principle is similar, and here is omitted.
In summary, the terminal device of the embodiment of the present invention, using face white balance algorithm, it is calculated the first of image
White balance gains value, if calculating imaging when obtaining image under various light sources respectively, image distinguish corresponding to it is multiple second white
Balancing gain value, according to the first white balance gains value, choose and obtain and the first white balance from multiple second white balance gains values
The close target white balance gains value of yield value, using target white balance gains value, blank level adjustment is carried out to image.Thus,
Inhibit under same scene, when having face and not having face, white balance gains value mutation is so as to causing asking for screen flicker
Topic, avoids the injury to human eye.
The embodiment of the present invention also proposes a kind of non-transitorycomputer readable storage medium, is stored thereon with computer journey
Sequence, white balance adjustment method as in the foregoing embodiment can be realized when the computer program is executed by processor.
In the description of this specification, reference term " one embodiment ", " some embodiments ", " example ", " specifically show
The description of example " or " some examples " etc. means specific features, structure, material or the spy for combining the embodiment or example description
Point is contained at least one embodiment or example of the present invention.In this manual, to the schematic representation of above-mentioned term not
Identical embodiment or example must be directed to.Moreover, specific features, structure, material or the feature of description can be with office
Combined in an appropriate manner in one or more embodiments or example.In addition, in the case of not conflicting, the skill of this area
Art personnel can be tied the different embodiments or example and the feature of different embodiments or example described in this specification
Close and combine.
In addition, term " first ", " second " are only used for describing purpose, and it is not intended that instruction or hint relative importance
Or the implicit quantity for indicating indicated technical characteristic.Thus, define " first ", the feature of " second " can be expressed or
Implicitly include at least one this feature.In the description of the invention, " multiple " are meant that at least two, such as two, three
It is individual etc., unless otherwise specifically defined.
Any process or method described otherwise above description in flow chart or herein is construed as, and represents to include
Module, fragment or the portion of the code of the executable instruction of one or more the step of being used to realize custom logic function or process
Point, and the scope of the preferred embodiment of the present invention includes other realization, wherein can not press shown or discuss suitable
Sequence, including according to involved function by it is basic simultaneously in the way of or in the opposite order, carry out perform function, this should be of the invention
Embodiment person of ordinary skill in the field understood.
Expression or logic and/or step described otherwise above herein in flow charts, for example, being considered use
In the order list for the executable instruction for realizing logic function, may be embodied in any computer-readable medium, for
Instruction execution system, device or equipment (such as computer based system including the system of processor or other can be held from instruction
The system of row system, device or equipment instruction fetch and execute instruction) use, or combine these instruction execution systems, device or set
It is standby and use.For the purpose of this specification, " computer-readable medium " can any can be included, store, communicate, propagate or pass
Defeated program is for instruction execution system, device or equipment or the dress used with reference to these instruction execution systems, device or equipment
Put.The more specifically example (non-exhaustive list) of computer-readable medium includes following:Electricity with one or more wiring
Connecting portion (electronic installation), portable computer diskette box (magnetic device), random access memory (RAM), read-only storage
(ROM), erasable edit read-only storage (EPROM or flash memory), fiber device, and portable optic disk is read-only deposits
Reservoir (CDROM).In addition, computer-readable medium, which can even is that, to print the paper of described program thereon or other are suitable
Medium, because can then enter edlin, interpretation or if necessary with it for example by carrying out optical scanner to paper or other media
His suitable method is handled electronically to obtain described program, is then stored in computer storage.
It should be appreciated that each several part of the present invention can be realized with hardware, software, firmware or combinations thereof.Above-mentioned
In embodiment, software that multiple steps or method can be performed in memory and by suitable instruction execution system with storage
Or firmware is realized.Such as, if realized with hardware with another embodiment, following skill well known in the art can be used
Any one of art or their combination are realized:With the logic gates for realizing logic function to data-signal from
Logic circuit is dissipated, the application specific integrated circuit with suitable combinational logic gate circuit, programmable gate array (PGA), scene can compile
Journey gate array (FPGA) etc..
Those skilled in the art are appreciated that to realize all or part of step that above-described embodiment method carries
Suddenly it is that by program the hardware of correlation can be instructed to complete, described program can be stored in a kind of computer-readable storage medium
In matter, the program upon execution, including one or a combination set of the step of embodiment of the method.
In addition, each functional unit in each embodiment of the present invention can be integrated in a processing module, can also
That unit is individually physically present, can also two or more units be integrated in a module.Above-mentioned integrated mould
Block can both be realized in the form of hardware, can also be realized in the form of software function module.The integrated module is such as
Fruit is realized in the form of software function module and as independent production marketing or in use, can also be stored in a computer
In read/write memory medium.
Storage medium mentioned above can be read-only storage, disk or CD etc..Although have been shown and retouch above
Embodiments of the invention are stated, it is to be understood that above-described embodiment is exemplary, it is impossible to be interpreted as the limit to the present invention
System, one of ordinary skill in the art can be changed to above-described embodiment, change, replace and become within the scope of the invention
Type.
Claims (10)
1. a kind of white balance adjustment method, it is characterised in that comprise the following steps:
Using face white balance algorithm, the first white balance gains value of image is calculated;
If calculating imaging when obtaining described image under various light sources respectively, described image distinguish corresponding to multiple second put down in vain
Weigh yield value;
According to the first white balance gains value, chosen from the multiple second white balance gains value obtain with it is described first white
The close target white balance gains value of balancing gain value;
Using the target white balance gains value, blank level adjustment is carried out to described image.
2. white balance adjustment method according to claim 1, it is characterised in that described according to first white balance gains
Value, chosen from the multiple second white balance gains value and obtain the target white balance close with the first white balance gains value
Yield value, including:
Determine in the first white balance gains value, the first yield value of each color component;
For each the second white balance gains value, the second yield value of each color component is determined;
Difference value between each second white balance gains value and the first white balance gains value is calculated, the difference
Different value is after calculating the absolute difference of the first yield value described in same color component and second yield value, to each color point
The absolute difference of amount sums what is obtained;
From multiple second white balance gains values, the target white balance the difference value minimum between the first yield value is chosen
Yield value.
3. white balance adjustment method according to claim 1, it is characterised in that described according to first white balance gains
Value, chosen from the multiple second white balance gains value and obtain the target white balance close with the first white balance gains value
Yield value, including:
According to first yield value of the first white balance gains value on each color component, primary vector is generated;
According to each second yield value of the second white balance gains value on each color component, corresponding to generation multiple second to
Amount;
Calculate the vector distance between the primary vector and each described secondary vector;The vector distance include Europe it is several in
Obtain distance;
According to the vector distance, from the multiple second white balance gains value, choose and obtain the vector distance minimum
Target white balance gains value.
4. according to the white balance adjustment method described in claim any one of 1-3, it is characterised in that described to use face white balance
Algorithm, it is calculated before the first white balance gains value of image, in addition to:
Recognition of face is carried out to described image, to determine to include human face region in described image;
Or, determine that described image is imaged to obtain using front camera;
Or, determine that described image is imaged to obtain using the portrait mode of figure of rear camera.
5. according to the white balance adjustment method described in claim any one of 1-3, it is characterised in that the light source includes:Daylight
One or more of light source, fluorescence light source, tungsten filament lamp sources and F-A-H light sources combine.
A kind of 6. white balance adjustment device, it is characterised in that including:
First computing module, for using face white balance algorithm, the first white balance gains value of image is calculated;
Second computing module, when for calculating, imaging obtains described image under various light sources respectively, described image institute is right respectively
The multiple second white balance gains values answered;
Module is chosen, for according to the first white balance gains value, being chosen from the multiple second white balance gains value
To the target white balance gains value close with the first white balance gains value;
Adjusting module, for using the target white balance gains value, blank level adjustment is carried out to described image.
7. white balance adjustment device according to claim 6, it is characterised in that the selection module, including:
First computing unit, for determining in the first white balance gains value, the first yield value of each color component;For every
One the second white balance gains value, determine the second yield value of each color component;To each second white balance gains value and institute
The difference value stated between the first white balance gains value is calculated, and the difference value is to the first gain described in same color component
After the absolute difference of value and second yield value calculates, what is obtained is summed to the absolute difference of each color component;
First chooses unit, for from multiple second white balance gains values, choosing the difference between the first yield value
It is worth minimum target white balance gains value.
8. white balance adjustment device according to claim 6, it is characterised in that the selection module, including:
Second computing unit, for the first yield value according to the first white balance gains value on each color component, generation
Primary vector;It is multiple corresponding to generation according to each second yield value of the second white balance gains value on each color component
Secondary vector;Calculate the vector distance between the primary vector and each described secondary vector;
Second chooses unit, for according to the vector distance, from the multiple second white balance gains value, selection to obtain institute
State the minimum target white balance gains value of vector distance.
9. a kind of computer equipment, it is characterised in that including memory, processor and storage on a memory and can be in processor
The computer program of upper operation, during the computing device described program, realize putting down in vain as described in any in claim 1-5
Weigh method of adjustment.
10. a kind of computer-readable recording medium, is stored thereon with computer program, it is characterised in that the program is by processor
The white balance adjustment method as described in any in claim 1-5 is realized during execution.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710776063.XA CN107396079B (en) | 2017-08-31 | 2017-08-31 | White balance adjustment method and device |
PCT/CN2017/107333 WO2019041493A1 (en) | 2017-08-31 | 2017-10-23 | White balance adjustment method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710776063.XA CN107396079B (en) | 2017-08-31 | 2017-08-31 | White balance adjustment method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN107396079A true CN107396079A (en) | 2017-11-24 |
CN107396079B CN107396079B (en) | 2019-06-07 |
Family
ID=60348993
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710776063.XA Active CN107396079B (en) | 2017-08-31 | 2017-08-31 | White balance adjustment method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107396079B (en) |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107948619A (en) * | 2017-12-13 | 2018-04-20 | 广东欧珀移动通信有限公司 | Image processing method, device, computer-readable recording medium and mobile terminal |
CN108063891A (en) * | 2017-12-07 | 2018-05-22 | 广东欧珀移动通信有限公司 | Image processing method, device, computer readable storage medium and computer equipment |
CN109903248A (en) * | 2019-02-20 | 2019-06-18 | 厦门美图之家科技有限公司 | A kind of method and image processing method generating automatic white balance model |
CN114268778A (en) * | 2021-12-16 | 2022-04-01 | 苏州科达科技股份有限公司 | Color temperature compensation method and system in white balance algorithm and image acquisition equipment |
CN114280822A (en) * | 2020-09-28 | 2022-04-05 | 纬创资通股份有限公司 | Color correction system and display panel color correction method |
TWI800934B (en) * | 2021-09-30 | 2023-05-01 | 宏碁股份有限公司 | Image color adjustment method and image color adjustment device |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20080211925A1 (en) * | 2007-03-02 | 2008-09-04 | Fujifilm Corporation | White balance correction apparatus and method |
CN103139573A (en) * | 2011-11-22 | 2013-06-05 | 三星电子株式会社 | Apparatus and method for adjusting white balance |
US20130278793A1 (en) * | 2012-04-24 | 2013-10-24 | Canon Kabushiki Kaisha | Image processing apparatus, image processing method, and storage medium |
CN105187810A (en) * | 2014-11-11 | 2015-12-23 | 怀效宁 | Automatic white balance method based on face color features and electronic media device |
CN105894458A (en) * | 2015-12-08 | 2016-08-24 | 乐视移动智能信息技术(北京)有限公司 | Processing method and device of image with human face |
CN106357988A (en) * | 2016-11-09 | 2017-01-25 | 广东欧珀移动通信有限公司 | White balance adjustment method, device and terminal equipment |
CN107018396A (en) * | 2015-12-22 | 2017-08-04 | 奥林巴斯株式会社 | Image processing apparatus, image processing method |
-
2017
- 2017-08-31 CN CN201710776063.XA patent/CN107396079B/en active Active
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20080211925A1 (en) * | 2007-03-02 | 2008-09-04 | Fujifilm Corporation | White balance correction apparatus and method |
CN103139573A (en) * | 2011-11-22 | 2013-06-05 | 三星电子株式会社 | Apparatus and method for adjusting white balance |
US20130278793A1 (en) * | 2012-04-24 | 2013-10-24 | Canon Kabushiki Kaisha | Image processing apparatus, image processing method, and storage medium |
CN105187810A (en) * | 2014-11-11 | 2015-12-23 | 怀效宁 | Automatic white balance method based on face color features and electronic media device |
CN105894458A (en) * | 2015-12-08 | 2016-08-24 | 乐视移动智能信息技术(北京)有限公司 | Processing method and device of image with human face |
CN107018396A (en) * | 2015-12-22 | 2017-08-04 | 奥林巴斯株式会社 | Image processing apparatus, image processing method |
CN106357988A (en) * | 2016-11-09 | 2017-01-25 | 广东欧珀移动通信有限公司 | White balance adjustment method, device and terminal equipment |
Cited By (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108063891A (en) * | 2017-12-07 | 2018-05-22 | 广东欧珀移动通信有限公司 | Image processing method, device, computer readable storage medium and computer equipment |
CN108063891B (en) * | 2017-12-07 | 2020-04-24 | Oppo广东移动通信有限公司 | Image processing method, image processing device, computer-readable storage medium and computer equipment |
CN107948619A (en) * | 2017-12-13 | 2018-04-20 | 广东欧珀移动通信有限公司 | Image processing method, device, computer-readable recording medium and mobile terminal |
CN107948619B (en) * | 2017-12-13 | 2019-07-16 | Oppo广东移动通信有限公司 | Image processing method, device, computer readable storage medium and mobile terminal |
CN109903248A (en) * | 2019-02-20 | 2019-06-18 | 厦门美图之家科技有限公司 | A kind of method and image processing method generating automatic white balance model |
CN109903248B (en) * | 2019-02-20 | 2021-04-16 | 厦门美图之家科技有限公司 | Method for generating automatic white balance model and image processing method |
CN114280822A (en) * | 2020-09-28 | 2022-04-05 | 纬创资通股份有限公司 | Color correction system and display panel color correction method |
CN114280822B (en) * | 2020-09-28 | 2023-08-22 | 纬创资通股份有限公司 | Color correction system and color correction method of display panel |
TWI800934B (en) * | 2021-09-30 | 2023-05-01 | 宏碁股份有限公司 | Image color adjustment method and image color adjustment device |
CN114268778A (en) * | 2021-12-16 | 2022-04-01 | 苏州科达科技股份有限公司 | Color temperature compensation method and system in white balance algorithm and image acquisition equipment |
Also Published As
Publication number | Publication date |
---|---|
CN107396079B (en) | 2019-06-07 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107396079B (en) | White balance adjustment method and device | |
CN107451969B (en) | Image processing method, image processing device, mobile terminal and computer readable storage medium | |
CN107424198B (en) | Image processing method, image processing device, mobile terminal and computer readable storage medium | |
CN101242476B (en) | Automatic correction method of image color and digital camera system | |
CN107977940A (en) | background blurring processing method, device and equipment | |
CN107948519A (en) | Image processing method, device and equipment | |
CN109191403A (en) | Image processing method and device, electronic equipment, computer readable storage medium | |
CN108055452A (en) | Image processing method, device and equipment | |
CN107509031A (en) | Image processing method, device, mobile terminal and computer-readable recording medium | |
CN107730444A (en) | Image processing method, device, readable storage medium storing program for executing and computer equipment | |
CN107580205B (en) | White balance adjustment method and device | |
CN108024056B (en) | Imaging method and device based on dual camera | |
CN108712608A (en) | Terminal device image pickup method and device | |
CN107493432A (en) | Image processing method, device, mobile terminal and computer-readable recording medium | |
CN109360254B (en) | Image processing method and device, electronic equipment and computer readable storage medium | |
CN108230407B (en) | Image processing method and device | |
CN108024054A (en) | Image processing method, device and equipment | |
CN108024057A (en) | Background blurring processing method, device and equipment | |
CN107800971B (en) | Auto-exposure control processing method, device and the equipment of pan-shot | |
CN108156369A (en) | Image processing method and device | |
CN107993209A (en) | Image processing method, device, computer-readable recording medium and electronic equipment | |
CN109089041A (en) | Recognition methods, device, electronic equipment and the storage medium of photographed scene | |
CN108616700A (en) | Image processing method and device, electronic equipment, computer readable storage medium | |
CN108989699A (en) | Image composition method, device, imaging device, electronic equipment and computer readable storage medium | |
CN108965729A (en) | Control method, device, electronic equipment and computer readable storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
CB02 | Change of applicant information | ||
CB02 | Change of applicant information |
Address after: 523860 No. 18, Wu Sha Beach Road, Changan Town, Dongguan, Guangdong Applicant after: OPPO Guangdong Mobile Communications Co., Ltd. Address before: 523860 No. 18, Wu Sha Beach Road, Changan Town, Dongguan, Guangdong Applicant before: Guangdong OPPO Mobile Communications Co., Ltd. |
|
GR01 | Patent grant | ||
GR01 | Patent grant |