Movatterモバイル変換


[0]ホーム

URL:


CN110602473A - White balance calibration method and device - Google Patents

White balance calibration method and device
Download PDF

Info

Publication number
CN110602473A
CN110602473ACN201911019847.3ACN201911019847ACN110602473ACN 110602473 ACN110602473 ACN 110602473ACN 201911019847 ACN201911019847 ACN 201911019847ACN 110602473 ACN110602473 ACN 110602473A
Authority
CN
China
Prior art keywords
white balance
balance gain
target image
gain coefficient
confidence
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
CN201911019847.3A
Other languages
Chinese (zh)
Other versions
CN110602473B (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.)
Vivo Mobile Communication Co Ltd
Original Assignee
Vivo Mobile Communication Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Vivo Mobile Communication Co LtdfiledCriticalVivo Mobile Communication Co Ltd
Priority to CN201911019847.3ApriorityCriticalpatent/CN110602473B/en
Publication of CN110602473ApublicationCriticalpatent/CN110602473A/en
Application grantedgrantedCritical
Publication of CN110602473BpublicationCriticalpatent/CN110602473B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Classifications

Landscapes

Abstract

The invention provides a white balance calibration method and a white balance calibration device. The method comprises the following steps: acquiring a shot target image; generating a first white balance gain coefficient of the target image according to a preset white balance algorithm; determining the confidence coefficient of the first white balance gain coefficient according to the target image and/or the brightness information when the target image is shot; acquiring the color temperature of a shooting environment; determining a second white balance gain coefficient of the target image according to the color temperature; calibrating the first white balance gain coefficient according to the confidence coefficient and the second white balance gain coefficient to generate a target white balance gain coefficient of the target image; and performing white balance gain processing on the target image according to the target white balance gain coefficient. The invention can improve the accuracy and reliability of the white balance gain coefficient.

Description

Translated fromChinese
一种白平衡校准方法及装置Method and device for calibrating white balance

技术领域technical field

本发明涉及图像处理技术领域,尤其涉及一种白平衡校准方法及装置。The present invention relates to the technical field of image processing, in particular to a white balance calibration method and device.

背景技术Background technique

当前,移动设备的白平衡算法主要是基于灰世界假设,假设认为:对于一幅有着大量色彩变化的图片,所有像素R,G,B三个分量的平均值趋于同一灰度值Gray,基于这个假设的白平衡算法,可以对包含足够的灰色统计信息的图像或者色彩丰富的图像进行较为准确的白平衡处理。基于灰世界假设的白平衡算法例如可以是基本灰度世界算法(simple greywold algorithm),或者升级灰度世界算法(advance grey world algorithm)。At present, the white balance algorithm of mobile devices is mainly based on the gray world assumption. It is assumed that: for a picture with a large number of color changes, the average value of the three components of R, G, and B of all pixels tends to the same gray value Gray, based on This hypothetical white balance algorithm can perform more accurate white balance processing on images containing sufficient gray statistical information or images with rich colors. The white balance algorithm based on the gray world assumption may be, for example, a simple gray world algorithm (simple gray world algorithm), or an advanced gray world algorithm (advance gray world algorithm).

但是,对于上述任意一种基于灰世界假设的白平衡算法,都具有一定的局限性,其局限性在于当画面中没有灰色统计信息或者灰色统计信息数量不足,或者单一色彩画面,环境光的照明度较低的时候,上述传统的白平衡算法统计出来的白平衡增益数据的准确度就较低,那么采用不准确的白平衡增益数据对拍摄的图像进行白平衡处理时,会导致处理后的图像色彩失真。However, any of the above-mentioned white balance algorithms based on the gray world assumption has certain limitations. The limitation is that when there is no gray statistical information in the picture or the number of gray statistical information is insufficient, or a single color picture, the lighting of ambient light When the accuracy is low, the accuracy of the white balance gain data calculated by the above-mentioned traditional white balance algorithm is low, so when the inaccurate white balance gain data is used to perform white balance processing on the captured image, it will lead to The color of the image is distorted.

因此,相关技术中的基于灰世界假设的白平衡算法,在面临拍摄画面的灰色像素数目不足或低照明度环境时,普遍存在着白平衡处理结果不准确,容易导致图像偏色、整体色彩表现不稳定的问题。Therefore, the white balance algorithm based on the gray world assumption in the related art generally suffers from inaccurate white balance processing results when the number of gray pixels in the shooting picture is insufficient or in a low-illumination environment, which may easily lead to color cast and overall color performance of the image. unstable problem.

发明内容Contents of the invention

本发明实施例提供一种白平衡校准方法及装置,以解决对相关技术中基于灰世界假设的白平衡算法的白平衡处理结果不准确、不可靠的问题。Embodiments of the present invention provide a white balance calibration method and device to solve the problem of inaccurate and unreliable white balance processing results of white balance algorithms based on gray world assumptions in the related art.

为了解决上述技术问题,本发明是这样实现的:In order to solve the problems of the technologies described above, the present invention is achieved in that:

第一方面,本发明实施例提供了一种白平衡校准方法,应用于电子设备,所述方法包括:In a first aspect, an embodiment of the present invention provides a white balance calibration method applied to an electronic device, and the method includes:

获取拍摄的目标图像;Obtain the captured target image;

根据预设白平衡算法,生成所述目标图像的第一白平衡增益系数;generating a first white balance gain coefficient of the target image according to a preset white balance algorithm;

根据所述目标图像和/或拍摄所述目标图像时的亮度信息,确定所述第一白平衡增益系数的置信度;determining the confidence level of the first white balance gain coefficient according to the target image and/or brightness information when the target image was captured;

获取拍摄环境的色温;Obtain the color temperature of the shooting environment;

根据所述色温,确定所述目标图像的第二白平衡增益系数;determining a second white balance gain coefficient of the target image according to the color temperature;

根据所述置信度和所述第二白平衡增益系数,对所述第一白平衡增益系数进行校准,生成所述目标图像的目标白平衡增益系数;Calibrate the first white balance gain coefficient according to the confidence level and the second white balance gain coefficient to generate a target white balance gain coefficient of the target image;

根据所述目标白平衡增益系数,对所述目标图像进行白平衡增益处理。Perform white balance gain processing on the target image according to the target white balance gain coefficient.

第二方面,本发明实施例还提供了一种白平衡校准装置,所述装置包括:In the second aspect, the embodiment of the present invention also provides a white balance calibration device, the device comprising:

第一获取模块,用于获取拍摄的目标图像;The first acquiring module is used to acquire the captured target image;

生成模块,用于根据预设白平衡算法,生成所述目标图像的第一白平衡增益系数;A generating module, configured to generate the first white balance gain coefficient of the target image according to a preset white balance algorithm;

第一确定模块,用于根据所述目标图像和/或拍摄所述目标图像时的亮度信息,确定所述第一白平衡增益系数的置信度;A first determination module, configured to determine the confidence level of the first white balance gain coefficient according to the target image and/or brightness information when the target image was captured;

第二获取模块,用于获取拍摄环境的色温;The second acquisition module is used to acquire the color temperature of the shooting environment;

第二确定模块,用于根据所述色温,确定所述目标图像的第二白平衡增益系数;A second determining module, configured to determine a second white balance gain coefficient of the target image according to the color temperature;

校准模块,用于根据所述置信度和所述第二白平衡增益系数,对所述第一白平衡增益系数进行校准,生成所述目标图像的目标白平衡增益系数;A calibration module, configured to calibrate the first white balance gain coefficient according to the confidence level and the second white balance gain coefficient, and generate a target white balance gain coefficient of the target image;

处理模块,用于根据所述目标白平衡增益系数,对所述目标图像进行白平衡增益处理。A processing module, configured to perform white balance gain processing on the target image according to the target white balance gain coefficient.

第三方面,本发明实施例还提供了一种电子设备,包括:存储器、处理器及存储在所述存储器上并可在所述处理器上运行的计算机程序,所述计算机程序被所述处理器执行时实现所述的白平衡校准方法的步骤。In a third aspect, an embodiment of the present invention also provides an electronic device, including: a memory, a processor, and a computer program stored on the memory and operable on the processor, the computer program being processed by the processor Implement the steps of the white balance calibration method when the controller is executed.

第四方面,本发明实施例还提供了一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机程序,所述计算机程序被处理器执行时实现所述的白平衡校准方法的步骤。In a fourth aspect, an embodiment of the present invention also provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the white balance calibration method described above is implemented. step.

在本发明实施例中,利用拍摄目标图像时的亮度信息和/或拍摄得到的目标图像来确定第一白平衡增益系数的置信度,且该置信度的大小能够表达出根据预设白平衡算法生成的目标图像的第一白平衡增益系数的可靠性,该置信度越高,该第一白平衡增益系数的可靠性越大,并且根据拍摄环境的色温来确定出该目标图像的第二白平衡增益系数,并依据该第一白平衡增益系数的置信度和该第二白平衡增益系数,来对该第一白平衡增益系数进行校准,使得得到的目标白平衡增益系数是与该拍摄环境的亮度情况和/或目标图像的实际图像参数相匹配的,提升了最终确定的针对该目标图像的目标白平衡增益系数的准确性和可靠性,那么利用该目标白平衡增益系数来对目标图像进行白平衡增益处理,则可以使得处理后的图像的整体色彩表现较为稳定。In the embodiment of the present invention, the confidence level of the first white balance gain coefficient is determined by using the brightness information when the target image is captured and/or the captured target image, and the confidence level can express the The reliability of the first white balance gain coefficient of the generated target image, the higher the confidence, the greater the reliability of the first white balance gain coefficient, and determine the second white balance gain coefficient of the target image according to the color temperature of the shooting environment Balance the gain coefficient, and calibrate the first white balance gain coefficient according to the confidence of the first white balance gain coefficient and the second white balance gain coefficient, so that the obtained target white balance gain coefficient is consistent with the shooting environment If the brightness conditions of the target image and/or the actual image parameters of the target image match, the accuracy and reliability of the finally determined target white balance gain coefficient for the target image are improved, then the target white balance gain coefficient is used to adjust the target image Performing white balance gain processing can make the overall color performance of the processed image relatively stable.

附图说明Description of drawings

为了更清楚地说明本发明实施例的技术方案,下面将对本发明实施例的描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following will briefly introduce the accompanying drawings that need to be used in the description of the embodiments of the present invention. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention , for those skilled in the art, other drawings can also be obtained according to these drawings without paying creative labor.

图1是本发明一个实施例的白平衡校准方法的流程图;Fig. 1 is the flowchart of the white balance calibration method of an embodiment of the present invention;

图2是本发明一个实施例的色度图坐标系的示意图;Fig. 2 is the schematic diagram of the chromaticity diagram coordinate system of an embodiment of the present invention;

图3是本发明一个实施例的白平衡校准装置的框图;Fig. 3 is a block diagram of a white balance calibration device according to an embodiment of the present invention;

图4是本发明一个实施例的电子设备的硬件结构示意图。Fig. 4 is a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present invention.

具体实施方式Detailed ways

下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are some of the embodiments of the present invention, but not all of them. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without creative efforts fall within the protection scope of the present invention.

参照图1,示出了本发明一个实施例的白平衡校准方法的流程图,应用于电子设备,所述方法具体可以包括如下步骤:Referring to FIG. 1 , it shows a flow chart of a white balance calibration method according to an embodiment of the present invention, which is applied to an electronic device. The method may specifically include the following steps:

步骤101,获取拍摄的目标图像;Step 101, acquiring the captured target image;

其中,可选的,电子设备的摄像头可以进行图像拍摄,可以生成拍摄的目标图像,本步骤中,电子设备可以获取到摄像头拍摄的目标图像;此外,也可以获取其他电子设备拍摄的目标图像,本发明实施例对此不作具体限定。Wherein, optionally, the camera of the electronic device can capture images, and can generate a captured target image. In this step, the electronic device can obtain the target image captured by the camera; in addition, it can also obtain target images captured by other electronic devices. This embodiment of the present invention does not specifically limit it.

步骤102,根据预设白平衡算法,生成所述目标图像的第一白平衡增益系数;Step 102, generating a first white balance gain coefficient of the target image according to a preset white balance algorithm;

其中,该预设白平衡算法可以为传统技术中的基于灰世界假设的白平衡算法,目前的电子设备在对拍摄对象进行拍摄后,可以基于灰世界假设的白平衡算法来对拍摄的目标图像进行自动计算白平衡增益值。具体使用何种白平衡算法,本发明实施例对此不作具体限定。本步骤中,就可以获取该自动的白平衡处理所对应的针对该目标图像的第一白平衡增益系数。Wherein, the preset white balance algorithm may be a white balance algorithm based on the gray world assumption in the traditional technology. After the current electronic device shoots the subject, it can adjust the captured target image based on the white balance algorithm based on the gray world assumption. Perform automatic calculation of white balance gain value. Which white balance algorithm is specifically used is not specifically limited in this embodiment of the present invention. In this step, the first white balance gain coefficient for the target image corresponding to the automatic white balance processing can be obtained.

其中,本发明中的白平衡增益系数(包括这里的第一白平衡增益系数、下文的第二白平衡增益系数以及目标白平衡增益系数)可以包括白平衡三通道增益数据,例如红基色增益值rgain、绿基色增益值ggain、蓝基色增益值bgain。Among them, the white balance gain coefficient in the present invention (including the first white balance gain coefficient here, the second white balance gain coefficient and the target white balance gain coefficient below) may include white balance three-channel gain data, such as the red primary color gain value rgain, green primary color gain value ggain, blue primary color gain value bgain.

例如这里的第一白平衡增益系数包括r1gain、g1gain、b1gain。For example, the first white balance gain coefficients here include r1gain, g1gain, and b1gain.

其中,电子设备可以包括自动白平衡计算模块,步骤101获取到的目标图像可以发送至该自动白平衡计算模块,来得到r1gain、g1gain、b1gain。Wherein, the electronic device may include an automatic white balance calculation module, and the target image acquired in step 101 may be sent to the automatic white balance calculation module to obtain r1gain, g1gain, and b1gain.

步骤103,根据所述目标图像和/或拍摄所述目标图像时的亮度信息,确定所述第一白平衡增益系数的置信度;Step 103, determining the confidence level of the first white balance gain coefficient according to the target image and/or brightness information when the target image was captured;

其中,该亮度信息为拍摄该目标图像时,拍摄环境的亮度信息。Wherein, the brightness information is the brightness information of the shooting environment when the target image is shot.

该拍摄环境的亮度信息可以由电子设备的摄像头直接获取到,也可以是由其他电子设备将该亮度信息发送给本电子设备,还可以是由用户输入等,本发明实施例对此不作具体限定。The brightness information of the shooting environment may be directly acquired by the camera of the electronic device, or sent to the electronic device by other electronic devices, or input by the user, etc., which is not specifically limited in the embodiment of the present invention. .

本发明对于获取该亮度信息的步骤与步骤101之间的执行顺序不做限制。The present invention does not limit the execution sequence between the step of acquiring the brightness information and step 101 .

其中,本发明的置信度T用于表示步骤102得到的第一白平衡增益系数的可靠性,其数值越高,第一白平衡增益系数可靠性越高,其数值越低,第一白平衡增益系数可靠性越低,0≤T≤1。Wherein, the confidence T of the present invention is used to represent the reliability of the first white balance gain coefficient obtained in step 102, the higher the value, the higher the reliability of the first white balance gain coefficient, and the lower the value, the first white balance The lower the reliability of the gain coefficient, 0≤T≤1.

其中,由于基于预设白平衡算法所生成的第一白平衡增益系数的准确性和可靠性受拍摄画面的灰色像素数目、环境照明度的影响,因此,在本步骤中,可以根据上述拍摄该目标图像时所处的拍摄环境的亮度信息和/或该目标图像,来确定该第一白平衡增益系数的置信度。Wherein, since the accuracy and reliability of the first white balance gain coefficient generated based on the preset white balance algorithm are affected by the number of gray pixels in the photographed picture and the ambient illumination, in this step, the The brightness information of the shooting environment where the target image is located and/or the target image is used to determine the confidence of the first white balance gain coefficient.

其中,该目标图像可以反映拍摄画面的灰色像素数目多少、以及画面颜色是否丰富等特征,因此,本步骤能够根据实际的拍摄环境的亮度情况和拍摄得到的目标图像的像素信息而较为灵活准确的确定出上述第一白平衡增益系数的置信度。Wherein, the target image can reflect the number of gray pixels in the shooting picture, and whether the picture color is rich or not. Therefore, this step can be more flexible and accurate according to the brightness of the actual shooting environment and the pixel information of the shooting target image. The confidence level of the first white balance gain coefficient is determined.

可选地,该电子设备可以包括置信度计算模块,该置信度计算模块用于执行步骤103。Optionally, the electronic device may include a confidence calculation module, and the confidence calculation module is used to execute step 103 .

步骤104,获取拍摄环境的色温;Step 104, obtaining the color temperature of the shooting environment;

其中,步骤104在步骤101之后执行。Wherein, step 104 is executed after step 101 .

该色温为拍摄该目标图像时所处的拍摄环境的色温。The color temperature is the color temperature of the shooting environment where the target image is shot.

可选地,所述电子设备具有色温传感器,可以利用色温传感器,获取所述拍摄环境的色温数据。当然,电子设备也可以通过其他方法来获取该色温,例如先由其他电子设备检测,再发送给本电子设备,或者由用户输入等,本发明实施例对此不作具体限定。Optionally, the electronic device has a color temperature sensor, which can be used to acquire color temperature data of the shooting environment. Of course, the electronic device can also obtain the color temperature through other methods, for example, it is first detected by other electronic devices, and then sent to the electronic device, or input by the user, etc., which is not specifically limited in this embodiment of the present invention.

可选地,在一个实施例中,可以利用电子设备的色温传感器来直接读取一次电子设备所处的环境(也即拍摄环境)的光线的色温值。Optionally, in one embodiment, the color temperature sensor of the electronic device can be used to directly read the color temperature value of the light in the environment where the electronic device is located (ie, the shooting environment).

可选地,在另一个实施例中,为了确保获取的色温值的精度和稳定性,可以在一定时间内利用该色温传感器连续多次读取拍摄环境的光线的色温值,对多个色温值做平均值处理,将平均色温值作为该拍摄环境的色温数据。Optionally, in another embodiment, in order to ensure the accuracy and stability of the acquired color temperature values, the color temperature sensor can be used to read the color temperature values of the light in the shooting environment multiple times within a certain period of time, and the multiple color temperature values Do average value processing, and use the average color temperature value as the color temperature data of the shooting environment.

其中,可选的,本步骤中读取的色温数据的单位为K。Wherein, optionally, the unit of the color temperature data read in this step is K.

可选地,在步骤101之前,根据本发明实施例的方法还包括:通过对所述色温传感器进行预校准而生成色温值与白平衡增益系数的映射表。Optionally, before step 101, the method according to the embodiment of the present invention further includes: generating a mapping table of color temperature values and white balance gain coefficients by pre-calibrating the color temperature sensor.

其中,该映射表为一一映射的映射表。Wherein, the mapping table is a one-to-one mapping mapping table.

这样,通过该映射表可以将色温传感器读取的色温实时的转换为对应的白平衡增益系数。也就是说,利用该映射表可以确定在某个色温下应该对上述目标图像进行多少的白平衡补偿。In this way, the color temperature read by the color temperature sensor can be converted into a corresponding white balance gain coefficient in real time through the mapping table. That is to say, the mapping table can be used to determine how much white balance compensation should be performed on the target image at a certain color temperature.

其中,本发明对于步骤102、步骤103以及步骤104之间的执行顺序不做限制。Wherein, the present invention does not limit the execution order of step 102, step 103 and step 104.

步骤105,根据所述色温,确定所述目标图像的第二白平衡增益系数;Step 105, determining a second white balance gain coefficient of the target image according to the color temperature;

其中,该第二白平衡增益系数为依据拍摄环境的色温而确定的白平衡增益系数。Wherein, the second white balance gain coefficient is a white balance gain coefficient determined according to the color temperature of the shooting environment.

例如第二白平衡增益系数包括r2gain、g2gain、b2gain。For example, the second white balance gain coefficients include r2gain, g2gain, and b2gain.

可选地,在执行步骤105时,可以通过以下实施例的方法或者其他已知或未来开发的利用色温来确定白平衡补偿的方法来实现。Optionally, when step 105 is executed, it may be implemented by the methods of the following embodiments or other known or future-developed methods of using color temperature to determine white balance compensation.

可选地,在一个实施例中,在执行步骤105时,则可以根据预设的色温值与白平衡增益系数的映射表(例如上述通过对色温传感器进行预校准而生成的映射表),获取与步骤104中的所述色温对应的第二白平衡增益系数;其中,所述映射表为通过对所述色温传感器进行预校准而生成的所述映射表。Optionally, in one embodiment, when step 105 is executed, according to the preset mapping table of color temperature value and white balance gain coefficient (such as the above-mentioned mapping table generated by pre-calibrating the color temperature sensor), obtain A second white balance gain coefficient corresponding to the color temperature in step 104; wherein, the mapping table is the mapping table generated by pre-calibrating the color temperature sensor.

在本发明实施例中,参考拍摄环境的光线的色温,而对拍摄的目标图像计算出一个对应于该色温的白平衡补偿值,即第二白平衡增益系数,可以利于对第一白平衡增益系数进行校准。In the embodiment of the present invention, with reference to the color temperature of the light in the shooting environment, a white balance compensation value corresponding to the color temperature is calculated for the captured target image, that is, the second white balance gain coefficient, which can be beneficial to the first white balance gain Coefficients are calibrated.

步骤106,根据所述置信度和所述第二白平衡增益系数,对所述第一白平衡增益系数进行校准,生成所述目标图像的目标白平衡增益系数;Step 106, calibrate the first white balance gain coefficient according to the confidence level and the second white balance gain coefficient, and generate a target white balance gain coefficient of the target image;

可选地,本发明预设有两个置信度阈值,分别为第一置信度阈值T1和第二置信度阈值T2,其中,T1>T2。Optionally, the present invention presets two confidence thresholds, namely a first confidence threshold T1 and a second confidence threshold T2, wherein T1>T2.

可选地,该电子设备可以包括白平衡校准模块,该白平衡校准模块用于执行步骤106,其中,根据第一白平衡增益系数的可靠程度的不同,该白平衡校准模块可以包括三个子模块,分别为白平衡校准模块1、白平衡校准模块2、白平衡校准模块3。Optionally, the electronic device may include a white balance calibration module, and the white balance calibration module is used to perform step 106, wherein, according to the reliability of the first white balance gain coefficient, the white balance calibration module may include three sub-modules , are white balance calibration module 1, white balance calibration module 2, and white balance calibration module 3, respectively.

可选地,在执行步骤106时,可以通过以下方式来实现:Optionally, when executing step 106, it may be implemented in the following manner:

当所述置信度大于第一置信度阈值时,则将所述第一白平衡增益系数确定为所述目标图像的目标白平衡增益系数;When the confidence level is greater than a first confidence level threshold, then determine the first white balance gain coefficient as the target white balance gain coefficient of the target image;

例如T>T1,则说明采用基于灰世界假设的白平衡算法所自动计算的白平衡增益足够可信可靠,因此,执行白平衡校准模块1,用于将第一白平衡增益系数确定该上述目标图像的目标白平衡增益系数(包括Rgainfinal、Ggainfinal、Bgainfinal)。For example, if T>T1, it means that the white balance gain automatically calculated by the white balance algorithm based on the gray world assumption is reliable and reliable enough. Therefore, the white balance calibration module 1 is executed to determine the above-mentioned target by the first white balance gain coefficient The target white balance gain coefficient of the image (including Rgainfinal, Ggainfinal, Bgainfinal).

其中,Rgainfinal=r1gain,Ggainfinal=g1gain,Bgainfinal=b1gain。Wherein, Rgainfinal=r1gain, Ggainfinal=g1gain, Bgainfinal=b1gain.

也就是说,说明拍摄环境的亮度够高、或者,目标图像的灰色像素点的数量足够多,因此,基于灰世界假设的白平衡算法所自动计算的第一白平衡增益系数是准确、可靠的。In other words, it means that the brightness of the shooting environment is high enough, or the number of gray pixels in the target image is large enough. Therefore, the first white balance gain coefficient automatically calculated by the white balance algorithm based on the gray world assumption is accurate and reliable .

当所述置信度大于或等于第二置信度阈值,且小于或等于所述第一置信度阈值时,则对所述第一白平衡增益系数和所述第二白平衡增益系数进行加权计算,生成所述目标图像的目标白平衡增益系数;When the confidence is greater than or equal to the second confidence threshold and less than or equal to the first confidence threshold, performing weighted calculations on the first white balance gain coefficient and the second white balance gain coefficient, generating a target white balance gain factor for the target image;

例如T2≤T≤T1,则说明采用基于灰世界假设的白平衡算法所自动计算的第一白平衡增益系数存在有一定偏差,需要结合色温得到更精确的目标白平衡增益系数,因此,执行白平衡校准模块2,用于对所述第一白平衡增益系数和所述第二白平衡增益系数进行加权计算,生成所述目标图像的目标白平衡增益系数(包括Rgainfinal、Ggainfinal、Bgainfinal)。For example, T2≤T≤T1, it means that there is a certain deviation in the first white balance gain coefficient automatically calculated by the white balance algorithm based on the gray world assumption, and it is necessary to combine the color temperature to obtain a more accurate target white balance gain coefficient. The balance calibration module 2 is configured to perform weighted calculation on the first white balance gain coefficient and the second white balance gain coefficient to generate target white balance gain coefficients (including Rgainfinal, Ggainfinal, Bgainfinal) of the target image.

其中,对于第一白平衡增益系数的权重w1和第二白平衡增益系数的权重w2的取值,可以预先人工配置,也可以由电子设备根据T在[T2,T1]区间内的位置,而自动设置w1和w2的取值。Wherein, the values of the weight w1 of the first white balance gain coefficient and the weight w2 of the second white balance gain coefficient can be manually configured in advance, or can be determined by the electronic device according to the position of T in the interval [T2, T1]. Automatically set the values of w1 and w2.

其中,Rgainfinal=r1gain*w1+r2gain*w2,Ggainfinal=g1gain*w1+g2gain*w2,Bgainfinal=b1gain*w1+b2gain*w2。Wherein, Rgainfinal=r1gain*w1+r2gain*w2, Ggainfinal=g1gain*w1+g2gain*w2, Bgainfinal=b1gain*w1+b2gain*w2.

当所述置信度小于所述第二置信度阈值时,则将所述第二白平衡增益系数确定为所述目标图像的目标白平衡增益系数。When the confidence level is smaller than the second confidence level threshold, the second white balance gain coefficient is determined as the target white balance gain coefficient of the target image.

例如T<T2,则说明采用基于灰世界假设的白平衡算法所自动计算的白平衡增益不可靠,因此,执行白平衡校准模块3,用于将第二白平衡增益系数确定该上述目标图像的目标白平衡增益系数(包括Rgainfinal、Ggainfinal、Bgainfinal)。For example, if T<T2, it means that the white balance gain automatically calculated by the white balance algorithm based on the gray world assumption is unreliable. Therefore, the white balance calibration module 3 is executed to determine the second white balance gain coefficient of the above-mentioned target image. Target white balance gain coefficient (including Rgainfinal, Ggainfinal, Bgainfinal).

其中,Rgainfinal=r2gain,Ggainfinal=g2gain,Bgainfinal=b2gain。Wherein, Rgainfinal=r2gain, Ggainfinal=g2gain, Bgainfinal=b2gain.

也就是说,说明拍摄环境的亮度比较低、或者,目标图像的灰色像素点的数量较少,因此,认为基于灰世界假设的白平衡算法所自动计算的第一白平衡增益系数是不准确、不可靠的。对该目标图像进行白平衡补偿的目标白平衡增益系数则完全取决于基于色温得到的第二白平衡增益系数。That is to say, it shows that the brightness of the shooting environment is relatively low, or the number of gray pixels in the target image is relatively small. Therefore, it is considered that the first white balance gain coefficient automatically calculated by the white balance algorithm based on the gray world assumption is inaccurate. Unreliable. The target white balance gain coefficient for performing white balance compensation on the target image completely depends on the second white balance gain coefficient obtained based on the color temperature.

在本发明实施例中,可以根据第一白平衡增益系数的置信度的大小情况,而判断基于灰世界假设的白平衡算法所自动计算的第一白平衡增益系数是否准确可靠,那么在其不可靠、不准确时,则直接采用色温而得到的第二白平衡增益系数作为针对该目标图像的白平衡补偿;当其可靠、准确时,则直接采用基于灰世界假设的白平衡算法所自动计算的第一白平衡增益系数作为针对该目标图像的白平衡补偿;当其存在一定偏差时,则对第一白平衡增益系数和第二白平衡增益系数进行加权求和,来得到针对该目标图像的白平衡补偿,使得本发明实施例所生成的目标白平衡增益系数是针对该目标图像的可靠、准确且稳定的白平衡增益系数。In the embodiment of the present invention, it can be judged whether the first white balance gain coefficient automatically calculated by the white balance algorithm based on the gray world assumption is accurate and reliable according to the confidence level of the first white balance gain coefficient. When it is reliable and inaccurate, the second white balance gain coefficient obtained by the color temperature is directly used as the white balance compensation for the target image; when it is reliable and accurate, it is directly calculated automatically by the white balance algorithm based on the gray world assumption The first white balance gain coefficient is used as the white balance compensation for the target image; when there is a certain deviation, the first white balance gain coefficient and the second white balance gain coefficient are weighted and summed to obtain the target image white balance compensation, so that the target white balance gain coefficient generated by the embodiment of the present invention is a reliable, accurate and stable white balance gain coefficient for the target image.

步骤107,根据所述目标白平衡增益系数,对所述目标图像进行白平衡增益处理。Step 107: Perform white balance gain processing on the target image according to the target white balance gain coefficient.

那么利用目标白平衡增益系数,来对拍摄得到的目标图像进行白平衡增益处理后,能够确保处理后的图像能够与实际拍摄对象之间的色差较低,避免摄像头拍摄的图像偏色以及整体色彩表现不稳定的情况。Then use the target white balance gain coefficient to perform white balance gain processing on the captured target image, which can ensure that the color difference between the processed image and the actual subject is low, and avoid the color cast and overall color of the image captured by the camera. Behave in an unstable situation.

例如,相关技术中单独利用基于灰世界假设的白平衡算法来对拍摄的目标图像,计算生成白平衡增益值时,如果拍摄环境的照明度较为正常,不是十分暗,或者,拍摄画面的灰色像素数目足够多,或者拍摄画面的颜色较为丰富时,则该白平衡增益值较为准确,那么利用该白平衡增益处理后的目标图像的颜色还原度高,图像的颜色与物体实际颜色的色差较小。但是,如果拍摄环境的照明度较低,或者,拍摄画面的灰色像素数目较少,或者拍摄画面的颜色较为单一时,则该白平衡增益值不够准确,那么利用该白平衡增益处理后的目标图像的颜色还原度较低,使得图像的颜色与物体实际颜色的色差较大。那么就使得采用相关技术中单独利用基于灰世界假设的白平衡算法来对拍摄的目标图像,计算生成白平衡增益值有时是准确的,有时却是不够准确的,使得利用该白平衡增益处理后的目标图像的整体色彩表现不够稳定,有时色彩真实,有时色彩失真。For example, in the related art, when the white balance algorithm based on the gray world assumption is used alone to calculate and generate the white balance gain value of the captured target image, if the illumination of the shooting environment is relatively normal and not very dark, or the gray pixels of the shooting picture When the number is large enough, or the color of the shooting picture is relatively rich, the white balance gain value is more accurate, then the target image processed with this white balance gain has a high degree of color restoration, and the color difference between the image color and the actual color of the object is small . However, if the illumination of the shooting environment is low, or the number of gray pixels in the shooting picture is small, or the color of the shooting picture is relatively single, the white balance gain value is not accurate enough, then the target processed by the white balance gain The color reproduction degree of the image is low, so that the color difference between the image color and the actual color of the object is relatively large. Then it makes use of the white balance algorithm based on the gray world assumption in the related art alone to calculate and generate the white balance gain value of the captured target image, sometimes it is accurate, but sometimes it is not accurate enough, so that The overall color performance of the target image is not stable enough, sometimes the color is true, sometimes the color is distorted.

但是,本发明实施例的上述技术方案却可以根据第一白平衡增益系数的置信度的大小而灵活的确定每次得到的第一白平衡增益系数是否准确,并灵活采用不同的校准方案进行白平衡增益的校准,使得利用本发明实施例的方法得到的目标白平衡增益系数处理后的图像的整体色彩表现较为稳定。However, the above-mentioned technical solution of the embodiment of the present invention can flexibly determine whether the first white balance gain coefficient obtained each time is accurate according to the confidence level of the first white balance gain coefficient, and flexibly adopt different calibration schemes to perform white balance adjustment. The calibration of the balance gain makes the overall color performance of the image processed by the target white balance gain coefficient obtained by the method of the embodiment of the present invention relatively stable.

在本发明实施例中,利用拍摄目标图像时的亮度信息和/或拍摄得到的目标图像来确定第一白平衡增益系数的置信度,且该置信度的大小能够表达出根据预设白平衡算法生成的目标图像的第一白平衡增益系数的可靠性,该置信度越高,该第一白平衡增益系数的可靠性越大,并且根据拍摄环境的色温来确定出该目标图像的第二白平衡增益系数,并依据该第一白平衡增益系数的置信度和该第二白平衡增益系数,来对该第一白平衡增益系数进行校准,使得得到的目标白平衡增益系数是与该拍摄环境的亮度情况和/或目标图像的实际图像参数相匹配的,提升了最终确定的针对该目标图像的目标白平衡增益系数的准确性和可靠性,那么利用该目标白平衡增益系数来对目标图像进行白平衡增益处理,则可以使得处理后的图像的整体色彩表现较为稳定。In the embodiment of the present invention, the confidence level of the first white balance gain coefficient is determined by using the brightness information when the target image is captured and/or the captured target image, and the confidence level can express the The reliability of the first white balance gain coefficient of the generated target image, the higher the confidence, the greater the reliability of the first white balance gain coefficient, and determine the second white balance gain coefficient of the target image according to the color temperature of the shooting environment Balance the gain coefficient, and calibrate the first white balance gain coefficient according to the confidence of the first white balance gain coefficient and the second white balance gain coefficient, so that the obtained target white balance gain coefficient is consistent with the shooting environment If the brightness conditions of the target image and/or the actual image parameters of the target image match, the accuracy and reliability of the finally determined target white balance gain coefficient for the target image are improved, then the target white balance gain coefficient is used to adjust the target image Performing white balance gain processing can make the overall color performance of the processed image relatively stable.

可选地,在一个实施例中,在执行步骤103时,具体在根据所述目标图像,确定所述第一白平衡增益系数的置信度时,可以通过以下方式来实现:Optionally, in one embodiment, when performing step 103, specifically, when determining the confidence level of the first white balance gain coefficient according to the target image, it may be implemented in the following manner:

S201,确定所述目标图像中满足预设条件的灰色像素;S201. Determine gray pixels in the target image that meet preset conditions;

其中,由于基于灰世界假设的白平衡算法所得到的白平衡增益系数,在面临拍摄得到的图像中的灰色像素的数量较少,或颜色单一的情况时,会存在该白平衡增益系数不准确的问题,为了解决上述问题,在本发明实施例中,可以识别该目标图像中满足预设条件的灰色像素。Among them, due to the white balance gain coefficient obtained by the white balance algorithm based on the gray world assumption, the white balance gain coefficient will be inaccurate when faced with the situation that the number of gray pixels in the captured image is small or the color is single In order to solve the above problem, in the embodiment of the present invention, the gray pixels satisfying the preset condition in the target image can be identified.

其中,满足预设条件的灰色像素为对于计算置信度而可用的灰色像素,其可以作为计算置信度的取值的依据。Wherein, the gray pixels satisfying the preset condition are gray pixels available for calculating the confidence level, which can be used as a basis for calculating the value of the confidence level.

可选地,该预设条件可以包括色度条件,或,进一步包括亮度条件。Optionally, the preset condition may include a chroma condition, or further include a brightness condition.

可选地,在一个实施例中,例如该预设条件包括色度条件,那么在执行S201时,可以将所述目标图像中色坐标处于色度图中预设灰色区域内的像素点,确定为满足预设条件的灰色像素。Optionally, in one embodiment, for example, if the preset condition includes a chromaticity condition, then when performing S201, the pixel points whose color coordinates in the target image are in the preset gray area in the chromaticity map can be determined Gray pixels that meet preset conditions.

其中,色坐标(chromaticity coordinate),就是颜色的坐标,也叫表色系。Among them, the chromaticity coordinate is the coordinate of the color, also called the color system.

每个像素点都有色坐标,色坐标为(Cr,Cb),色坐标精确表示了像素点的颜色。由于目标图像中每个像素点都有唯一的一个颜色,因此,每个像素点都有唯一的色坐标。Each pixel has a color coordinate, which is (Cr, Cb), and the color coordinate accurately represents the color of the pixel. Since each pixel in the target image has a unique color, each pixel has a unique color coordinate.

此外,色坐标为色度图中的坐标,色度图对应的坐标系中包括很多种颜色,每个坐标点对应一种颜色,例如如图2所示的色度图的坐标系中,横轴为cr,纵轴为cb。In addition, the color coordinates are the coordinates in the chromaticity diagram. The coordinate system corresponding to the chromaticity diagram includes many kinds of colors, and each coordinate point corresponds to a color. For example, in the coordinate system of the chromaticity diagram shown in Figure 2, horizontal The axis is cr and the vertical axis is cb.

本发明实施例可以预先在图2所示的坐标系中识别灰色或接近灰色的颜色所对应坐标点,从而确定如图2所示的4个函数曲线,其中,四个函数曲线中的8个系数(m1、m2、m3、m4、c1、c2、c3、c4)的取值为预先通过多次调试而确定出来的。In the embodiment of the present invention, the coordinate points corresponding to gray or close to gray colors can be identified in advance in the coordinate system shown in FIG. 2, so as to determine the four function curves shown in FIG. The values of the coefficients (m1, m2, m3, m4, c1, c2, c3, c4) are determined in advance through multiple debuggings.

其中,4个函数曲线分别为:Among them, the four function curves are:

Cb=m1Cr+c1;Cb=m1Cr+c1;

Cb=m3Cr+c3;Cb=m3Cr+c3;

Cr=m2Cb+c2;Cr=m2Cb+c2;

Cr=m4Cb+c4。Cr=m4Cb+c4.

如图2所示,位于坐标系中上述四个函数曲线所组成的矩形区域内的色坐标都是灰色或接近灰色的色坐标,那么上述目标图像中具有该矩形区域内的色坐标的像素点均为本实施例中满足预设条件的灰色像素点。As shown in Figure 2, the color coordinates in the rectangular area formed by the above four function curves in the coordinate system are all gray or close to gray color coordinates, then the pixel points with the color coordinates in the rectangular area in the above-mentioned target image All are gray pixels that meet the preset conditions in this embodiment.

在具体实现时,可以通过判断目标图像中哪些像素点的色坐标(cb,cr)同时满足以下的色度条件,将色坐标满足该色度条件的像素点确定为满足预设条件的灰色像素点。In specific implementation, by judging the color coordinates (cb,cr) of which pixels in the target image meet the following chromaticity conditions at the same time, the pixels whose color coordinates meet the chromaticity conditions are determined as gray pixels that meet the preset conditions point.

色度条件:m3Cr+c3≤Cb≤m1Cr+c1,且,m2Cb+c2≤Cr≤m4Cb+c4Chromaticity conditions: m3Cr+c3≤Cb≤m1Cr+c1, and, m2Cb+c2≤Cr≤m4Cb+c4

因此,本步骤中,可以将所述目标图像中色坐标处于图2的色度图坐标系中灰色像素区域(Grey pixel area)的像素点,确定为满足预设条件的灰色像素。Therefore, in this step, the pixels whose color coordinates in the target image are in the gray pixel area (Grey pixel area) in the chromaticity diagram coordinate system of FIG. 2 can be determined as gray pixels satisfying the preset condition.

在本发明实施例中,通过将目标图像中色坐标满足灰色条件的灰色像素点查找出来,并将该灰色像素点的数量与该目标图像的像素点总数量的比值,作为置信度的取值,使得置信度的大小参考了拍摄的目标图像中灰色像素点在目标图像中所占的像素比例,那么当目标图像灰色像素点的数量较少,比例较低时,则置信度也较低,那么在利用该置信度来对第一白平衡增益系数进行校正时,就可以基于该置信度的取值而了解到第一白平衡增益系数的可靠性,选择合理的校正方案。In the embodiment of the present invention, the gray pixel points whose color coordinates meet the gray condition in the target image are found, and the ratio of the number of gray pixels to the total number of pixels in the target image is used as the value of the confidence , so that the size of the confidence refers to the pixel ratio of the gray pixels in the captured target image to the target image, then when the number of gray pixels in the target image is small and the ratio is low, the confidence is also low, Then, when the confidence level is used to correct the first white balance gain coefficient, the reliability of the first white balance gain coefficient can be known based on the value of the confidence level, and a reasonable correction scheme can be selected.

可选地,在另一个实施例中,该预设条件可以包括亮度条件以及色度条件,那么在执行S201时,可以识别所述目标图像中色坐标处于色度图中预设灰色区域内的第一像素点集合(具体方法可以参照上述实施例,这里不再赘述);以及,识别所述目标图像中亮度值在预设亮度区间之内的第二像素点集合(其中,目标图像中每个像素点都具有一个亮度值,那么基于灰世界假设的白平衡算法对太暗或者太亮的像素点所计算的白平衡增益都不够准确,因此,这里在计算置信度的取值时,还需要参考目标图像中每个像素点的亮度值Y,其中,Y满足该亮度条件:Ymin≤Y≤Ymax的情况下,则该像素点被识别到第二像素集合中);将所述第一像素点集合和所述第二像素点集合的交集内的像素点,确定为满足预设条件的灰色像素。Optionally, in another embodiment, the preset conditions may include brightness conditions and chromaticity conditions, then when performing S201, it may be identified that the color coordinates in the target image are within the preset gray area in the chromaticity diagram The first set of pixel points (the specific method can refer to the above-mentioned embodiments, which will not be repeated here); and, identify the second set of pixel points whose luminance values in the target image are within the preset luminance interval (wherein, each pixel point set in the target image Each pixel has a brightness value, so the white balance gain calculated by the white balance algorithm based on the gray world assumption is not accurate enough for the pixels that are too dark or too bright. Therefore, when calculating the value of the confidence, it is necessary to Refer to the luminance value Y of each pixel in the target image, wherein Y satisfies the luminance condition: in the case of Ymin≤Y≤Ymax, the pixel is identified into the second set of pixels); the first pixel The pixel points within the intersection of the point set and the second pixel point set are determined as gray pixels satisfying a preset condition.

也就是说,本实施例所确定的用于计算置信度的灰色像素,为同时满足亮度条件和色度条件的像素点的集合。那么采用本发明实施例确定的灰色像素来计算置信度时,能够提升所确定的置信度的准确度。That is to say, the gray pixels used for calculating the confidence determined in this embodiment are a set of pixel points satisfying the brightness condition and the chromaticity condition at the same time. Then, when the gray pixels determined in the embodiment of the present invention are used to calculate the confidence level, the accuracy of the determined confidence level can be improved.

其中,不论第一像素集合还是第二像素集合,均包括多个像素点。Wherein, both the first pixel set and the second pixel set include multiple pixel points.

其中,本发明对于识别第一像素点集合和识别第二像素点集合的执行顺序不做限制。Wherein, the present invention does not limit the execution order of identifying the first pixel point set and identifying the second pixel point set.

S202,获取所述灰色像素的数量;S202, acquiring the number of gray pixels;

S203,将所述灰色像素的数量与所述目标图像的像素总数量的比值,确定为所述第一白平衡增益系数的置信度。S203. Determine the ratio of the number of gray pixels to the total number of pixels of the target image as the confidence level of the first white balance gain coefficient.

在本发明实施例中,通过参考目标图像中像素点的色度,或进一步参考像素点的亮度,来确定用于计算置信度可用的灰色像素,并将所述灰色像素的数量与所述目标图像的像素总数量的比值,确定为所述第一白平衡增益系数的置信度。那么当目标图像灰色像素的数量较少,比例较低时,则该置信度较低,那么在利用该置信度来对第一白平衡增益系数进行校正时,就可以基于该置信度的大小而了解到第一白平衡增益系数的可靠性,选择合理的校正方案。In the embodiment of the present invention, the available gray pixels for calculating the confidence are determined by referring to the chromaticity of the pixel points in the target image, or further referring to the brightness of the pixel points, and comparing the number of gray pixels with the target The ratio of the total number of pixels in the image is determined as the confidence of the first white balance gain coefficient. Then when the number of gray pixels in the target image is small and the ratio is low, the confidence level is low, so when using the confidence level to correct the first white balance gain coefficient, it can be based on the size of the confidence level. Knowing the reliability of the first white balance gain coefficient, choose a reasonable correction scheme.

可选地,在一个实施例中,在执行步骤103时,具体到根据拍摄所述目标图像时的亮度信息,确定所述第一白平衡增益系数的置信度时,则可以通过以下方式来实现:Optionally, in one embodiment, when performing step 103, specifically, when determining the confidence level of the first white balance gain coefficient according to the brightness information when the target image is captured, it may be implemented in the following manner :

S301,获取所述电子设备的摄像头可识别的最大亮度值;S301. Obtain the maximum luminance value recognizable by the camera of the electronic device;

S302,根据所述最大亮度值和拍摄所述目标图像时拍摄环境的亮度信息,确定所述第一白平衡增益系数的置信度。S302. Determine the confidence level of the first white balance gain coefficient according to the maximum brightness value and the brightness information of the shooting environment when the target image is shot.

其中,该摄像头可以获取在拍摄该目标图像时的拍摄环境的亮度信息,那么本发明实施例的方法,可以利用最大亮度值和该亮度信息,来确定所述第一白平衡增益系数的置信度,使得本发明实施例计算的置信度,参考了拍摄场景的光线亮度情况,使得置信度的大小能够和第一白平衡增益系数的可靠性正相关,提升置信度的准确度。Wherein, the camera can obtain the brightness information of the shooting environment when the target image is taken, then the method of the embodiment of the present invention can use the maximum brightness value and the brightness information to determine the confidence level of the first white balance gain coefficient , so that the confidence calculated in the embodiment of the present invention refers to the light brightness of the shooting scene, so that the confidence can be positively correlated with the reliability of the first white balance gain coefficient, and the accuracy of the confidence can be improved.

可选地,在一个实施例中,在执行S302时,可以根据所述最大亮度值Emax,确定第一亮度阈值Ea(例如将Emax的预设比例的结果作为Ea。例如预设比例为50%,Emax=500,则Ea=250);当所述拍摄环境的亮度信息m小于或等于所述第一亮度阈值Ea时,则置信度为1;当所述拍摄环境的亮度信息m大于所述第一亮度阈值Ea时,则置信度为(Emax-m)/(Emax-Ea),例如m=300,则T=(500-300)/(500-250)=0.8。Optionally, in one embodiment, when executing S302, the first brightness threshold Ea may be determined according to the maximum brightness value Emax (for example, the result of a preset ratio of Emax is used as Ea. For example, the preset ratio is 50% , Emax=500, then Ea=250); when the brightness information m of the shooting environment is less than or equal to the first brightness threshold Ea, the confidence level is 1; when the brightness information m of the shooting environment is greater than the For the first brightness threshold Ea, the confidence level is (Emax-m)/(Emax-Ea), for example, if m=300, then T=(500-300)/(500-250)=0.8.

可选地,在另一个实施例中,在执行S302时,可以将拍摄环境的亮度信息m与该最大亮度值Emax的比值,确定为该置信度,例如T=m/Emax。Optionally, in another embodiment, when S302 is executed, a ratio of brightness information m of the shooting environment to the maximum brightness value Emax may be determined as the confidence level, for example, T=m/Emax.

可选地,在一个实施例中,在执行步骤103时,具体到根据所述目标图像和拍摄所述目标图像时的亮度信息,来确定所述第一白平衡增益系数的置信度时,则可以获取根据拍摄所述目标图像时的亮度信息所确定的第一置信度Ta(例如通过上述S301~S302所得到的置信度);获取根据所述目标图像所确定的第二置信度Tb(例如通过上述S201~S203所得到的置信度);对所述第一置信度和所述第二置信度进行加权计算,生成所述第一白平衡增益系数的置信度T。Optionally, in one embodiment, when step 103 is executed, specifically when determining the confidence level of the first white balance gain coefficient according to the target image and the brightness information when the target image was captured, then The first confidence degree Ta determined according to the luminance information when the target image is taken (such as the confidence obtained through the above S301-S302) may be obtained; the second confidence degree Tb determined according to the target image (such as Confidence obtained through the above steps S201-S203); performing weighted calculation on the first confidence and the second confidence to generate the confidence T of the first white balance gain coefficient.

其中,拍摄环境的亮度信息对应的置信度权重为w3,目标图像对应的置信度权重为w4,那么T=Ta*w3+Tb*w4。Wherein, the confidence weight corresponding to the brightness information of the shooting environment is w3, and the confidence weight corresponding to the target image is w4, then T=Ta*w3+Tb*w4.

其中,本发明对于获取第一置信度和获取第二置信度的两个步骤之间的执行顺序不做限制。Wherein, the present invention does not limit the execution sequence between the two steps of obtaining the first confidence degree and obtaining the second confidence degree.

在本发明实施例中,可以综合参考拍摄环境的亮度信息以及拍摄得到的目标图像,来计算第一白平衡增益系数的置信度,提升置信度的准确性,进一步确保计算的目标白平衡增益系数的准确性,提升了对采用基于灰世界假设的白平衡算法计算的第一白平衡增益系数的校准准确度。In the embodiment of the present invention, the confidence level of the first white balance gain coefficient can be calculated by comprehensively referring to the brightness information of the shooting environment and the target image obtained by shooting, so as to improve the accuracy of the confidence level and further ensure the calculated target white balance gain coefficient The accuracy of the first white balance gain coefficient calculated by the white balance algorithm based on the gray world assumption is improved, and the calibration accuracy of the first white balance gain coefficient is improved.

参照图3,示出了本发明一个实施例的白平衡校准装置的框图。本发明实施例的白平衡校准装置能实现上述实施例中电子设备实现的白平衡校准方法的细节,并达到相同的效果。图3所示的白平衡校准装置包括:Referring to FIG. 3 , it shows a block diagram of a white balance calibration device according to an embodiment of the present invention. The white balance calibration device of the embodiment of the present invention can realize the details of the white balance calibration method implemented by the electronic device in the above embodiments, and achieve the same effect. The white balance calibration device shown in Figure 3 includes:

第一获取模块31,用于获取拍摄的目标图像;The first obtaining module 31 is used for obtaining the target image of photographing;

生成模块32,用于根据预设白平衡算法,生成所述目标图像的第一白平衡增益系数;A generating module 32, configured to generate a first white balance gain coefficient of the target image according to a preset white balance algorithm;

第一确定模块33,用于根据所述目标图像和/或拍摄所述目标图像时的亮度信息,确定所述第一白平衡增益系数的置信度;The first determination module 33 is configured to determine the confidence level of the first white balance gain coefficient according to the target image and/or the brightness information when the target image was captured;

第二获取模块34,用于获取拍摄环境的色温;The second acquisition module 34 is used to acquire the color temperature of the shooting environment;

第二确定模块35,用于根据所述色温,确定所述目标图像的第二白平衡增益系数;The second determination module 35 is configured to determine a second white balance gain coefficient of the target image according to the color temperature;

校准模块36,用于根据所述置信度和所述第二白平衡增益系数,对所述第一白平衡增益系数进行校准,生成所述目标图像的目标白平衡增益系数;A calibration module 36, configured to calibrate the first white balance gain coefficient according to the confidence level and the second white balance gain coefficient, and generate a target white balance gain coefficient of the target image;

处理模块37,用于根据所述目标白平衡增益系数,对所述目标图像进行白平衡增益处理。The processing module 37 is configured to perform white balance gain processing on the target image according to the target white balance gain coefficient.

可选地,所述第一确定模块33包括:Optionally, the first determination module 33 includes:

第一确定子模块,用于确定所述目标图像中满足预设条件的灰色像素;A first determining submodule, configured to determine gray pixels satisfying preset conditions in the target image;

第一获取子模块,用于获取所述灰色像素的数量;The first obtaining submodule is used to obtain the quantity of the gray pixels;

第二确定子模块,用于将所述灰色像素的数量与所述目标图像的像素总数量的比值,确定为所述第一白平衡增益系数的置信度。The second determination sub-module is configured to determine the ratio of the number of gray pixels to the total number of pixels of the target image as the confidence level of the first white balance gain coefficient.

可选地,所述第一确定子模块包括:Optionally, the first determining submodule includes:

第一确定单元,用于将所述目标图像中色坐标处于色度图中预设灰色区域内的像素点,确定为满足预设条件的灰色像素。The first determining unit is configured to determine, in the target image, pixels whose color coordinates are within a preset gray area in the chromaticity diagram as gray pixels satisfying a preset condition.

可选地,所述第一确定子模块包括:Optionally, the first determining submodule includes:

第一识别单元,用于识别所述目标图像中色坐标处于色度图中预设灰色区域内的第一像素点集合;A first identification unit, configured to identify a first set of pixels in the target image whose color coordinates are within a preset gray area in the chromaticity diagram;

第二识别单元,用于识别所述目标图像中亮度值在预设亮度区间之内的第二像素点集合;a second identifying unit, configured to identify a second set of pixel points in the target image whose luminance values are within a preset luminance range;

第二确定单元,用于将所述第一像素点集合和所述第二像素点集合的交集内的像素点,确定为满足预设条件的灰色像素。The second determination unit is configured to determine the pixels within the intersection of the first pixel point set and the second pixel point set as gray pixels satisfying a preset condition.

可选地,所述第一确定模块33包括:Optionally, the first determination module 33 includes:

第二获取子模块,用于获取所述电子设备的摄像头可识别的最大亮度值;The second acquisition sub-module is used to acquire the maximum brightness value recognizable by the camera of the electronic device;

第三确定子模块,用于根据所述最大亮度值和拍摄所述目标图像时拍摄环境的亮度信息,确定所述第一白平衡增益系数的置信度。The third determining submodule is configured to determine the confidence level of the first white balance gain coefficient according to the maximum brightness value and the brightness information of the shooting environment when the target image is shot.

可选地,所述第一确定模块33包括:Optionally, the first determination module 33 includes:

第三获取子模块,用于获取根据拍摄所述目标图像时的亮度信息所确定的第一置信度;A third acquiring submodule, configured to acquire the first confidence level determined according to the brightness information when the target image is captured;

第四获取子模块,用于获取根据所述目标图像所确定的第二置信度;A fourth acquiring submodule, configured to acquire the second confidence determined according to the target image;

计算子模块,用于对所述第一置信度和所述第二置信度进行加权计算,生成所述第一白平衡增益系数的置信度。The calculation submodule is configured to perform weighted calculation on the first confidence level and the second confidence level to generate the confidence level of the first white balance gain coefficient.

可选地,所述电子设备具有色温传感器,所述第二确定模块35包括:Optionally, the electronic device has a color temperature sensor, and the second determining module 35 includes:

第五获取子模块,用于根据预设的色温值与白平衡增益系数的映射表,获取与所述色温数据对应的第二白平衡增益系数;其中,所述映射表为通过对所述色温传感器进行预校准而生成的映射表。The fifth obtaining sub-module is used to obtain the second white balance gain coefficient corresponding to the color temperature data according to the preset mapping table of color temperature value and white balance gain coefficient; The mapping table generated by the sensor pre-calibration.

可选地,所述校准模块36包括:Optionally, the calibration module 36 includes:

第四确定子模块,用于当所述置信度大于第一置信度阈值时,则将所述第一白平衡增益系数确定为所述目标图像的目标白平衡增益系数;A fourth determination submodule, configured to determine the first white balance gain coefficient as the target white balance gain coefficient of the target image when the confidence level is greater than a first confidence level threshold;

生成子模块,用于当所述置信度大于或等于第二置信度阈值,且小于或等于所述第一置信度阈值时,则对所述第一白平衡增益系数和所述第二白平衡增益系数进行加权计算,生成所述目标图像的目标白平衡增益系数;Generating a submodule, for when the confidence degree is greater than or equal to a second confidence threshold and less than or equal to the first confidence threshold, the first white balance gain coefficient and the second white balance The gain coefficient is weighted and calculated to generate the target white balance gain coefficient of the target image;

第五确定子模块,用于当所述置信度小于所述第二置信度阈值时,则将所述第二白平衡增益系数确定为所述目标图像的目标白平衡增益系数;A fifth determining submodule, configured to determine the second white balance gain coefficient as the target white balance gain coefficient of the target image when the confidence degree is less than the second confidence degree threshold;

其中,所述第二置信度阈值小于所述第一置信度阈值。Wherein, the second confidence threshold is smaller than the first confidence threshold.

本发明实施例提供的白平衡校准装置能够实现上述方法实施例中电子设备实现的各个过程,为避免重复,这里不再赘述。The white balance calibrating device provided by the embodiment of the present invention can realize each process realized by the electronic device in the above method embodiment, and to avoid repetition, details are not repeated here.

在本发明实施例中,利用拍摄目标图像时的亮度信息和/或拍摄得到的目标图像来确定第一白平衡增益系数的置信度,且该置信度的大小能够表达出根据预设白平衡算法生成的目标图像的第一白平衡增益系数的可靠性,该置信度越高,该第一白平衡增益系数的可靠性越大,并且根据拍摄环境的色温来确定出该目标图像的第二白平衡增益系数,并依据该第一白平衡增益系数的置信度和该第二白平衡增益系数,来对该第一白平衡增益系数进行校准,使得得到的目标白平衡增益系数是与该拍摄环境的亮度情况和/或目标图像的实际图像参数相匹配的,提升了最终确定的针对该目标图像的目标白平衡增益系数的准确性和可靠性,那么利用该目标白平衡增益系数来对目标图像进行白平衡增益处理,则可以使得处理后的图像的整体色彩表现较为稳定。In the embodiment of the present invention, the confidence level of the first white balance gain coefficient is determined by using the brightness information when the target image is captured and/or the captured target image, and the confidence level can express the The reliability of the first white balance gain coefficient of the generated target image, the higher the confidence, the greater the reliability of the first white balance gain coefficient, and determine the second white balance gain coefficient of the target image according to the color temperature of the shooting environment Balance the gain coefficient, and calibrate the first white balance gain coefficient according to the confidence of the first white balance gain coefficient and the second white balance gain coefficient, so that the obtained target white balance gain coefficient is consistent with the shooting environment If the brightness conditions of the target image and/or the actual image parameters of the target image match, the accuracy and reliability of the finally determined target white balance gain coefficient for the target image are improved, then the target white balance gain coefficient is used to adjust the target image Performing white balance gain processing can make the overall color performance of the processed image relatively stable.

图4为实现本发明各个实施例的一种电子设备的硬件结构示意图,FIG. 4 is a schematic diagram of a hardware structure of an electronic device implementing various embodiments of the present invention,

该电子设备400包括但不限于:射频单元401、网络模块402、音频输出单元403、输入单元404、传感器405、显示单元406、用户输入单元407、接口单元408、存储器409、处理器410、以及电源411等部件,所述电子设备还包括摄像头。本领域技术人员可以理解,图4中示出的电子设备结构并不构成对电子设备的限定,电子设备可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。在本发明实施例中,电子设备包括但不限于手机、平板电脑、笔记本电脑、掌上电脑、车载终端、可穿戴设备、以及计步器等。The electronic device 400 includes but is not limited to: a radio frequency unit 401, a network module 402, an audio output unit 403, an input unit 404, a sensor 405, a display unit 406, a user input unit 407, an interface unit 408, a memory 409, a processor 410, and power supply 411 and other components, and the electronic device also includes a camera. Those skilled in the art can understand that the structure of the electronic device shown in Figure 4 does not constitute a limitation on the electronic device, and the electronic device may include more or less components than shown in the illustration, or combine some components, or different components layout. In the embodiment of the present invention, electronic devices include but are not limited to mobile phones, tablet computers, notebook computers, palmtop computers, vehicle-mounted terminals, wearable devices, and pedometers.

处理器410,获取所述摄像头拍摄的目标图像;根据预设白平衡算法,生成所述目标图像的第一白平衡增益系数;根据所述目标图像和/或拍摄所述目标图像时的亮度信息,确定所述第一白平衡增益系数的置信度;获取拍摄环境的色温;根据所述色温,确定所述目标图像的第二白平衡增益系数;根据所述置信度和所述第二白平衡增益系数,对所述第一白平衡增益系数进行校准,生成所述目标图像的目标白平衡增益系数;根据所述目标白平衡增益系数,对所述目标图像进行白平衡增益处理。Processor 410, acquiring a target image captured by the camera; generating a first white balance gain coefficient of the target image according to a preset white balance algorithm; according to the target image and/or brightness information when the target image was captured , determine the confidence degree of the first white balance gain coefficient; obtain the color temperature of the shooting environment; determine the second white balance gain coefficient of the target image according to the color temperature; according to the confidence degree and the second white balance Gain coefficient, calibrate the first white balance gain coefficient to generate a target white balance gain coefficient of the target image; perform white balance gain processing on the target image according to the target white balance gain coefficient.

在本发明实施例中,利用拍摄目标图像时的亮度信息和/或拍摄得到的目标图像来确定第一白平衡增益系数的置信度,且该置信度的大小能够表达出根据预设白平衡算法生成的目标图像的第一白平衡增益系数的可靠性,该置信度越高,该第一白平衡增益系数的可靠性越大,并且根据拍摄环境的色温来确定出该目标图像的第二白平衡增益系数,并依据该第一白平衡增益系数的置信度和该第二白平衡增益系数,来对该第一白平衡增益系数进行校准,使得得到的目标白平衡增益系数是与该拍摄环境的亮度情况和/或目标图像的实际图像参数相匹配的,提升了最终确定的针对该目标图像的目标白平衡增益系数的准确性和可靠性,那么利用该目标白平衡增益系数来对目标图像进行白平衡增益处理,则可以使得处理后的图像的整体色彩表现较为稳定。In the embodiment of the present invention, the confidence level of the first white balance gain coefficient is determined by using the brightness information when the target image is captured and/or the captured target image, and the confidence level can express the The reliability of the first white balance gain coefficient of the generated target image, the higher the confidence, the greater the reliability of the first white balance gain coefficient, and determine the second white balance gain coefficient of the target image according to the color temperature of the shooting environment Balance the gain coefficient, and calibrate the first white balance gain coefficient according to the confidence of the first white balance gain coefficient and the second white balance gain coefficient, so that the obtained target white balance gain coefficient is consistent with the shooting environment If the brightness conditions of the target image and/or the actual image parameters of the target image match, the accuracy and reliability of the finally determined target white balance gain coefficient for the target image are improved, then the target white balance gain coefficient is used to adjust the target image Performing white balance gain processing can make the overall color performance of the processed image relatively stable.

应理解的是,本发明实施例中,射频单元401可用于收发信息或通话过程中,信号的接收和发送,具体的,将来自基站的下行数据接收后,给处理器410处理;另外,将上行的数据发送给基站。通常,射频单元401包括但不限于天线、至少一个放大器、收发信机、耦合器、低噪声放大器、双工器等。此外,射频单元401还可以通过无线通信系统与网络和其他设备通信。It should be understood that, in the embodiment of the present invention, the radio frequency unit 401 can be used for receiving and sending signals during sending and receiving information or during a call. Specifically, the downlink data from the base station is received and processed by the processor 410; Uplink data is sent to the base station. Generally, the radio frequency unit 401 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, and the like. In addition, the radio frequency unit 401 can also communicate with the network and other devices through a wireless communication system.

电子设备通过网络模块402为用户提供了无线的宽带互联网访问,如帮助用户收发电子邮件、浏览网页和访问流式媒体等。The electronic device provides users with wireless broadband Internet access through the network module 402, such as helping users send and receive emails, browse web pages, and access streaming media.

音频输出单元403可以将射频单元401或网络模块402接收的或者在存储器409中存储的音频数据转换成音频信号并且输出为声音。而且,音频输出单元403还可以提供与电子设备400执行的特定功能相关的音频输出(例如,呼叫信号接收声音、消息接收声音等等)。音频输出单元403包括扬声器、蜂鸣器以及受话器等。The audio output unit 403 may convert audio data received by the radio frequency unit 401 or the network module 402 or stored in the memory 409 into an audio signal and output as sound. Also, the audio output unit 403 may also provide audio output related to a specific function performed by the electronic device 400 (eg, call signal reception sound, message reception sound, etc.). The audio output unit 403 includes a speaker, a buzzer, a receiver, and the like.

输入单元404用于接收音频或视频信号。输入单元404可以包括图形处理器(Graphics Processing Unit,GPU)4041和麦克风4042,图形处理器4041对在视频捕获模式或图像捕获模式中由图像捕获装置(如摄像头)获得的静态图片或视频的目标图像进行处理。处理后的图像帧可以显示在显示单元406上。经图形处理器4041处理后的图像帧可以存储在存储器409(或其它存储介质)中或者经由射频单元401或网络模块402进行发送。麦克风4042可以接收声音,并且能够将这样的声音处理为音频数据。处理后的音频数据可以在电话通话模式的情况下转换为可经由射频单元401发送到移动通信基站的格式输出。The input unit 404 is used for receiving audio or video signals. The input unit 404 can include a graphics processing unit (Graphics Processing Unit, GPU) 4041 and a microphone 4042, and the graphics processing unit 4041 can target still pictures or videos obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode. The image is processed. The processed image frames may be displayed on the display unit 406 . The image frames processed by the graphics processor 4041 may be stored in the memory 409 (or other storage media) or sent via the radio frequency unit 401 or the network module 402 . The microphone 4042 can receive sound, and can process such sound into audio data. The processed audio data can be converted into a format that can be sent to a mobile communication base station via the radio frequency unit 401 for output in the case of a phone call mode.

电子设备400还包括至少一种传感器405,比如光传感器、运动传感器以及其他传感器。具体地,光传感器包括环境光传感器及接近传感器,其中,环境光传感器可根据环境光线的明暗来调节显示面板4061的亮度,接近传感器可在电子设备400移动到耳边时,关闭显示面板4061和/或背光。作为运动传感器的一种,加速计传感器可检测各个方向上(一般为三轴)加速度的大小,静止时可检测出重力的大小及方向,可用于识别电子设备姿态(比如横竖屏切换、相关游戏、磁力计姿态校准)、振动识别相关功能(比如计步器、敲击)等;传感器405还可以包括指纹传感器、压力传感器、虹膜传感器、分子传感器、陀螺仪、气压计、湿度计、温度计、红外线传感器等,在此不再赘述。The electronic device 400 also includes at least one sensor 405, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor and a proximity sensor, wherein the ambient light sensor can adjust the brightness of the display panel 4061 according to the brightness of the ambient light, and the proximity sensor can turn off the display panel 4061 and the / or backlighting. As a kind of motion sensor, the accelerometer sensor can detect the magnitude of acceleration in various directions (generally three axes), and can detect the magnitude and direction of gravity when it is still, and can be used to identify the posture of electronic equipment (such as horizontal and vertical screen switching, related games) , magnetometer posture calibration), vibration recognition-related functions (such as pedometer, knocking), etc.; the sensor 405 can also include fingerprint sensors, pressure sensors, iris sensors, molecular sensors, gyroscopes, barometers, hygrometers, thermometers, Infrared sensors, etc., will not be repeated here.

显示单元406用于显示由用户输入的信息或提供给用户的信息。显示单元406可包括显示面板4061,可以采用液晶显示器(Liquid Crystal Display,LCD)、有机发光二极管(Organic Light-Emitting Diode,OLED)等形式来配置显示面板4061。The display unit 406 is used to display information input by the user or information provided to the user. The display unit 406 may include a display panel 4061, and the display panel 4061 may be configured in the form of a liquid crystal display (Liquid Crystal Display, LCD), an organic light-emitting diode (Organic Light-Emitting Diode, OLED), or the like.

用户输入单元407可用于接收输入的数字或字符信息,以及产生与电子设备的用户设置以及功能控制有关的键信号输入。具体地,用户输入单元407包括触控面板4071以及其他输入设备4072。触控面板4071,也称为触摸屏,可收集用户在其上或附近的触摸操作(比如用户使用手指、触笔等任何适合的物体或附件在触控面板4071上或在触控面板4071附近的操作)。触控面板4071可包括触摸检测装置和触摸控制器两个部分。其中,触摸检测装置检测用户的触摸方位,并检测触摸操作带来的信号,将信号传送给触摸控制器;触摸控制器从触摸检测装置上接收触摸信息,并将它转换成触点坐标,再送给处理器410,接收处理器410发来的命令并加以执行。此外,可以采用电阻式、电容式、红外线以及表面声波等多种类型实现触控面板4071。除了触控面板4071,用户输入单元407还可以包括其他输入设备4072。具体地,其他输入设备4072可以包括但不限于物理键盘、功能键(比如音量控制按键、开关按键等)、轨迹球、鼠标、操作杆,在此不再赘述。The user input unit 407 can be used to receive input numbers or character information, and generate key signal input related to user settings and function control of the electronic device. Specifically, the user input unit 407 includes a touch panel 4071 and other input devices 4072 . The touch panel 4071, also referred to as a touch screen, can collect touch operations of the user on or near it (for example, the user uses any suitable object or accessory such as a finger or a stylus on the touch panel 4071 or near the touch panel 4071). operate). The touch panel 4071 may include two parts, a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, and detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into contact coordinates, and sends it to the For the processor 410, receive the command sent by the processor 410 and execute it. In addition, the touch panel 4071 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic wave. In addition to the touch panel 4071 , the user input unit 407 may also include other input devices 4072 . Specifically, other input devices 4072 may include, but are not limited to, physical keyboards, function keys (such as volume control keys, switch keys, etc.), trackballs, mice, and joysticks, which will not be repeated here.

进一步的,触控面板4071可覆盖在显示面板4061上,当触控面板4071检测到在其上或附近的触摸操作后,传送给处理器410以确定触摸事件的类型,随后处理器410根据触摸事件的类型在显示面板4061上提供相应的视觉输出。虽然在图4中,触控面板4071与显示面板4061是作为两个独立的部件来实现电子设备的输入和输出功能,但是在某些实施例中,可以将触控面板4071与显示面板4061集成而实现电子设备的输入和输出功能,具体此处不做限定。Furthermore, the touch panel 4071 can be covered on the display panel 4061, and when the touch panel 4071 detects a touch operation on or near it, it will be sent to the processor 410 to determine the type of the touch event, and then the processor 410 will The type of event provides a corresponding visual output on the display panel 4061 . Although in FIG. 4, the touch panel 4071 and the display panel 4061 are used as two independent components to realize the input and output functions of the electronic device, in some embodiments, the touch panel 4071 and the display panel 4061 can be integrated. The implementation of the input and output functions of the electronic device is not specifically limited here.

接口单元408为外部装置与电子设备400连接的接口。例如,外部装置可以包括有线或无线头戴式耳机端口、外部电源(或电池充电器)端口、有线或无线数据端口、存储卡端口、用于连接具有识别模块的装置的端口、音频输入/输出(I/O)端口、视频I/O端口、耳机端口等等。接口单元408可以用于接收来自外部装置的输入(例如,数据信息、电力等等)并且将接收到的输入传输到电子设备400内的一个或多个元件或者可以用于在电子设备400和外部装置之间传输数据。The interface unit 408 is an interface for connecting an external device to the electronic device 400 . For example, an external device may include a wired or wireless headset port, an external power (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device with an identification module, audio input/output (I/O) ports, video I/O ports, headphone ports, and more. The interface unit 408 can be used to receive input from an external device (for example, data information, power, etc.) transfer data between devices.

存储器409可用于存储软件程序以及各种数据。存储器409可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序(比如声音播放功能、图像播放功能等)等;存储数据区可存储根据手机的使用所创建的数据(比如音频数据、电话本等)等。此外,存储器409可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。The memory 409 can be used to store software programs as well as various data. The memory 409 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, at least one application program required by a function (such as a sound playback function, an image playback function, etc.); Data created by the use of mobile phones (such as audio data, phonebook, etc.), etc. In addition, the memory 409 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage devices.

处理器410是电子设备的控制中心,利用各种接口和线路连接整个电子设备的各个部分,通过运行或执行存储在存储器409内的软件程序和/或模块,以及调用存储在存储器409内的数据,执行电子设备的各种功能和处理数据,从而对电子设备进行整体监控。处理器410可包括一个或多个处理单元;优选的,处理器410可集成应用处理器和调制解调处理器,其中,应用处理器主要处理操作系统、用户界面和应用程序等,调制解调处理器主要处理无线通信。可以理解的是,上述调制解调处理器也可以不集成到处理器410中。The processor 410 is the control center of the electronic device, and uses various interfaces and lines to connect various parts of the entire electronic device, by running or executing software programs and/or modules stored in the memory 409, and calling data stored in the memory 409 , to perform various functions of the electronic equipment and process data, so as to monitor the electronic equipment as a whole. The processor 410 may include one or more processing units; preferably, the processor 410 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface and application programs, etc., and the modem The processor mainly handles wireless communication. It can be understood that the foregoing modem processor may not be integrated into the processor 410 .

电子设备400还可以包括给各个部件供电的电源411(比如电池),优选的,电源411可以通过电源管理系统与处理器410逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。The electronic device 400 can also include a power supply 411 (such as a battery) for supplying power to various components. Preferably, the power supply 411 can be logically connected to the processor 410 through a power management system, so as to manage charging, discharging, and power consumption through the power management system. and other functions.

另外,电子设备400包括一些未示出的功能模块,在此不再赘述。In addition, the electronic device 400 includes some functional modules not shown, which will not be repeated here.

优选的,本发明实施例还提供一种电子设备,包括处理器410,存储器409,存储在存储器409上并可在所述处理器410上运行的计算机程序,该计算机程序被处理器410执行时实现上述白平衡校准方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。Preferably, the embodiment of the present invention also provides an electronic device, including a processor 410, a memory 409, and a computer program stored in the memory 409 and operable on the processor 410, when the computer program is executed by the processor 410 The various processes of the embodiments of the white balance calibration method described above can achieve the same technical effect, so in order to avoid repetition, details will not be repeated here.

本发明实施例还提供一种计算机可读存储介质,计算机可读存储介质上存储有计算机程序,该计算机程序被处理器执行时实现上述白平衡校准方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。其中,所述的计算机可读存储介质,如只读存储器(Read-Only Memory,简称ROM)、随机存取存储器(Random Access Memory,简称RAM)、磁碟或者光盘等。The embodiment of the present invention also provides a computer-readable storage medium. A computer program is stored on the computer-readable storage medium. When the computer program is executed by a processor, each process of the above-mentioned embodiment of the white balance calibration method can be achieved, and the same Technical effects, in order to avoid repetition, will not be repeated here. Wherein, the computer-readable storage medium is, for example, a read-only memory (Read-Only Memory, ROM for short), a random access memory (Random Access Memory, RAM for short), a magnetic disk or an optical disk, and the like.

需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。It should be noted that, in this document, the term "comprising", "comprising" or any other variation thereof is intended to cover a non-exclusive inclusion such that a process, method, article or apparatus comprising a set of elements includes not only those elements, It also includes other elements not expressly listed, or elements inherent in the process, method, article, or device. Without further limitations, an element defined by the phrase "comprising a ..." does not preclude the presence of additional identical elements in the process, method, article, or apparatus comprising that element.

通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端(可以是手机,计算机,服务器,空调器,或者网络设备等)执行本发明各个实施例所述的方法。Through the description of the above embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus a necessary general-purpose hardware platform, and of course also by hardware, but in many cases the former is better implementation. Based on such an understanding, the essence of the technical solution of the present invention or the part that contributes to the prior art can be embodied in the form of software products, and the computer software products are stored in a storage medium (such as ROM/RAM, disk, CD) contains several instructions to make a terminal (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) execute the methods described in various embodiments of the present invention.

上面结合附图对本发明的实施例进行了描述,但是本发明并不局限于上述的具体实施方式,上述的具体实施方式仅仅是示意性的,而不是限制性的,本领域的普通技术人员在本发明的启示下,在不脱离本发明宗旨和权利要求所保护的范围情况下,还可做出很多形式,均属于本发明的保护之内。Embodiments of the present invention have been described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific implementations, and the above-mentioned specific implementations are only illustrative, rather than restrictive, and those of ordinary skill in the art will Under the enlightenment of the present invention, without departing from the gist of the present invention and the protection scope of the claims, many forms can also be made, all of which belong to the protection of the present invention.

Claims (10)

CN201911019847.3A2019-10-242019-10-24White balance calibration method and deviceActiveCN110602473B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN201911019847.3ACN110602473B (en)2019-10-242019-10-24White balance calibration method and device

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN201911019847.3ACN110602473B (en)2019-10-242019-10-24White balance calibration method and device

Publications (2)

Publication NumberPublication Date
CN110602473Atrue CN110602473A (en)2019-12-20
CN110602473B CN110602473B (en)2021-11-16

Family

ID=68850215

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN201911019847.3AActiveCN110602473B (en)2019-10-242019-10-24White balance calibration method and device

Country Status (1)

CountryLink
CN (1)CN110602473B (en)

Cited By (13)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN111064938A (en)*2019-12-302020-04-24西安易朴通讯技术有限公司Multi-skin-color-weighted white balance correction method, system and storage medium thereof
CN111641819A (en)*2020-05-192020-09-08浙江大华技术股份有限公司Method, device, system and computer device for white balance gain correction
CN111698493A (en)*2020-06-022020-09-22Oppo广东移动通信有限公司White balance processing method and device
CN112822370A (en)*2021-01-122021-05-18Oppo广东移动通信有限公司Electronic device, pre-image signal processor and image processing method
CN113329215A (en)*2020-02-282021-08-31佳能株式会社Image processing apparatus, image processing method, and storage medium
CN113411555A (en)*2021-06-082021-09-17珠海市杰理科技股份有限公司White balance processing method and device, storage medium and image capturing device
CN113497927A (en)*2020-03-182021-10-12Oppo广东移动通信有限公司White balance adjusting method, device, terminal and storage medium
CN113596427A (en)*2021-09-132021-11-02厦门亿联网络技术股份有限公司Image white balance improving method and device, electronic equipment and storage medium
WO2021226819A1 (en)*2020-05-122021-11-18Polycom Communications Technology (Beijing) Co. Ltd.Deep learning based white balance correction of video frames
CN113766206A (en)*2020-06-012021-12-07Oppo广东移动通信有限公司White balance adjusting method, device and storage medium
EP3972243A1 (en)*2020-09-182022-03-23Beijing Xiaomi Mobile Software Co., Ltd.A computer implemented method for temporally stabilizing white point information in an auto white balance process, a data processing apparatus, a computer program product, and a computer-readable storage medium
WO2022126379A1 (en)*2020-12-152022-06-23深圳市大疆创新科技有限公司Method and device for image processing, and image capturing device
CN115190283A (en)*2022-07-052022-10-14北京地平线信息技术有限公司White balance adjusting method and device

Citations (9)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN1694543A (en)*2004-05-092005-11-09天瀚科技股份有限公司 The method of automatic detection of white balance and dealing with the main color system
JP4051171B2 (en)*2000-05-302008-02-20株式会社リコー White balance adjustment device
CN101179663A (en)*2006-11-072008-05-14明基电通股份有限公司Photographing method and system and machine readable medium thereof
JP2008211756A (en)*2007-02-022008-09-11Ricoh Co Ltd Imaging device
CN101472188A (en)*2007-12-272009-07-01佳能株式会社White balance control device and white balance control method
CN102892010A (en)*2012-10-222013-01-23浙江宇视科技有限公司White balance processing method and device under multiple light sources
CN105245863A (en)*2014-07-072016-01-13佳能株式会社 Image processing device for white balance control, control method thereof, and imaging device
CN105306916A (en)*2014-05-302016-02-03佳能株式会社Image pickup apparatus that performs white balance control and method of controlling the same
CN107920236A (en)*2017-12-182018-04-17广东欧珀移动通信有限公司 Image white balance processing method and device, storage medium and electronic equipment

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
JP4051171B2 (en)*2000-05-302008-02-20株式会社リコー White balance adjustment device
CN1694543A (en)*2004-05-092005-11-09天瀚科技股份有限公司 The method of automatic detection of white balance and dealing with the main color system
CN101179663A (en)*2006-11-072008-05-14明基电通股份有限公司Photographing method and system and machine readable medium thereof
JP2008211756A (en)*2007-02-022008-09-11Ricoh Co Ltd Imaging device
CN101472188A (en)*2007-12-272009-07-01佳能株式会社White balance control device and white balance control method
CN102892010A (en)*2012-10-222013-01-23浙江宇视科技有限公司White balance processing method and device under multiple light sources
CN105306916A (en)*2014-05-302016-02-03佳能株式会社Image pickup apparatus that performs white balance control and method of controlling the same
CN105245863A (en)*2014-07-072016-01-13佳能株式会社 Image processing device for white balance control, control method thereof, and imaging device
CN107920236A (en)*2017-12-182018-04-17广东欧珀移动通信有限公司 Image white balance processing method and device, storage medium and electronic equipment

Cited By (20)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN111064938A (en)*2019-12-302020-04-24西安易朴通讯技术有限公司Multi-skin-color-weighted white balance correction method, system and storage medium thereof
CN113329215A (en)*2020-02-282021-08-31佳能株式会社Image processing apparatus, image processing method, and storage medium
CN113497927B (en)*2020-03-182023-08-29Oppo广东移动通信有限公司White balance adjustment method, device, terminal and storage medium
CN113497927A (en)*2020-03-182021-10-12Oppo广东移动通信有限公司White balance adjusting method, device, terminal and storage medium
CN115918102A (en)*2020-05-122023-04-04Polycom通讯技术(北京)有限公司 White balance correction of video frame based on deep learning
WO2021226819A1 (en)*2020-05-122021-11-18Polycom Communications Technology (Beijing) Co. Ltd.Deep learning based white balance correction of video frames
CN111641819A (en)*2020-05-192020-09-08浙江大华技术股份有限公司Method, device, system and computer device for white balance gain correction
CN113766206B (en)*2020-06-012024-08-02Oppo广东移动通信有限公司 White balance adjustment method, device and storage medium
CN113766206A (en)*2020-06-012021-12-07Oppo广东移动通信有限公司White balance adjusting method, device and storage medium
CN111698493A (en)*2020-06-022020-09-22Oppo广东移动通信有限公司White balance processing method and device
EP3972243A1 (en)*2020-09-182022-03-23Beijing Xiaomi Mobile Software Co., Ltd.A computer implemented method for temporally stabilizing white point information in an auto white balance process, a data processing apparatus, a computer program product, and a computer-readable storage medium
US11457191B2 (en)2020-09-182022-09-27Beijing Xiaomi Mobile Software Co., Ltd.Computer implemented method for temporally stabilizing white point information in an auto white balance process, a data processing apparatus, a computer program product, and a computer-readable storage medium
WO2022126379A1 (en)*2020-12-152022-06-23深圳市大疆创新科技有限公司Method and device for image processing, and image capturing device
CN112822370A (en)*2021-01-122021-05-18Oppo广东移动通信有限公司Electronic device, pre-image signal processor and image processing method
CN113411555B (en)*2021-06-082022-07-22珠海市杰理科技股份有限公司 White balance processing method and device, storage medium, and image capture device
CN113411555A (en)*2021-06-082021-09-17珠海市杰理科技股份有限公司White balance processing method and device, storage medium and image capturing device
CN113596427A (en)*2021-09-132021-11-02厦门亿联网络技术股份有限公司Image white balance improving method and device, electronic equipment and storage medium
CN113596427B (en)*2021-09-132024-03-15厦门亿联网络技术股份有限公司Image white balance improving method and device, electronic equipment and storage medium
CN115190283A (en)*2022-07-052022-10-14北京地平线信息技术有限公司White balance adjusting method and device
CN115190283B (en)*2022-07-052023-09-19北京地平线信息技术有限公司White balance adjustment method and device

Also Published As

Publication numberPublication date
CN110602473B (en)2021-11-16

Similar Documents

PublicationPublication DateTitle
CN110602473A (en)White balance calibration method and device
CN107580184B (en) A shooting method and mobile terminal
CN107566730B (en) A panoramic image shooting method and mobile terminal
CN109688322B (en)Method and device for generating high dynamic range image and mobile terminal
CN107958470A (en)A kind of color correcting method, mobile terminal
CN107846583B (en) A kind of image shadow compensation method and mobile terminal
CN108040240B (en) Method, device and mobile terminal for white balance adjustment
CN110266930A (en) Lighting method for image shooting, mobile terminal and lighting adjustment method
CN109104578B (en) An image processing method and mobile terminal
CN108924414A (en)A kind of image pickup method and terminal device
CN108040209B (en)Shooting method and mobile terminal
CN107845363B (en)A kind of display control method and mobile terminal
CN111028192B (en)Image synthesis method and electronic equipment
CN107623818A (en) A kind of image exposure method and mobile terminal
CN109729280A (en) An image processing method and mobile terminal
CN111459233A (en)Display method, electronic device, and storage medium
CN111131722A (en) Image processing method, electronic device and medium
CN108616687B (en) A photographing method, device and mobile terminal
CN107807488B (en)Camera assembly, aperture adjusting method and mobile terminal
CN107835402A (en)A kind of image processing method, device and mobile terminal
WO2023072038A1 (en)Image data processing method and electronic device
CN108038889A (en)The processing method and mobile terminal of a kind of image color cast
CN107944438A (en)A kind of file and picture bearing calibration and mobile terminal
CN108932505B (en)Image processing method and electronic equipment
CN110636225A (en) Photographing method and electronic equipment

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
GR01Patent grant
GR01Patent grant

[8]ページ先頭

©2009-2025 Movatter.jp