WO2023024286A1 - 白平衡控制方法、装置、终端设备以及存储介质 - Google Patents

白平衡控制方法、装置、终端设备以及存储介质 Download PDF

Info

Publication number
WO2023024286A1
WO2023024286A1 PCT/CN2021/132137 CN2021132137W WO2023024286A1 WO 2023024286 A1 WO2023024286 A1 WO 2023024286A1 CN 2021132137 W CN2021132137 W CN 2021132137W WO 2023024286 A1 WO2023024286 A1 WO 2023024286A1
Authority
WO
WIPO (PCT)
Prior art keywords
target
value
pixel
preset
color temperature
Prior art date
Application number
PCT/CN2021/132137
Other languages
English (en)
French (fr)
Inventor
付谨学
吴晓霞
周璇
陈洪波
Original Assignee
深圳创维-Rgb电子有限公司
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 深圳创维-Rgb电子有限公司 filed Critical 深圳创维-Rgb电子有限公司
Priority to EP21926048.6A priority Critical patent/EP4164217A4/en
Publication of WO2023024286A1 publication Critical patent/WO2023024286A1/zh
Priority to US18/177,920 priority patent/US20230216998A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N9/00Details of colour television systems
    • H04N9/64Circuits for processing colour signals
    • H04N9/73Colour balance circuits, e.g. white balance circuits or colour temperature control

Definitions

  • the present application relates to the field of image processing, and in particular to a white balance control method, device, terminal equipment, and computer-readable storage medium.
  • the basic concept of white balance refers to "regardless of the color temperature of any light source, white objects can be restored to white”.
  • white objects can be restored to white.
  • a white balance control method which uses the gray scale world method, the color temperature curve method or the perfect reflection method to control the white balance.
  • the main purpose of the present application is to provide a white balance control method, device, terminal equipment and computer-readable storage medium, aiming to solve the technical problem of color shift phenomenon still existing in the existing white balance control method in the prior art.
  • the present application proposes a white balance control method, the method includes the following steps:
  • the target image is acquired by a target camera; before the step of acquiring the target pixel value of the target white point in the target image, the method further includes:
  • the step of obtaining the target pixel value of the target white point in the target image includes:
  • the method before the step of obtaining the pixel gain value based on the target pixel sum value and the preset weight corresponding to the preset color temperature partition, the method further includes:
  • the preset weight is adjusted to obtain the actual weight corresponding to the preset color temperature zone;
  • the step of obtaining a pixel gain value based on the target pixel sum value and the preset weight corresponding to the preset color temperature partition includes:
  • a pixel gain value is obtained based on the target pixel sum value and the actual weight.
  • the step of obtaining a pixel gain value based on the target pixel sum value and the actual weight includes:
  • the pixel gain value is obtained.
  • the preset weight is adjusted by using the number of white points, the maximum number of preset white points, and the minimum number of preset white points to obtain the actual weights corresponding to the preset color temperature zones steps, including:
  • the actual weight is obtained based on the number of white points, the maximum number of preset white points, the minimum number of preset white points, the preset weight, and the minimum value of the preset weight corresponding to the preset color temperature zone ;
  • the first formula is:
  • K' n is the actual weight corresponding to any preset color temperature partition n in the preset color temperature partitions
  • K n is the preset weight corresponding to the preset color temperature partition n
  • K min,n is the preset weight Set the minimum value of the preset weight corresponding to the color temperature zone n
  • T n is the number of white points corresponding to the preset color temperature zone n
  • Tmin ,n is the minimum number of preset white points corresponding to the preset color temperature zone n
  • T max,n is the maximum number of preset white points corresponding to the preset color temperature zone n.
  • the step of obtaining the resultant pixel and value based on the target pixel and value and the actual weight includes:
  • the second formula is:
  • SUM(R), SUM(G) and SUM(B) are the result red pixel sum value, result green pixel sum value and result blue pixel sum value in the result pixel sum value respectively
  • N is the preset Set the number of color temperature partitions
  • SUM(R n ) is the target red pixel and value corresponding to the preset color temperature partition n in the target pixel and value
  • SUM(G n ) is the preset color temperature partition in the target pixel and value
  • SUM(B n ) is the target blue pixel and value corresponding to the preset color temperature partition n in the target pixel and value.
  • the pixel gain value includes a red gain value, a green gain value and a blue gain value; the step of obtaining the pixel gain value based on the resulting pixel sum value includes:
  • the ratio of the resulting green pixel sum to the resulting red pixel sum is determined as a red gain value, and the resulting green pixel sum to the resulting blue pixel
  • the ratio of the sum value is determined as the blue gain value, and the first preset constant is determined as the green gain value; or,
  • the ratio of the result red pixel sum value to the result green pixel sum value is determined as a green gain value, and the result red pixel sum value is compared to the result blue pixel sum value
  • the ratio of the sum value is determined as the blue gain value, and the second preset constant is determined as the red gain value; or,
  • the ratio of the result blue pixel sum value to the result red pixel sum value is determined as a red gain value, and the result blue pixel sum value and the result
  • the ratio of the green pixel sum value is determined as the green gain value, and the third preset constant is determined as the blue gain value.
  • a white balance control device which includes:
  • An acquisition module configured to acquire the target pixel value of the target white point in the target image
  • a calculation module configured to use the target pixel value to calculate the target pixel and value corresponding to the preset color temperature partition
  • An obtaining module configured to obtain a pixel gain value based on the target pixel sum value and the preset weight corresponding to the preset color temperature partition;
  • An adjustment module configured to use the pixel gain value to adjust the white balance of the target image to obtain a result image.
  • a terminal device which includes: a memory, a processor, and a white balance control program stored in the memory and running on the processor, the white balance When the balance control program is executed by the processor, the steps of the white balance control method described in any one of the above are realized.
  • the present application also proposes a computer-readable storage medium, on which a white balance control program is stored, and when the white balance control program is executed by a processor, any of the above-mentioned A step of the described white balance control method.
  • the technical solution of the present application proposes a white balance control method, the method includes the following steps: acquiring the target pixel value of the target white point in the target image; using the target pixel value, calculating the target pixel and the target pixel corresponding to the preset color temperature partition value; based on the target pixel sum value and the preset weight corresponding to the preset color temperature zone, obtain a pixel gain value; use the pixel gain value to adjust the white balance of the target image to obtain a result image.
  • the interfering color block when there is an interfering color block in the target image, the interfering color block will have a negative effect on the adjustment of the target image, so that the obtained result image still has an inaccurate white balance, resulting in a color shift in the result image.
  • the target pixel value of the target white point in the target image the final pixel gain value is obtained, and the target image is adjusted for white balance by using the pixel gain value to obtain the result image, the target pixel value It will not be affected by the interfering color blocks in the target image, so that the accuracy of the pixel gain value is high, and then the white balance of the resulting image is accurate, and the color shift of the resulting image is avoided.
  • FIG. 1 is a schematic structural diagram of a terminal device in a hardware operating environment involved in an embodiment of the present application
  • FIG. 2 is a schematic flowchart of the first embodiment of the white balance control method of the present application
  • Fig. 3 is the schematic diagram of the Planck color temperature curve of the target of the present application.
  • FIG. 4 is a relationship diagram between the preset color temperature zones of the present application and the target Planckian color temperature curve
  • FIG. 5 is a structural block diagram of the first embodiment of the white balance control device of the present application.
  • FIG. 1 is a schematic structural diagram of a terminal device in a hardware operating environment involved in an embodiment of the present application.
  • Terminal devices can be mobile phones, smart phones, notebook computers, digital broadcast receivers, personal digital assistants (PDAs), tablet computers (PADs) and other user equipment (User Equipment, UE), handheld devices, vehicle-mounted devices, wearable devices, A computing device or other processing device connected to a wireless modem, a mobile station (Mobile station, MS), etc.
  • a terminal device may be called a user terminal, a portable terminal, a desktop terminal, or the like.
  • a terminal device includes: at least one processor 301, a memory 302, and a white balance control program stored on the memory and operable on the processor, the white balance control program is configured to implement the aforementioned Steps of a white balance control method.
  • the processor 301 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and the like.
  • Processor 301 can adopt at least one hardware form in DSP (Digital Signal Processing, digital signal processing), FPGA (Field-Programmable Gate Array, field programmable gate array), PLA (Programmable Logic Array, programmable logic array) accomplish.
  • Processor 301 can also include main processor and coprocessor, and main processor is the processor that is used for processing the data in wake-up state, also claims CPU (Central Processing Unit, central processing unit); Low-power processor for processing data in standby state.
  • CPU Central Processing Unit, central processing unit
  • Low-power processor for processing data in standby state.
  • the processor 301 may be integrated with a GPU (Graphics Processing Unit, image processor), and the GPU is used for rendering and drawing the content that needs to be displayed on the display screen.
  • the processor 301 may also include an AI (Artificial Intelligence, artificial intelligence) processor, which is used to process operations related to the white balance control method, so that the model of the white balance control method can be independently trained and learned to improve efficiency and accuracy.
  • AI Artificial Intelligence, artificial intelligence
  • Memory 302 may include one or more computer-readable storage media, which may be non-transitory.
  • the memory 302 may also include high-speed random access memory and non-volatile memory, such as one or more magnetic disk storage devices and flash memory storage devices.
  • the non-transitory computer-readable storage medium in the memory 302 is used to store at least one instruction, and the at least one instruction is used to be executed by the processor 301 to realize the white balance provided by the method embodiment in this application Control Method.
  • the terminal may optionally further include: a communication interface 303 and at least one peripheral device.
  • the processor 301, the memory 302, and the communication interface 303 may be connected through a bus or a signal line.
  • Each peripheral device can be connected to the communication interface 303 through a bus, a signal line or a circuit board.
  • the peripheral device includes: at least one of a radio frequency circuit 304 , a display screen 305 and a power supply 306 .
  • the communication interface 303 may be used to connect at least one peripheral device related to I/O (Input/Output, input/output) to the processor 301 and the memory 302 .
  • the processor 301, the memory 302 and the communication interface 303 are integrated on the same chip or circuit board; in some other embodiments, any one or both of the processor 301, the memory 302 and the communication interface 303 It can be implemented on a separate chip or circuit board, which is not limited in this embodiment.
  • the radio frequency circuit 304 is used to receive and transmit RF (Radio Frequency, radio frequency) signals, also called electromagnetic signals.
  • the radio frequency circuit 304 communicates with the communication network and other communication devices through electromagnetic signals.
  • the radio frequency circuit 304 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals into electrical signals.
  • the radio frequency circuit 304 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a subscriber identity module card, and the like.
  • the radio frequency circuit 304 can communicate with other terminals through at least one wireless communication protocol.
  • the wireless communication protocol includes but is not limited to: metropolitan area network, mobile communication networks of various generations (2G, 3G, 4G and 5G), wireless local area network and/or WiFi (Wireless Fidelity, wireless fidelity) network.
  • the radio frequency circuit 304 may also include circuits related to NFC (Near Field Communication, short-range wireless communication), which is not limited in this application.
  • the display screen 305 is used to display a UI (User Interface, user interface).
  • the UI can include graphics, text, icons, video, and any combination thereof.
  • the display screen 305 also has the ability to collect touch signals on or above the surface of the display screen 305 .
  • the touch signal can be input to the processor 301 as a control signal for processing.
  • the display screen 305 can also be used to provide virtual buttons and/or virtual keyboards, also called soft buttons and/or soft keyboards.
  • the display screen 305 there can be one display screen 305, which is the front panel of the electronic device; in other embodiments, there can be at least two display screens 305, which are respectively arranged on different surfaces of the electronic device or in a folded design; In some embodiments, the display screen 305 may be a flexible display screen disposed on a curved surface or a folded surface of the electronic device. Even, the display screen 305 can also be set as a non-rectangular irregular figure, that is, a special-shaped screen.
  • the display screen 305 can be made of LCD (Liquid Crystal Display, liquid crystal display), OLED (Organic Light-Emitting Diode, organic light-emitting diode) and other materials.
  • the power supply 306 is used to supply power to various components in the electronic device.
  • Power source 306 may be alternating current, direct current, disposable batteries, or rechargeable batteries.
  • the rechargeable battery can support wired charging or wireless charging.
  • the rechargeable battery can also be used to support fast charging technology.
  • Figure 1 does not constitute a limitation on the terminal device, and may include more or less components than those shown in the figure, or combine some components, or arrange different components.
  • the embodiment of the present application also proposes a computer-readable storage medium, on which a white balance control program is stored, and when the white balance control program is executed by a processor, the white balance as described above is realized.
  • the description of the beneficial effect of adopting the same method will not be repeated here.
  • program instructions may be deployed to be executed on one terminal device, or on multiple terminal devices located at one location, or, alternatively, on multiple terminal devices distributed across multiple locations and interconnected by a communication network Ready for execution.
  • the above-mentioned computer-readable 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).
  • FIG. 2 is a schematic flowchart of a first embodiment of a white balance control method of the present application, the method is used in a terminal device, and the method includes the following steps:
  • Step S11 Obtain the target pixel value of the target white point in the target image.
  • the subject of execution of this application is a terminal device, and the mechanism of the terminal device refers to the above description, which will not be repeated here.
  • the terminal device is installed with a white balance control program, and when the terminal device executes the white balance control program, the implementation of this application The steps of the white balance control method.
  • the target image is an image for white balance adjustment.
  • the target image can be an image captured by the target camera (the camera used to capture the target image), or an image scanned by the target camera (such as scanning a two-dimensional code). It can be the image that the target camera is preparing to take (the target camera is turned on, the user sees the image through the target camera, and the user does not press the camera button at this time).
  • the target camera may be a built-in camera of the terminal device, or may be an external camera of the terminal device.
  • the target image is acquired by the target camera; before the step of acquiring the target pixel value of the target white point in the target image, the method further includes: using a preset color temperature lamp corresponding to a preset color temperature range to pair the The target camera performs curve calibration and fitting to obtain the target Planckian color temperature curve of the target camera; based on the target Planckian color temperature curve, the preset color temperature partition is obtained; correspondingly, the acquired target image
  • the step of the target pixel value of the target white point includes: determining the pixel point whose pixel value in the target image matches the target Planckian color temperature curve as the target white point; obtaining the target pixel of the target white point value.
  • the preset color temperature range can be a color temperature range composed of color temperature values ranging from 1800K to 10000K; usually, in order to obtain the Planckian color temperature curve corresponding to the preset color temperature range, it is necessary to select multiple preset color temperature lamps (for example, D65 color temperature lamp, color temperature value 6500K; D50 color temperature lamp, color temperature value 5000K, TL40 color temperature lamp, color temperature value 4000K, F color temperature lamp, color temperature value 2700K) carry out curve calibration fitting to described target camera, to obtain described target camera Planck color temperature curve, the Planck color temperature curve is the target Planck color temperature curve; for a target camera, it is only necessary to use the preset color temperature lamp corresponding to the preset color temperature range to curve the target camera once Calibration and fitting to obtain the target Planckian color temperature curve of the target camera; for multiple target cameras, it is necessary to use the preset color temperature lamp corresponding to the preset color temperature range to perform curve calibration and fitting on the target camera , the step of
  • Fig. 3 is a schematic diagram of the target Planckian color temperature curve of this application.
  • the dotted line part represents the target Planckian color temperature curve, and the solid line part represents the color temperature space threshold, which can be set by the user based on demand. No limit.
  • preset color temperature zones are obtained, and the number of preset color temperature zones is preferably 5.
  • FIG. 4 is a graph showing the relationship between the preset color temperature zones and the target Planckian color temperature curve in the present application.
  • the effective area of the target Planckian color temperature curve is divided into five preset color temperature zones: ZONE1-ZONE5, where the area involved in ZONE1-ZONE5 is the valid period area, and the area outside ZONE1-ZONE5 is the non-effective area. There is no need to make a selection.
  • the color temperature range corresponding to ZONE1 is 1800K-2700K
  • the color temperature range corresponding to ZONE2 is 2700K-4000K
  • the color temperature range corresponding to ZONE 3 is 4000K-5500K
  • the color temperature range corresponding to ZONE 4 is 5500K-7500K
  • the color temperature range corresponding to ZONE 5 is 7500K-10000K.
  • the pixel value of each pixel in the target image needs to be obtained, and the pixel whose pixel value matches the target Planckian color temperature curve is determined as the target white point, and the pixel value of a pixel is consistent with the target Planckian color temperature curve.
  • Gramma color temperature curve matching means that the pixel value of the pixel point falls within the color temperature space threshold range of the target Planckian color temperature curve, and the pixel value falls within the effective area of the target Planckian color temperature curve (for example, the upper The set of zones corresponding to the five zones ZONE1-ZONE5 mentioned in the article).
  • the pixel value of the target white point needs to be obtained.
  • Step S12 Using the target pixel value, calculate the target pixel sum value corresponding to the preset color temperature zone.
  • each preset color temperature zone corresponds to a certain number of target white points; for a preset color temperature zone, it is necessary to calculate the pixel values of all target white points included in the preset color temperature zone. and to get the target pixel and value.
  • the target pixels and values include target red pixels and values, target blue pixels and values, and target green pixels and values, that is, for the preset color temperature zone, it is necessary to calculate all target Blue pixels and values for white points, red pixels and values for all target white points, and green pixels and values for all target white points.
  • the ZONE1 area includes 100 target white points
  • Step S13 Obtain a pixel gain value based on the target pixel sum value and the preset weight corresponding to the preset color temperature zone.
  • the preset weights include red preset weights, blue preset weights, and green preset weights; correspondingly, the pixel gain values include green pixel gains, red pixel gains, and blue pixel gains.
  • the red pixel gain value based on its red pixel sum value and red preset weight; similarly, it is necessary to obtain the green pixel gain value based on its green pixel sum value and green preset weight, which needs to be based on Its blue pixel sum value and blue preset weight, get the blue pixel gain value.
  • step S11 needs to be performed to obtain pixel gain values corresponding to each preset color temperature zone.
  • the preset weight of ZONE4 is the highest, followed by ZONE3, then ZONE5, then ZONE2, and finally ZONE1.
  • the sum of preset weights corresponding to multiple preset color temperature zones may be equal to 1. If you don't consider the target white point in a preset color temperature range at all, just set the corresponding preset weights to 0.
  • the method further includes: counting the target values in the preset color temperature zone The number of white points of the white point; using the number of white points, the maximum number of preset white points and the minimum number of preset white points, the preset weight is adjusted to obtain the actual weight corresponding to the preset color temperature zone;
  • the step of obtaining the pixel gain value based on the target pixel sum value and the preset weight corresponding to the preset color temperature partition includes: obtaining the pixel gain value based on the target pixel sum value and the actual weight value.
  • the preset weight needs to be adjusted based on the number of white points corresponding to the target image, and the red preset weight, the blue preset weight and the green preset weight all need to be adjusted.
  • the step of using the number of white points, the maximum number of preset white points, and the minimum number of preset white points to adjust the preset weights to obtain the actual weights corresponding to the preset color temperature zones include:
  • the actual weight is obtained based on the number of white points, the maximum number of preset white points, the minimum number of preset white points, the preset weight, and the minimum value of the preset weight corresponding to the preset color temperature zone ;
  • the first formula is:
  • K' n is the actual weight corresponding to any preset color temperature partition n in the preset color temperature partitions
  • K n is the preset weight corresponding to the preset color temperature partition n
  • K min,n is the preset weight Set the minimum value of the preset weight corresponding to the color temperature zone n
  • T n is the number of white points corresponding to the preset color temperature zone n
  • Tmin ,n is the minimum number of preset white points corresponding to the preset color temperature zone n
  • T max,n is the maximum number of preset white points corresponding to the preset color temperature zone n.
  • the red preset weight, blue preset weight and green preset weight in the preset weights are all the same, that is, the preset weight K n , similarly, the actual weight obtained
  • the three color weights corresponding to K′ n and the preset weight minimum value K min,n are also the same.
  • the maximum number of preset white points T max,n and the minimum number of preset white points T min,n of a preset color temperature zone are based on the size of the actual target image and the target white point value in the preset color temperature zone. The proportion of these two factors is determined.
  • the step of obtaining a pixel gain value based on the target pixel sum value and the actual weight includes: obtaining a result pixel sum value based on the target pixel sum value and the actual weight; pixel and value, to obtain the pixel gain value.
  • the step of obtaining the result pixel and value based on the target pixel and value and the actual weight includes: using formula 2 to obtain the result pixel and value based on the target pixel and value and the actual weight;
  • the second formula is:
  • SUM(R), SUM(G) and SUM(B) are the result red pixel sum value, result green pixel sum value and result blue pixel sum value in the result pixel sum value respectively
  • N is the preset Set the number of color temperature partitions
  • SUM(R n ) is the target red pixel and value corresponding to the preset color temperature partition n in the target pixel and value
  • SUM(G n ) is the preset color temperature partition in the target pixel and value
  • SUM(B n ) is the target blue pixel and value corresponding to the preset color temperature partition n in the target pixel and value.
  • the target pixels and values include target pixels and values corresponding to each preset color temperature zone, and for a preset color temperature zone, the target pixels and values include target red pixels and values, target green pixels and values, and target For the blue pixel sum value, it is necessary to obtain a result red pixel sum value, a result blue pixel sum value and a result green pixel sum value corresponding to all preset color temperature partitions according to formula 2.
  • the pixel gain value includes a red gain value, a green gain value and a blue gain value; the step of obtaining the pixel gain value based on the result pixel sum value includes:
  • the ratio of the resulting green pixel sum to the resulting red pixel sum is determined as a red gain value, and the resulting green pixel sum to the resulting blue pixel
  • the ratio of the sum value is determined as the blue gain value, and the first preset constant is determined as the green gain value; or,
  • the ratio of the result red pixel sum value to the result green pixel sum value is determined as a green gain value, and the result red pixel sum value is compared to the result blue pixel sum value
  • the ratio of the sum value is determined as the blue gain value, and the second preset constant is determined as the red gain value; or,
  • the ratio of the result blue pixel sum value to the result red pixel sum value is determined as a red gain value, and the result blue pixel sum value and the result
  • the ratio of the green pixel sum value is determined as the green gain value, and the third preset constant is determined as the blue gain value.
  • Step S14 Using the pixel gain value to adjust the white balance of the target image to obtain a result image.
  • red gain value After obtaining the red gain value, green gain value and blue gain value, you can use the red gain value, green gain value and blue gain value to adjust all pixel values of the target image to achieve white balance adjustment of the target image , the final adjusted result image can be obtained, and there is no color cast in the result image.
  • the technical solution of the present application proposes a white balance control method, the method includes the following steps: acquiring the target pixel value of the target white point in the target image; using the target pixel value, calculating the target pixel and the target pixel corresponding to the preset color temperature partition value; based on the target pixel sum value and the preset weight corresponding to the preset color temperature zone, obtain a pixel gain value; use the pixel gain value to adjust the white balance of the target image to obtain a result image.
  • the interfering color blocks when there are interfering color blocks in the target image, the interfering color blocks will have a negative effect on the adjustment of the target image, so that the resulting image still has an inaccurate white balance, resulting in color shift in the resulting image.
  • the target pixel value of the target white point in the target image the final pixel gain value is obtained, and the target image is adjusted for white balance by using the pixel gain value to obtain the result image, the target pixel value It will not be affected by the interfering color blocks in the target image, so that the accuracy of the pixel gain value is high, and then the white balance of the resulting image is accurate, and color shift in the resulting image is avoided.
  • FIG. 5 is a structural block diagram of the first embodiment of the white balance control device of the present application.
  • the device is used for terminal equipment. Based on the same application concept as the previous embodiment, the device includes:
  • An acquisition module 10 configured to acquire the target pixel value of the target white point in the target image
  • a calculation module 20 configured to use the target pixel value to calculate the target pixel and value corresponding to the preset color temperature partition;
  • An obtaining module 30, configured to obtain a pixel gain value based on the target pixel sum value and the preset weight corresponding to the preset color temperature partition;
  • the adjustment module 40 is configured to use the pixel gain value to adjust the white balance of the target image to obtain a result image. It should be noted that since the steps performed by the device in this embodiment are the same as those in the foregoing method embodiments, the specific implementation manners and achievable technical effects can refer to the foregoing embodiments, and will not be repeated here.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Color Television Image Signal Generators (AREA)
  • Processing Of Color Television Signals (AREA)

Abstract

本申请公开一种白平衡控制方法,方法包括以下步骤:获取目标图像中的目标白点的目标像素值(S11);利用目标像素值,计算预设色温分区对应的目标像素和值(S12);基于目标像素和值和预设色温分区对应的预设权重,获得像素增益值(S13);利用像素增益值对目标图像进行白平衡调整,以获得结果图像(S14)。本申请还公开一种白平衡控制装置、终端设备以及计算机可读存储介质。利用本申请的方法,目标像素值不会受到目标图像中的干扰色块的影响,从而使得像素增益值的准确率较高,进而使得结果图像白平衡准确,避免了结果图像出现色偏。

Description

白平衡控制方法、装置、终端设备以及存储介质
本申请要求于2021年8月23日提交中国专利局、申请号为202110971603.6、申请名称为“白平衡控制方法、装置、终端设备以及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在申请中。
技术领域
本申请涉及图像处理领域,特别涉及一种白平衡控制方法、装置、终端设备以及计算机可读存储介质。
背景技术
白平衡的基本概念指“不管在任何光源色温下,都能将白色物体还原为白色”。当在特定光源下拍摄时出现偏色现象时,通过加强对应的补色来进行补偿。
自动控制白平衡可以实现在不同的色温下,将图像的还原成颜色正常的图像。相关技术中,公布了一种白平衡控制方法,利用灰度世界法、色温曲线法或完美反射法,进行白平衡的控制。
但是,采用现有的白平衡控制方法,依旧存在色偏现象。
技术问题
本申请的主要目的是提供一种白平衡控制方法、装置、终端设备以及计算机可读存储介质,旨在解决现有技术中采用现有的白平衡控制方法,依旧存在色偏现象的技术问题。
技术解决方案
为实现上述目的,本申请提出一种白平衡控制方法,所述方法包括以下步骤:
获取目标图像中的目标白点的目标像素值;
利用所述目标像素值,计算预设色温分区对应的目标像素和值;
基于所述目标像素和值和所述预设色温分区对应的预设权重,获得像素增益值;
利用所述像素增益值对所述目标图像进行白平衡调整,以获得结果图像。
在一实施例中,所述目标图像利用目标摄像头获取;所述获取目标图像中的目标白点的目标像素值的步骤之前,所述方法还包括:
利用预设色温区间对应的预设色温灯对所述目标摄像头进行曲线校准拟合,以获得所述目标摄像头的目标普朗克色温曲线;
基于所述目标普朗克色温曲线,获得所述预设色温分区;
所述获取目标图像中的目标白点的目标像素值的步骤,包括:
将所述目标图像中像素值与所述目标普朗克色温曲线匹配的像素点确定为所述目标白点;获取所述目标白点的目标像素值。
在一实施例中,所述基于所述目标像素和值和所述预设色温分区对应的预设权重,获得像素增益值的步骤之前,所述方法还包括:
统计所述预设色温分区中所述目标白点的白点数量;
利用所述白点数量、预设白点最大数量和预设白点最小数量,对所述预设权重进行调整,以获得所述预设色温分区对应的实际权重;
所述基于所述目标像素和值和所述预设色温分区对应的预设权重,获得像素增益值的步骤,包括:
基于所述目标像素和值和所述实际权重,获得像素增益值。
在一实施例中,所述基于所述目标像素和值和所述实际权重,获得像素增益值的步骤,包括:
基于所述目标像素和值和所述实际权重,获得结果像素和值;
基于所述结果像素和值,获得所述像素增益值。
在一实施例中,所述利用所述白点数量、预设白点最大数量和预设白点最小数量,对所述预设权重进行调整,以获得所述预设色温分区对应的实际权重的步骤,包括:
利用公式一,基于所述白点数量、预设白点最大数量、预设白点最小数量、所述预设权重和所述预设色温分区对应的预设权重最小值,获得所述实际权重;
所述公式一为:
Figure PCTCN2021132137-appb-000001
其中,K′ n为所述预设色温分区中的任意一个预设色温分区n对应的实际权重,K n为所述预设色温分区n对应的预设权重,K min,n为所述预设色温分区n对应的预设权重最小值,T n为所述预设色温分区n对应的白点数量,T min,n为所述预设色温分区n对应的预设白点最小数量,T max,n为所述预设色温分区n对应的预设白点最大数量。
在一实施例中,所述基于所述目标像素和值和所述实际权重,获得结果像素和值的步骤,包括:
利用公式二,基于所述目标像素和值和所述实际权重,获得结果像素和值;
所述公式二为:
Figure PCTCN2021132137-appb-000002
Figure PCTCN2021132137-appb-000003
Figure PCTCN2021132137-appb-000004
其中,SUM(R)、SUM(G)和SUM(B)分别为所述结果像素和值中的结果红色像素和值、结果绿色像素和值和结果蓝色像素和值,N为所述预设色温分区的个数,SUM(R n)为所述目标像素和值中预设色温分区n对应的目标红色像素和值,SUM(G n)为所述目标像素和值中预设色温分区n对应的目标绿色像素和值,SUM(B n)为所述目标像素和值中预设色温分区n对应的目标蓝色像素和值。
在一实施例中,所述像素增益值包括红色增益值、绿色增益值和蓝色增益值;所述基于所述结果像素和值,获得所述像素增益值的步骤,包括:
若所述结果绿色像素和值最大,则将所述结果绿色像素和值与所述结果红色像素和值的比值确定为红色增益值,将所述结果绿色像素和值与所述结果蓝色像素和值的比值确定为蓝色增益值,将第一预设常数确定为确定为绿色增益值;或,
若所述结果红色像素和值最大,则将所述结果红色像素和值与所述结果绿色像素和值的比值确定为绿色增益值,将所述结果红色像素和值与所述结果蓝色像素和值的比值确定为蓝色增益值,将第二预设常数确定为确定为红色增益值;或,
若所述结果蓝色像素和值最大,则将所述结果蓝色像素和值与所述结果红色像素和值的比值确定为红色增益值,将所述结果蓝色像素和值与所述结果绿色像素和值的比值确定为绿色增益值,将第三预设常数确定为确定为蓝色增益值。
此外,为实现上述目的,本申请还提出了一种白平衡控制装置,所述装置包括:
获取模块,用于获取目标图像中的目标白点的目标像素值;
计算模块,用于利用所述目标像素值,计算预设色温分区对应的目标像素和值;
获得模块,用于基于所述目标像素和值和所述预设色温分区对应的预设权重,获得像素增益值;
调整模块,用于利用所述像素增益值对所述目标图像进行白平衡调整,以获得结果图像。此外,为实现上述目的,本申请还提出了一种终端设备,所述终端设备包括:存储器、处理器及存储在所述存储器上并在所述处理器上运行白平衡控制程序,所述白平衡控制程序被所述处理器执行时实现如上述任一项所述的白平衡控制方法的步骤。
此外,为实现上述目的,本申请还提出了一种计算机可读存储介质,所述计算机可读存储介质上存储有白平衡控制程序,所述白平衡控制程序被处理器执行时实现如上述任一项所述的白平衡控制方法的步骤。
有益效果
本申请技术方案提出了一种白平衡控制方法,所述方法包括以下步骤:获取目标图像中的目标白点的目标像素值;利用所述目标像素值,计算预设色温分区对应的目标像素和值;基于所述目标像素和值和所述预设色温分区对应的预设权重,获得像素增益值;利用所述像素增益值对所述目标图像进行白平衡调整,以获得结果图像。
现有的方法中,当目标图像中存在干扰色块时,干扰色块会对目标图像的调整产生负面效果,使得获得的结果图像依旧出现白平衡不准确,从而导致结果图像出现色偏。而本申请中,基于目标图像中的目标白点的目标像素值,获得最终的像素增益值,并利用所述像素增益值对所述目标图像进行白平衡调整,以获得结果图像,目标像素值不会受到目标图像中的干扰色块的影响,从而使得像素增益值的准确率较高,进而使得结果图像白平衡准确,避免了结果图像出现色偏。
附图说明
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图示出的结构获得其他的附图。
图1为本申请实施例方案涉及的硬件运行环境的终端设备结构示意图;
图2为本申请白平衡控制方法第一实施例的流程示意图;
图3为本申请目标普朗克色温曲线的示意图;
图4为本申请预设色温分区与目标普朗克色温曲线的关系图;
图5为本申请白平衡控制装置第一实施例的结构框图。
本申请目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。
本发明的实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请的一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
参照图1,图1为本申请实施例方案涉及的硬件运行环境的终端设备结构示意图。
终端设备可以是移动电话、智能电话、笔记本电脑、数字广播接收器、个人数字助理(PDA)、平板电脑(PAD)等用户设备(User Equipment,UE)、手持设备、车载设备、可穿戴设备、计算设备或连接到无线调制解调器的其它处理设备、移动台(Mobile station,MS)等。终端设备可能被称为用户终端、便携式终端、台式终端等。
通常,终端设备包括:至少一个处理器301、存储器302以及存储在所述存储器上并可在所述处理器上运行的白平衡控制程序,所述白平衡控制程序配置为实现如前所述的白平衡控制方法的步骤。
处理器301可以包括一个或多个处理核心,比如4核心处理器、8核心处理器等。处理器301可以采用DSP(Digital Signal Processing,数字信号处理)、FPGA(Field-Programmable Gate Array,现场可编程门阵列)、PLA(Programmable Logic Array,可编程逻辑阵列)中的至少一种硬件形式来实现。处理器301也可以包括主处理器和协处理器,主处理器是用于对在唤醒状态下的数据进行处理的处理器,也称CPU(Central ProcessingUnit,中央处理器);协处理器是用于对在待机状态下的数据进行处理的低功耗处理器。在一些实施例中,处理器301可以在集成有GPU(Graphics Processing Unit,图像处理器),GPU用于负责显示屏所需要显示的内容的渲染和绘制。处理器301还可以包括AI(Artificial Intelligence,人工智能)处理器,该AI处理器用于处理有关白平衡控制方法操作,使得白平衡控制方法模型可以自主训练学习,提高效率和准确度。
存储器302可以包括一个或多个计算机可读存储介质,该计算机可读存储介质可以是非暂态的。存储器302还可包括高速随机存取存储器,以及非易失性存储器,比如一个或多个磁盘存储设备、闪存存储设备。在一些实施例中,存储器302中的非暂态的计算机可读存储介质用于存储至少一个指令,该至少一个指令用于被处理器301所执行以实现本申请中方法实施例提供的白平衡控制方法。
在一些实施例中,终端还可选包括有:通信接口303和至少一个外围设备。处理器301、存储器302和通信接口303之间可以通过总线或信号线相连。各个外围设备可以通过总线、信号线或电路板与通信接口303相连。具体地,外围设备包括:射频电路304、显示屏305和电源306中的至少一种。
通信接口303可被用于将I/O(Input/Output,输入/输出)相关的至少一个外围设备连接到处理器301和存储器302。在一些实施例中,处理器301、存储器302和通信接口303被集成在同一芯片或电路板上;在一些其他实施例中,处理器301、存储器302和通信接口303中的任意一个或两个可以在单独的芯片或电路板上实现,本实施例对此不加以限定。
射频电路304用于接收和发射RF(Radio Frequency,射频)信号,也称电磁信号。射频电路304通过电磁信号与通信网络以及其他通信设备进行通信。射频电路304将电信号转换为电磁信号进行发送,或者,将接收到的电磁信号转换为电信号。可选地,射频电路304包括:天线系统、RF收发器、一个或多个放大器、调谐器、振荡器、数字信号处理器、编解码芯片组、用户身份模块卡等等。射频电路304可以通过至少一种无线通信协议来与其它终端进行通信。该无线通信协议包括但不限于:城域网、各代移动通信网络(2G、3G、4G及5G)、无线局域网和/或WiFi(Wireless Fidelity,无线保真)网络。在一些实施例中,射频电路304还可以包括NFC(Near Field Communication,近距离无线通信)有关的电路,本申请对此不加以限定。
显示屏305用于显示UI(User Interface,用户界面)。该UI可以包括图形、文本、图标、视频及其它们的任意组合。当显示屏305是触摸显示屏时,显示屏305还具有采集在显示屏305的表面或表面上方的触摸信号的能力。该触摸信号可以作为控制信号输入至处理器301进行处理。此时,显示屏305还可以用于提供虚拟按钮和/或虚拟键盘,也称软按钮和/或软键盘。在一些实施例中,显示屏305可以为一个,电子设备的前面板;在另一些实施例中,显示屏305可以为至少两个,分别设置在电子设备的不同表面或呈折叠设计;在再一些实施例中,显示屏305可以是柔性显示屏,设置在电子设备的弯曲表面上或折叠面上。甚至,显示屏305还可以设置成非矩形的不规则图形,也即异形屏。显示屏305可以采用LCD(LiquidCrystal Display,液晶显示屏)、OLED(Organic Light-Emitting Diode,有机发光二极管)等材质制备。
电源306用于为电子设备中的各个组件进行供电。电源306可以是交流电、直流电、一次性电池或可充电电池。当电源306包括可充电电池时,该可充电电池可以支持有线充电或无线充电。该可充电电池还可以用于支持快充技术。
本领域技术人员可以理解,图1中示出的结构并不构成对终端设备的限定,可以包括比图 示更多或更少的部件,或者组合某些部件,或者不同的部件布置。
此外,本申请实施例还提出一种计算机可读存储介质,所述计算机可读存储介质上存储有白平衡控制程序,所述白平衡控制程序被处理器执行时实现如上文所述的白平衡控制方法的步骤。因此,这里将不再进行赘述。另外,对采用相同方法的有益效果描述,也不再进行赘述。对于本申请所涉及的计算机可读存储介质实施例中未披露的技术细节,请参照本申请方法实施例的描述。确定为示例,程序指令可被部署为在一个终端设备上执行,或者在位于一个地点的多个终端设备上执行,又或者,在分布在多个地点且通过通信网络互连的多个终端设备备上执行。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,上述的程序可存储于一计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。其中,上述的计算机可读存储介质可为磁碟、光盘、只读存储记忆体(Read-Only Memory,ROM)或随机存储记忆体(Random AccessMemory,RAM)等。
基于上述硬件结构,提出本申请白平衡控制方法的实施例。
参照图2,图2为本申请白平衡控制方法第一实施例的流程示意图,所述方法用于终端设备,所述方法包括以下步骤:
步骤S11:获取目标图像中的目标白点的目标像素值。
需要说明的是,本申请的执行主体是终端设备,终端设备的机构参照上文描述,此处不再赘述,终端设备安装有白平衡控制程序,终端设备执行白平衡控制程序时,实现本申请的白平衡控制方法的步骤。
目标图像即为进行白平衡调整的图像,目标图像可以是利用目标摄像头(用于拍摄目标图像的摄像头)已经拍摄的图像,也可以是目标摄像头正在扫描的图像(例如扫描二维码),还可以目标摄像头正准备拍摄的图像(目标摄像头打开,用户通过目标摄像头看到的图像,此时用户并未按下拍照按钮)。目标摄像头可以是终端设备内置的摄像头,也可以是终端设备外接的摄像头。
进一步的,所述目标图像利用目标摄像头获取;所述获取目标图像中的目标白点的目标像素值的步骤之前,所述方法还包括:利用预设色温区间对应的预设色温灯对所述目标摄像头进行曲线校准拟合,以获得所述目标摄像头的目标普朗克色温曲线;基于所述目标普朗克色温曲线,获得所述预设色温分区;相应的,所述获取目标图像中的目标白点的目标像素值的步骤,包括:将所述目标图像中像素值与所述目标普朗克色温曲线匹配的像素点确定为所述目标白点;获取所述目标白点的目标像素值。
需要说明的是,预设色温区间可以是色温值在1800K-10000K组成的色温区间;通常,为了可以获得预设色温区间对应的普朗克色温曲线,需要选取多个预设色温灯(例如,D65色温灯,色温值6500K;D50色温灯,色温值5000K,TL40色温灯,色温值4000K,F色温灯,色温值2700K)对所述目标摄像头进行曲线校准拟合,以获得所述目标摄像头的普朗克色温曲线,该普朗克色温曲线即为所述目标普朗克色温曲线;对于一个目标摄像头,只需要进行一次利用预设色温区间对应的预设色温灯对所述目标摄像头进行曲线校准拟合,以获得所述目标摄像头的目标普朗克色温曲线的步骤;对于多个目标摄像头,均需要进行利用预设色温区间对应的预设色温灯对所述目标摄像头进行曲线校准拟合,以获得所述目标摄像头的目标普朗克色温曲线的步骤,以获得多个目标摄像头各自的目标普朗克色温曲线。参照图3,图3为本申请目标普朗克色温曲线的示意图,虚线部分表示目标普朗克色温曲线,实线部分表示色温空间阈值,色温空间阈值可以是用户基于需求设定的,本申请不做限定。
在本申请中,基于所述目标普朗克色温曲线,获得预设色温分区,预设色温分区的数量较优的选择为5个。
参照图4,图4为本申请预设色温分区与目标普朗克色温曲线的关系图。在图3中,将目 标普朗克色温曲线的有效区域分成五个预设色温分区:ZONE1-ZONE5,其中ZONE1-ZONE5涉及的区域即为有效期区域,ZONE1-ZONE5以外的区域为非有效区域,可以不进行选择。其中,ZONE1对应的色温区间1800K~2700K,ZONE2对应的色温区间2700K~4000K,ZONE 3对应的色温区间4000K~5500K,ZONE 4对应的色温区间5500K~7500K,ZONE 5对应的色温区间7500K~10000K。
其中,需要获取目标图像中各像素点的像素值,将像素值与所述目标普朗克色温曲线匹配的像素点确定为所述目标白点,一个像素点的像素值与所述目标普朗克色温曲线匹配即是指该像素点的像素值落于所述目标普朗克色温曲线中的色温空间阈值范围内,且像素值落于所述目标普朗克色温曲线的有效区域(例如上文所述的ZONE1-ZONE5五个区域对应的区域集合)。目标白点的像素值需要获取。
步骤S12:利用所述目标像素值,计算预设色温分区对应的目标像素和值。
需要说明的是,在本申请中,每个预设色温分区均对应的一定数量的目标白点;对于一个预设色温分区,需要将该预设色温分区包括的全部目标白点的像素值求和,以获得所述目标像素和值。
可以理解的是,对于一个预设色温分区,目标像素和值,包括目标红色像素和值、目标蓝色像素和值和目标绿色像素和值,即,对于该预设色温分区,需要计算全部目标白点的蓝色像素和值、全部目标白点的红色像素和值以及全部目标白点的绿色像素和值。
例如,ZONE1区域包括100个目标白点,则需要将100个白点红色像素值求和,以获得ZONE1区域的红色像素和值,同理,获得ZONE1区域的绿色像素和值以及ZONE1区域的蓝色像素和值。
步骤S13:基于所述目标像素和值和所述预设色温分区对应的预设权重,获得像素增益值。需要说明的是,预设权重包括红色预设权重、蓝色预设权重和绿色预设权重;对应的,像素增益值包括绿色像素增益、红色像素增益和蓝色像素增益。对于一个预设色温分区,需要基于其红色像素和值和红色预设权重,获得红色像素增益值;同理,需要基于其绿色像素和值和绿色预设权重,获得绿色像素增益值,需要基于其蓝色像素和值和蓝色预设权重,获得蓝色像素增益值。然后对于多个预设色温分区,均需要进行步骤S11,以获得各个预设色温分区对应的像素增益值。
按照常规的应用环境,参照上文ZONE1-ZONE5分区的设置,将ZONE4的预设权重最高,ZONE3次之,之后是ZONE5,再之后ZONE2,最后是ZONE1。将ZONE1-ZONE5范围的预设权重设置为K n(n为自然数1-5),另外再设置ZONE1-ZONE5预设权重最小值K min,n。多个预设色温分区对应的预设权重之和可以等于1。如果完全不考虑某个预设色温区间内的目标白点,只要把对应的预设权重都设置为0。
进一步的,所述基于所述目标像素和值和所述预设色温分区对应的预设权重,获得像素增益值的步骤之前,所述方法还包括:统计所述预设色温分区中所述目标白点的白点数量;利用所述白点数量、预设白点最大数量和预设白点最小数量,对所述预设权重进行调整,以获得所述预设色温分区对应的实际权重;相应的,所述基于所述目标像素和值和所述预设色温分区对应的预设权重,获得像素增益值的步骤,包括:基于所述目标像素和值和所述实际权重,获得像素增益值。
需要说明的是,需要基于目标图像对应的白点数量,进行预设权重的调整,红色预设权重、蓝色预设权重和绿色预设权重均需要进行调整。
具体的,所述利用所述白点数量、预设白点最大数量和预设白点最小数量,对所述预设权重进行调整,以获得所述预设色温分区对应的实际权重的步骤,包括:
利用公式一,基于所述白点数量、预设白点最大数量、预设白点最小数量、所述预设权重和所述预设色温分区对应的预设权重最小值,获得所述实际权重;
所述公式一为:
Figure PCTCN2021132137-appb-000005
其中,K′ n为所述预设色温分区中的任意一个预设色温分区n对应的实际权重,K n为所述预设色温分区n对应的预设权重,K min,n为所述预设色温分区n对应的预设权重最小值,T n为所述预设色温分区n对应的白点数量,T min,n为所述预设色温分区n对应的预设白点最小数量,T max,n为所述预设色温分区n对应的预设白点最大数量。
需要说明的是,在本申请中,预设权重中的红色预设权重、蓝色预设权重和绿色预设权重均相同,即为所述预设权重K n,同理,求的实际权重K′ n和预设权重最小值K min,n对应的三种颜色权重也均相同。另外,对于一个预设色温分区的预设白点最大数量T max,n和预设白点最小数量T min,n,基于实际目标图像的大小,以及该预设色温分区中目标白点值的占比这两个因素确定。
可以理解的是,按照上文所述,设置ZONE1-ZONE5五个预设色温分区,则需要求得五个实际权重,并基于五个实际权重和目标白点的目标像素和值,获得像素增益值。
具体的,所述基于所述目标像素和值和所述实际权重,获得像素增益值的步骤,包括:基于所述目标像素和值和所述实际权重,获得结果像素和值;基于所述结果像素和值,获得所述像素增益值。
其中,所述基于所述目标像素和值和所述实际权重,获得结果像素和值的步骤,包括:利用公式二,基于所述目标像素和值和所述实际权重,获得结果像素和值;
所述公式二为:
Figure PCTCN2021132137-appb-000006
Figure PCTCN2021132137-appb-000007
Figure PCTCN2021132137-appb-000008
其中,SUM(R)、SUM(G)和SUM(B)分别为所述结果像素和值中的结果红色像素和值、结果绿色像素和值和结果蓝色像素和值,N为所述预设色温分区的个数,SUM(R n)为所述目标像素和值中预设色温分区n对应的目标红色像素和值,SUM(G n)为所述目标像素和值中预设色温分区n对应的目标绿色像素和值,SUM(B n)为所述目标像素和值中预设色温分区n对应的目标蓝色像素和值。
需要说明的是,所述目标像素和值包括各个预设色温分区分别对应的目标像素和值,对于一个预设色温分区,目标像素和值包括目标红色像素和值、目标绿色像素和值和目标蓝色像素和值,需要按照公式二,求得全部预设色温分区对应的一个结果红色像素和值、一个 结果蓝色像素和值和一个结果绿色像素和值。
按照上文所述方式获得结果红色像素和值、结果蓝色像素和值和结果绿色像素和值,并基于结果红色像素和值、结果蓝色像素和值和结果绿色像素和值,获得像素增益值;其中,所述像素增益值包括红色增益值、绿色增益值和蓝色增益值;所述基于所述结果像素和值,获得所述像素增益值的步骤,包括:
若所述结果绿色像素和值最大,则将所述结果绿色像素和值与所述结果红色像素和值的比值确定为红色增益值,将所述结果绿色像素和值与所述结果蓝色像素和值的比值确定为蓝色增益值,将第一预设常数确定为确定为绿色增益值;或,
若所述结果红色像素和值最大,则将所述结果红色像素和值与所述结果绿色像素和值的比值确定为绿色增益值,将所述结果红色像素和值与所述结果蓝色像素和值的比值确定为蓝色增益值,将第二预设常数确定为确定为红色增益值;或,
若所述结果蓝色像素和值最大,则将所述结果蓝色像素和值与所述结果红色像素和值的比值确定为红色增益值,将所述结果蓝色像素和值与所述结果绿色像素和值的比值确定为绿色增益值,将第三预设常数确定为确定为蓝色增益值。
步骤S14:利用所述像素增益值对所述目标图像进行白平衡调整,以获得结果图像。
求得红色增益值、绿色增益值和蓝色增益值之后,即可利用红色增益值、绿色增益值和蓝色增益值对目标图像的全部像素值进行调整,以实现对目标图像的白平衡调整,即可获得最终调整后的结果图像,结果图像不再存在色偏。
本申请技术方案提出了一种白平衡控制方法,所述方法包括以下步骤:获取目标图像中的目标白点的目标像素值;利用所述目标像素值,计算预设色温分区对应的目标像素和值;基于所述目标像素和值和所述预设色温分区对应的预设权重,获得像素增益值;利用所述像素增益值对所述目标图像进行白平衡调整,以获得结果图像。
现有的方法中,当目标图像中存在干扰色块时,干扰色块会对目标图像的调整产生负面效果,使得获得的结果图像依旧出现白平衡不准确,从而导致结果图像出现色偏。而本申请中,基于目标图像中的目标白点的目标像素值,获得最终的像素增益值,并利用所述像素增益值对所述目标图像进行白平衡调整,以获得结果图像,目标像素值不会受到目标图像中的干扰色块的影响,从而使得像素增益值的准确率较高,进而使得结果图像白平衡准确,避免了结果图像出现色偏。
参照图5,图5为本申请白平衡控制装置第一实施例的结构框图,所述装置用于终端设备,基于与前述实施例相同的申请构思,所述装置包括:
获取模块10,用于获取目标图像中的目标白点的目标像素值;
计算模块20,用于利用所述目标像素值,计算预设色温分区对应的目标像素和值;
获得模块30,用于基于所述目标像素和值和所述预设色温分区对应的预设权重,获得像素增益值;
调整模块40,用于利用所述像素增益值对所述目标图像进行白平衡调整,以获得结果图像。需要说明的是,由于本实施例的装置所执行的步骤与前述方法实施例的步骤相同,其具体的实施方式以及可以达到的技术效果都可参照前述实施例,这里不再赘述。
以上所述仅为本申请的可选实施例,并非因此限制本申请的专利范围,凡是在本申请的申请构思下,利用本申请说明书及附图内容所作的等效结构变换,或直接/间接运用在其他相关的技术领域均包括在本申请的专利保护范围内。

Claims (15)

  1. 一种白平衡控制方法,其中,所述方法包括以下步骤:
    获取目标图像中的目标白点的目标像素值;
    利用所述目标像素值,计算预设色温分区对应的目标像素和值;
    基于所述目标像素和值和所述预设色温分区对应的预设权重,获得像素增益值;
    利用所述像素增益值对所述目标图像进行白平衡调整,以获得结果图像。
  2. 如权利要求1所述的方法,其中,所述目标图像利用目标摄像头获取;所述获取目标图像中的目标白点的目标像素值的步骤之前,所述方法还包括:
    利用预设色温区间对应的预设色温灯对所述目标摄像头进行曲线校准拟合,以获得所述目标摄像头的目标普朗克色温曲线;
    基于所述目标普朗克色温曲线,获得所述预设色温分区;
    所述获取目标图像中的目标白点的目标像素值的步骤,包括:
    将所述目标图像中像素值与所述目标普朗克色温曲线匹配的像素点确定为所述目标白点;获取所述目标白点的目标像素值。
  3. 如权利要求2所述的方法,其中,所述基于所述目标像素和值和所述预设色温分区对应的预设权重,获得像素增益值的步骤之前,所述方法还包括:
    统计所述预设色温分区中所述目标白点的白点数量;
    利用所述白点数量、预设白点最大数量和预设白点最小数量,对所述预设权重进行调整,以获得所述预设色温分区对应的实际权重;
    所述基于所述目标像素和值和所述预设色温分区对应的预设权重,获得像素增益值的步骤,包括:
    基于所述目标像素和值和所述实际权重,获得像素增益值。
  4. 如权利要求3所述的方法,其中,所述基于所述目标像素和值和所述实际权重,获得像素增益值的步骤,包括:
    基于所述目标像素和值和所述实际权重,获得结果像素和值;
    基于所述结果像素和值,获得所述像素增益值。
  5. 如权利要求4所述的方法,其中,所述利用所述白点数量、预设白点最大数量和预设白点最小数量,对所述预设权重进行调整,以获得所述预设色温分区对应的实际权重的步骤,包括:
    利用公式一,基于所述白点数量、预设白点最大数量、预设白点最小数量、所述预设权重和所述预设色温分区对应的预设权重最小值,获得所述实际权重;
    所述公式一为:
    Figure PCTCN2021132137-appb-100001
    其中,K′ n为所述预设色温分区中的任意一个预设色温分区n对应的实际权重,K n为所述预设色温分区n对应的预设权重,K min,n为所述预设色温分区n对应的预设权重最小值,T n为所述预设色温分区n对应的白点数量,T min,n为所述预设色温分区n对应的预设白点最小数量,T max,n为所述预设色温分区n对应的预设白点最大数量。
  6. 如权利要求5所述的方法,其中,所述基于所述目标像素和值和所述实际权重,获得结果像素和值的步骤,包括:
    利用公式二,基于所述目标像素和值和所述实际权重,获得结果像素和值;
    所述公式二为:
    Figure PCTCN2021132137-appb-100002
    Figure PCTCN2021132137-appb-100003
    Figure PCTCN2021132137-appb-100004
    其中,SUM(R)、SUM(G)和SUM(B)分别为所述结果像素和值中的结果红色像素和值、结果绿色像素和值和结果蓝色像素和值,N为所述预设色温分区的个数,SUM(R n)为所述目标像素和值中预设色温分区n对应的目标红色像素和值,SUM(G n)为所述目标像素和值中预设色温分区n对应的目标绿色像素和值,SUM(B n)为所述目标像素和值中预设色温分区n对应的目标蓝色像素和值。
  7. 如权利要求6所述的方法,其中,所述像素增益值包括红色增益值、绿色增益值和蓝色增益值;所述基于所述结果像素和值,获得所述像素增益值的步骤,包括:
    若所述结果绿色像素和值最大,则将所述结果绿色像素和值与所述结果红色像素和值的比值确定为红色增益值,将所述结果绿色像素和值与所述结果蓝色像素和值的比值确定为蓝色增益值,将第一预设常数确定为确定为绿色增益值;或,
    若所述结果红色像素和值最大,则将所述结果红色像素和值与所述结果绿色像素和值的比值确定为绿色增益值,将所述结果红色像素和值与所述结果蓝色像素和值的比值确定为蓝色增益值,将第二预设常数确定为确定为红色增益值;或,
    若所述结果蓝色像素和值最大,则将所述结果蓝色像素和值与所述结果红色像素和值的比值确定为红色增益值,将所述结果蓝色像素和值与所述结果绿色像素和值的比值确定为绿色增益值,将第三预设常数确定为确定为蓝色增益值。
  8. 如权利要求6所述的方法,其中,所述利用所述目标像素值,计算预设色温分区对应的目标像素和值,包括:
    每个预设色温分区均对应的一定数量的目标白点;
    对于一个预设色温分区,将该预设色温分区包括的全部目标白点的像素值求和,以获得所述目标像素和值,所述目标像素和值包括:目标红色像素和值、目标蓝色像素和值和目标绿色像素和值。
  9. 如权利要求6所述的方法,其中,所述预设色温区间是色温值在1800K-10000K组成的色温区间。
  10. 如权利要求5所述的方法,其中,预设权重中的红色预设权重、蓝色预设权重和绿色预设权重均相同,权重K′ n和预设权重最小值K min,n对应的三种颜色权重相同。
  11. 如权利要求5所述的方法,其中,预设色温分区的预设白点最大数量T max,n和预设白点最小数量T min,n是基于实际目标图像的大小,以及该预设色温分区中目标白点值的占比确定。
  12. 如权利要求5所述的方法,其中,选取多个预设色温灯对所述目标摄像头进行曲线校 准拟合,以获得所述目标摄像头的普朗克色温曲线;
    基于所述目标普朗克色温曲线,获得预设色温分区。
  13. 一种白平衡控制装置,其中,所述装置包括:
    获取模块,用于获取目标图像中的目标白点的目标像素值;
    计算模块,用于利用所述目标像素值,计算预设色温分区对应的目标像素和值;
    获得模块,用于基于所述目标像素和值和所述预设色温分区对应的预设权重,获得像素增益值;
    调整模块,用于利用所述像素增益值对所述目标图像进行白平衡调整,以获得结果图像。
  14. 一种终端设备,其中,所述终端设备包括:存储器、处理器及存储在所述存储器上并在所述处理器上运行白平衡控制程序,所述白平衡控制程序被所述处理器执行时实现如权利要求1至12中任一项所述的白平衡控制方法的步骤。
  15. 一种计算机可读存储介质,其中,所述计算机可读存储介质上存储有白平衡控制程序,所述白平衡控制程序被处理器执行时实现如权利要求1至12中任一项所述的白平衡控制方法的步骤。
PCT/CN2021/132137 2021-08-23 2021-11-22 白平衡控制方法、装置、终端设备以及存储介质 WO2023024286A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP21926048.6A EP4164217A4 (en) 2021-08-23 2021-11-22 WHITE BALANCE CONTROL METHOD AND DEVICE AND TERMINAL DEVICE AND STORAGE MEDIUM
US18/177,920 US20230216998A1 (en) 2021-08-23 2023-03-03 White balance control method and apparatus, terminal device, and storage medium

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110971603.6 2021-08-23
CN202110971603.6A CN113676716B (zh) 2021-08-23 2021-08-23 白平衡控制方法、装置、终端设备以及存储介质

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US18/177,920 Continuation US20230216998A1 (en) 2021-08-23 2023-03-03 White balance control method and apparatus, terminal device, and storage medium

Publications (1)

Publication Number Publication Date
WO2023024286A1 true WO2023024286A1 (zh) 2023-03-02

Family

ID=78545232

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/132137 WO2023024286A1 (zh) 2021-08-23 2021-11-22 白平衡控制方法、装置、终端设备以及存储介质

Country Status (4)

Country Link
US (1) US20230216998A1 (zh)
EP (1) EP4164217A4 (zh)
CN (1) CN113676716B (zh)
WO (1) WO2023024286A1 (zh)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113676716B (zh) * 2021-08-23 2022-10-14 深圳创维-Rgb电子有限公司 白平衡控制方法、装置、终端设备以及存储介质
CN114449243B (zh) * 2022-01-28 2023-12-12 青岛海信移动通信技术有限公司 一种白平衡方法和终端设备
CN115334295B (zh) * 2022-08-10 2024-05-03 杭州联吉技术有限公司 图像白平衡处理方法及电子设备
CN115379186B (zh) * 2022-08-19 2023-11-03 福州鑫图光电有限公司 一种图像自动白平衡的方法及终端

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150271460A1 (en) * 2014-03-18 2015-09-24 Samsung Techwin Co., Ltd. White balance correcting apparatus and white balance correcting method
CN105959662A (zh) * 2016-05-24 2016-09-21 深圳英飞拓科技股份有限公司 自适应白平衡调整方法及装置
CN107483908A (zh) * 2017-09-27 2017-12-15 歌尔科技有限公司 白平衡校准方法及电子设备
CN108377372A (zh) * 2018-03-13 2018-08-07 普联技术有限公司 一种白平衡处理方法、装置、终端设备和存储介质
US20190045163A1 (en) * 2018-10-02 2019-02-07 Intel Corporation Method and system of deep learning-based automatic white balancing
CN110876049A (zh) * 2018-08-29 2020-03-10 浙江宇视科技有限公司 图像白平衡处理方法及装置
CN113676716A (zh) * 2021-08-23 2021-11-19 深圳创维-Rgb电子有限公司 白平衡控制方法、装置、终端设备以及存储介质

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI493967B (zh) * 2013-11-12 2015-07-21 Novatek Microelectronics Corp 自動色彩校正方法及其色彩校正模組
CN105578165B (zh) * 2015-12-30 2017-06-23 浙江大华技术股份有限公司 一种图像白平衡处理方法、装置及摄像机
CN105430367B (zh) * 2015-12-30 2017-11-03 浙江宇视科技有限公司 一种自动白平衡的方法和装置
CN109361910B (zh) * 2018-10-23 2020-09-01 浙江宇视科技有限公司 自适应白平衡校正方法及装置

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150271460A1 (en) * 2014-03-18 2015-09-24 Samsung Techwin Co., Ltd. White balance correcting apparatus and white balance correcting method
CN105959662A (zh) * 2016-05-24 2016-09-21 深圳英飞拓科技股份有限公司 自适应白平衡调整方法及装置
CN107483908A (zh) * 2017-09-27 2017-12-15 歌尔科技有限公司 白平衡校准方法及电子设备
CN108377372A (zh) * 2018-03-13 2018-08-07 普联技术有限公司 一种白平衡处理方法、装置、终端设备和存储介质
CN110876049A (zh) * 2018-08-29 2020-03-10 浙江宇视科技有限公司 图像白平衡处理方法及装置
US20190045163A1 (en) * 2018-10-02 2019-02-07 Intel Corporation Method and system of deep learning-based automatic white balancing
CN113676716A (zh) * 2021-08-23 2021-11-19 深圳创维-Rgb电子有限公司 白平衡控制方法、装置、终端设备以及存储介质

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP4164217A4 *

Also Published As

Publication number Publication date
EP4164217A4 (en) 2024-04-03
CN113676716A (zh) 2021-11-19
US20230216998A1 (en) 2023-07-06
CN113676716B (zh) 2022-10-14
EP4164217A1 (en) 2023-04-12

Similar Documents

Publication Publication Date Title
WO2023024286A1 (zh) 白平衡控制方法、装置、终端设备以及存储介质
US11302258B2 (en) Method for operating electronic device and electronic device for supporting the same
CN107451979B (zh) 一种图像处理方法、装置和存储介质
CN108494974B (zh) 显示亮度的调节方法、移动终端及存储介质
CN107038715B (zh) 一种图像处理方法及装置
CN108307125B (zh) 一种图像采集方法、装置和存储介质
US20220191668A1 (en) Short-Distance Information Transmission Method and Electronic Device
EP3267670A1 (en) Electronic device including dual camera and method for controlling dual camera
CN109741288B (zh) 图像处理方法、装置、存储介质及电子设备
US11025876B2 (en) Method and device for controlling white balance function of electronic device
WO2023016320A1 (zh) 图像处理方法、装置、设备及介质
CN111176602B (zh) 图片显示方法、装置、存储介质及智能设备
CN108200352B (zh) 一种调解图片亮度的方法、终端及存储介质
CN111345019B (zh) 一种环境光检测的方法及终端
CN112017577B (zh) 屏幕显示校准方法及装置
WO2020134789A1 (zh) 移动终端及其屏幕亮灭的控制方法、计算机存储介质
CN114900199A (zh) 散射参数确定方法与装置、信号处理电路和电子设备
WO2021120383A1 (zh) 屏幕色温控制方法、装置、存储介质及移动终端
WO2022082960A1 (zh) 局部显示区补偿值确定方法、装置、存储介质及终端设备
CN112634155B (zh) 图像处理方法、装置、电子设备及存储介质
US11929001B2 (en) Method and device for measuring illuminance
CN113407423A (zh) 信号强度显示方法和信号强度显示装置
CN113676663B (zh) 相机白平衡调整方法、装置、存储介质及终端设备
WO2022161036A1 (zh) 天线选择方法、装置、电子设备及可读存储介质
EP4037210A1 (en) Probe antenna determination method and apparatus

Legal Events

Date Code Title Description
ENP Entry into the national phase

Ref document number: 2021926048

Country of ref document: EP

Effective date: 20220824

WWE Wipo information: entry into national phase

Ref document number: 202227052711

Country of ref document: IN

NENP Non-entry into the national phase

Ref country code: DE