CN104394392B - A kind of white balance adjusting method, device and terminal - Google Patents

A kind of white balance adjusting method, device and terminal Download PDF

Info

Publication number
CN104394392B
CN104394392B CN201410647497.6A CN201410647497A CN104394392B CN 104394392 B CN104394392 B CN 104394392B CN 201410647497 A CN201410647497 A CN 201410647497A CN 104394392 B CN104394392 B CN 104394392B
Authority
CN
China
Prior art keywords
gain
image
white balance
frame rate
average value
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.)
Expired - Fee Related
Application number
CN201410647497.6A
Other languages
Chinese (zh)
Other versions
CN104394392A (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.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp 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 Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201410647497.6A priority Critical patent/CN104394392B/en
Publication of CN104394392A publication Critical patent/CN104394392A/en
Application granted granted Critical
Publication of CN104394392B publication Critical patent/CN104394392B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Color Television Image Signal Generators (AREA)
  • Processing Of Color Television Signals (AREA)

Abstract

本发明实施例公开了一种白平衡调节方法、装置以及终端,其中所述白平衡调节方法包括:获取第一摄像头的帧率;判断帧率是否是最大帧率,若是,则通过第一摄像头获取第一图像;对第一图像进行分析以获取第一图像的白平衡增益;根据白平衡增益对通过第二摄像头获取到的第二图像进行白平衡调节;显示白平衡调节后的第二图像。采用本发明实施例,可在不影响图像画质的情况下,提高白平衡调节速度,降低白平衡调节后的图像的显示时延。

The embodiment of the present invention discloses a white balance adjustment method, device and terminal, wherein the white balance adjustment method includes: obtaining the frame rate of the first camera; judging whether the frame rate is the maximum Acquire the first image; analyze the first image to obtain the white balance gain of the first image; adjust the white balance of the second image obtained through the second camera according to the white balance gain; display the second image after the white balance adjustment . By adopting the embodiments of the present invention, the white balance adjustment speed can be increased without affecting the image quality, and the display delay of the image after the white balance adjustment can be reduced.

Description

一种白平衡调节方法、装置以及终端A white balance adjustment method, device and terminal

技术领域technical field

本发明涉及电子技术领域,尤其涉及一种白平衡调节方法、装置以及终端。The present invention relates to the field of electronic technology, in particular to a white balance adjustment method, device and terminal.

背景技术Background technique

在摄像技术中,摄像头启动或者光环境发生变化时,通常会伴随白平衡调节过程。其中,白平衡用于描述显示器中红、绿以及蓝三基色混合生成白色的精确度。白平衡调节速度通常与帧率有关,若帧率越高,则白平衡调节速度越快,终端通过显示器显示白平衡调节后的图像的时间越短,其中帧率用于测量单位时间内传输的图像的帧数。而现有摄像技术中,帧率越高,对显卡的处理能力要求也越高,若提高帧率,将导致图像亮度较低或者噪点较大,进而影响图像画质;若帧率较低,则白平衡调节速度较慢,终端通过显示器显示白平衡调节后的图像的时延较长。In camera technology, when the camera is started or the light environment changes, it is usually accompanied by a white balance adjustment process. Among them, white balance is used to describe the accuracy with which the red, green and blue primary colors in the display are mixed to generate white. The white balance adjustment speed is usually related to the frame rate. If the frame rate is higher, the white balance adjustment speed is faster, and the time for the terminal to display the white balance adjusted image on the display is shorter. The frame rate is used to measure the transmission rate per unit time. The number of frames of the image. In the existing camera technology, the higher the frame rate, the higher the processing capability requirements of the graphics card. If the frame rate is increased, the image brightness will be lower or the noise will be larger, which will affect the image quality; if the frame rate is lower, Then the white balance adjustment speed is slow, and the time delay for the terminal to display the white balance adjusted image through the display is relatively long.

发明内容Contents of the invention

本发明实施例提供一种白平衡调节方法、装置以及终端,可在不影响图像画质的情况下,提高白平衡调节速度,降低白平衡调节后的图像的显示时延。Embodiments of the present invention provide a white balance adjustment method, device and terminal, which can improve the white balance adjustment speed and reduce the display delay of the white balance adjusted image without affecting the image quality.

本发明实施例提供了一种白平衡调节方法,包括:An embodiment of the present invention provides a white balance adjustment method, including:

获取第一摄像头的帧率;Get the frame rate of the first camera;

判断所述帧率是否是最大帧率,若是,则通过所述第一摄像头获取第一图像;Judging whether the frame rate is the maximum frame rate, if so, acquiring the first image through the first camera;

对所述第一图像进行分析以获取所述第一图像的白平衡增益;analyzing the first image to obtain a white balance gain of the first image;

根据所述白平衡增益对通过第二摄像头获取到的第二图像进行白平衡调节;adjusting the white balance of the second image acquired by the second camera according to the white balance gain;

显示所述白平衡调节后的第二图像。and displaying the second image after the white balance has been adjusted.

相应地,本发明实施例还提供了一种白平衡调节装置,包括:Correspondingly, an embodiment of the present invention also provides a white balance adjustment device, including:

帧率获取模块,用于获取第一摄像头的帧率;A frame rate acquisition module, configured to obtain the frame rate of the first camera;

判断模块,用于判断所述帧率是否是最大帧率;A judging module, configured to judge whether the frame rate is the maximum frame rate;

图像获取模块,用于若所述判断模块判断所述帧率是最大帧率,则通过所述第一摄像头获取第一图像;An image acquisition module, configured to acquire a first image through the first camera if the judging module judges that the frame rate is the maximum frame rate;

增益获取模块,用于对所述第一图像进行分析以获取所述第一图像的白平衡增益;a gain obtaining module, configured to analyze the first image to obtain the white balance gain of the first image;

调节模块,用于根据所述白平衡增益对通过第二摄像头获取到的第二图像进行白平衡调节;An adjustment module, configured to adjust the white balance of the second image acquired through the second camera according to the white balance gain;

显示模块,用于显示所述白平衡调节后的第二图像。A display module, configured to display the second image after the white balance has been adjusted.

相应地,本发明实施例还提供了一种终端,包括如上所述的白平衡调节装置。Correspondingly, an embodiment of the present invention also provides a terminal, including the above-mentioned white balance adjustment device.

实施本发明实施例,终端判断第一摄像头的帧率是最大帧率时,通过第一摄像头获取第一图像,对第一图像进行分析以获取第一图像的白平衡增益,根据白平衡增益对通过第二摄像头获取到的第二图像进行白平衡调节,并显示白平衡调节后的第二图像,相对现有技术中,帧率较高将导致图像画质较差,帧率较低将导致白平衡调节速度较慢,本发明实施例可在不影响图像画质的情况下,提高白平衡调节速度,降低白平衡调节后的图像的显示时延。Implementing the embodiment of the present invention, when the terminal judges that the frame rate of the first camera is the maximum frame rate, the terminal obtains the first image through the first camera, analyzes the first image to obtain the white balance gain of the first image, and adjusts the The second image obtained by the second camera is used for white balance adjustment, and the second image after white balance adjustment is displayed. Compared with the prior art, a higher frame rate will result in poorer image quality, and a lower frame rate will result in The white balance adjustment speed is relatively slow, and the embodiment of the present invention can increase the white balance adjustment speed and reduce the display delay of the white balance adjusted image without affecting the image quality.

附图说明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 drawings that need to be used in the description of the embodiments. Obviously, the drawings in the following description are some embodiments of the present invention. Those of ordinary skill in the art can also obtain other drawings based on these drawings without any creative effort.

图1是本发明第一实施例中提供的一种白平衡调节方法的流程示意图;FIG. 1 is a schematic flowchart of a white balance adjustment method provided in the first embodiment of the present invention;

图2是本发明实施例中提供的一种白平衡调节装置的结构示意图;FIG. 2 is a schematic structural diagram of a white balance adjustment device provided in an embodiment of the present invention;

图3是本发明实施例中图2的增益获取模块的结构示意图;Fig. 3 is a schematic structural diagram of the gain acquisition module of Fig. 2 in an embodiment of the present invention;

图4是本发明实施例中图2的调节模块的结构示意图;Fig. 4 is a schematic structural diagram of the regulating module of Fig. 2 in an embodiment of the present invention;

图5是本发明实施例中提供的一种终端的结构示意图。Fig. 5 is a schematic structural diagram of a terminal provided in an embodiment of the present invention.

具体实施方式detailed description

下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。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 making creative efforts belong to the protection scope of the present invention.

本发明实施例公开了一种白平衡调节方法,终端判断第一摄像头的帧率是最大帧率时,通过第一摄像头获取第一图像,对第一图像进行分析以获取第一图像的白平衡增益,根据白平衡增益对通过第二摄像头获取到的第二图像进行白平衡调节,并显示白平衡调节后的第二图像,可在不影响图像画质的情况下,提高白平衡调节速度,降低白平衡调节后的图像的显示时延。The embodiment of the present invention discloses a white balance adjustment method. When the terminal judges that the frame rate of the first camera is the maximum frame rate, the terminal obtains the first image through the first camera, and analyzes the first image to obtain the white balance of the first image. Gain, adjust the white balance of the second image obtained through the second camera according to the white balance gain, and display the second image after white balance adjustment, which can improve the speed of white balance adjustment without affecting the image quality. Reduce the display delay of the image after white balance adjustment.

本发明实施例提及到的第一摄像头和第二摄像头的拍摄方向可以相同,也可以不相同。例如,第一摄像头可以为前置摄像头,第二摄像头可以为后置摄像头,其中第一摄像头和第二摄像头的拍摄方向相反。又如,第一摄像头和第二摄像头可以为后置摄像头,其中第一摄像头和第二摄像头的拍摄方向相同,等等,本发明实施例不做限定。The shooting directions of the first camera and the second camera mentioned in the embodiment of the present invention may be the same or different. For example, the first camera may be a front camera, and the second camera may be a rear camera, where the shooting directions of the first camera and the second camera are opposite. For another example, the first camera and the second camera may be rear cameras, where the shooting directions of the first camera and the second camera are the same, etc., which are not limited in this embodiment of the present invention.

本发明实施例提及到的白平衡调节装置可以设置在手机、照相机、平板电脑、PC(personal computer,个人计算机)或者佩戴式智能设备等终端中。The white balance adjusting device mentioned in the embodiment of the present invention may be set in a terminal such as a mobile phone, a camera, a tablet computer, a PC (personal computer, personal computer) or a wearable smart device.

请参见图1,图1是本发明第一实施例中提供的一种白平衡调节方法的流程示意图,如图所示本发明实施例中的白平衡调节方法可以包括:Please refer to FIG. 1. FIG. 1 is a schematic flowchart of a white balance adjustment method provided in the first embodiment of the present invention. As shown in the figure, the white balance adjustment method in the embodiment of the present invention may include:

S101,获取第一摄像头的帧率。S101. Acquire the frame rate of the first camera.

终端可以获取第一摄像头的帧率。例如,终端通过摄像头模块启动第一摄像头之后,可以获取第一摄像头的配置信息,并根据第一摄像头的配置信息获取第一摄像头的帧率。其中,帧率用于测量单位时间内传输的图像的帧数,帧率越高,单位时间内传输的图像的帧数越多,则终端通过摄像头获取图像的速度越快,终端对图像进行分析以获取图像的白平衡增益的速度就越快,进而终端通过白平衡增益对图像进行白平衡调节的速度就越快,终端通过显示器显示白平衡调节后的图像的时延越短。The terminal can acquire the frame rate of the first camera. For example, after starting the first camera through the camera module, the terminal may acquire configuration information of the first camera, and acquire a frame rate of the first camera according to the configuration information of the first camera. Among them, the frame rate is used to measure the number of frames of images transmitted per unit time. The higher the frame rate, the more frames of images transmitted per unit time, and the faster the terminal acquires images through the camera. The terminal analyzes the images The faster the speed of obtaining the white balance gain of the image is, the faster the terminal can adjust the white balance of the image through the white balance gain, and the shorter the time delay for the terminal to display the white balance adjusted image on the display.

S102,判断帧率是否是最大帧率。S102. Determine whether the frame rate is the maximum frame rate.

终端获取到第一摄像头的帧率之后,可以判断该帧率是否是最大帧率,若该帧率是最大帧率,则进一步执行S104;若该帧率不是最大帧率,则进一步执行S103。例如,终端可以获取第一摄像头的配置信息,并根据第一摄像头的配置信息获取第一摄像头的最大帧率,则终端获取到第一摄像头的帧率之后,可以判断该帧率是否是最大帧率。After the terminal obtains the frame rate of the first camera, it can determine whether the frame rate is the maximum frame rate, and if the frame rate is the maximum frame rate, further execute S104; if the frame rate is not the maximum frame rate, further execute S103. For example, the terminal can obtain the configuration information of the first camera, and obtain the maximum frame rate of the first camera according to the configuration information of the first camera, then after obtaining the frame rate of the first camera, the terminal can determine whether the frame rate is the maximum frame rate Rate.

S103,将帧率调整为最大帧率。S103. Adjust the frame rate to the maximum frame rate.

终端判断第一摄像头的帧率不是最大帧率时,可以将该帧率调整为最大帧率。例如,终端可以获取第一摄像头的配置信息,并根据第一摄像头的配置信息获取第一摄像头的最大帧率,则终端可以将该帧率调整为最大帧率。When the terminal determines that the frame rate of the first camera is not the maximum frame rate, it may adjust the frame rate to the maximum frame rate. For example, the terminal may obtain the configuration information of the first camera, and obtain the maximum frame rate of the first camera according to the configuration information of the first camera, and then the terminal may adjust the frame rate to the maximum frame rate.

S104,通过第一摄像头获取第一图像。S104. Acquire a first image through a first camera.

终端判断第一摄像头的帧率是最大帧率时,可以通过第一摄像头获取第一图像。具体的,终端可以控制第一摄像头以最大帧率为参数,获取第一图像,其中终端获取第一图像的速度最快。When the terminal determines that the frame rate of the first camera is the maximum frame rate, the terminal may acquire the first image through the first camera. Specifically, the terminal may control the first camera to acquire the first image with a maximum frame rate parameter, and the terminal acquires the first image at the fastest speed.

在可选实施例中,终端判断第一摄像头的帧率不是最大帧率,并将该帧率调整为最大帧率之后,可以通过第一摄像头获取第一图像。In an optional embodiment, after determining that the frame rate of the first camera is not the maximum frame rate, and adjusting the frame rate to the maximum frame rate, the terminal may obtain the first image through the first camera.

S105,对第一图像进行分析以获取第一图像的白平衡增益。S105. Analyze the first image to obtain a white balance gain of the first image.

终端可以对第一图像进行分析以获取第一图像的白平衡增益。终端可以通过基于动态阈值或者灰度世界等的自动白平衡算法,对第一图像进行分析以获取第一图像的白平衡增益。The terminal may analyze the first image to obtain the white balance gain of the first image. The terminal may analyze the first image by using an automatic white balance algorithm based on a dynamic threshold or a grayscale world, to obtain a white balance gain of the first image.

以基于动态阈值的自动白平衡算法为例,终端可以将第一图像切分成至少一个子图像,计算各个子图像的亮度平均值,获取最大亮度平均值对应的子图像中R、G、B三基色的平均值,根据R、G、B三基色的平均值获取白平衡增益,其中R基色为红色,G基色为绿色,B基色为蓝色。Taking the automatic white balance algorithm based on dynamic threshold as an example, the terminal can divide the first image into at least one sub-image, calculate the average brightness of each sub-image, and obtain the R, G, and B three colors in the sub-image corresponding to the maximum average brightness. The average value of the primary colors, the white balance gain is obtained according to the average value of the three primary colors R, G, and B, where the R primary color is red, the G primary color is green, and the B primary color is blue.

需要指出的是,本发明实施例包含但不局限于通过基于动态阈值的自动白平衡算法对第一图像进行分析以获取第一图像的白平衡增益,例如,终端还可以通过基于色相关法的自动白平衡算法对第一图像进行分析以获取第一图像的白平衡增益,等等,本发明实施例不做限定。It should be noted that this embodiment of the present invention includes but is not limited to analyzing the first image through an automatic white balance algorithm based on a dynamic threshold to obtain the white balance gain of the first image. The automatic white balance algorithm analyzes the first image to obtain the white balance gain of the first image, etc., which are not limited in this embodiment of the present invention.

可选的,终端可以计算最大亮度平均值与R基色的平均值的乘积,作为白平衡增益中的红色增益,或者计算最大亮度平均值与G基色的平均值的乘积,作为白平衡增益中的绿色增益,或者计算最大亮度平均值与B基色的平均值的乘积,作为白平衡增益中的蓝色增益。Optionally, the terminal may calculate the product of the maximum average brightness value and the average value of the R primary color as the red gain in the white balance gain, or calculate the product of the maximum brightness average value and the average value of the G primary color as the white balance gain Green gain, or calculate the product of the maximum luminance average value and the average value of the B primary color as the blue gain in the white balance gain.

进一步可选的,终端可以计算最大亮度平均值与R基色的平均值的乘积,作为白平衡增益中的红色增益,并计算最大亮度平均值与G基色的平均值的乘积,作为白平衡增益中的绿色增益。终端也可以计算最大亮度平均值与R基色的平均值的乘积,作为白平衡增益中的红色增益,并计算最大亮度平均值与B基色的平均值的乘积,作为白平衡增益中的蓝色增益。终端也可以计算最大亮度平均值与G基色的平均值的乘积,作为白平衡增益中的绿色增益,并计算最大亮度平均值与B基色的平均值的乘积,作为白平衡增益中的蓝色增益。Further optionally, the terminal may calculate the product of the maximum average brightness value and the average value of the R primary color as the red gain in the white balance gain, and calculate the product of the maximum brightness average value and the average value of the G primary color as the red gain in the white balance gain. green gain. The terminal can also calculate the product of the maximum brightness average value and the average value of the R primary color as the red gain in the white balance gain, and calculate the product of the maximum brightness average value and the average value of the B primary color as the blue gain in the white balance gain . The terminal can also calculate the product of the maximum brightness average value and the G primary color average value as the green gain in the white balance gain, and calculate the product of the maximum brightness average value and the B primary color average value as the blue gain in the white balance gain .

进一步可选的,终端可以计算最大亮度平均值与R基色的平均值的乘积,作为白平衡增益中的红色增益,计算最大亮度平均值与G基色的平均值的乘积,作为白平衡增益中的绿色增益,并计算最大亮度平均值与B基色的平均值的乘积,作为白平衡增益中的蓝色增益。Further optionally, the terminal may calculate the product of the average value of the maximum brightness and the average value of the primary color R as the red gain in the white balance gain, and calculate the product of the average value of the maximum brightness and the average value of the primary color G as the red gain in the white balance gain. Green gain, and calculate the product of the maximum luminance average value and the average value of the B primary color as the blue gain in the white balance gain.

S106,根据白平衡增益对通过第二摄像头获取到的第二图像进行白平衡调节。S106. Perform white balance adjustment on the second image acquired through the second camera according to the white balance gain.

终端可以根据白平衡增益对通过第二摄像头获取到的第二图像进行白平衡调节。The terminal may adjust the white balance of the second image acquired through the second camera according to the white balance gain.

具体的,白平衡增益可以包括红色增益、绿色增益或者蓝色增益,终端可以通过第二摄像头获取第二图像,将红色增益渲染在第二图像的红色通道上,或者将绿色增益渲染在第二图像的绿色通道上,或者将蓝色增益渲染在第二图像信息的蓝色通道上,以实现对第二图像的白平衡调节。Specifically, the white balance gain may include red gain, green gain or blue gain, and the terminal may acquire the second image through the second camera, render the red gain on the red channel of the second image, or render the green gain on the second on the green channel of the image, or render the blue gain on the blue channel of the second image information, so as to realize the white balance adjustment of the second image.

可选的,白平衡增益包括红色增益和绿色增益时,终端可以通过第二摄像头获取第二图像,将红色增益渲染在第二图像的红色通道上,并将绿色增益渲染在第二图像的绿色通道上,以实现对第二图像的白平衡调节。白平衡增益包括红色增益和蓝色增益时,终端可以通过第二摄像头获取第二图像,将红色增益渲染在第二图像的红色通道上,并将蓝色增益渲染在第二图像的蓝色通道上,以实现对第二图像的白平衡调节。白平衡增益包括绿色增益和蓝色增益时,终端可以通过第二摄像头获取第二图像,将绿色增益渲染在第二图像的绿色通道上,并将蓝色增益渲染在第二图像的蓝色通道上,以实现对第二图像的白平衡调节。Optionally, when the white balance gain includes red gain and green gain, the terminal may acquire the second image through the second camera, render the red gain on the red channel of the second image, and render the green gain on the green gain of the second image channel to adjust the white balance of the second image. When the white balance gain includes red gain and blue gain, the terminal can capture the second image through the second camera, render the red gain on the red channel of the second image, and render the blue gain on the blue channel of the second image to adjust the white balance of the second image. When the white balance gain includes green gain and blue gain, the terminal can capture the second image through the second camera, render the green gain on the green channel of the second image, and render the blue gain on the blue channel of the second image to adjust the white balance of the second image.

进一步可选的,白平衡增益包括红色增益、绿色增益以及蓝色增益时,终端可以通过第二摄像头获取第二图像,将红色增益渲染在第二图像的红色通道上,将绿色增益渲染在第二图像的绿色通道上,并将蓝色增益渲染在第二图像信息的蓝色通道上,以实现对第二图像的白平衡调节。Further optionally, when the white balance gain includes red gain, green gain, and blue gain, the terminal may acquire the second image through the second camera, render the red gain on the red channel of the second image, and render the green gain on the second image. on the green channel of the second image, and render the blue gain on the blue channel of the second image information, so as to realize the white balance adjustment of the second image.

S107,显示白平衡调节后的第二图像。S107, displaying the second image after white balance adjustment.

终端对第二图像进行白平衡调节之后,可以显示白平衡调节后的第二图像,例如,终端可以通过显示器显示白平衡调节后的第二图像。After adjusting the white balance of the second image, the terminal may display the second image after white balance adjustment, for example, the terminal may display the second image after white balance adjustment through a display.

本发明实施例中终端通过第一摄像头获取到的第一图像用于获取白平衡增益,通过第二摄像头获取的第二图像用于预览并显示,则第一摄像头的帧率调整为最大帧率时,可以提高第一图像的白平衡增益的获取速度,第二摄像头的帧率保持不变,将不影响第二图像的画质,通过第一图像的白平衡增益对第二图像进行白平衡调节,提高了白平衡调节速度,降低了白平衡调节后的图像的显示时延。In the embodiment of the present invention, the first image obtained by the terminal through the first camera is used to obtain the white balance gain, and the second image obtained through the second camera is used for preview and display, and the frame rate of the first camera is adjusted to the maximum frame rate , the acquisition speed of the white balance gain of the first image can be increased, and the frame rate of the second camera remains unchanged, which will not affect the quality of the second image. White balance the second image through the white balance gain of the first image Adjustment, the speed of white balance adjustment is improved, and the display delay of the image after white balance adjustment is reduced.

在图1所示的白平衡调节方法中,终端判断第一摄像头的帧率是最大帧率时,通过第一摄像头获取第一图像,对第一图像进行分析以获取第一图像的白平衡增益,根据白平衡增益对通过第二摄像头获取到的第二图像进行白平衡调节,并显示白平衡调节后的第二图像,可在不影响图像画质的情况下,提高白平衡调节速度,降低白平衡调节后的图像的显示时延。In the white balance adjustment method shown in Figure 1, when the terminal judges that the frame rate of the first camera is the maximum frame rate, the terminal obtains the first image through the first camera, and analyzes the first image to obtain the white balance gain of the first image , adjust the white balance of the second image acquired by the second camera according to the white balance gain, and display the second image after white balance adjustment, which can improve the white balance adjustment speed and reduce the The display delay of the image after white balance adjustment.

请参见图2,图2是本发明实施例中提供的一种白平衡调节装置的结构示意图,其中本发明实施例提供的白平衡调节装置与图1所示的方法相对应,为基于图1所示的白平衡调节方法的执行主体,如图所示本发明实施例中的白平衡调节装置200至少可以包括帧率获取模块210、判断模块220、图像获取模块230、增益获取模块240、调节模块250以及显示模块260,其中:Please refer to Figure 2, Figure 2 is a schematic structural diagram of a white balance adjustment device provided in an embodiment of the present invention, wherein the white balance adjustment device provided in an embodiment of the present invention corresponds to the method shown in Figure 1, and is based on Figure 1 The executive body of the white balance adjustment method shown in the figure, as shown in the figure, the white balance adjustment device 200 in the embodiment of the present invention may at least include a frame rate acquisition module 210, a judgment module 220, an image acquisition module 230, a gain acquisition module 240, an adjustment Module 250 and display module 260, wherein:

帧率获取模块210,用于获取第一摄像头的帧率。The frame rate acquiring module 210 is configured to acquire the frame rate of the first camera.

例如,帧率获取模块210可以获取第一摄像头的配置信息,并根据第一摄像头的配置信息获取第一摄像头的帧率。其中,帧率用于测量单位时间内传输的图像的帧数,帧率越高,单位时间内传输的图像的帧数越多,则图像获取模块230通过摄像头获取图像的速度越快,增益获取模块240对图像进行分析以获取图像的白平衡增益的速度就越快,进而调节模块250通过白平衡增益对图像进行白平衡调节的速度就越快,显示模块260通过显示器显示白平衡调节后的图像的时延越短。For example, the frame rate obtaining module 210 may obtain configuration information of the first camera, and obtain the frame rate of the first camera according to the configuration information of the first camera. Wherein, the frame rate is used to measure the number of frames of images transmitted per unit time, the higher the frame rate, the more frames of images transmitted per unit time, the faster the image acquisition module 230 acquires images through the camera, and the gain is obtained The faster the module 240 analyzes the image to obtain the white balance gain of the image, the faster the adjustment module 250 adjusts the white balance of the image through the white balance gain, and the display module 260 displays the adjusted white balance through the display. The shorter the image delay.

判断模块220,用于判断帧率是否是最大帧率。A judging module 220, configured to judge whether the frame rate is the maximum frame rate.

例如,判断模块220可以获取第一摄像头的配置信息,并根据第一摄像头的配置信息获取第一摄像头的最大帧率,则判断模块220获取到第一摄像头的帧率之后,可以判断该帧率是否是最大帧率。For example, the judgment module 220 can obtain the configuration information of the first camera, and obtain the maximum frame rate of the first camera according to the configuration information of the first camera, then after the judgment module 220 obtains the frame rate of the first camera, it can judge the frame rate Whether it is the maximum frame rate.

图像获取模块230,用于若判断模块220判断帧率是最大帧率,则通过第一摄像头获取第一图像。The image acquiring module 230 is configured to acquire the first image through the first camera if the judging module 220 judges that the frame rate is the maximum frame rate.

增益获取模块240,用于对第一图像进行分析以获取第一图像的白平衡增益。The gain obtaining module 240 is configured to analyze the first image to obtain the white balance gain of the first image.

例如,增益获取模块240可以通过基于动态阈值或者灰度世界等的自动白平衡算法,对第一图像进行分析以获取第一图像的白平衡增益。需要指出的是,本发明实施例包含但不局限于通过基于动态阈值的自动白平衡算法对第一图像进行分析以获取第一图像的白平衡增益,例如,增益获取模块240还可以通过基于色相关法的自动白平衡算法对第一图像进行分析以获取第一图像的白平衡增益,等等,本发明实施例不做限定。For example, the gain obtaining module 240 may analyze the first image to obtain the white balance gain of the first image through an automatic white balance algorithm based on a dynamic threshold or a grayscale world. It should be pointed out that the embodiment of the present invention includes but is not limited to analyzing the first image through an automatic white balance algorithm based on a dynamic threshold to obtain the white balance gain of the first image. The automatic white balance algorithm of the correlation method analyzes the first image to obtain the white balance gain of the first image, etc., which are not limited in this embodiment of the present invention.

调节模块250,用于根据白平衡增益对通过第二摄像头获取到的第二图像进行白平衡调节。The adjusting module 250 is configured to adjust the white balance of the second image acquired through the second camera according to the white balance gain.

显示模块260,用于显示白平衡调节后的第二图像。例如,显示模块260可以通过显示器显示白平衡调节后的第二图像。The display module 260 is configured to display the second image after white balance adjustment. For example, the display module 260 may display the second image after white balance adjustment through a display.

作为一种可选的实施方式,调节模块250,还用于判断模块220判断帧率不是最大帧率时,将帧率调整为最大帧率,触发图像获取模块230通过第一摄像头获取第一图像。As an optional implementation manner, the adjustment module 250 is also used to adjust the frame rate to the maximum frame rate when the judging module 220 judges that the frame rate is not the maximum frame rate, and trigger the image acquisition module 230 to acquire the first image through the first camera .

作为一种可选的实施方式,图像获取模块230,用于控制第一摄像头以最大帧率为参数,获取第一图像,其中图像获取模块230获取第一图像的速度最快。As an optional implementation manner, the image acquisition module 230 is configured to control the first camera to acquire the first image with a maximum frame rate parameter, wherein the image acquisition module 230 acquires the first image at the fastest speed.

作为一种可选的实施方式,增益获取模块240可以如图3所示,进一步包括:As an optional implementation manner, the gain acquisition module 240 may be shown in FIG. 3, further comprising:

切分单元310,用于将第一图像切分成至少一个子图像。The segmentation unit 310 is configured to segment the first image into at least one sub-image.

计算单元320,用于计算各个子图像的亮度平均值。A calculation unit 320, configured to calculate the average brightness of each sub-image.

均值获取单元330,用于获取最大亮度平均值对应的子图像中R、G、B三基色的平均值。其中R基色为红色,G基色为绿色,B基色为蓝色。The mean value obtaining unit 330 is configured to obtain the mean value of the three primary colors R, G and B in the sub-image corresponding to the maximum brightness mean value. The R base color is red, the G base color is green, and the B base color is blue.

增益获取单元340,用于根据R、G、B三基色的平均值获取白平衡增益。The gain acquiring unit 340 is configured to acquire the white balance gain according to the average value of the three primary colors R, G, and B.

作为一种可选的实施方式,增益获取单元340,用于计算最大亮度平均值与R基色的平均值的乘积,作为白平衡增益中的红色增益。或者As an optional implementation manner, the gain acquisition unit 340 is configured to calculate a product of a maximum brightness average value and an R primary color average value as a red gain in the white balance gain. or

增益获取单元340,用于计算最大亮度平均值与G基色的平均值的乘积,作为白平衡增益中的绿色增益。或者The gain obtaining unit 340 is configured to calculate the product of the maximum brightness average value and the G primary color average value as the green gain in the white balance gain. or

增益获取单元340,用于计算最大亮度平均值与B基色的平均值的乘积,作为白平衡增益中的蓝色增益。The gain acquisition unit 340 is configured to calculate the product of the maximum brightness average value and the B primary color average value as the blue gain in the white balance gain.

进一步可选的,增益获取单元340可以计算最大亮度平均值与R基色的平均值的乘积,作为白平衡增益中的红色增益,并计算最大亮度平均值与G基色的平均值的乘积,作为白平衡增益中的绿色增益。增益获取单元340也可以计算最大亮度平均值与R基色的平均值的乘积,作为白平衡增益中的红色增益,并计算最大亮度平均值与B基色的平均值的乘积,作为白平衡增益中的蓝色增益。增益获取单元340也可以计算最大亮度平均值与G基色的平均值的乘积,作为白平衡增益中的绿色增益,并计算最大亮度平均值与B基色的平均值的乘积,作为白平衡增益中的蓝色增益。Further optionally, the gain acquisition unit 340 may calculate the product of the maximum average brightness value and the average value of the R primary color as the red gain in the white balance gain, and calculate the product of the maximum brightness average value and the average value of the G primary color as the white gain Green gain in balance gain. The gain obtaining unit 340 may also calculate the product of the maximum brightness average value and the R primary color average value as the red gain in the white balance gain, and calculate the product of the maximum brightness average value and the B primary color average value as the white balance gain Blue gain. The gain obtaining unit 340 may also calculate the product of the maximum brightness average value and the G primary color average value as the green gain in the white balance gain, and calculate the product of the maximum brightness average value and the B primary color average value as the white balance gain. Blue gain.

进一步可选的,增益获取单元340可以计算最大亮度平均值与R基色的平均值的乘积,作为白平衡增益中的红色增益,计算最大亮度平均值与G基色的平均值的乘积,作为白平衡增益中的绿色增益,并计算最大亮度平均值与B基色的平均值的乘积,作为白平衡增益中的蓝色增益。Further optionally, the gain acquisition unit 340 may calculate the product of the maximum brightness average value and the R primary color average value as the red gain in the white balance gain, and calculate the product of the maximum brightness average value and the G primary color average value as the white balance gain. The green gain in the gain, and the product of the maximum luminance average value and the average value of the B primary color is calculated as the blue gain in the white balance gain.

作为一种可选的实施方式,白平衡增益可以包括红色增益、绿色增益或者蓝色增益,则调节模块250可以如图4所示,进一步包括:As an optional implementation manner, the white balance gain may include red gain, green gain or blue gain, and then the adjustment module 250 may be as shown in FIG. 4 , further comprising:

图像获取单元410,用于通过第二摄像头获取第二图像。An image acquiring unit 410, configured to acquire a second image through a second camera.

渲染单元420,用于将红色增益渲染在第二图像的红色通道上、将绿色增益渲染在第二图像的绿色通道上、或者将蓝色增益渲染在第二图像信息的蓝色通道上,以实现对第二图像的白平衡调节。a rendering unit 420, configured to render the red gain on the red channel of the second image, the green gain on the green channel of the second image, or the blue gain on the blue channel of the second image information, to The white balance adjustment of the second image is realized.

进一步可选的,白平衡增益包括红色增益和绿色增益时,渲染单元420可以将红色增益渲染在第二图像的红色通道上,并将绿色增益渲染在第二图像的绿色通道上,以实现对第二图像的白平衡调节。白平衡增益包括红色增益和蓝色增益时,渲染单元420可以将红色增益渲染在第二图像的红色通道上,并将蓝色增益渲染在第二图像的蓝色通道上,以实现对第二图像的白平衡调节。白平衡增益包括绿色增益和蓝色增益时,渲染单元420可以将绿色增益渲染在第二图像的绿色通道上,并将蓝色增益渲染在第二图像的蓝色通道上,以实现对第二图像的白平衡调节。Further optionally, when the white balance gain includes a red gain and a green gain, the rendering unit 420 may render the red gain on the red channel of the second image, and render the green gain on the green channel of the second image, so as to realize White balance adjustment for the second image. When the white balance gain includes red gain and blue gain, the rendering unit 420 may render the red gain on the red channel of the second image, and render the blue gain on the blue channel of the second image, so as to realize the Image white balance adjustment. When the white balance gain includes a green gain and a blue gain, the rendering unit 420 may render the green gain on the green channel of the second image, and render the blue gain on the blue channel of the second image, so as to achieve the second Image white balance adjustment.

进一步可选的,白平衡增益包括红色增益、绿色增益以及蓝色增益时,渲染单元420可以将红色增益渲染在第二图像的红色通道上,将绿色增益渲染在第二图像的绿色通道上,并将蓝色增益渲染在第二图像信息的蓝色通道上,以实现对第二图像的白平衡调节。Further optionally, when the white balance gain includes a red gain, a green gain, and a blue gain, the rendering unit 420 may render the red gain on the red channel of the second image, and render the green gain on the green channel of the second image, And render the blue gain on the blue channel of the second image information, so as to realize the white balance adjustment of the second image.

在图2所示的白平衡调节装置中,判断模块220判断帧率获取模块210获取到的帧率是最大帧率时,图像获取单元230通过第一摄像头获取第一图像,增益获取模块240对第一图像进行分析以获取第一图像的白平衡增益,调节模块250根据白平衡增益对通过第二摄像头获取到的第二图像进行白平衡调节,显示模块260显示白平衡调节后的第二图像,可在不影响图像画质的情况下,提高白平衡调节速度,降低白平衡调节后的图像的显示时延。In the white balance adjustment device shown in FIG. 2 , when the judgment module 220 judges that the frame rate acquired by the frame rate acquisition module 210 is the maximum frame rate, the image acquisition unit 230 acquires the first image through the first camera, and the gain acquisition module 240 The first image is analyzed to obtain the white balance gain of the first image, the adjustment module 250 adjusts the white balance of the second image acquired through the second camera according to the white balance gain, and the display module 260 displays the second image after white balance adjustment , without affecting the image quality, the speed of white balance adjustment can be increased, and the display delay of the image after white balance adjustment can be reduced.

请参见图5,图5是本发明实施例中提供的一种终端的结构示意图,可以包括图2~图4所示的白平衡调节装置,其中,该终端可以是手机、照相机、平板电脑、PC或者佩戴式智能设备等终端,白平衡调节装置设置于该终端中。如图5所示,该终端500包括:至少一个处理器510,例如CPU,至少一个第一输入装置530,至少一个第二输入装置540,至少一个输出装置550,存储器560,至少一个总线520。其中,通信总线520用于实现这些组件之间的连接通信。例如,第一输入装置530可以包括第一摄像头,第二输入装置540可以包括第二摄像头,输出装置550可以包括显示屏。存储器560可以是高速RAM存储器,也可以是非不稳定的存储器(non-volatile memory),例如至少一个磁盘存储器。存储器560可选的还可以是至少一个位于远离前述处理器510的存储终端。其中处理器510可以结合图2~图4所示的白平衡调节装置,其中存储器560中存储一组程序代码,且处理器510调用存储器560中存储的程序代码,用于执行以下操作:Please refer to Figure 5. Figure 5 is a schematic structural diagram of a terminal provided in an embodiment of the present invention, which may include the white balance adjustment device shown in Figures 2 to 4, wherein the terminal may be a mobile phone, a camera, a tablet computer, For a terminal such as a PC or a wearable smart device, the white balance adjustment device is disposed in the terminal. As shown in FIG. 5 , the terminal 500 includes: at least one processor 510, such as a CPU, at least one first input device 530, at least one second input device 540, at least one output device 550, memory 560, and at least one bus 520. Wherein, the communication bus 520 is used to realize connection and communication between these components. For example, the first input device 530 may include a first camera, the second input device 540 may include a second camera, and the output device 550 may include a display screen. The memory 560 may be a high-speed RAM memory, or a non-volatile memory, such as at least one disk memory. Optionally, the memory 560 may also be at least one storage terminal located away from the aforementioned processor 510 . The processor 510 can be combined with the white balance adjustment device shown in FIGS. 2 to 4 , wherein a set of program codes are stored in the memory 560, and the processor 510 calls the program codes stored in the memory 560 to perform the following operations:

获取第一输入装置530的帧率。The frame rate of the first input device 530 is acquired.

例如,处理器510可以获取第一输入装置530的配置信息,并根据第一输入装置530的配置信息获取第一输入装置530的帧率。其中,帧率用于测量单位时间内传输的图像的帧数,帧率越高,单位时间内传输的图像的帧数越多,则通过第一输入装置530获取图像的速度越快,处理器510对图像进行分析以获取图像的白平衡增益的速度就越快,进而通过白平衡增益对图像进行白平衡调节的速度就越快,通过输出装置550显示白平衡调节后的图像的时延越短。For example, the processor 510 may obtain configuration information of the first input device 530 , and obtain the frame rate of the first input device 530 according to the configuration information of the first input device 530 . Wherein, the frame rate is used to measure the number of frames of images transmitted per unit time, the higher the frame rate, the more frames of images transmitted per unit time, the faster the speed of acquiring images through the first input device 530, the processor The faster the 510 analyzes the image to obtain the white balance gain of the image, the faster the white balance adjustment of the image is performed through the white balance gain, and the longer the time delay for displaying the white balance adjusted image through the output device 550 is. short.

判断帧率是否是最大帧率。Determine whether the frame rate is the maximum frame rate.

例如,处理器510可以获取第一输入装置530的配置信息,并根据第一输入装置530的配置信息获取第一输入装置530的最大帧率,则获取到第一输入装置530的帧率之后,可以判断该帧率是否是最大帧率。For example, the processor 510 may obtain the configuration information of the first input device 530, and obtain the maximum frame rate of the first input device 530 according to the configuration information of the first input device 530, then after obtaining the frame rate of the first input device 530, It can be judged whether the frame rate is the maximum frame rate.

若判断帧率是最大帧率,则通过第一输入装置530获取第一图像。If it is determined that the frame rate is the maximum frame rate, the first image is acquired through the first input device 530 .

对第一图像进行分析以获取第一图像的白平衡增益。The first image is analyzed to obtain a white balance gain for the first image.

例如,处理器510可以通过基于动态阈值或者灰度世界等的自动白平衡算法,对第一图像进行分析以获取第一图像的白平衡增益。需要指出的是,本发明实施例包含但不局限于通过基于动态阈值的自动白平衡算法对第一图像进行分析以获取第一图像的白平衡增益,例如,处理器510还可以通过基于色相关法的自动白平衡算法对第一图像进行分析以获取第一图像的白平衡增益,等等,本发明实施例不做限定。For example, the processor 510 may analyze the first image to obtain the white balance gain of the first image by using an automatic white balance algorithm based on a dynamic threshold or a gray scale world. It should be noted that this embodiment of the present invention includes but is not limited to analyzing the first image through an automatic white balance algorithm based on a dynamic threshold to obtain the white balance gain of the first image. The automatic white balance algorithm of the method analyzes the first image to obtain the white balance gain of the first image, etc., which are not limited in this embodiment of the present invention.

根据白平衡增益对通过第二输入装置540获取到的第二图像进行白平衡调节。The white balance of the second image obtained through the second input device 540 is adjusted according to the white balance gain.

通过输出装置550显示白平衡调节后的第二图像。The second image after white balance adjustment is displayed through the output device 550 .

作为一种可选的实施方式,处理器510判断帧率不是最大帧率时,可以将帧率调整为最大帧率,并通过第一输入装置530获取第一图像。As an optional implementation manner, when the processor 510 determines that the frame rate is not the maximum frame rate, it may adjust the frame rate to the maximum frame rate, and acquire the first image through the first input device 530 .

作为一种可选的实施方式,处理器510通过第一输入装置530获取第一图像具体可以包括:As an optional implementation manner, the acquiring the first image by the processor 510 through the first input device 530 may specifically include:

控制第一输入装置530以最大帧率为参数,获取第一图像,其中处理器510获取第一图像的速度最快。The first input device 530 is controlled to acquire the first image with the maximum frame rate as a parameter, wherein the processor 510 acquires the first image at the fastest speed.

作为一种可选的实施方式,处理器510对第一图像进行分析以获取第一图像的白平衡增益具体可以包括:As an optional implementation manner, the processor 510 analyzing the first image to obtain the white balance gain of the first image may specifically include:

将第一图像切分成至少一个子图像。Slicing the first image into at least one sub-image.

计算各个子图像的亮度平均值。Computes the brightness average of each subimage.

获取最大亮度平均值对应的子图像中R、G、B三基色的平均值。其中R基色为红色,G基色为绿色,B基色为蓝色。Obtain the average value of the three primary colors R, G, and B in the sub-image corresponding to the average value of the maximum brightness. The R base color is red, the G base color is green, and the B base color is blue.

根据R、G、B三基色的平均值获取白平衡增益。The white balance gain is obtained according to the average value of the three primary colors R, G, and B.

作为一种可选的实施方式,处理器510根据R、G、B三基色的平均值获取白平衡增益具体可以包括:As an optional implementation manner, the processor 510 obtaining the white balance gain according to the average value of the three primary colors R, G, and B may specifically include:

计算最大亮度平均值与R基色的平均值的乘积,作为白平衡增益中的红色增益。或者The product of the maximum luminance average value and the average value of the R primary color is calculated as the red gain in the white balance gain. or

计算最大亮度平均值与G基色的平均值的乘积,作为白平衡增益中的绿色增益。或者The product of the maximum luminance average value and the average value of the G primary color is calculated as the green gain in the white balance gain. or

计算最大亮度平均值与B基色的平均值的乘积,作为白平衡增益中的蓝色增益。The product of the maximum luminance average value and the average value of the B primary color is calculated as the blue gain in the white balance gain.

进一步可选的,处理器510可以计算最大亮度平均值与R基色的平均值的乘积,作为白平衡增益中的红色增益,并计算最大亮度平均值与G基色的平均值的乘积,作为白平衡增益中的绿色增益。处理器510也可以计算最大亮度平均值与R基色的平均值的乘积,作为白平衡增益中的红色增益,并计算最大亮度平均值与B基色的平均值的乘积,作为白平衡增益中的蓝色增益。处理器510也可以计算最大亮度平均值与G基色的平均值的乘积,作为白平衡增益中的绿色增益,并计算最大亮度平均值与B基色的平均值的乘积,作为白平衡增益中的蓝色增益。Further optionally, the processor 510 may calculate the product of the maximum average brightness value and the average value of the R primary color as the red gain in the white balance gain, and calculate the product of the maximum brightness average value and the average value of the G primary color as the white balance gain. Green buffs in buffs. The processor 510 may also calculate the product of the maximum brightness average value and the average value of the R primary color as the red gain in the white balance gain, and calculate the product of the maximum brightness average value and the average value of the B primary color as the blue gain in the white balance gain. color gain. The processor 510 may also calculate the product of the maximum brightness average value and the average value of the G primary color as the green gain in the white balance gain, and calculate the product of the maximum brightness average value and the average value of the B primary color as the blue gain in the white balance gain. color gain.

进一步可选的,处理器510可以计算最大亮度平均值与R基色的平均值的乘积,作为白平衡增益中的红色增益,计算最大亮度平均值与G基色的平均值的乘积,作为白平衡增益中的绿色增益,并计算最大亮度平均值与B基色的平均值的乘积,作为白平衡增益中的蓝色增益。Further optionally, the processor 510 may calculate the product of the average value of the maximum brightness and the average value of the primary color R as the red gain in the white balance gain, and calculate the product of the average value of the maximum brightness and the average value of the primary color G as the white balance gain The green gain in , and calculate the product of the maximum luminance average value and the average value of the B primary color as the blue gain in the white balance gain.

作为一种可选的实施方式,白平衡增益可以包括红色增益、绿色增益或者蓝色增益,则处理器510根据白平衡增益对通过第二输入装置540获取到的第二图像进行白平衡调节具体可以包括:As an optional implementation manner, the white balance gain may include red gain, green gain or blue gain, and the processor 510 performs white balance adjustment on the second image acquired through the second input device 540 according to the white balance gain. Can include:

通过第二输入装置540获取第二图像。The second image is acquired through the second input device 540 .

将红色增益渲染在第二图像的红色通道上、将绿色增益渲染在第二图像的绿色通道上、或者将蓝色增益渲染在第二图像信息的蓝色通道上,以实现对第二图像的白平衡调节。Render the red gain on the red channel of the second image, render the green gain on the green channel of the second image, or render the blue gain on the blue channel of the second image information to achieve the White balance adjustment.

进一步可选的,白平衡增益包括红色增益和绿色增益时,处理器510可以将红色增益渲染在第二图像的红色通道上,并将绿色增益渲染在第二图像的绿色通道上,以实现对第二图像的白平衡调节。白平衡增益包括红色增益和蓝色增益时,处理器510可以将红色增益渲染在第二图像的红色通道上,并将蓝色增益渲染在第二图像的蓝色通道上,以实现对第二图像的白平衡调节。白平衡增益包括绿色增益和蓝色增益时,处理器510可以将绿色增益渲染在第二图像的绿色通道上,并将蓝色增益渲染在第二图像的蓝色通道上,以实现对第二图像的白平衡调节。Further optionally, when the white balance gain includes a red gain and a green gain, the processor 510 may render the red gain on the red channel of the second image, and render the green gain on the green channel of the second image, so as to implement White balance adjustment for the second image. When the white balance gain includes a red gain and a blue gain, the processor 510 may render the red gain on the red channel of the second image, and render the blue gain on the blue channel of the second image, so as to implement the second Image white balance adjustment. When the white balance gain includes a green gain and a blue gain, the processor 510 may render the green gain on the green channel of the second image, and render the blue gain on the blue channel of the second image, so as to implement the second Image white balance adjustment.

进一步可选的,白平衡增益包括红色增益、绿色增益以及蓝色增益时,处理器510可以将红色增益渲染在第二图像的红色通道上,将绿色增益渲染在第二图像的绿色通道上,并将蓝色增益渲染在第二图像信息的蓝色通道上,以实现对第二图像的白平衡调节。Further optionally, when the white balance gain includes a red gain, a green gain, and a blue gain, the processor 510 may render the red gain on the red channel of the second image, and render the green gain on the green channel of the second image, And render the blue gain on the blue channel of the second image information, so as to realize the white balance adjustment of the second image.

具体的,本发明实施例中介绍的终端500可以用以实施本发明结合图1介绍的白平衡调节方法实施例中的部分或全部流程。Specifically, the terminal 500 described in the embodiment of the present invention may be used to implement part or all of the procedures in the embodiment of the white balance adjustment method described in conjunction with FIG. 1 in the present invention.

本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的程序可存储于计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。其中,所述的存储介质可为磁碟、光盘、只读存储记忆体(Read-Only Memory,ROM)或随机存储记忆体(Random Access Memory,RAM)等。Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be implemented through computer programs to instruct related hardware, and the programs can be stored in computer-readable storage media. During execution, it may include the processes of the embodiments of the above-mentioned methods. Wherein, the storage medium may be a magnetic disk, an optical disk, a read-only memory (Read-Only Memory, ROM) or a random access memory (Random Access Memory, RAM) and the like.

需要说明的是,在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详细描述的部分,可以参见其他实施例的相关描述。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作和模块并不一定是本发明实施例所必须的。It should be noted that, in the foregoing embodiments, descriptions of each embodiment have their own emphases, and for parts that are not described in detail in a certain embodiment, reference may be made to relevant descriptions of other embodiments. Secondly, those skilled in the art should also know that the embodiments described in the specification belong to preferred embodiments, and the actions and modules involved are not necessarily required by the embodiments of the present invention.

本发明实施例方法中的步骤可以根据实际需要进行顺序调整、合并和删减。The steps in the methods of the embodiments of the present invention can be adjusted, combined and deleted according to actual needs.

本发明实施例终端中的模块或者单元可以根据实际需要进行合并、划分和删减。The modules or units in the terminal in the embodiment of the present invention can be combined, divided and deleted according to actual needs.

本发明实施例中所述模块或者单元,可以通过通用集成电路,例如CPU(Central Processing Unit,中央处理器),或通过ASIC(Application SpecificIntegrated Circuit,专用集成电路)来实现。The modules or units in the embodiments of the present invention may be implemented by a general integrated circuit, such as a CPU (Central Processing Unit, central processing unit), or an ASIC (Application Specific Integrated Circuit, application specific integrated circuit).

以上对本发明实施例所提供的白平衡调节方法、装置以及终端进行了详细介绍,本文中应用了具体个例对本发明的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本发明的方法及其核心思想;同时,对于本领域的一般技术人员,依据本发明的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本发明的限制。The white balance adjustment method, device and terminal provided by the embodiments of the present invention have been introduced in detail above. This article uses specific examples to illustrate the principle and implementation of the present invention. The description of the above embodiments is only used to help understand the present invention. The method of the invention and its core idea; at the same time, for those of ordinary skill in the art, according to the idea of the present invention, there will be changes in the specific implementation and scope of application. In summary, the content of this specification should not be understood To limit the present invention.

Claims (11)

1.一种白平衡调节方法,其特征在于,包括:1. A method for adjusting white balance, comprising: 获取第一摄像头的帧率;Get the frame rate of the first camera; 判断所述帧率是否是最大帧率,若是,则通过所述第一摄像头以所述最大帧率为参数获取第一图像;Judging whether the frame rate is the maximum frame rate, if so, obtaining the first image with the maximum frame rate parameter through the first camera; 对所述第一图像进行分析以获取所述第一图像的白平衡增益;analyzing the first image to obtain a white balance gain of the first image; 根据所述白平衡增益对通过第二摄像头获取到的第二图像进行白平衡调节;adjusting the white balance of the second image acquired by the second camera according to the white balance gain; 显示所述白平衡调节后的第二图像。and displaying the second image after the white balance has been adjusted. 2.如权利要求1所述的方法,其特征在于,判断所述帧率不是最大帧率时,还包括:2. The method according to claim 1, wherein when judging that the frame rate is not the maximum frame rate, further comprising: 将所述帧率调整为最大帧率,并执行通过所述第一摄像头获取所述第一图像。adjusting the frame rate to a maximum frame rate, and performing acquiring the first image through the first camera. 3.如权利要求1所述的方法,其特征在于,所述对所述第一图像进行分析以获取所述第一图像的白平衡增益包括:3. The method according to claim 1, wherein the analyzing the first image to obtain the white balance gain of the first image comprises: 将所述第一图像切分成至少一个子图像;segmenting the first image into at least one sub-image; 计算各个所述子图像的亮度平均值;calculating the average brightness of each of the sub-images; 获取最大亮度平均值对应的子图像中R、G、B三基色的平均值;Obtain the average value of the three primary colors R, G, and B in the sub-image corresponding to the maximum brightness average value; 根据所述R、G、B三基色的平均值获取所述白平衡增益。The white balance gain is obtained according to the average value of the three primary colors R, G, and B. 4.如权利要求3所述的方法,其特征在于,所述根据所述R、G、B三基色的平均值获取所述白平衡增益包括:4. The method according to claim 3, wherein said obtaining said white balance gain according to the average value of said R, G, and B three primary colors comprises: 计算所述最大亮度平均值与所述R基色的平均值的乘积,作为所述白平衡增益中的红色增益;或者calculating the product of the maximum brightness average value and the average value of the R primary color as the red gain in the white balance gain; or 计算所述最大亮度平均值与所述G基色的平均值的乘积,作为所述白平衡增益中的绿色增益;或者calculating the product of the maximum brightness average value and the G primary color average value as the green gain in the white balance gain; or 计算所述最大亮度平均值与所述B基色的平均值的乘积,作为所述白平衡增益中的蓝色增益。Calculate the product of the average value of the maximum brightness and the average value of the B primary color as the blue gain in the white balance gain. 5.如权利要求1所述的方法,其特征在于,所述白平衡增益包括红色增益、绿色增益或者蓝色增益;5. The method according to claim 1, wherein the white balance gain comprises a red gain, a green gain or a blue gain; 所述根据所述白平衡增益对通过第二摄像头获取到的第二图像进行白平衡调节包括:The white balance adjustment of the second image acquired by the second camera according to the white balance gain includes: 通过所述第二摄像头获取所述第二图像;acquiring the second image through the second camera; 将所述红色增益渲染在所述第二图像的红色通道上、将所述绿色增益渲染在所述第二图像的绿色通道上、或者将所述蓝色增益渲染在所述第二图像信息的蓝色通道上,以实现对所述第二图像的白平衡调节。rendering the red gain on the red channel of the second image, rendering the green gain on the green channel of the second image, or rendering the blue gain on the second image information on the blue channel to realize the white balance adjustment of the second image. 6.一种白平衡调节装置,其特征在于,包括:6. A white balance adjustment device, comprising: 帧率获取模块,用于获取第一摄像头的帧率;A frame rate acquisition module, configured to obtain the frame rate of the first camera; 判断模块,用于判断所述帧率是否是最大帧率;A judging module, configured to judge whether the frame rate is the maximum frame rate; 图像获取模块,用于若所述判断模块判断所述帧率是最大帧率,则通过所述第一摄像头以所述最大帧率为参数获取第一图像;An image acquisition module, configured to acquire a first image through the first camera with the maximum frame rate as a parameter if the judging module judges that the frame rate is the maximum frame rate; 增益获取模块,用于对所述第一图像进行分析以获取所述第一图像的白平衡增益;a gain obtaining module, configured to analyze the first image to obtain the white balance gain of the first image; 调节模块,用于根据所述白平衡增益对通过第二摄像头获取到的第二图像进行白平衡调节;An adjustment module, configured to adjust the white balance of the second image acquired through the second camera according to the white balance gain; 显示模块,用于显示所述白平衡调节后的第二图像。A display module, configured to display the second image after the white balance has been adjusted. 7.如权利要求6所述的装置,其特征在于,7. The apparatus of claim 6, wherein 所述调节模块,还用于所述判断模块判断所述帧率不是最大帧率时,将所述帧率调整为最大帧率,触发所述图像获取模块通过所述第一摄像头获取所述第一图像。The adjustment module is also used to adjust the frame rate to the maximum frame rate when the judging module judges that the frame rate is not the maximum frame rate, and trigger the image acquisition module to acquire the second frame rate through the first camera. an image. 8.如权利要求6所述的装置,其特征在于,8. The apparatus of claim 6, wherein 所述增益获取模块包括:The gain acquisition module includes: 切分单元,用于将所述第一图像切分成至少一个子图像;a segmentation unit, configured to segment the first image into at least one sub-image; 计算单元,用于计算各个所述子图像的亮度平均值;a calculation unit, configured to calculate an average brightness value of each of the sub-images; 均值获取单元,用于获取最大亮度平均值对应的子图像中R、G、B三基色的平均值;An average value acquisition unit, used to obtain the average value of the three primary colors R, G, and B in the sub-image corresponding to the maximum brightness average value; 增益获取单元,用于根据所述R、G、B三基色的平均值获取所述白平衡增益。A gain acquiring unit, configured to acquire the white balance gain according to the average value of the three primary colors R, G, and B. 9.如权利要求8所述的装置,其特征在于,9. The apparatus of claim 8, wherein 所述增益获取单元,用于计算所述最大亮度平均值与所述R基色的平均值的乘积,作为所述白平衡增益中的红色增益;或者The gain acquisition unit is configured to calculate the product of the maximum brightness average value and the R primary color average value as the red gain in the white balance gain; or 所述增益获取单元,用于计算所述最大亮度平均值与所述G基色的平均值的乘积,作为所述白平衡增益中的绿色增益;或者The gain acquisition unit is configured to calculate the product of the maximum brightness average value and the G primary color average value as the green gain in the white balance gain; or 所述增益获取单元,用于计算所述最大亮度平均值与所述B基色的平均值的乘积,作为所述白平衡增益中的蓝色增益。The gain acquisition unit is configured to calculate the product of the maximum brightness average value and the B primary color average value as the blue gain in the white balance gain. 10.如权利要求6所述的装置,其特征在于,所述白平衡增益包括红色增益、绿色增益或者蓝色增益;10. The device according to claim 6, wherein the white balance gain comprises a red gain, a green gain or a blue gain; 所述调节模块包括:The adjustment module includes: 图像获取单元,用于通过所述第二摄像头获取所述第二图像;an image acquisition unit, configured to acquire the second image through the second camera; 渲染单元,用于将所述红色增益渲染在所述第二图像的红色通道上、将所述绿色增益渲染在所述第二图像的绿色通道上、或者将所述蓝色增益渲染在所述第二图像信息的蓝色通道上,以实现对所述第二图像的白平衡调节。a rendering unit configured to render the red gain on the red channel of the second image, render the green gain on the green channel of the second image, or render the blue gain on the on the blue channel of the second image information, so as to realize the white balance adjustment of the second image. 11.一种终端,其特征在于,包括如权利要求6~10中任一项所述的白平衡调节装置。11. A terminal, characterized by comprising the white balance adjustment device according to any one of claims 6-10.
CN201410647497.6A 2014-11-14 2014-11-14 A kind of white balance adjusting method, device and terminal Expired - Fee Related CN104394392B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410647497.6A CN104394392B (en) 2014-11-14 2014-11-14 A kind of white balance adjusting method, device and terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410647497.6A CN104394392B (en) 2014-11-14 2014-11-14 A kind of white balance adjusting method, device and terminal

Publications (2)

Publication Number Publication Date
CN104394392A CN104394392A (en) 2015-03-04
CN104394392B true CN104394392B (en) 2016-09-28

Family

ID=52612221

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410647497.6A Expired - Fee Related CN104394392B (en) 2014-11-14 2014-11-14 A kind of white balance adjusting method, device and terminal

Country Status (1)

Country Link
CN (1) CN104394392B (en)

Families Citing this family (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106331661A (en) * 2015-06-25 2017-01-11 西安中兴新软件有限责任公司 White balance processing method and device
CN104994362A (en) * 2015-07-02 2015-10-21 广东欧珀移动通信有限公司 Method and device for white balance processing
CN105120247B (en) * 2015-09-10 2017-12-26 联想(北京)有限公司 A kind of white balance adjustment method and electronic equipment
CN105141934B (en) * 2015-09-25 2017-07-25 深圳Tcl数字技术有限公司 The method and device of modulus signal compensation
CN105227945B (en) * 2015-10-21 2017-05-17 维沃移动通信有限公司 Automatic white balance control method and mobile terminal
CN105635568B (en) * 2015-12-25 2019-09-17 青岛海信移动通信技术股份有限公司 Image processing method and mobile terminal in a kind of mobile terminal
CN107277480B (en) 2017-07-10 2019-03-29 Oppo广东移动通信有限公司 White balance synchronous method, device and terminal device
CN107820070B (en) * 2017-10-25 2019-05-17 长沙云知检信息科技有限公司 White balance adjustment method
CN107911683B (en) * 2017-11-28 2019-07-23 Oppo广东移动通信有限公司 image white balance processing method, device, storage medium and electronic equipment
CN108848294B (en) * 2018-08-15 2020-09-04 努比亚技术有限公司 Shooting parameter adjusting method, terminal and computer readable storage medium
CN109379575B (en) * 2018-11-28 2020-06-30 维沃移动通信(杭州)有限公司 White balance processing method and mobile terminal
CN112087569B (en) * 2019-06-12 2022-03-04 杭州萤石软件有限公司 Camera and camera starting method and device

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8149323B2 (en) * 2008-12-18 2012-04-03 Qualcomm Incorporated System and method to autofocus assisted by autoexposure control
CN102104709B (en) * 2009-12-21 2013-01-30 展讯通信(上海)有限公司 Method for processing image shot by camera and camera
JP5234119B2 (en) * 2011-01-20 2013-07-10 カシオ計算機株式会社 Imaging apparatus, imaging processing method, and program

Also Published As

Publication number Publication date
CN104394392A (en) 2015-03-04

Similar Documents

Publication Publication Date Title
CN104394392B (en) A kind of white balance adjusting method, device and terminal
US8405736B2 (en) Face detection using orientation sensor data
WO2020108018A1 (en) Game scene processing method and apparatus, electronic device, and storage medium
EP3599760A1 (en) Image processing method and apparatus
JP6225256B2 (en) Image processing system and computer-readable recording medium
US20160094770A1 (en) Image Processing Method and Apparatus, and Terminal
US20210281718A1 (en) Video Processing Method, Electronic Device and Storage Medium
US20160094824A1 (en) Image processing method, image processing apparatus and electronic device
US9747867B2 (en) Apparatus and method for performing image content adjustment according to viewing condition recognition result and content classification result
US10706512B2 (en) Preserving color in image brightness adjustment for exposure fusion
JP2014529385A (en) Image processing system and image processing apparatus
WO2020108010A1 (en) Video processing method and apparatus, electronic device and storage medium
CN109544503B (en) Image processing method, image processing device, electronic equipment and storage medium
TW201123912A (en) Method for adjusting image
WO2022151852A1 (en) Image processing method, apparatus, and system, electronic device, and storage medium
TWI567707B (en) Image adjusting method and related display
CN107729099A (en) Background method of adjustment and its system
WO2020108060A1 (en) Video processing method and apparatus, and electronic device and storage medium
KR20160063794A (en) Image photographing apparatus and control methods thereof
WO2025016115A1 (en) Image enhancement display method, and display device and electronic device
US10205940B1 (en) Determining calibration settings for displaying content on a monitor
CN109547699A (en) A kind of method and device taken pictures
US9571744B2 (en) Video processing method and apparatus
CN101399909B (en) Adaptive image adjustment method and image processing device using the method
US10079981B2 (en) Image dynamic range adjustment method, terminal, and storage medium

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CP01 Change in the name or title of a patent holder
CP01 Change in the name or title of a patent holder

Address after: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18

Patentee after: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS Corp.,Ltd.

Address before: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18

Patentee before: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS Corp.,Ltd.

CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20160928