CN109246406A - A kind of implementation method of color camera automatic white balance - Google Patents

A kind of implementation method of color camera automatic white balance Download PDF

Info

Publication number
CN109246406A
CN109246406A CN201811365142.2A CN201811365142A CN109246406A CN 109246406 A CN109246406 A CN 109246406A CN 201811365142 A CN201811365142 A CN 201811365142A CN 109246406 A CN109246406 A CN 109246406A
Authority
CN
China
Prior art keywords
gain
component
frame image
pixel
current frame
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201811365142.2A
Other languages
Chinese (zh)
Other versions
CN109246406B (en
Inventor
孔亮
温志刚
闫鹏
傅頔
刘永征
魏文鹏
刘文龙
周冠
张昕
赵昊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
XiAn Institute of Optics and Precision Mechanics of CAS
Original Assignee
XiAn Institute of Optics and Precision Mechanics of CAS
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by XiAn Institute of Optics and Precision Mechanics of CAS filed Critical XiAn Institute of Optics and Precision Mechanics of CAS
Priority to CN201811365142.2A priority Critical patent/CN109246406B/en
Publication of CN109246406A publication Critical patent/CN109246406A/en
Application granted granted Critical
Publication of CN109246406B publication Critical patent/CN109246406B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/80Camera processing pipelines; Components thereof
    • H04N23/84Camera processing pipelines; Components thereof for processing colour signals
    • H04N23/88Camera 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 relates to a kind of implementation methods of color camera automatic white balance.The method increase the speed of color camera automatic white balance algorithmic statement.This method has main steps that: 1, according to RGB and YCbCr space transformational relation, obtaining current gain and target gain relational expression;2, current frame image carries out detection white point detection;3, color temperature estimation is carried out to current frame image N, judges whether colour cast occur;4, according to the current gain and target gain relational expression calculating target gain in step 1;5, to the carry out gain adjustment of the R of each pixel of N+2 frame image, B component.

Description

A kind of implementation method of color camera automatic white balance
Technical field
The present invention relates to a kind of image processing techniques, and in particular to a kind of implementation method of form and aspect machine automatic white balance.
Background technique
The basic conception of white balance is regardless of that white object can be reduced to white under any light source.Different Spectral characteristic is mutually different under light source or weather condition, this is referred to as colour temperature.From physical significance, it is seen that Object why show specific color, be because light is when being pointed into object, the light that object is reflected is in human eye vision system This particular color is showed in system.That is, it can be seen that object color depend not only on its reflection characteristic, but also and The light for being pointed into object has a relationship, for example, a blank sheet of paper under tengsten lamp can partially orange tone, under fluorescent light can be partially green, and It can be a little partially blue under daylight.The purpose of automatic white balance is exactly the three primary colours component of image under adjust automatically different-colour illumination Ratio makes it appear to and the solid colour that shoots under standard sources.
Many automatic white balance function color cameras that have are to carry out colour temperature assessment to the image of YCbCr space, are then adjusted The yield value of whole Cb and Cr makes Cb and Cr meet the condition of white pixel point, to complete the function of automatic white balance, therefore The method of adjustment of the gain of Cb, Cr is an emphasis of automatic white balance.
Existing method to be adjusted step by step to gain, but is adjusted using this method by the way that step-length is arranged When, convergence rate is slower, is unable to satisfy the requirement of higher frequency camera.
Summary of the invention
In order to solve the defect of the prior art in background technique, the present invention provides a kind of color camera automatic white balance Implementation method improves the speed of the fast convergence of color camera automatic white balance.
The specific technical solution of the present invention is:
A kind of implementation method of color camera automatic white balance runs on the processor of color camera, the processor class Type is FPGA or CPU or DSP;It is realized by following steps:
[1] according to RGB and YCbCr space transformational relation, current gain R component gain gamma and target gain R component are obtained Gain gamma ' relational expression and current gain B component gain alpha and target gain B component gain alphaRelational expression;
Specific formula are as follows:
[2] the number threshold value w for setting white point, detects each pixel of current frame image N, judges whether it is white Point, statistic mixed-state go out the white point number w of current frame image N, utilize the white point number w ' and white point for detecting current frame image N Number threshold value w be compared, if w ' >=w, step [3] are carried out, if w ' < w, enters step [6];
[3] color temperature estimation is carried out to current frame image N, judges whether colour cast occur;
Find out the albomaculatus average value of current frame image N instituteWith
IfM is set as 9, then judges that colour cast occurs in image, the component of B or R need into Row gain adjustment enters step [4];
IfThen judge that colour cast does not occur in image, enters step [6];
[4] whenWhen, according to formula (1) calculate target gain R component gain gamma ';WhenWhen, according to formula (2) calculate target gain R component gain alpha ';
[5] the target gain R component gain gamma ' or target gain R component gain alpha obtained by step [4] ' to present frame Image carries out blank level adjustment.
[6] after waiting 1 frame image transmitting, step [2]-[5] are repeated since N+2 frame image.
Further, any one pixel is the Rule of judgment of white point in current frame image N in step [3] are as follows: Y >=A, | Cb|≤B,|Cr|≤C;Wherein, A=2048, B=10, C=20.Due to realizing that the quantization digit of camera of this method is 12bit, the range of gray value are that the value of 0~4095, A is set as the half of intensity value ranges in the method, therefore A is arranged It is 2048.
Further, effect and correctness that the number threshold value of white point enough must just can guarantee white balance, here by w It is set as the 1/500 of pixel sum;
The beneficial effects of the present invention are:
The present invention can make automatic white balance fast convergence using the method for directly calculating gain, by 2 or several A frame period can realize convergence, can be quickly real for the camera of tens frames of frame frequency/second or frame/second up to a hundred Existing white balance, greatly improves work efficiency.
General white balance method is in adjust gain, in order to guarantee that biggish step-length, in this way meeting can be arranged in convergence rate The case where appearance can not restrain.Adjacent gain adjustment twice may be implemented in the method for directly calculating gain that the present invention uses Step-length is very small, ensure that the accuracy of white balance method.
Detailed description of the invention
Fig. 1 is workflow schematic diagram of the invention;
Fig. 2 is the linear relationship chart of Cb and gain alpha;
Fig. 3 is the linear relationship chart of Cr and gain gamma.
Specific embodiment
The present invention provides a kind of methods by directly calculating gain, fast and efficiently realize color camera Automatic white balance, specific implementation step are as follows:
[1] obtain current gain R component gain gamma and target gain R component gain gamma ' relational expression and current gain B component gain alpha and target gain B component gain alpha ' relational expression;The specific implementation steps are as follows for the step:
[1.1] formula that rgb space is converted to YCbCr space is determined;
Y=a* γ * R+b*G+c* α * B (1)
Cb=α * B-Y=-a* γ * R-b*G+ (1-c) * α * B (2)
Cr=γ * R-Y=(1-a) * γ * R-b*G-c* α * B (3)
Wherein, Y is luminance component of the pixel in YCbCr space;Cb is blue offset point of the pixel in YCbCr space Amount;Cr is red shift component of the pixel in YCbCr space;R is pixel in the red component of rgb space, and G is pixel In the green component of rgb space, B is blue component of the pixel in rgb space, and a is that R component is in the conversion formula of space Number, b are the coefficient of G component in the conversion formula of space, and c is the coefficient of B component in the conversion formula of space, and γ is in automatic white balance The gain of R component, α are the gain of B component in automatic white balance.
According to formula (1), (2) and (3) as can be seen that α is as constant when carrying out gain adjustment to γ;It is carried out to α When gain adjustment, γ is as constant.γ in this way and Cr is in a linear relationship, and α is in a linear relationship with Cb, and specific linear relationship is as schemed Shown in 2 and Fig. 3.
[1.2] it can be obtained according to formula (1), (2) and (3):
Y '=a* γ ' * R+b*G+c* α ' * B (4)
Cb '=α ' * B-Y '=- a* γ ' * R-b*G+ (1-c) * α ' * B (5)
Cr '=γ ' * R-Y '=(1-a) * γ ' * R-b*G-c* α ' * B (6)
Wherein, Cr ' is red shift component when auto white balance method is restrained, i.e. target value, is a constant;Cb ' is Blue offset component when auto white balance method is restrained, i.e. target value are a constants;γ ' is auto white balance method convergence When R component gain, α ' be auto white balance method restrain when B component gain.
It can arrange to obtain by formula (5) and formula (6)
It can thus be seen that the gain gamma ' and α ' of target can be calculated by current gain γ and α.
[2] the number threshold value w for setting white point, detects each pixel of current frame image N, judges whether it is white Point, statistic mixed-state go out the white point number w ' of current frame image N, utilize the white point number w ' and white point for detecting current frame image N Number threshold value w be compared, if w ' >=w, step [3] are carried out, if w ' < w, enters step [6];;W in the present embodiment The 1/500 of detector pixel sum.;
Any one pixel is the Rule of judgment of white point in current frame image N are as follows: Y >=A, | Cb |≤B, | Cr |≤C;Its In, A=2048, B=10, C=20.Due to realizing that the quantization digit of the camera of this method is 12bit, the range of gray value is 0 The value of~4095, A are set as the half of intensity value ranges in the method, therefore set 2048 for A.
[3] color temperature estimation is carried out to current frame image N, judges whether colour cast occur;
Find out the albomaculatus average value of current frame image N instituteWith
IfM is set as 9, then judges that colour cast occurs in image, the component of B or R need into Row gain adjustment, enters step 4;
IfThen judge that colour cast does not occur in image, enters step 6;
[4] whenWhen, according to formula (1) calculate target gain R component gain gamma ';WhenWhen, according to formula (2) calculate target gain R component gain alpha ';
[5] the target gain R component gain gamma ' or target gain R component gain alpha obtained by step [4] ' to present frame Image carries out blank level adjustment.
[6] after waiting 1 frame image transmitting, step [2]-[5] are repeated since N+2 frame image.The reason of doing so It is to work as to calculate new gain gamma according to nth frame imageAnd αLater, if frame frequency is sufficiently fast, N+1 frame image has been exported, New gain is not worked.New gain can act on N+2 frame image.So in order to guarantee the correct of automatic white balance Property, use this method.
It is improper if there is the parameter of setting since the parameters such as w, A, B, C many in the invention are all sets itselfs The case where, automatic white balance also will appear the case where can not restraining, and the adjusting number T of automatic white balance at this moment can be set.It is super This threshold value is crossed, automatic white balance can temporarily stop, and gain recovery default value after a period of time restarts to calculate.

Claims (3)

1. a kind of implementation method of color camera automatic white balance, which comprises the following steps:
[1] according to RGB and YCbCr space transformational relation, current gain R component gain gamma and target gain R component gain are obtained The relational expression and current gain B component gain alpha and target gain B component gain alpha of γ ' ' relational expression;
Specific formula are as follows:
Wherein, Cb is blue offset component of the pixel in YCbCr space;Cr is red shift of the pixel in YCbCr space Component;G is green component of the pixel in rgb space, and B is blue component of the pixel in rgb space, and a is that space conversion is public The coefficient of R component in formula, b are the coefficient of G component in the conversion formula of space;
[2] the number threshold value w for setting white point, detects each pixel of current frame image N, judges whether it is white point, Statistic mixed-state goes out the white point number w ' of current frame image N, utilizes for the white point number w ' and white point for detecting current frame image N Number threshold value w is compared, if w ' >=w, step [3] is carried out, if w ' < w, enters step [6];
[3] color temperature estimation is carried out to current frame image N, judges whether colour cast occur;
Find out the albomaculatus average value of current frame image N instituteWith
IfM is set as 9, then judges that colour cast occurs in image, the component of B or R need to carry out gain It adjusts, enters step [4];
IfThen judge that colour cast does not occur in image, enters step [6];
[4] whenWhen, according to formula (1) calculate target gain R component gain gamma ';When When, according to formula (2) calculate target gain R component gain alpha ';
[5] the target gain R component gain gamma ' or target gain R component gain alpha obtained by step [4] ' to current frame image Carry out blank level adjustment;
[6] after waiting 1 frame image transmitting, step [2]-[5] are repeated since N+2 frame image.
2. the implementation method of color camera automatic white balance according to claim 1, it is characterised in that: the step [3] Any one pixel is the Rule of judgment of white point in middle current frame image N are as follows: Y >=A, | Cb |≤B, | Cr |≤C;Wherein, A= 2048, B=10, C=20.
3. the implementation method of color camera automatic white balance according to claim 1, it is characterised in that: the W is detection The 1/500 of device pixel sum.
CN201811365142.2A 2018-11-16 2018-11-16 Method for realizing automatic white balance of color camera Active CN109246406B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811365142.2A CN109246406B (en) 2018-11-16 2018-11-16 Method for realizing automatic white balance of color camera

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811365142.2A CN109246406B (en) 2018-11-16 2018-11-16 Method for realizing automatic white balance of color camera

Publications (2)

Publication Number Publication Date
CN109246406A true CN109246406A (en) 2019-01-18
CN109246406B CN109246406B (en) 2019-12-31

Family

ID=65075567

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811365142.2A Active CN109246406B (en) 2018-11-16 2018-11-16 Method for realizing automatic white balance of color camera

Country Status (1)

Country Link
CN (1) CN109246406B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113674258A (en) * 2021-08-26 2021-11-19 展讯通信(上海)有限公司 Image processing method and related equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101227623A (en) * 2008-01-31 2008-07-23 炬力集成电路设计有限公司 White balance adjustment method, system and camera
US20120044372A1 (en) * 2010-08-18 2012-02-23 Apple Inc. Dual image sensor image processing system and method
CN104618703A (en) * 2015-02-09 2015-05-13 傅邓文 White balance adjusting method
CN107027017A (en) * 2017-04-25 2017-08-08 建荣半导体(深圳)有限公司 A kind of method of adjustment, device, picture processing chip and the storage device of image white balance

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101227623A (en) * 2008-01-31 2008-07-23 炬力集成电路设计有限公司 White balance adjustment method, system and camera
US20120044372A1 (en) * 2010-08-18 2012-02-23 Apple Inc. Dual image sensor image processing system and method
CN104618703A (en) * 2015-02-09 2015-05-13 傅邓文 White balance adjusting method
CN107027017A (en) * 2017-04-25 2017-08-08 建荣半导体(深圳)有限公司 A kind of method of adjustment, device, picture processing chip and the storage device of image white balance

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113674258A (en) * 2021-08-26 2021-11-19 展讯通信(上海)有限公司 Image processing method and related equipment
CN113674258B (en) * 2021-08-26 2022-09-23 展讯通信(上海)有限公司 Image processing method and related equipment

Also Published As

Publication number Publication date
CN109246406B (en) 2019-12-31

Similar Documents

Publication Publication Date Title
EP3648459B1 (en) White balance adjustment method and apparatus, camera and medium
CN106716243B (en) Image capture system and method
US7949185B2 (en) Method of performing robust auto white balance
TWI389559B (en) Foreground image separation method
US20140085503A1 (en) Mobile Communication Apparatus and Flashlight Controlling Method
US8243164B2 (en) Method, apparatus, and system for selecting pixels for automatic white balance processing
CN103227928B (en) White balance adjusting method and device
CN104113743B (en) Colour TV camera AWB processing method and processing device under low-light (level)
CN103716547A (en) Smart mode photographing method
US10567723B2 (en) System and method for detecting light sources in a multi-illuminated environment using a composite RGB-IR sensor
CN104079909B (en) A kind of image auto white balance method and device
CN103491357A (en) Auto white balance treatment method of image sensor
US20030063197A1 (en) Illumination light color estimating method of obtaining white balance and image sensing apparatus
CN103108469A (en) Method and device for controlling output light of illuminating device and illuminating system
KR20100009035A (en) Apparatus and method for controlling gain of color signal
CN103973992A (en) Automatic exposure method and device for LED white-light source
US20070041064A1 (en) Image sampling method for automatic white balance
US20200029016A1 (en) Moving object monitoring device and moving object monitoring system
CN109246406A (en) A kind of implementation method of color camera automatic white balance
CN106471565A (en) Image display device and for method to dimming light source
KR101131109B1 (en) Auto white balance setting method by white detection considering sensor characteristic
CN105391831A (en) Mobile terminal and method for calibrating photographing color effect
KR101867568B1 (en) system for detecting space correlated color temperature using image sensor AWB
US9191640B1 (en) Systems and methods for automatic white balance of images
WO2022032666A1 (en) Image processing method and related apparatus

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
GR01 Patent grant
GR01 Patent grant