CN107396079B - White balance adjustment method and device - Google Patents
White balance adjustment method and device Download PDFInfo
- Publication number
- CN107396079B CN107396079B CN201710776063.XA CN201710776063A CN107396079B CN 107396079 B CN107396079 B CN 107396079B CN 201710776063 A CN201710776063 A CN 201710776063A CN 107396079 B CN107396079 B CN 107396079B
- 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.)
- Active
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
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Processing Of Color Television Signals (AREA)
- Color Television Image Signal Generators (AREA)
Abstract
The present invention proposes a kind of white balance adjustment method and device, wherein, method includes: that the first white balance gains value of image is calculated using face white balance algorithm, if calculating respectively, imaging is when obtaining image under various light sources, the corresponding multiple second white balance gains values of image institute;According to the first white balance gains value, is 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.It solves in the prior art, has face under identical scene, in image and when not having face, the technical issues 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 methods and device.
Background technique
In the related technology, it when the capture apparatus of using terminal equipment is taken pictures, is obtained in actual Color Image Acquisition
To color-values and the realistic colour of object can generate deviation, cause the deviation the reason of it is main there are two, one is light source ring
The color temperature change in border, in the case of different-colour, the spectrum of the reflection of the same object is different, so as to cause object not homochromy
The lower color presented of the light source irradiation of temperature is different, such as blue is presented in white object under high color temperature environment, and in low color temperature
It is presented in environment red.The other is the deviation of the gain by the intrinsic color channel of capture apparatus itself, such as
The manual gain value of the channel B of GC0307 is 0x98, and the manual gain value in the channel R, G is 0x80.
Thus, in the related technology, in order to compensate for the deviation of this color, shooting is changed by relevant white balance algorithm and is set
The white balance gains value in standby color gain channel, to misalignment and capture apparatus itself caused by colour temperature environment it is intrinsic
The deviations of color channel gains carry out unified compensation, thus allow acquisition image can correct reactant realistic colour.
Wherein, it there are many white balance algorithms, is used equally for calculating white balance gains value, be 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 obviously, so as to cause image color mutation.
Summary 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, the technical issues of mutation so as to cause color.
The embodiment of the present invention provides a kind of white balance adjustment method, comprising the following steps: uses 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
As a corresponding multiple second white balance gains values;It is white from the multiple second according to the first white balance gains value
It is chosen in balancing gain value and obtains the target white balance gains value close with the first white balance gains value;Using the target
White balance gains value carries out blank level adjustment to described image.
Another embodiment of the present invention provides a kind of white balance adjustment devices, comprising: the first computing module, for using face
The first white balance gains value of image is calculated in white balance algorithm;Second computing module, for calculating respectively in various light sources
When lower imaging obtains described image, the corresponding multiple second white balance gains values of described image institute;Module is chosen, root is used for
According to the first white balance gains value, is 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;Adjust module, for use the target white balance gains value, to described image into
Row blank level adjustment.
Further embodiment of this invention provides a kind of computer equipment, including memory and processor, stores up in the memory
There is computer-readable instruction, when described instruction is executed by the processor, so that the processor executes the above-mentioned reality of the present invention
Apply 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, the computer program realize white balance adjustment method as described in the above embodiment the present invention when being executed by processor.
Technical solution 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, the corresponding multiple second white balance gains values of image institute, according to the first white balance gains value,
It is chosen from multiple second white balance gains values and obtains the target white balance gains value close with the first white balance gains value, used
Target white balance gains value carries out blank level adjustment to image.Thus, it is suppressed that under same scene, have face and do not have
When face, the problem of white balance gains value mutation is so as to cause screen flicker, the injury to human eye is avoided.
Detailed description of the invention
Above-mentioned and/or additional aspect and advantage of the invention will become from the following description of the accompanying drawings of embodiments
Obviously and it is readily appreciated that, in which:
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 schematic diagram of white balance adjustment device according to an embodiment of the invention;
Fig. 4 is the structural schematic diagram of white balance adjustment device in accordance with another embodiment of the present invention;
Fig. 5 is the structural schematic diagram of the white balance adjustment device of another embodiment according to the present invention;And
Fig. 6 is the structural schematic diagram of the image processing circuit in the computer equipment that one embodiment of the invention proposes.
Specific embodiment
The embodiment of the present invention is described below in detail, examples of the embodiments are shown in the accompanying drawings, wherein from beginning to end
Same or similar label indicates same or similar element or element with the same or similar functions.Below with reference to attached
The embodiment of figure description is exemplary, it is intended to is used to explain the present invention, and is not considered as limiting the invention.
It is appreciated that under many application scenarios in practical applications, user uses in the terminal devices such as smart phone
Application program is taken pictures, wherein under the mode that the preposition photographing mode of terminal device or portrait photographing mode etc. clap portrait
It takes pictures, and, it is set when being taken pictures under the non-portrait photographing mode such as photographing mode after use, used white balance algorithm is not
With, this is because the color composition of image is different under face photographing mode and under non-face mode.Specifically,
Face white balance (Face Automatic White Balance, FaceAWB) algorithm is used under portrait photographing mode, works as image
In there are when personage, since the colour of skin of a kind of ethnic group varies less, in the range of can estimate for one.It therefore, can be according to people
The feature of the face colour of skin determines corresponding corrector, and then obtains more accurate white balance calculated result.It is especially pure in large area
Under the conditions of color background and/or light mixing, the white balance effect of image can effectively improve.
Gray world (Simple Gray World) algorithm, gray world (Simple are used under non-portrait photographing mode
Gray World) algorithm is based on being assumed by gray world, which thinks: having 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 mean value of the average reflection of light, this
The saturation degree of tri- components of R, G, B reaches unanimity in a definite value.When, there are when color abundant, passing through the gray world in image
Algorithm handles image, can preferably eliminate the influence of environment light.
However, using 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 not scene of face from the scene for having face, white balance gains value difference obtained
Away from larger, so as to cause color mutation, there is injury to human eye, visual effect is bad.
In order to solve the above-mentioned technical problem, the invention proposes a kind of white balance adjustment method and devices, can inhibit 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 packet
Include following steps:
Step 101, using face white balance algorithm, the first white balance gains value of image is calculated.
Specifically, in order to select suitable yield value to carry out white balance processing to image for facial image, so that at image
It manages in result, the color and the colour of skin of face are relatively coincide, and can be calculated the to image first according to the face white balance algorithm
One yield value is spare to make.
Step 102, if calculating is imaged when obtaining image respectively under various light sources, image institute corresponding multiple second
White balance gains value.
Wherein, light source includes: one or more groups in daylight source, fluorescent light source, tungsten filament lamp sources and F-A-H light source
It closes, wherein F-A-H light source is the light source between A light and H light, and A light color temperature is 2850K, and H light color temperature is 2350K.
Specifically, in order to select suitable yield value to carry out white balance processing to image for inhuman face image, so that image
In processing result, the color and Natural color in non-face region are relatively coincide, if calculating respectively, imaging obtains figure under various light sources
When picture, the corresponding multiple second white balance gains values of image institute are spare to make, 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 photographing mode and non-face photographing mode it is different compared with
Greatly, it according to the first white balance gains value, is chosen from multiple second white balance gains values and obtains connecing with the first white balance gains value
Close target white balance gains value, thus, blank level adjustment is carried out to image according to the target white balance gains value, is on the one hand examined
Face complexion has been measured, nature color abundant (gray world) is on the other hand contemplated, image procossing not only can be improved
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 different implementations can be used according to the difference of application scenarios, increased according to the first white balance
Benefit value, chooses from multiple second white balance gains values and obtains the target white balance gains close with the first white balance gains value
Value, is illustrated below:
The first example determines in the first white balance gains value, the first yield value of each color component, for each
Two white balance gains values determine the second yield value of each color component, 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
To difference calculate after, sum to the absolute difference of each color component, from multiple second white balance gains values, choose with
The smallest target white balance gains value of difference value between first yield value.
Second of example, according to first yield value of the first white balance gains value on each color component, generate first to
Amount, according to each second yield value of the second white balance gains value on each color component, generate corresponding multiple second to
Amount calculates the vector distance between primary vector and each secondary vector, and vector distance includes Euclidean distance, according to
Span is from from multiple second white balance gains values, selection obtains the smallest target white balance gains value of vector distance.
In conclusion image is calculated using face white balance algorithm in the white balance adjustment method of the embodiment of the present invention
The first white balance gains value, if calculating respectively, when obtaining image, image institute is corresponding multiple for imaging under various light sources
Second white balance gains value is chosen from multiple second white balance gains values and is obtained and first according to the first white balance gains value
The close target white balance gains value of white balance gains value carries out blank level adjustment to image using target white balance gains value.
Thus, it is suppressed that under same scene, when having face and not having face, white balance gains value mutation is so as to cause screen flicker
The problem of, avoid the injury to human eye.
Based on above embodiments, for further detailed description, how according to the first white balance gains value, from multiple
It is chosen in two white balance gains values and obtains the target white balance gains value close with the first white balance gains value, below with reference to above-mentioned
For the vector based on yield value shown in second of example determines target white balance gains value, it is illustrated.
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
Include:
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 image by face recognition technology, to determine in image comprising face area
Domain identifies the face in image for example, face recognition technology can be first passed through, and obtains the coordinate section of human face region,
Wherein, face recognition algorithms, there are many kinds of implementations in the prior art, for example, being carried out using Adaboost model algorithm
Recognition of face can also carry out the identification of human face region using the algorithm of other energy express delivery identification human face regions.Corresponding face is known
Other implementation, in the present embodiment without limitation.
After obtaining human face region, since 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 range of face is respectively [133,173], [77,127].As long as can determine that out people
Skin color range, so that it may according to the skin color range correct image.It therefore, can be by comparing the face of human face region in the image
Color and preset 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 obtain and take pictures in face
Under mode based on the colour of skin carry out white balance processing when the first yield value, in fact, front camera photographing mode or
It under the photographing mode of rear camera, is all based on face white balance algorithm and carries out white balance processing, and hence it is also possible to determine figure
When as using front camera imaging, using face white balance algorithm, the first white balance gains value of image is calculated, or
When determining portrait mode of figure imaging of the image using rear camera, using face white balance algorithm, the of image is calculated in person
One white balance gains value etc..
Step 202, if calculating is imaged when obtaining image respectively under various light sources, image institute corresponding 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
The hypothesis that algorithm is based on are as follows: have 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 practical applications, gray value G usually is determined there are two types of method.
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 mean value of these three average values as gray value G.Determining the gray scale
It, can be by the way that tri- kinds of respective average values of color of gray value G and R, G, B be compared respectively, to calculate pair after value G
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 generates primary vector.
Step 204, it according to each second yield value of the second white balance gains value on each color component, generates and corresponds to
Multiple secondary vectors.
In practical applications, it can use the vector in color space and accurately 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 space, which is the vision system from people, uses 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 be described using other color spaces, this reality
It applies in example and this is repeated no more.It, can be using the RGB model characterization first in color space as a kind of possible implementation
Yield value and the second yield value.
Specifically, in RGB model, each color is appeared in tri- color components of R, G, B, this model is based on flute card
That coordinate system, the color space considered is a cube.One vertex of cube 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
It above or 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., the value of all R, G, B 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 generate primary vector, by value group of second yield value on each color component
It is combined, secondary vector can be generated.For example, if value of first yield value in R component is 0.1, on G component
Value is 0.2, and the value on B component is 0.3, then can be raw according to value of first yield value on each color component
At primary vector [0.1,0.2,0.3].If value of second yield value in R component is 0.2, the value on G component is
0.2, the value on B component is 0.2, then can generate first according to value of second yield value on each color component
Vector [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, it after generating primary vector and secondary vector, just realizes 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 can also describe the two vectors using modes such as COS distance, Pearson correlation coefficients
Between vector distance.It, can by taking the vector distance described between primary vector and secondary vector using Euclidean distance as an example
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.
In turn, 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 is bigger, can determine
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, it is the smallest that selection obtains vector distance
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, selection obtains the smallest mesh of vector distance
White balance gains value is marked, the target white balance gains value being calculated using gray world algorithm carries out image accurately white flat
Weighing apparatus processing, is on the one hand contemplated face complexion, nature color abundant is on the other hand contemplated, not only can be improved at image
The visual effect of reason, and image procossing is carried out based on unified target white balance gains value, it is prominent to avoid white balance gains value
The problem of becoming so as to cause screen flicker.
In conclusion the white balance adjustment method of the embodiment of the present invention, according to 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 under various light sources respectively
When to image, the corresponding multiple second white balance gains values of image institute, 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 generates corresponding multiple secondary vectors, and calculates 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
The smallest target white balance gains value using target white balance gains value, carries out blank level adjustment to image in turn, thus, match
Slower white balance convergence rate is closed, when can be effectively improved using face white balance algorithm progress blank level adjustment, whether there is or not faces
When the problem of flashing.
In order to realize above-described embodiment, the present invention also proposes that a kind of white balance adjustment device, Fig. 3 are one according to the present invention
The structural schematic diagram of the white balance adjustment device of embodiment, as shown in figure 3, the white balance adjustment device includes the first computing module
100, the second computing module 200, selection module 300 and adjustment module 400.
Wherein, the first white balance of image is calculated for using face white balance algorithm in the first computing module 100
Yield value.
Second computing module 200, when for calculating, imaging obtains image under various light sources respectively, image is respectively corresponded
Multiple second white balance gains values.
Module 300 is chosen, for choosing and obtaining from multiple second white balance gains values according to the first white balance gains value
The target white balance gains value close with the first white balance gains value.
Module 400 is adjusted, for using target white balance gains value, blank level adjustment is carried out to image.
Based on the above 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, the selection module 300 includes that the first computing unit 310 and first chooses list on the basis of as shown in Figure 3
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 the 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, sum to the absolute difference of each color component.
First selection unit 320, for choosing the difference between the first yield value from multiple second white balance gains values
The different the smallest target white balance gains value of value.
Based on the above embodiment, Fig. 5 is the structural representation of the white balance adjustment device of another embodiment according to the present invention
Figure, as shown in figure 5, the selection module 300 includes that the second computing unit 330 and second chooses list on the basis of as shown in Figure 3
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 generates primary vector;According to each second yield value of the second white balance gains value on each color component, generates and correspond to
Multiple secondary vectors;Calculate the vector distance between primary vector and each secondary vector.
Second selection unit 340, for according to vector distance, from multiple second white balance gains values, selection obtain to
Span is from the smallest target white balance gains value.
It should be noted that the aforementioned description to embodiment of the method, is also applied for the device of the embodiment of the present invention, realize
Principle is similar, and details are not described herein.
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 function of above-mentioned white balance adjustment device
Energy.
In conclusion image is calculated using face white balance algorithm in the white balance adjustment device of the embodiment of the present invention
The first white balance gains value, if calculating respectively, when obtaining image, image institute is corresponding multiple for imaging under various light sources
Second white balance gains value is chosen from multiple second white balance gains values and is obtained and first according to the first white balance gains value
The close target white balance gains value of white balance gains value carries out blank level adjustment to image using target white balance gains value.
Thus, it is suppressed that under same scene, when having face and not having face, white balance gains value mutation is so as to cause 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.Include in above-mentioned computer equipment
Image processing circuit, image processing circuit can use hardware and or software component realization, it may include define ISP (Image
Signal Processing, image signal process) 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, only showing each of image processing techniques relevant to the embodiment of the present invention
Aspect.
As shown in fig. 6, image processing circuit includes ISP processor 1040 and control logic device 1050.Imaging device 1010
The image data of capture is handled by ISP processor 1040 first, and ISP processor 1040 analyzes image data can with capture
Image statistics for determining and/or imaging device 1010 one or more control parameters.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 filter), imaging sensor 1014 can obtain the light captured 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 processor 1040 is provided.Sensor 1020 can be based on
Raw image data is supplied to ISP processor 1040 by 1020 interface type of sensor.1020 interface of sensor can use
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 processor 1040 handles 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 processor 1040 can carry out raw image data at one or more images
Reason operation, statistical information of the collection about image data.Wherein, image processing operations can be by identical or different bit depth precision
It carries out.
ISP processor 1040 can also receive pixel data from video memory 1030.For example, will from 1020 interface of sensor
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 equipment or electronic equipment of memory device
Independent private memory, and may include DMA (Direct Memory Access, direct direct memory access (DMA)) feature.
When receiving from 1020 interface of sensor or from the raw image data of video memory 1030, at ISP
Reason device 1040 can carry out one or more image processing operations, such as time-domain filtering.Treated, and image data can be transmitted to image
Memory 1030, to carry out other processing before shown.ISP processor 1040 is from 1030 receiving area of video memory
Data are managed, and the image real time transfer in original domain and in RGB and YCbCr color space is carried out to the processing data.Place
Image 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) it is further processed.In addition, the output of ISP processor 1040 also can be transmitted to image
Memory 1030, and display 1070 can read image data from video memory 1030.In one embodiment, image stores
Device 1030 can be configured to realize one or more frame buffers.In addition, the output of ISP processor 1040 can be transmitted to coding
Device/decoder 1060, so as to encoding/decoding image data.The image data of coding can be saved, and be shown in display
It is decompressed before in 1070 equipment.Encoder/decoder 1060 can be realized by CPU or GPU or coprocessor.
The statistical data that ISP processor 1040 determines, which can be transmitted, gives control logic device Unit 1050.For example, statistical data can
It is passed including the images such as automatic exposure, automatic white balance, automatic focusing, flicker detection, black level compensation, 1012 shadow correction of lens
1014 statistical information of sensor.Control logic device 1050 may include execute one or more routines (such as firmware) processor and/or
Microcontroller, one or more routines can statistical data based on the received, determine imaging device 1010 control parameter and
Control parameter.For example, control parameter may include 1020 control parameter of sensor (such as time of integration of gain, spectrum assignment),
The combination of camera flash control parameter, 1012 control parameter of lens (such as focusing or zoom focal length) or these parameters.
ISP control parameter may include the gain level and color for automatic white balance and color adjustment (for example, during RGB processing)
1012 shadow correction parameter of correction matrix and lens.
The following are realize 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 when obtaining described image respectively under various light sources, described image is respectively corresponded
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 aforementioned terminal device that the present embodiment is also applied for the explanation of embodiment of the method,
Realization principle is similar, and details are not described herein again.
In conclusion the first of image is calculated using face white balance algorithm in the terminal device of the embodiment of the present invention
White balance gains value, if calculating imaging when obtaining image under various light sources respectively, image institute is corresponding multiple second white
Balancing gain value is chosen from multiple second white balance gains values and is obtained and the first white balance according to the first white balance gains value
The close target white balance gains value of yield value carries out blank level adjustment to image using target white balance gains value.As a result,
It inhibits under same scene, when having face and not having face, white balance gains value mutation is asked so as to cause 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 can be realized white balance adjustment method as in the foregoing embodiment 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 spy described in conjunction with this embodiment or example
Point is included at least one embodiment or example of the invention.In the present specification, schematic expression of the above terms are not
It must be directed to identical embodiment or example.Moreover, particular features, structures, materials, or characteristics described can be in office
It can be combined in any suitable manner in one or more embodiment or examples.In addition, without conflicting with each other, the skill of this field
Art personnel can tie the feature of different embodiments or examples described in this specification and different embodiments or examples
It closes and combines.
In addition, term " first ", " second " are used for descriptive purposes only and cannot be understood as indicating or suggesting relative importance
Or implicitly indicate the quantity of indicated technical characteristic.Define " first " as a result, the feature of " second " can be expressed or
Implicitly include at least one this feature.In the description of the present invention, the meaning of " plurality " is at least two, such as two, three
It is a etc., unless otherwise specifically defined.
Any process described otherwise above or method description are construed as in flow chart or herein, and expression includes
It is one or more for realizing custom logic function or process the step of executable instruction code module, segment or portion
Point, and the range of the preferred embodiment of the present invention includes other realization, wherein can not press shown or discussed suitable
Sequence, including according to related function by it is basic simultaneously in the way of or in the opposite order, Lai Zhihang 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 instruction fetch of row system, device or equipment and the system executed instruction) it uses, or combine these instruction execution systems, device or set
It is standby and use.For the purpose of this specification, " computer-readable medium ", which can be, any may include, stores, communicates, propagates or pass
Defeated program is for instruction execution system, device or equipment or the dress used in conjunction with these instruction execution systems, device or equipment
It sets.The more specific example (non-exhaustive list) of computer-readable medium include the following: there is the electricity of one or more wirings
Interconnecting piece (electronic device), portable computer diskette box (magnetic device), random access memory (RAM), read-only memory
(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 can even is that the paper that can print described program on it or other are suitable
Medium, because can then be edited, be interpreted or when 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 section of the invention can be realized with hardware, software, firmware or their combination.Above-mentioned
In embodiment, software that multiple steps or method can be executed in memory and by suitable instruction execution system with storage
Or firmware is realized.Such as, if realized with hardware in another embodiment, following skill well known in the art can be used
Any one of art or their combination are realized: have for data-signal is realized the logic gates of logic function from
Logic circuit is dissipated, the 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 understood that realize all or part of step that above-described embodiment method carries
It suddenly is that relevant hardware can be instructed to complete by program, the program can store in a kind of computer-readable storage medium
In matter, which when being executed, includes the steps that one or a combination set of embodiment of the method.
It, can also be in addition, each functional unit in each embodiment of the present invention can integrate in a processing module
It is that each unit physically exists alone, can also be integrated in two or more units in a module.Above-mentioned integrated mould
Block both can take the form of hardware realization, can also be realized in the form of software function module.The integrated module is such as
Fruit is realized and when sold or used as an independent product in the form of software function module, also can store in a computer
In read/write memory medium.
Storage medium mentioned above can be read-only memory, disk or CD etc..Although having been shown and retouching above
The embodiment of the present invention is stated, it is to be understood that above-described embodiment is exemplary, and should not be understood as to limit of the invention
System, those skilled in the art can be changed above-described embodiment, modify, replace and become within the scope of the invention
Type.
Claims (10)
1. a kind of white balance adjustment method, which comprises 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 institute is corresponding multiple second white flat
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, which is characterized in that described according to first white balance gains
Value is chosen from the multiple second white balance gains value and obtains the target white balance close with the first white balance gains value
Yield value, comprising:
It determines 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
What the absolute difference of amount was summed;
From multiple second white balance gains values, the smallest target white balance of difference value between the first yield value is chosen
Yield value.
3. white balance adjustment method according to claim 1, which is characterized in that described according to first white balance gains
Value is chosen from the multiple second white balance gains value and obtains the target white balance close with the first white balance gains value
Yield value, comprising:
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, generate corresponding multiple second to
Amount;
Calculate the vector distance between the primary vector and each described secondary vector;The vector distance is Euclid
Distance;
According to the vector distance, from the multiple second white balance gains value, it is the smallest that selection obtains the vector distance
Target white balance gains value.
4. white balance adjustment method according to claim 1-3, which is characterized in that described to use face white balance
Algorithm is calculated before the first white balance gains value of image, further includes:
Recognition of face is carried out to described image, to determine in described image comprising human face region;
Or, determining that described image is imaged to obtain using front camera;
Or, determining that described image is imaged to obtain using the portrait mode of figure of rear camera.
5. white balance adjustment method according to claim 1-3, which is characterized in that the light source includes: daylight
One or more combinations in light source, fluorescent light source, tungsten filament lamp sources and F-A-H light source.
6. a kind of white balance adjustment device characterized by comprising
The first white balance gains value of image is calculated for using face white balance algorithm in first computing module;
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 being chosen from the multiple second white balance gains value according to the first white balance gains value
To the target white balance gains value close with the first white balance gains value;
Module is adjusted, 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, which is characterized in that the selection module, comprising:
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, determines 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, sum to the absolute difference of each color component;
First selection unit, for choosing the difference between the first yield value from multiple second white balance gains values
It is worth the smallest target white balance gains value.
8. white balance adjustment device according to claim 6, which is characterized in that the selection module, comprising:
Second computing unit is generated for the first yield value according to the first white balance gains value on each color component
Primary vector;According to each second yield value of the second white balance gains value on each color component, generate corresponding multiple
Secondary vector;Calculate the vector distance between the primary vector and each described secondary vector;
Second selection unit, for according to the vector distance, from the multiple second white balance gains value, selection to obtain institute
State the smallest target white balance gains value of vector distance.
9. a kind of computer equipment, which is characterized in that on a memory and can be in processor including memory, processor and storage
The computer program of upper operation when the processor executes the computer program, is realized as described in any in claim 1-5
White balance adjustment method.
10. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that the computer program
Such as white balance adjustment method as claimed in any one of claims 1 to 5 is realized when being executed by processor.
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 CN107396079A (en) | 2017-11-24 |
CN107396079B true 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) |
Families Citing this family (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108063891B (en) * | 2017-12-07 | 2020-04-24 | Oppo广东移动通信有限公司 | Image processing method, image processing device, computer-readable storage medium and computer equipment |
CN107948619B (en) * | 2017-12-13 | 2019-07-16 | Oppo广东移动通信有限公司 | Image processing method, device, computer readable storage medium and mobile terminal |
CN109903248B (en) * | 2019-02-20 | 2021-04-16 | 厦门美图之家科技有限公司 | Method for generating automatic white balance model and image processing method |
TWI761968B (en) * | 2020-09-28 | 2022-04-21 | 緯創資通股份有限公司 | Color-calibration system and color-calibration method for display panel |
TWI800934B (en) * | 2021-09-30 | 2023-05-01 | 宏碁股份有限公司 | Image color adjustment method and image color adjustment device |
CN114268778B (en) * | 2021-12-16 | 2024-05-03 | 苏州科达科技股份有限公司 | Color temperature compensation method and system in white balance algorithm and image acquisition equipment |
Family Cites Families (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP5021338B2 (en) * | 2007-03-02 | 2012-09-05 | 富士フイルム株式会社 | White balance correction apparatus and method |
KR101896386B1 (en) * | 2011-11-22 | 2018-09-11 | 삼성전자주식회사 | Device and method for adjusting white balance |
JP6083974B2 (en) * | 2012-04-24 | 2017-02-22 | キヤノン株式会社 | Image processing apparatus, image processing method, and program |
CN105187810B (en) * | 2014-11-11 | 2017-06-06 | 怀效宁 | A kind of auto white balance method and electronic medium device based on face color character |
CN105894458A (en) * | 2015-12-08 | 2016-08-24 | 乐视移动智能信息技术(北京)有限公司 | Processing method and device of image with human face |
JP2017118254A (en) * | 2015-12-22 | 2017-06-29 | オリンパス株式会社 | Image processing device, image processing program, and image processing method |
CN106357988B (en) * | 2016-11-09 | 2020-03-06 | Oppo广东移动通信有限公司 | White balance adjusting method and device and terminal equipment |
-
2017
- 2017-08-31 CN CN201710776063.XA patent/CN107396079B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN107396079A (en) | 2017-11-24 |
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 | |
CN107730446B (en) | Image processing method, image processing device, computer equipment and computer readable storage medium | |
CN108055452A (en) | Image processing method, device and equipment | |
CN101242476B (en) | Automatic correction method of image color and digital camera system | |
CN107580205B (en) | White balance adjustment method and device | |
CN109191403A (en) | Image processing method and device, electronic equipment, computer readable storage medium | |
CN107798652A (en) | Image processing method, device, readable storage medium storing program for executing and electronic equipment | |
CN107424198A (en) | Image processing method, device, mobile terminal and computer-readable recording medium | |
CN111292246B (en) | Image color correction method, storage medium, and endoscope | |
CN108024056B (en) | Imaging method and device based on dual camera | |
CN108683861A (en) | Shoot exposal control method, device, imaging device and electronic equipment | |
CN107509031A (en) | Image processing method, device, mobile terminal and computer-readable recording medium | |
CN108712608A (en) | Terminal device image pickup method and device | |
CN107493432A (en) | Image processing method, device, mobile terminal and computer-readable recording medium | |
CN107800965B (en) | Image processing method, device, computer readable storage medium and computer equipment | |
CN108024054A (en) | Image processing method, device and equipment | |
CN108230407B (en) | Image processing method and device | |
CN107801011B (en) | White balancing treatment method, device and the equipment of pan-shot | |
CN108156369A (en) | Image processing method and device | |
CN108024057A (en) | Background blurring processing method, device and equipment | |
CN107993209A (en) | Image processing method, device, computer-readable recording medium and electronic equipment | |
CN108616700A (en) | Image processing method and device, electronic equipment, computer readable storage medium | |
CN109005343A (en) | Control method, device, imaging device, electronic equipment and readable storage medium storing program for executing | |
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 |