A white balance correction method and device, electronic equipment and storage medium

CN122845946APending Publication Date: 2026-09-29ZHIYUE STAR (SHANGHAI) INTELLIGENT TERMINAL CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611031326.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-10
Publication Date
2026-09-29

AI Technical Summary

Technical Problem

但是,无论是基于白世界还是灰度世界的白平衡校正方式,在晴天、阴天、雾天或者雨天等复杂场景下,均难以确定可靠白点或中性灰区域,估算得到的CCT误差较大,导致白平衡校正效果误差较大,影响画面效果

Benefits of technology

[0009]本发明实施例的技术方案,通过确定当前天气,基于预先设置的白平衡参考表,确定当前天气数据对应的第一白平衡特征值和第一相关色温,同时确定拍摄设备根据原始图像计算得到的第二白平衡特征值和第二相关色温,基于第一相关色温、第二相关色温,以及第一白平衡特征值和/或第二白平衡特征值,确定目标白平衡特征值,并基于目标白平衡特征值进行白平衡校正。本发明实施例的技术方案解决了仅依靠拍摄设备计算进行白平衡校正,在复杂场景下误差较大的问题,通过不同天气场景下的实际参考与拍摄设备计算辅助,提高了白平衡校正的准确性,针对偏差较大的复杂场景具有较好的适用性和有效改善效果。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122845946A_ABST
    Figure CN122845946A_ABST
Patent Text Reader

Abstract

The application discloses a white balance correction method and device, electronic equipment and a storage medium. The method comprises the following steps: determining current weather data, and determining a first white balance characteristic value and a first correlated color temperature according to the current weather data and a pre-set white balance reference table; determining a second white balance characteristic value and a second correlated color temperature calculated by a shooting device according to an original image; determining a target white balance characteristic value based on the first correlated color temperature, the second correlated color temperature, and the first white balance characteristic value and / or the second white balance characteristic value, and performing white balance correction based on the target white balance characteristic value. The application can improve the accuracy of white balance correction, and has good applicability for complex scenes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing technology, and in particular to a white balance correction method, apparatus, electronic device, and storage medium. Background Technology

[0002] With the increasing number of mobile shooting devices, users' demands for image quality are also constantly rising, which places higher demands on the accuracy of white balance in shooting devices. The function of white balance is to correct color cast. By adjusting the gain of the RGB three channels of each pixel, it ensures that white objects in the image can be reproduced as true white by the shooting device, that is, R=G=B for white objects.

[0003] The existing white balance correction process, taking white balance correction based on the white world as an example, typically involves identifying the white points in the image, calculating the CCT (Correlated Color Temperature) based on the RGB values ​​of the white points, calculating the R gain and B gain based on the CCT and RGB values, and finally compensating each pixel with the R gain and B gain. White balance calibration based on the gray world is similar to the above process, the difference being the identification of neutral gray areas in the image. However, regardless of whether the white balance correction method is based on the white world or the gray world, it is difficult to determine reliable white points or neutral gray areas in complex scenes such as sunny, cloudy, foggy, or rainy days. The estimated CCT has a large error, resulting in a large error in the white balance correction effect and affecting the image quality. Summary of the Invention

[0004] This invention provides a white balance correction method, apparatus, electronic device, and storage medium to improve the accuracy of white balance correction, especially for complex scenarios.

[0005] In a first aspect, embodiments of the present invention provide a white balance correction method, the method comprising: Determine the current weather data, and based on the current weather data and the pre-set white balance reference table, determine the first white balance characteristic value and the first correlated color temperature; The second white balance feature value and second correlated color temperature calculated by the shooting device based on the original image are determined. Based on the first correlated color temperature, the second correlated color temperature, and the first white balance feature value and / or the second white balance feature value, a target white balance feature value is determined, and white balance correction is performed based on the target white balance feature value.

[0006] Secondly, embodiments of the present invention also provide a white balance correction device, the device comprising: The first parameter determination module is used to determine the current weather data and, based on the current weather data and a pre-set white balance reference table, determine the first white balance characteristic value and the first correlated color temperature. The second parameter determination module is used to determine the second white balance feature value and the second correlated color temperature calculated by the shooting device based on the original image; The white balance correction module is used to determine a target white balance feature value based on a first correlated color temperature, a second correlated color temperature, and a first white balance feature value and / or a second white balance feature value, and to perform white balance correction based on the target white balance feature value.

[0007] Thirdly, embodiments of the present invention also provide an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the white balance correction method as described in any of the embodiments of the present invention.

[0008] Fourthly, embodiments of the present invention also provide a storage medium for storing computer-executable instructions, which, when executed by a computer processor, are used to perform the white balance correction method as described in any of the embodiments of the present invention.

[0009] The technical solution of this invention determines the current weather, and based on a pre-set white balance reference table, determines the first white balance feature value and the first correlated color temperature corresponding to the current weather data. Simultaneously, it determines the second white balance feature value and the second correlated color temperature calculated by the shooting device from the original image. Based on the first correlated color temperature, the second correlated color temperature, and the first and / or second white balance feature values, it determines the target white balance feature value, and performs white balance correction based on the target white balance feature value. This technical solution solves the problem of large errors in complex scenes when relying solely on shooting device calculations for white balance correction. By combining actual references under different weather conditions with calculation assistance from the shooting device, it improves the accuracy of white balance correction, demonstrating good applicability and effective improvement for complex scenes with large deviations.

[0010] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description

[0011] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0012] Figure 1 This is a flowchart of a white balance correction method provided in Embodiment 1 of the present invention; Figure 2 This is a flowchart of a white balance correction method provided in Embodiment 2 of the present invention; Figure 3 This is a schematic diagram of the structure of a white balance correction device provided in Embodiment 3 of the present invention; Figure 4 This is a schematic diagram of the structure of an electronic device provided in Embodiment 4 of the present invention. Detailed Implementation

[0013] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0014] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or device that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or devices. In the embodiments of this application, certain software, components, models, and other existing industry solutions may be mentioned. These should be considered exemplary, intended only to illustrate the feasibility of implementing the technical solutions of this application, and do not imply that the applicant has already used or necessarily used such solutions.

[0015] The acquisition, transmission, storage, use, and processing of data in this application all comply with the relevant provisions of national laws and regulations.

[0016] Example 1 Figure 1The flowchart of a white balance correction method is provided in Embodiment 1 of the present invention. This embodiment is applicable to the white balance correction of shooting equipment. The method can be executed by a white balance correction device, which can be implemented in hardware and / or software and can be configured in the shooting equipment.

[0017] like Figure 1 As shown, the method includes: S110. Determine the current weather data, and based on the current weather data and the pre-set white balance reference table, determine the first white balance characteristic value and the first correlated color temperature.

[0018] The current weather data refers to the weather at the current time and location of the shooting device, such as sunny, cloudy, partly cloudy, light rain, moderate rain, heavy rain, sleet, light snow, moderate snow, heavy snow, fog, sandstorm, etc. This embodiment is executed by the shooting device or by an electronic device integrated with a shooting device. In this embodiment, after the shooting device starts working, it sends a command to the server to request the current weather data, or the electronic device calls weather software in the background to obtain the current weather data.

[0019] It should be noted that in this embodiment, the weather data in both the server and the weather software in the electronic device can be updated either daily or at preset intervals, such as 2 hours or 1 hour. The finer the granularity of the weather data updates, the more it matches the actual situation of the scene where the shooting device is located at the current moment, and the more accurate the reference values ​​for white balance feature values ​​and related color temperature are determined.

[0020] The white balance reference table stores white balance reference values ​​for different weather conditions, including reference values ​​for white balance feature values ​​and related color temperatures. Based on these reference values, it is possible to determine how to adjust reference points in an image to the standard white corresponding to the desired weather scene, thereby describing the target effect of white balance in the actual scene.

[0021] White balance feature values ​​refer to the R / G and B / G values ​​of reference points in an image, that is, the ratio of R channel values ​​to G channel values, and the ratio of B channel values ​​to G channel values. These can be calculated from the RGB values ​​of the image reference points. The process of determining reference points in an image may include: first, dividing the original image into blocks; calculating the RGB average value of each block; performing brightness and saturation filtering on each block, retaining blocks with moderate brightness and low saturation as candidate blocks; calculating the R / G and B / G values ​​of each candidate block; and then weighted summing the R / G and B / G values ​​of all candidate blocks. The point corresponding to the average R / G value and the average B / G value is then used as the reference point.

[0022] Correlated color temperature (CCT) refers to the color temperature value of the current light source. When performing white balance correction through the shooting device, the neutral gray / white area of ​​the original image is usually extracted, the RGB mean of the neutral gray / white area is calculated, the RGB mean is normalized to obtain the chromaticity coordinates (u,v) or (x,y), and then the correlated color temperature is calculated by using the blackbody trajectory formula.

[0023] The first white balance feature value is the reference value of the white balance feature value under the actual scene corresponding to the current weather data, and the first correlated color temperature is the reference value of the correlated color temperature under the actual scene corresponding to the current weather data. In this embodiment, the white balance reference table can bridge the gap between the reference values ​​of the white balance feature values ​​under different correlated color temperatures and the calculated values ​​by the shooting device.

[0024] In this embodiment, a first white balance feature value and a first correlated color temperature are determined based on the current weather data and a pre-set white balance reference table. Specifically, since the white balance reference table stores the mapping relationship between weather data, correlated color temperature and white balance feature value, the correlated color temperature corresponding to the current weather data is determined as the first correlated color temperature in the white balance reference table based on the current weather data, and the white balance feature value corresponding to the current weather data is determined as the first white balance feature value.

[0025] Furthermore, the process of setting up the white balance reference table includes: S1. Determine the correlated color temperature and wavelength information corresponding to at least two types of weather data, and determine the correlated color temperature, wavelength information and white balance reference point corresponding to at least two types of light sources, and determine the white balance characteristic value based on the white balance reference point. S2. Based on the correlated color temperature and wavelength information corresponding to each weather data, and the correlated color temperature, wavelength information, and white balance characteristic value corresponding to each light source, determine the mapping relationship between the weather data, correlated color temperature, and white balance characteristic value, and obtain the white balance reference table.

[0026] In this embodiment, at least two types of weather data can be from different time periods and different weather types. Similarly, the finer the granularity of the weather data settings, the more accurate the final white balance characteristic value and correlated color temperature will be. For example, it can be set to collect corresponding correlated color temperature and wavelength information every half hour from 8:00 to 19:00 under different weather types. The correlated color temperature and wavelength information can be detected by devices such as spectroradiometers, and this embodiment does not impose any limitations on this.

[0027] Wavelength information is used to describe the color of monochromatic light, such as blue light at 450nm and green light at 550nm. In this embodiment, since the same CCT does not correspond to a single wavelength, this embodiment obtains the CCT and wavelength information from the current actual weather scene and uses them together as index information when establishing a white balance reference table later.

[0028] The light source refers to the simulated light source in the standard light source color matching box, which can be a D75 standard daylight source used to simulate visible daylight. Similarly, the correlated color temperature and wavelength information under the simulated light source in the standard light source color matching box can be detected using equipment such as a spectroradiometer, and the white balance reference point of the image sensor of the shooting device under each simulated light source in the standard light source color matching box can be determined. The process of determining the white balance reference point in the image, and the process of determining the white balance characteristic value based on the white balance reference point, have been described in the above embodiments, and will not be repeated in this embodiment.

[0029] In this embodiment, after obtaining the mapping relationship between weather data, correlated color temperature and wavelength information in actual weather scenarios, as well as the correlated color temperature, wavelength information and white balance characteristic value under the simulated light source of the light box, the correlated color temperature and wavelength information are used as index information to obtain the mapping relationship between weather data, correlated color temperature and white balance characteristic value, thereby establishing a white balance reference table.

[0030] Furthermore, after determining the mapping relationship between weather data, correlated color temperature, and white balance characteristic values, a target effect matching the correlated color temperature can be determined, the target effect can be adjusted, and the white balance characteristic values ​​can be redefined based on the adjusted target effect. The redefined white balance characteristic values ​​can then be saved to the white balance reference table.

[0031] In this embodiment, after establishing the mapping relationship, the target effect can also be adjusted. The target effect is standard white, which is the endpoint of white balance correction. The task of white balance correction is to adjust the white balance reference point to the target effect through gain correction.

[0032] Understandably, the target effect may differ under different weather conditions. Correlated color temperature is used to classify scenes, and different scene types use different target effects. In this embodiment, the target effect can be adjusted under different weather conditions to make the white balance correction effect under different weather conditions closer to the actual effect under that weather condition, thereby improving the adaptability of white balance correction.

[0033] Specifically, based on the adjusted RGB values ​​of the target effect, the R / G and B / G values ​​are recalculated and saved as new white balance feature values ​​in the white balance reference table. For example, if the target effect is adjusted to a warmer tone with RGB values ​​of 985, 1000, and 1010, the recalculated white balance feature values ​​are: R / G value 985 / 1000 = 0.985, and B / G value 1010 / 1000 = 1.01.

[0034] In this embodiment, the white balance reference table is established and updated through the server, and then the white balance reference table is sent to the shooting device or an electronic device integrated with the shooting device for local storage, so as to facilitate data retrieval and calculation when the shooting device is started later.

[0035] S120. Determine the second white balance feature value and the second correlated color temperature calculated by the shooting device based on the original image.

[0036] Specifically, the imaging device determines a reference point in the original image, as detailed in the above embodiment. The R / G and B / G values ​​of the reference point are used as the second white balance feature values. These second white balance feature values ​​are converted into chromaticity coordinates, and then calculated using the blackbody trajectory formula to obtain the second correlated color temperature.

[0037] S130. Based on the first correlated color temperature, the second correlated color temperature, and the first white balance characteristic value and / or the second white balance characteristic value, determine the target white balance characteristic value, and perform white balance correction based on the target white balance characteristic value.

[0038] In this embodiment, in order to correct the error of white balance correction relying solely on the shooting device for calculation in some complex weather scenarios, by using reference values ​​of white balance correction parameters corresponding to the weather scenario, the white balance correction effect can be effectively improved for complex weather scenarios with large errors.

[0039] In an optional embodiment, a target white balance feature value is determined based on a first correlated color temperature, a second correlated color temperature, and a first white balance feature value and / or a second white balance feature value. This can be achieved by directly using a weighted fusion of the first and second white balance feature values ​​as the target white balance feature value. Initially, when setting up the white balance reference table, the first correlated color temperature and the first white balance feature value can be assigned relatively small weights. After white balance correction is performed based on the fused target white balance feature value, feedback on the white balance correction effect can be provided, and the white balance reference table can be updated and adjusted based on the correction effect. As the white balance reference table is continuously adjusted, a larger weight can be assigned to the first white balance feature value to give the reference value of the white balance feature value a higher confidence level.

[0040] In another optional embodiment, it can be determined whether the current situation is one where the white balance correction parameters calculated by the shooting device have a large error, based on the first correlated color temperature and the second correlated color temperature. Specifically, this can be determined by the magnitude of the absolute value of the difference between the first correlated color temperature and the second correlated color temperature. After determining that the current situation is one where the white balance correction parameters calculated by the shooting device have a large error, the weighted fusion of the first white balance feature value and the second white balance feature value is performed using the method described in the above embodiment.

[0041] White balance correction based on target white balance feature values ​​can specifically include: determining the gain result based on the target white balance feature values, and then performing white balance correction based on the gain result. Specifically, the gain result includes R channel gain, G channel gain, and B channel gain, where G channel gain = 1, R channel gain is 1 / R / G value in the target white balance feature values, and B channel gain is 1 / B / G value in the target white balance feature values.

[0042] The R channel gain and B channel gain are applied to the RGB values ​​of all pixels in the original image to obtain the updated RGB values ​​of the pixels, thus completing the white balance correction.

[0043] The technical solution of this embodiment not only reduces white balance correction errors in complex weather scenes and improves the accuracy of white balance correction by using reference values ​​of white balance correction parameters and calculated values ​​from the shooting device, but also eliminates the need for additional auxiliary single-spectral or multi-spectral sensors, saving overall hardware design space and facilitating the stacking design of other hardware.

[0044] The technical solution of this invention determines the current weather, and based on a pre-set white balance reference table, determines the first white balance feature value and the first correlated color temperature corresponding to the current weather data. Simultaneously, it determines the second white balance feature value and the second correlated color temperature calculated by the shooting device from the original image. Based on the first correlated color temperature, the second correlated color temperature, and the first and / or second white balance feature values, it determines the target white balance feature value, and performs white balance correction based on the target white balance feature value. This technical solution solves the problem of large errors in complex scenes when relying solely on shooting device calculations for white balance correction. By combining actual references under different weather conditions with calculation assistance from the shooting device, it improves the accuracy of white balance correction, demonstrating good applicability and effective improvement for complex scenes with large deviations.

[0045] Example 2 Figure 2This is a flowchart of a white balance correction method provided in Embodiment 2 of the present invention. Based on the above embodiments, the present invention further specifies the process of determining the target white balance characteristic value and the target correlated color temperature.

[0046] like Figure 2 As shown, the method includes: S210. Determine the current weather data, and based on the current weather data and the pre-set white balance reference table, determine the first white balance characteristic value and the first correlated color temperature.

[0047] S220. Determine the second white balance feature value and the second correlated color temperature calculated by the shooting device based on the original image.

[0048] In the above embodiments, the process of determining the first white balance characteristic value and the first correlated color temperature, as well as the process of calculating the second white balance characteristic value and the second correlated color temperature, have been specifically described, and will not be repeated here in this embodiment.

[0049] S230. Determine whether the absolute value of the difference between the first correlated color temperature and the second correlated color temperature is less than or equal to a preset threshold. If yes, execute S240; otherwise, execute S250.

[0050] This embodiment incorporates a logic for judging the difference between the correlated color temperature of the current weather scene and the correlated color temperature calculated by the shooting device. The threshold can be a pre-set fixed value or can be set separately according to different weather types. This embodiment does not impose any restrictions on this.

[0051] S240. Use the second white balance characteristic value as the target white balance characteristic value.

[0052] Understandably, when the absolute value of the difference between the first and second correlated color temperatures is less than or equal to a preset threshold, the second correlated color temperature calculated by the shooting device is considered to meet the image quality requirements of the current weather scene, and the second white balance feature value can be directly used as the target white balance feature value for white balance correction.

[0053] S250. The first white balance feature value and the second white balance feature value are weighted and fused to obtain the target white balance feature value.

[0054] When the absolute value of the difference between the first correlated color temperature and the second correlated color temperature is greater than a preset threshold, it is considered that the second correlated color temperature calculated by the shooting device cannot meet the image quality requirements of the current weather scene. In other words, the white balance correction parameter calculated by the shooting device has a large error. At this time, the reference value corresponding to the current weather scene is fused with the calculated value of the shooting device as the final white balance correction parameter.

[0055] In an optional embodiment, when performing weighted fusion, the weights of the first white balance feature value and the second white balance feature value can be preset with fixed values. For example, the weights of the first white balance feature value and the second white balance feature value are 0.6 and 0.4, respectively.

[0056] In another optional embodiment, during weighted fusion, different weights can be pre-set for the first and second white balance feature values ​​based on the weather type of the current weather data. For example, when the weather type is heavy rain, the weights for the first and second white balance feature values ​​are set to 0.8 and 0.2; when the weather type is moderate rain, the weights are set to 0.7 and 0.3; and when the weather type is light rain, the weights are set to 0.6 and 0.4.

[0057] In another optional embodiment, during weighted fusion, the weights of the first white balance feature value and the second white balance feature value can be determined based on the absolute value of the difference between the first and second correlated color temperatures. Specifically, the larger the absolute value of the difference between the first and second correlated color temperatures, the higher the weights are assigned to the first white balance feature value and the first correlated color temperature.

[0058] S260. Perform white balance correction based on the target white balance characteristic value.

[0059] The specific process of white balance correction based on the target white balance feature value has been described in the above embodiments, and will not be repeated in this embodiment.

[0060] The technical solution of this invention determines the correlated color temperature and wavelength information corresponding to the actual weather scene, and simultaneously determines the correlated color temperature, wavelength information, and white balance reference point corresponding to the simulated light source of the lightbox. Using the correlated color temperature and wavelength information as indexes, a mapping relationship is established between the weather, correlated color temperature, and white balance reference point to obtain a white balance reference table. When the shooting device is working, the current weather is determined, and the first white balance feature value and the first correlated color temperature corresponding to the current weather data are determined in the white balance reference table. At the same time, the second white balance feature value and the second correlated color temperature calculated by the shooting device based on the original image are determined. When the difference between the first correlated color temperature and the second correlated color temperature is small, the second white balance feature value calculated by the shooting device is directly used for white balance correction. When the difference between the first correlated color temperature and the second correlated color temperature is large, the first white balance feature value and the second white balance feature value are weighted and fused, and white balance correction is performed based on the fused target white balance feature value and target correlated color temperature. The technical solution of this invention solves the problem that white balance correction relying solely on the shooting device for calculation results in large errors in complex scenes. By combining actual references under different weather conditions with calculation assistance from the shooting device, the accuracy of white balance correction is improved, and it has good applicability and effective improvement effect for complex scenes with large deviations.

[0061] Example 3 Figure 3 This is a schematic diagram of a white balance correction device provided in Embodiment 3 of the present invention. Figure 3 As shown, the device includes: The first parameter determination module 310 is used to determine the current weather data and, based on the current weather data and a pre-set white balance reference table, determine the first white balance characteristic value and the first correlated color temperature. The second parameter determination module 320 is used to determine the second white balance feature value and the second correlated color temperature calculated by the shooting device based on the original image; The white balance correction module 330 is used to determine a target white balance feature value based on a first correlated color temperature, a second correlated color temperature, and a first white balance feature value and / or a second white balance feature value, and to perform white balance correction based on the target white balance feature value.

[0062] The technical solution of this invention determines the current weather, and based on a pre-set white balance reference table, determines the first white balance feature value and the first correlated color temperature corresponding to the current weather data. Simultaneously, it determines the second white balance feature value and the second correlated color temperature calculated by the shooting device from the original image. Based on the first correlated color temperature, the second correlated color temperature, and the first and / or second white balance feature values, it determines the target white balance feature value, and performs white balance correction based on the target white balance feature value. This technical solution solves the problem of large errors in complex scenes when relying solely on shooting device calculations for white balance correction. By combining actual references under different weather conditions with calculation assistance from the shooting device, it improves the accuracy of white balance correction, demonstrating good applicability and effective improvement for complex scenes with large deviations.

[0063] Optionally, based on the above embodiments, the apparatus further includes: The parameter measurement module is used to determine the correlated color temperature and wavelength information corresponding to at least two types of weather data, and to determine the correlated color temperature, wavelength information and white balance reference point corresponding to at least two types of light sources, and to determine the white balance characteristic value based on the white balance reference point. The white balance reference table setting module is used to determine the mapping relationship between weather data, correlated color temperature, and white balance characteristic values ​​based on the correlated color temperature and wavelength information corresponding to each weather data, and the correlated color temperature, wavelength information, and white balance characteristic values ​​corresponding to each light source, so as to obtain a white balance reference table.

[0064] Optionally, based on the above embodiments, the apparatus further includes: The target effect adjustment module is used to determine the target effect that matches the relevant color temperature, adjust the target effect, and redetermine the white balance feature value based on the adjusted target effect, and save the redetermined white balance feature value to the white balance reference table.

[0065] Based on the above embodiments, optionally, the white balance correction module 330 includes: The first white balance parameter determination unit is used to determine the second white balance feature value as the target white balance feature value if the absolute value of the difference between the first correlated color temperature and the second correlated color temperature is less than or equal to a preset threshold.

[0066] Based on the above embodiments, optionally, the white balance correction module 330 includes: The second white balance parameter determination unit is used to perform weighted fusion of the first white balance feature value and the second white balance feature value to obtain the target white balance feature value if the absolute value of the difference between the first correlated color temperature and the second correlated color temperature is greater than a preset threshold.

[0067] Optionally, based on the above embodiments, the apparatus further includes: The weight determination module is used to determine the weights of the first white balance feature value and the second white balance feature value based on the absolute value of the difference between the first correlated color temperature and the second correlated color temperature.

[0068] Based on the above embodiments, optionally, the white balance correction module 330 includes: The white balance correction unit is used to determine the gain result based on the target white balance characteristic value and perform white balance correction based on the gain result.

[0069] The white balance correction device provided in the embodiments of the present invention can execute the white balance correction method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the method.

[0070] Example 4 Figure 4 A schematic diagram of an electronic device 10, which can be used to implement embodiments of the present invention, is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.

[0071] like Figure 4 As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 can also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0072] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0073] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as white balance correction methods.

[0074] In some embodiments, the white balance correction method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the white balance correction method described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to perform the white balance correction method by any other suitable means (e.g., by means of firmware).

[0075] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0076] Computer programs used to implement the methods of the present invention can be written in any combination of one or more programming languages. These computer programs can be provided to the processor of a general-purpose computer, a special-purpose computer, or other programmable white balance correction device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The computer programs can be executed entirely on the machine, partially on the machine, as a standalone software package partially on the machine and partially on a remote machine, or entirely on a remote machine or server.

[0077] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0078] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0079] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or middleware components (e.g., application servers), or frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.

[0080] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.

[0081] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.

[0082] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. A white balance correction method, characterized in that, include: Determine the current weather data, and based on the current weather data and the pre-set white balance reference table, determine the first white balance characteristic value and the first correlated color temperature; The second white balance feature value and second correlated color temperature calculated by the shooting device based on the original image are determined. Based on the first correlated color temperature, the second correlated color temperature, and the first white balance feature value and / or the second white balance feature value, a target white balance feature value is determined, and white balance correction is performed based on the target white balance feature value.

2. The method according to claim 1, characterized in that, The process of setting up the white balance reference table includes: Determine the correlated color temperature and wavelength information corresponding to at least two types of weather data, and determine the correlated color temperature, wavelength information, and white balance reference point corresponding to at least two types of light sources, and determine the white balance characteristic value based on the white balance reference point; Based on the correlated color temperature and wavelength information corresponding to each weather data, and the correlated color temperature, wavelength information, and white balance characteristic values ​​corresponding to each light source, the mapping relationship between weather data, correlated color temperature, and white balance characteristic values ​​is determined, and a white balance reference table is obtained.

3. The method according to claim 2, characterized in that, After determining the mapping relationship between weather data, correlated color temperature, and white balance characteristic values, the following is also included: Determine the target effect that matches the relevant color temperature, adjust the target effect, and based on the adjusted target effect, redetermine the white balance characteristic value and save the redetermined white balance characteristic value to the white balance reference table.

4. The method according to claim 1, characterized in that, Based on the first correlated color temperature, the second correlated color temperature, and the first white balance characteristic value and / or the second white balance characteristic value, the target white balance characteristic value is determined, including: If the absolute value of the difference between the first correlated color temperature and the second correlated color temperature is determined to be less than or equal to a preset threshold, then the second white balance feature value is taken as the target white balance feature value.

5. The method according to claim 1, characterized in that, Determining the target white balance characteristic value based on the first correlated color temperature, the second correlated color temperature, and the first white balance characteristic value and / or the second white balance characteristic value, further includes: If the absolute value of the difference between the first correlated color temperature and the second correlated color temperature is greater than a preset threshold, then the first white balance feature value and the second white balance feature value are weighted and fused to obtain the target white balance feature value.

6. The method according to claim 5, characterized in that, The method further includes: The weights of the first white balance feature value and the second white balance feature value are determined based on the absolute value of the difference between the first and second correlated color temperatures.

7. The method according to any one of claims 1-6, characterized in that, White balance correction based on target white balance feature values ​​includes: Based on the target white balance characteristic value, the gain result is determined, and white balance correction is performed based on the gain result.

8. A white balance correction device, characterized in that, include: The first parameter determination module is used to determine the current weather data and, based on the current weather data and a pre-set white balance reference table, determine the first white balance characteristic value and the first correlated color temperature. The second parameter determination module is used to determine the second white balance feature value and the second correlated color temperature calculated by the shooting device based on the original image; The white balance correction module is used to determine a target white balance feature value based on a first correlated color temperature, a second correlated color temperature, and a first white balance feature value and / or a second white balance feature value, and to perform white balance correction based on the target white balance feature value.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the white balance correction method as described in any one of claims 1-7.

10. A storage medium for storing computer-executable instructions, characterized in that, The computer-executable instructions, when executed by a computer processor, are used to perform the white balance correction method as described in any one of claims 1-7.