Face white balance processing method and device, chip and computer equipment

By extracting skin color pixels from facial images and using ambient brightness and calibrated color temperature white balance parameters to determine target white balance parameters, the problem of poor white balance effect caused by inaccurate mapping relationship is solved, and more accurate white balance processing is achieved.

CN121985228APending Publication Date: 2026-05-05SPREADTRUM SEMICON (NANJING) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SPREADTRUM SEMICON (NANJING) CO LTD
Filing Date
2026-03-03
Publication Date
2026-05-05

AI Technical Summary

Technical Problem

In existing technologies, when the mapping relationship is inaccurate, the white balance processing method leads to inaccurate white balance parameters, which affects the white balance effect of face images.

Method used

By extracting skin color pixels from the face region of the image to be processed, determining the chromaticity data of the skin color pixels at the corresponding calibrated color temperature based on the ambient brightness and calibrated white balance parameters at different calibrated color temperatures, and determining the target white balance parameters based on the degree of deviation, white balance processing is performed.

Benefits of technology

The accuracy and processing effect of white balance parameters have been improved, ensuring that the chromaticity data of skin color pixels under the target white balance parameters are within the target chromaticity range, thus achieving the expected white balance effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121985228A_ABST
    Figure CN121985228A_ABST
Patent Text Reader

Abstract

The invention relates to a face white balance processing method and device, a chip and computer equipment, and the method comprises the steps: extracting skin color pixel points from a face region of a to-be-processed image; according to the calibrated white balance parameters of the ambient brightness corresponding to the to-be-processed image under different calibrated color temperatures, determining chromaticity data of the skin color pixel points under the corresponding calibrated color temperatures; determining a target white balance parameter of the skin color pixel point under the ambient brightness according to a deviation degree between the chromaticity data of the skin color pixel point under each calibration color temperature and a target chromaticity range; and performing white balance processing on the face area according to the target white balance parameter. The white balance effect can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image processing technology, and in particular to a method, apparatus, chip, and computer device for processing facial white balance. Background Technology

[0002] Currently, white balance processing involves calibrating the pixel values ​​of a skin tone card and a grayscale card under the same light source, determining the mapping relationship between these two values, and finally using this mapping to determine the white balance parameters. However, this method can lead to inaccurate white balance parameters if the mapping relationship is inaccurate, resulting in poor white balance processing of faces in images based on these parameters. Summary of the Invention

[0003] Therefore, it is necessary to provide a method, device, chip, and computer equipment for facial white balance processing that can improve the white balance effect, in response to the above-mentioned technical problems.

[0004] In a first aspect, this application provides a face white balance processing method, comprising: extracting skin color pixels from the face region of an image to be processed; determining the chromaticity data of the skin color pixels at a corresponding calibrated color temperature based on calibrated white balance parameters of the ambient brightness corresponding to the image to be processed at different calibrated color temperatures; determining the target white balance parameters of the skin color pixels at the ambient brightness based on the degree of deviation between the chromaticity data of the skin color pixels at each calibrated color temperature and the target chromaticity range; and performing white balance processing on the face region based on the target white balance parameters.

[0005] In one embodiment, determining the target white balance parameter of a skin color pixel under ambient brightness based on the degree of deviation between the chromaticity data of the skin color pixel at each calibrated color temperature and the target chromaticity range includes: determining the initial white balance parameter of the skin color pixel under ambient brightness based on the degree of deviation; and determining the target white balance parameter based on the color cast direction of the skin color pixel under the initial white balance parameter.

[0006] In one embodiment, determining the initial white balance parameters of skin-tone pixels under ambient brightness based on the degree of deviation includes: selecting a target calibration color temperature from various calibration color temperatures based on the degree of deviation; and determining the initial white balance parameters based on the target calibration color temperature; wherein the target calibration color temperature is the calibration color temperature corresponding to the target chromaticity data; and the target chromaticity data is selected based on the proximity of each chromaticity data to the boundary value in the target chromaticity range.

[0007] In one embodiment, selecting a target calibration color temperature from each calibration color temperature based on the degree of deviation includes: for each calibration color temperature, determining the color temperature weight of the skin color pixel at the calibration color temperature based on the degree of deviation corresponding to the calibration color temperature; wherein, the color temperature weight of the skin color pixel at the calibration color temperature is used to characterize the proximity of the chromaticity data of the skin color pixel at the calibration color temperature to the boundary value in the target chromaticity range; selecting a target calibration color temperature from each calibration color temperature based on the color temperature weight corresponding to each calibration color temperature; correspondingly, determining initial white balance parameters based on the target calibration color temperature includes: determining initial white balance parameters based on the target calibration color temperature and the corresponding color temperature weight.

[0008] In one embodiment, the color temperature weight corresponding to each calibrated color temperature includes a low color temperature weight and a high color temperature weight. Accordingly, determining the color temperature weight of a skin tone pixel at the calibrated color temperature based on the degree of deviation corresponding to the calibrated color temperature includes: responding to the skin tone pixel's chromaticity data at the calibrated color temperature exceeding the upper boundary value of the target chromaticity range, determining the high color temperature weight of the skin tone pixel at the calibrated color temperature based on the degree of excess, and setting the low color temperature weight of the skin tone pixel at the calibrated color temperature to a first value; responding to the skin tone pixel's chromaticity data at the calibrated color temperature exceeding the lower boundary value of the target chromaticity range, determining the low color temperature weight of the skin tone pixel at the calibrated color temperature based on the degree of excess, and setting the high color temperature weight of the skin tone pixel at the calibrated color temperature to a first value; responding to the skin tone pixel's chromaticity data at the calibrated color temperature falling within the target chromaticity range, determining that both the low color temperature weight and the high color temperature weight of the skin tone pixel at the calibrated color temperature are second values; wherein, the second value is greater than the first value.

[0009] In one embodiment, determining the target white balance parameter based on the color cast direction of the skin pixel under the initial white balance parameter includes: cascading adjustment of the light color parameter corresponding to the initial white balance parameter in the opposite direction of the color cast direction until the chromaticity data of the skin pixel under the white balance parameter corresponding to the adjusted light color parameter falls within the target chromaticity range.

[0010] In one embodiment, the light color parameters include color temperature parameters and color deviation parameters; correspondingly, the light color parameters corresponding to the initial white balance parameters are cascaded and adjusted in the opposite direction of the color deviation direction until the chromaticity data of the skin pixel point under the white balance parameters corresponding to the adjusted light color parameters falls within the target chromaticity range, including: cascading and adjusting the color temperature parameters in the opposite direction until the chromaticity data of the skin pixel point under the white balance parameters corresponding to the adjusted color temperature parameters falls within the adjacent area of ​​the target chromaticity range; and cascading and adjusting the color deviation parameters in the opposite direction until the chromaticity data of the skin pixel point under the white balance parameters corresponding to the adjusted color deviation parameters falls within the target chromaticity range.

[0011] Secondly, this application provides a face white balance processing device, comprising: a first extraction module for extracting skin color pixels from a face region of an image to be processed; a first determination module for determining the chromaticity data of the skin color pixels at a corresponding calibrated color temperature based on calibrated white balance parameters at different calibrated color temperatures corresponding to the ambient brightness of the image to be processed; a second determination module for determining the target white balance parameters of the skin color pixels at ambient brightness based on the degree of deviation between the chromaticity data of the skin color pixels at each calibrated color temperature and the target chromaticity range; and a white balance processing module for performing white balance processing on the face region based on the target white balance parameters.

[0012] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the method provided in the first aspect.

[0013] Fourthly, this application also provides a chip, including a processor and a communication interface, wherein the processor is configured to cause the chip to perform the steps of the method provided in the first aspect.

[0014] Fifthly, this application also provides a chip module, including a communication module, a power module, a storage module, and a chip, wherein: the power module is used to provide electrical energy to the chip module; the storage module is used to store data and instructions; the communication module is used for internal communication within the chip module, or for communication between the chip module and external devices; and the chip is used to perform the steps of the method provided in the first aspect above.

[0015] In a sixth aspect, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method provided in the first aspect.

[0016] In a seventh aspect, this application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the method provided in the first aspect.

[0017] The aforementioned face white balance processing method, apparatus, chip, and computer equipment extract skin color pixels from the face region of the image to be processed. Since skin color pixels are the most numerous pixels in the face region, determining the target white balance parameters based on skin color pixels can improve the accuracy of the target white balance parameters. Furthermore, because calibrated white balance parameters are pre-calibrated for different ambient brightness and color temperatures, the corresponding calibrated white balance parameters for different color temperatures at the ambient brightness of the image to be processed can be found among these calibrated white balance parameters. This ensures that the subsequently calculated calibrated white balance parameters match the ambient brightness of the image to be processed, thereby improving the accuracy of the calibrated white balance parameters. Because the accuracy of the target white balance parameters is improved, the effect of subsequent white balance processing can be enhanced. Next, the chromaticity data of the skin pixel is determined under each of the found calibrated white balance parameters. Based on the degree of deviation between each determined chromaticity data and the target chromaticity range, the target white balance parameter of the skin pixel under ambient brightness is determined to ensure that the chromaticity data of the skin pixel under the target white balance parameter is within the target chromaticity range. In this way, after white balance processing of the face area according to the target white balance parameter, the white balance processing result can achieve the expected white balance effect. Attached Figure Description

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

[0019] Figure 1 This is a flowchart illustrating a face white balance processing method in one embodiment.

[0020] Figure 2 This is a schematic diagram of the target chromaticity range in one embodiment;

[0021] Figure 3 This is a flowchart illustrating the steps for determining the target white balance parameters in one embodiment;

[0022] Figure 4 This is a flowchart illustrating the initial white balance parameter determination steps in one embodiment;

[0023] Figure 5 This is a flowchart illustrating the target calibration color temperature selection step in one embodiment;

[0024] Figure 6 This is a flowchart illustrating the steps for determining the target white balance parameters in one embodiment;

[0025] Figure 7 This is a flowchart illustrating the steps for adjusting light and color parameters in one embodiment;

[0026] Figure 8 This is a schematic diagram of the adjacent area in one embodiment;

[0027] Figure 9 This is a structural block diagram of a face white balance processing device in one embodiment;

[0028] Figure 10 This is an internal structural diagram of a computer device in one embodiment;

[0029] Figure 11 This is an internal structure diagram of a chip module in one embodiment. Detailed Implementation

[0030] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0031] It should be noted that the terms "first," "second," etc., used in this application can be used to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish the first element from the second element. The terms "comprising" and "having," and any variations thereof, used in this application, are intended to cover non-exclusive inclusion. The term "multiple" used in this application refers to two or more. The term "and / or" used in this application refers to one of the embodiments, or any combination of multiple embodiments.

[0032] In one exemplary embodiment, a facial white balance processing method is provided, see [link to relevant documentation]. Figure 1 The facial white balance processing method includes:

[0033] S110: Extract skin color pixels from the face region of the image to be processed.

[0034] Skin color pixels are the pixels representing the skin color of the face. They represent the most abundant color type of pixels in the face region. Specifically, skin color pixels can be extracted by clustering the pixels in the face region and identifying pixels whose distance from the cluster center is less than a preset distance. Of course, other methods can also be used to extract skin color pixels from the face region; these are not limited here.

[0035] In a real-world scenario, after acquiring an image frame via an image acquisition module (e.g., a camera, smartphone, etc.), a face region is identified from that frame. If the recognition score of the face region is lower than a preset threshold, or the number of face regions is zero, the face white balance processing method provided in this embodiment is not applied to that frame. Subsequent steps are only executed if the number of face regions is not zero and the recognition score of the face region is not lower than the preset threshold.

[0036] After identifying face regions with recognition scores no lower than a preset threshold, the raw image data of these face regions is acquired. Based on this raw image data, the brightness of the face regions is determined to meet the requirements: neither too dark nor too exposed, to ensure the accuracy of subsequent calculations. Once the brightness of the face regions is confirmed to meet the requirements, the skin tone pixel extraction step is performed.

[0037] The specific methods for determining whether the brightness of a face region meets the requirements can include the following two:

[0038] (1) Compare the average value of each pixel in the face region in the green channel with the first preset range. If the average value is within the first preset range, the brightness of the face region meets the requirements.

[0039] (2) Convert the data of each pixel in the face region in the RGB (R represents Red, G represents Green, and B represents Blue) channel to the data in the YCbCr (Y represents the luminance component, Cb and Cr are chrominance data, Cb represents blue chrominance data, and Cr represents red chrominance data) channel, and then compare the luminance component Y with the second preset range. If the luminance component Y is within the second preset range, then the brightness of the face region meets the requirements.

[0040] Of course, other methods can be used to determine whether the brightness of the face area meets the requirements, which are not limited here.

[0041] Before determining whether the brightness of the face region meets the requirements, the original image data of the face region can be downsampled to improve the running speed and reduce power consumption.

[0042] In practical scenarios, after extracting each skin tone pixel, the average color value of each skin tone pixel in each color channel can be calculated: the average value of each skin tone pixel in the R channel, the average value of each skin tone pixel in the G channel, and the average value of each skin tone pixel in the B channel. These three average values ​​are used as the new skin tone pixel data in the RGB channels. This new skin tone pixel replaces the individual pixels extracted from the face region in subsequent steps to reduce the computational load.

[0043] S120: Based on the calibrated white balance parameters of the ambient brightness corresponding to the image to be processed under different calibrated color temperatures, determine the chromaticity data of the skin color pixel at the corresponding calibrated color temperature.

[0044] Ambient brightness can be understood as the brightness or intensity of a light source. The ambient brightness corresponding to the image to be processed actually refers to the ambient brightness corresponding to the face region in the image to be processed. Specifically, a preset exposure algorithm can be applied to the face region in the image to be processed to obtain the ambient brightness corresponding to the face region in the image to be processed. Of course, other methods can also be used to determine the ambient brightness corresponding to the image to be processed.

[0045] Among them, the chromaticity data of skin pixels at a calibrated color temperature can be understood as the chromaticity data obtained by performing white balance processing and color channel conversion on skin pixels using the ambient brightness corresponding to the image to be processed and the calibrated white balance parameters at the calibrated color temperature.

[0046] The white balance parameters include white balance gain parameters, color conversion matrix, and brightness correction parameters. White balance gain parameters are used to process the RGB data of pixels in the image, ensuring that white objects appear white under different light sources. The color conversion matrix is ​​used to adjust the color of the white-balanced RGB data, making the image more consistent with human color perception or meeting specific color style requirements. The brightness correction parameters are used to correct the brightness of the color-adjusted RGB data, ensuring the image displays appropriate brightness on different display devices. Therefore, white balance gain processing, color adjustment, and brightness correction can improve the visual effect of an image.

[0047] The process involves pre-calibrating white balance parameters under different calibrated color temperatures and ambient brightness levels. The calibration process may include: photographing a 24-color chart at multiple calibrated ambient brightness levels and multiple calibrated color temperatures, ensuring the 24 color charts are neither overexposed nor underexposed. White balance parameters are then calibrated based on the 24 color patches of the 24-color chart at different calibrated ambient brightness levels and color temperatures. At one calibrated color temperature and different calibrated ambient brightness levels, different color conversion matrices and brightness correction parameters correspond, but a single calibrated white balance gain parameter exists.

[0048] For example, N sets of color temperatures are calibrated, and M sets of ambient brightness are calibrated, resulting in N×M sets of calibrated white balance parameters. In S120, N sets of white balance parameters corresponding to the ambient brightness of the image to be processed are found from the N×M sets of calibrated white balance parameters. Using the N sets of white balance parameters, white balance gain, color adjustment, and brightness adjustment are applied to the skin pixels sequentially to obtain N sets of RGB data for the skin pixels after visual improvement. Then, all N sets of RGB data are converted into chrominance data (i.e., CbCr data) to obtain N sets of CbCr data.

[0049] S130 determines the target white balance parameters of skin color pixels under ambient brightness based on the degree of deviation between the chromaticity data of skin color pixels at each calibrated color temperature and the target chromaticity range.

[0050] The target chromaticity range can be set according to the desired white balance effect. For example, a first target range can be set for Cb data, and a second target range can be set for Cr data. The area formed by the two target ranges can then be used as the target chromaticity range. Figure 2 In the diagram, the horizontal axis represents Cb data, and the vertical axis represents Cr data. Figure 2 The rectangular area in the diagram represents the target chromaticity range.

[0051] For example, the degree of deviation between N sets of CbCr data and the target color range is determined, resulting in N deviation degrees. Based on the N deviation degrees, the target white balance parameters for skin color pixels under ambient light are determined.

[0052] Among them, the chromaticity data of skin color pixels under the target white balance parameters are within the target chromaticity range.

[0053] S140: Perform white balance processing on the face area according to the target white balance parameters.

[0054] The target white balance parameters include: target white balance gain parameters, target color conversion matrix, and target brightness correction parameters.

[0055] The white balance processing in S140 includes: applying white balance gain processing to each pixel in the face region using the target white balance gain parameter; adjusting the color of each pixel in the face region after white balance using the target color conversion matrix; and then adjusting the brightness of each pixel in the face region after color adjustment using the target brightness correction parameter, thus achieving white balance processing for the face region.

[0056] In cases where the light sources for the face region and the background region in the image to be processed are different (i.e., the ambient brightness is different), the target white balance parameters can be fine-tuned based on factors such as the ambient brightness and / or size of the background region to obtain the fine-tuned target white balance parameters. The background region can then be white-balanced using the fine-tuned target white balance parameters.

[0057] The aforementioned facial white balance processing method extracts skin tone pixels from the face region of the image to be processed. Since skin tone pixels are the most numerous pixels in the face region, determining the target white balance parameters based on skin tone pixels can improve the accuracy of the target white balance parameters. Furthermore, because calibrated white balance parameters are pre-calibrated for different ambient brightness and color temperatures, the corresponding calibrated white balance parameters for different color temperatures at the ambient brightness of the image to be processed can be found among these calibrated white balance parameters. This ensures that the subsequently calculated calibrated white balance parameters match the ambient brightness of the image to be processed, thereby improving the accuracy of the calibrated white balance parameters. Because the accuracy of the target white balance parameters is improved, the effect of subsequent white balance processing can be enhanced. Next, the chromaticity data of the skin pixel is determined under each of the found calibrated white balance parameters. Based on the degree of deviation between each determined chromaticity data and the target chromaticity range, the target white balance parameter of the skin pixel under ambient brightness is determined to ensure that the chromaticity data of the skin pixel under the target white balance parameter is within the target chromaticity range. In this way, after white balance processing of the face area according to the target white balance parameter, the white balance processing result can achieve the expected white balance effect.

[0058] Based on the technical solution provided in the above embodiments, an optional embodiment is provided, in which the target white balance parameter determination step in S130 is refined.

[0059] See Figure 3 The detailed steps for determining the target white balance parameters include:

[0060] S310 determines the initial white balance parameters of skin color pixels under ambient brightness based on the degree of deviation.

[0061] Among them, the chromaticity data of skin color pixels under the initial white balance parameters is close to the target chromaticity range.

[0062] S320 determines the target white balance parameters based on the color cast direction of skin color pixels under the initial white balance parameters.

[0063] Among them, the chromaticity data of skin color pixels under the target white balance parameters falls within the target chromaticity range.

[0064] The color cast direction can be understood as the color cast direction of the skin pixel's chromaticity data under the initial white balance parameters relative to the target chromaticity range, such as whether it is more red or more green, more blue or more yellow.

[0065] In this embodiment, the initial white balance parameters are first determined based on the aforementioned deviation levels, and then the color cast direction of the skin color pixels under the initial white balance parameters is determined. The color cast direction provides guidance for determining the target white balance parameters. That is, the adjustment direction of the target white balance parameters can be known based on the color cast direction, so that the target white balance parameters can be determined more quickly.

[0066] Based on the technical solution provided in the above embodiments, an optional embodiment is provided, in which the initial white balance parameter determination step in S310 is refined.

[0067] See Figure 4 The detailed steps for determining the initial white balance parameters include:

[0068] S410 selects the target calibration color temperature from the various calibration color temperatures based on the degree of deviation.

[0069] The target calibration color temperature is the calibration color temperature corresponding to the target chromaticity data.

[0070] The target chromaticity data is selected based on the proximity of each chromaticity data point to the boundary values ​​within the target chromaticity range. Here, each chromaticity data point refers to the chromaticity data of skin-tone pixels under calibrated white balance parameters at different calibrated color temperatures in the ambient brightness of the image to be processed, such as the N sets of CbCr data mentioned above.

[0071] The boundary values ​​of the target chromaticity range can include an upper boundary value and a lower boundary value, for example, Figure 2 The CbCr data of the farthest point from the origin (where cb is 0 and cr is 0) within the rectangle is used as the upper boundary value, and the CbCr data of the closest point from the origin within the rectangle is used as the lower boundary value.

[0072] Specifically, among all the chromaticity data, the chromaticity data closest to the upper boundary value of the target chromaticity range, or the second closest, can be selected as the first target chromaticity data. Similarly, among all the chromaticity data, the chromaticity data closest to the lower boundary value of the target chromaticity range, or the second closest, can be selected as the second target chromaticity data.

[0073] For example, if the second group of CbCr data in N groups is closest to the upper boundary value of the target chromaticity range, and the tenth group of CbCr data in N groups is closest to the lower boundary value of the target chromaticity range, then the second group of CbCr data is taken as the first target chromaticity data, the calibration color temperature corresponding to the second group of CbCr data is taken as the first target calibration color temperature, the tenth group of CbCr data is taken as the second target chromaticity data, and the calibration color temperature corresponding to the tenth group of CbCr data is taken as the second target calibration color temperature.

[0074] S420 determines the initial white balance parameters based on the target calibrated color temperature.

[0075] For example, the initial white balance parameters are determined based on the calibration color temperature corresponding to the second group of CbCr data and the calibration color temperature corresponding to the tenth group of CbCr data as two target calibration color temperatures.

[0076] In this embodiment, the target chromaticity data is determined based on the proximity of each chromaticity data to the boundary value in the target chromaticity range. Then, the target calibrated color temperature is determined based on the target chromaticity data. Thus, the initial white balance parameters are determined based on the target calibrated color temperature. This can improve the proximity of the chromaticity data of skin-colored pixels to the target chromaticity range under the initial white balance parameters, thereby increasing the speed of subsequent determination of the target white balance parameters.

[0077] Based on the technical solution provided in the above embodiments, an optional embodiment is provided, in which the target calibration color temperature selection step in S410 is refined.

[0078] See Figure 5 The detailed steps for selecting the target calibration color temperature include:

[0079] S510 determines the color temperature weight of skin pixels at the calibrated color temperature based on the degree of deviation corresponding to the calibrated color temperature for each calibrated color temperature.

[0080] Among them, the color temperature weight of skin color pixels at the calibrated color temperature is used to characterize how close the chromaticity data of skin color pixels at the calibrated color temperature is to the boundary value in the target chromaticity range.

[0081] The degree of deviation corresponding to a calibrated color temperature can be understood as the degree of deviation between the chromaticity data of skin pixels under the ambient brightness of the image to be processed and the calibrated white balance parameters under the calibrated color temperature, and the target chromaticity range.

[0082] In one optional implementation, the color temperature weight corresponding to each calibrated color temperature includes a low color temperature weight and a high color temperature weight; correspondingly, the color temperature weight determination step in S510 includes:

[0083] (1) In response to the chromaticity data of skin pixel at the calibrated color temperature exceeding the upper boundary value of the target chromaticity range, the high color temperature weight of skin pixel at the calibrated color temperature is determined according to the degree of exceeding, and the low color temperature weight of skin pixel at the calibrated color temperature is set as the first value.

[0084] The low color temperature weight represents how close the chromaticity data of a skin pixel at the calibrated color temperature is to the lower boundary value of the target chromaticity range. The closer the chromaticity data of a skin pixel at the calibrated color temperature is to the lower boundary value of the target chromaticity range, the greater the low color temperature weight.

[0085] The high color temperature weight represents how close the chromaticity data of a skin pixel at the calibrated color temperature is to the upper boundary value of the target chromaticity range. The closer the chromaticity data of a skin pixel at the calibrated color temperature is to the upper boundary value of the target chromaticity range, the greater the high color temperature weight.

[0086] The weight for low color temperature can be denoted as W_D_low[light], and the weight for high color temperature can be denoted as W_D_high[light].

[0087] Understandably, if the chromaticity data of a skin pixel at a calibrated color temperature exceeds the upper boundary value of the target chromaticity range, that is, if the chromaticity data of a skin pixel at a calibrated color temperature is above the upper boundary value of the target chromaticity range, it indicates that the calibrated color temperature is too high.

[0088] (2) In response to the chromaticity data of skin pixel at the calibrated color temperature exceeding the lower boundary value of the target chromaticity range, the low color temperature weight of skin pixel at the calibrated color temperature is determined according to the degree of exceeding, and the high color temperature weight of skin pixel at the calibrated color temperature is set as the first value.

[0089] Understandably, if the chromaticity data of a skin color pixel at a calibrated color temperature exceeds the lower boundary value of the target chromaticity range, it indicates that the calibrated color temperature is too low.

[0090] (3) In response to the fact that the chromaticity data of the skin pixel falls within the target chromaticity range at the calibrated color temperature, the low color temperature weight and high color temperature weight of the skin pixel at the calibrated color temperature are both determined to be the second value.

[0091] Understandably, if the chromaticity data of a skin color pixel falls within the target chromaticity range at a calibrated color temperature, it indicates that the calibrated color temperature is neither too high nor too low.

[0092] The second value is greater than the first value. For example, the first value is 0 and the second value is 1. Of course, the first and second values ​​can be other values, which are not limited here.

[0093] For example, based on Figure 2 The process of determining color temperature weights may include the following steps:

[0094] S1. Determine the Euclidean distances between the upper and lower boundary values ​​of the target chromaticity range and the origin, respectively, to obtain the target Euclidean distance range [D_low, D_high]. D_low is the Euclidean distance between the lower boundary value and the origin, and D_high is the Euclidean distance between the upper boundary value and the origin. D_low is less than D_high.

[0095] S2, calculate the Euclidean distance between the N sets of CbCr data and the origin, and obtain N D_light.

[0096] S3. Determine the magnitude relationships between the N D_light values and the target Euclidean distance range [D_low, D_high], obtaining N magnitude relationships.

[0097] It can be understood that based on the magnitude relationship between a D_light and the target Euclidean distance range, the deviation degree between the CbCr data corresponding to this D_light and the target chromaticity range can be known.

[0098] S4. Based on the above N magnitude relationships, determine the N low-color-temperature weights and N high-color-temperature weights of the skin-color pixel points.

[0099] For example, for the first set of CbCr data, after calculating the Euclidean distance between the first set of CbCr data and the origin, D_light1 is obtained. According to the magnitude relationship between D_light1 and the target Euclidean distance range [D_low, D_high], the low-color-temperature weight and high-color-temperature weight of the skin-color pixel point at the calibrated color temperature corresponding to the first set of CbCr data can be determined.

[0100] When D_light1 > D_high, the high-color-temperature weight W_D_high[light1] of the skin-color pixel point at the calibrated color temperature corresponding to the first set of CbCr data is 1 / (D_light1 - D_high), and the low-color-temperature weight W_D_low[light1] is 0.

[0101] When D_light1 < D_low, the low-color-temperature weight W_D_low[light1] of the skin-color pixel point at the calibrated color temperature corresponding to the first set of CbCr data is 1 / (D_low - D_light1), and the high-color-temperature weight W_D_high[light1] is 0.

[0102] When D_light1 < D_high and D_ligh1 > D_low, the low-color-temperature weight W_D_low[light1] of the skin-color pixel point at the calibrated color temperature corresponding to the first set of CbCr data is 1, and the high-color-temperature weight W_D_high[light1] is 1.

[0103] In the above implementation, the color temperature weights are refined into low color temperature weights and high color temperature weights. For each calibrated color temperature, the low color temperature weight is determined based on how close the chromaticity data of the skin pixel at that calibrated color temperature is to the lower boundary value of the target chromaticity range, and the high color temperature weight is determined based on how close the chromaticity data of the skin pixel at that calibrated color temperature is to the upper boundary value of the target chromaticity range. This results in a system based on both low and high color temperature weights. Obtaining the low and high color temperature weights for skin pixels at each calibrated color temperature facilitates the accurate selection of the first and second target calibrated color temperatures.

[0104] S520 selects the target calibration color temperature from each calibration color temperature according to the color temperature weight corresponding to each calibration color temperature.

[0105] For example, from N low color temperature weights, the largest low color temperature weight is selected, where the chromaticity data of the skin pixel at the calibration color temperature corresponding to the largest low color temperature weight is closest to the lower boundary value of the target chromaticity range; from N high color temperature weights, the largest high color temperature weight is selected, where the chromaticity data of the skin pixel at the calibration color temperature corresponding to the largest high color temperature weight is closest to the upper boundary value of the target chromaticity range. If the calibration color temperature corresponding to the largest low color temperature weight is less than the calibration color temperature corresponding to the largest high color temperature weight, then the calibration color temperature corresponding to the largest high color temperature weight is selected as the first target calibration color temperature, and the chromaticity data of the skin pixel at the first target calibration color temperature is the first target chromaticity data; and the calibration color temperature corresponding to the largest low color temperature weight is selected as the second target calibration color temperature, and the chromaticity data of the skin pixel at the second target calibration color temperature is the second target chromaticity data.

[0106] If the calibrated color temperature corresponding to the maximum low color temperature weight is not less than the calibrated color temperature corresponding to the maximum high color temperature weight, then the second largest low color temperature weight needs to be selected from the N low color temperature weights. The chromaticity data of the skin pixel at the calibrated color temperature corresponding to the second largest low color temperature weight is closest to the lower boundary value of the target chromaticity range. Similarly, the second largest high color temperature weight needs to be selected from the N high color temperature weights. The chromaticity data of the skin pixel at the calibrated color temperature corresponding to the second largest high color temperature weight is closest to the upper boundary value of the target chromaticity range. If the second largest low color temperature weight is less than the second largest high color temperature weight, then the calibrated color temperature corresponding to the second largest high color temperature weight is selected as the first target calibrated color temperature, and the calibrated color temperature corresponding to the second largest low color temperature weight is selected as the second target calibrated color temperature.

[0107] If the weight of the second largest low color temperature is not less than the weight of the second largest high color temperature, continue searching until the weights of the low and high color temperatures satisfy the relationship between the weights, thereby determining the first target calibration color temperature and the second target calibration color temperature.

[0108] Based on the above target calibration color temperature selection steps, the initial white balance parameters in S410 include: determining the initial white balance parameters according to the target calibration color temperature and the corresponding color temperature weight.

[0109] For example, firstly, the high color temperature weights corresponding to the first target calibrated color temperature and the low color temperature weights corresponding to the second target calibrated color temperature are normalized to ensure that the sum of the high color temperature weights corresponding to the first target calibrated color temperature and the low color temperature weights corresponding to the second target calibrated color temperature is 1. Then, the first target calibrated color temperature is multiplied by the normalized high color temperature weights corresponding to the first target calibrated color temperature, and the second target calibrated color temperature is multiplied by the normalized low color temperature weights corresponding to the second target calibrated color temperature. The two products are then added together to obtain the comprehensive color temperature. Finally, the white balance parameters of the skin color pixels under the ambient brightness and comprehensive color temperature of the image to be processed are used as the initial white balance parameters.

[0110] Of course, other methods can be used to determine the initial white balance parameters, which are not limited here.

[0111] Understandably, the accuracy of the initial white balance parameters can be improved by using the target calibrated color temperature and the corresponding color temperature weight.

[0112] In this embodiment, for each calibrated color temperature, the color temperature weight of the skin pixel at the calibrated color temperature is determined based on the degree of deviation corresponding to that calibrated color temperature. Then, based on the color temperature weight corresponding to each calibrated color temperature, a target calibrated color temperature is selected from among the calibrated color temperatures. Since the color temperature weight is taken into account, and the color temperature weight reflects how close the chromaticity data of the skin pixel at the calibrated color temperature is to the boundary value in the target chromaticity range, a suitable target calibrated color temperature can be selected, thereby making the chromaticity data of the skin pixel at the target calibrated color temperature close to the target chromaticity range.

[0113] Based on the technical solution provided in the above embodiments, an optional embodiment is provided, in which the target white balance parameter determination step in S320 is refined.

[0114] See Figure 6 The detailed steps for determining the target white balance parameters include:

[0115] S610 performs cascaded adjustments on the light color parameters corresponding to the initial white balance parameters in the opposite direction of the color cast, until the chromaticity data of the skin pixel falls within the target chromaticity range under the white balance parameters corresponding to the adjusted light color parameters.

[0116] For example, if the color cast direction is reddish, the opposite direction is greenish; if the color cast direction is bluish, the opposite direction is yellowish.

[0117] Among them, the light color parameters include color temperature parameters and color deviation parameters, and of course, other parameters may also be included, which are not limited here.

[0118] In real-world scenarios, the light color parameters corresponding to the initial white balance parameters are cascaded and adjusted in the opposite direction of the color cast. After each adjustment, the chromaticity data of the skin pixel under the adjusted light color parameters is calculated, and it is determined whether the chromaticity data falls within the target chromaticity range. If it does not fall within the target chromaticity range, the light color parameters are adjusted again. If it falls within the target chromaticity range, the adjustment of the light color parameters is stopped, and the white balance parameter corresponding to the last adjusted light color parameters is taken as the target white balance parameter.

[0119] In this embodiment, the light color parameters corresponding to the initial white balance parameters are cascaded and adjusted in the opposite direction of the color cast to reduce the degree of color cast. Once the chromaticity data of the skin-tone pixels falls within the target chromaticity range under the adjusted light color parameters, no color cast is achieved. Therefore, the white balance parameter corresponding to the last adjusted light color parameters is used as the target white balance parameter, thus achieving accurate calculation of the target white balance parameter.

[0120] Based on the technical solution provided in the above embodiments, an optional embodiment is provided, in which the light color parameter adjustment step in S610 is refined.

[0121] See Figure 7 The detailed steps for adjusting light and color parameters include:

[0122] S710 adjusts the color temperature parameters in a cascaded manner in the opposite direction until the chromaticity data of the skin pixel falls within the vicinity of the target chromaticity range under the white balance parameters corresponding to the adjusted color temperature parameters.

[0123] For example, if the color cast is towards blue, the color temperature parameter is increased; if the color cast is towards yellow, the color temperature parameter is decreased, thereby reducing the degree of color cast.

[0124] See Figure 8 The adjacent region is the annular area formed by the large ring containing the upper boundary value of the target chromaticity range and the small ring containing the lower boundary value.

[0125] As can be seen, based on the cascading adjustment of color temperature parameters, the chromaticity data of skin color pixels under the white balance parameters corresponding to the adjusted color temperature parameters is adjusted to the vicinity of the target chromaticity range, thus achieving the first stage of adjustment.

[0126] S720 adjusts the color deviation parameters in a cascaded manner in the opposite direction until the chromaticity data of the skin pixel falls within the target chromaticity range under the white balance parameters corresponding to the adjusted color deviation parameters.

[0127] For example, if the color deviation direction is reddish, the color deviation parameter is decreased; if the color deviation direction is greenish, the color deviation parameter is increased, thereby reducing the degree of color deviation.

[0128] As can be seen, the cascaded adjustment of the color deviation parameter adjusts the chromaticity data of skin pixels under the white balance parameter corresponding to the adjusted color deviation parameter from the neighboring area to the target chromaticity range, thus achieving the second stage of adjustment.

[0129] In real-world scenarios, you can first cascade the color deviation parameters until the chromaticity data of skin pixels under the white balance parameters corresponding to the adjusted color deviation parameters falls within the vicinity of the target chromaticity range; then cascade the color temperature parameters until the chromaticity data of skin pixels under the white balance parameters corresponding to the adjusted color deviation parameters falls within the target chromaticity range.

[0130] Of course, you can also adjust the color temperature parameter and the color deviation parameter in turn. That is, adjust the color temperature parameter once, then adjust the color deviation parameter once, then adjust the color temperature parameter again, and so on, until the color data of the skin pixel falls within the target color range under the corresponding white balance parameter after adjustment.

[0131] In this embodiment, the color temperature parameter is first adjusted in stages until the chromaticity data of the skin tone pixels under the white balance parameter corresponding to the adjusted color temperature parameter falls within the vicinity of the target chromaticity range; then, the color deviation parameter is adjusted in stages until the chromaticity data of the skin tone pixels under the white balance parameter corresponding to the adjusted color deviation parameter falls within the target chromaticity range. It can be seen that by adjusting in stages, the target white balance parameter can be accurately and quickly determined.

[0132] It should be understood that although the steps in the flowcharts of the above embodiments are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages in other steps. It is understood that the steps in different embodiments can be freely combined as needed, and all non-contradictory solutions formed by such combinations are within the scope of protection of this application.

[0133] Based on the same inventive concept, this application also provides a facial white balance processing device for implementing the facial white balance processing method described above. This device can be applied to or integrated into a chip or chip module, for example. The solution provided by this device is similar to the implementation scheme described in the above method; therefore, the specific limitations of one or more facial white balance processing device embodiments provided below can be found in the limitations of the facial white balance processing method described above, and will not be repeated here.

[0134] In one exemplary embodiment, such as Figure 9 As shown, a facial white balance processing device is provided, comprising: a first extraction module 910, a first determination module 920, a second determination module 930, and a white balance processing module 940, wherein:

[0135] The first extraction module 910 is used to extract skin color pixels from the face region of the image to be processed;

[0136] The first determining module 920 is used to determine the chromaticity data of skin pixels at the corresponding calibrated color temperature based on the calibrated white balance parameters of the ambient brightness corresponding to the image to be processed at different calibrated color temperatures.

[0137] The second determining module 930 is used to determine the target white balance parameters of the skin color pixel under ambient brightness based on the degree of deviation between the chromaticity data of the skin color pixel at each calibrated color temperature and the target chromaticity range.

[0138] The white balance processing module 940 is used to perform white balance processing on the face area according to the target white balance parameters.

[0139] In one embodiment, the second determining module includes: a first determining submodule, configured to determine the initial white balance parameters of skin color pixels under ambient brightness based on the degree of deviation; and a second determining submodule, configured to determine the target white balance parameters based on the color cast direction of the skin color pixels under the initial white balance parameters.

[0140] In one embodiment, the first determining submodule includes: a first selecting unit, configured to select a target calibration color temperature from each calibration color temperature according to the degree of deviation; and a first determining unit, configured to determine initial white balance parameters according to the target calibration color temperature; wherein the target calibration color temperature is the calibration color temperature corresponding to the target chromaticity data; and the target chromaticity data is selected based on the proximity of each chromaticity data to the boundary value in the target chromaticity range.

[0141] In one embodiment, the first selection unit includes: a first determining subunit, configured to determine the color temperature weight of the skin tone pixel at the calibrated color temperature based on the degree of deviation corresponding to the calibrated color temperature for each calibrated color temperature; wherein the color temperature weight of the skin tone pixel at the calibrated color temperature is used to characterize the proximity of the chromaticity data of the skin tone pixel at the calibrated color temperature to the boundary value in the target chromaticity range; the first selection subunit is configured to select a target calibrated color temperature from each calibrated color temperature based on the color temperature weight corresponding to each calibrated color temperature; accordingly, the first determining unit is specifically configured to: determine the initial white balance parameters based on the target calibrated color temperature and the corresponding color temperature weight.

[0142] In one embodiment, the color temperature weight corresponding to each calibrated color temperature includes a low color temperature weight and a high color temperature weight; accordingly, the first determining subunit is specifically configured to: in response to the skin color pixel's chromaticity data exceeding the upper boundary value of the target chromaticity range at the calibrated color temperature, determine the high color temperature weight of the skin color pixel at the calibrated color temperature according to the degree of exceeding, and set the low color temperature weight of the skin color pixel at the calibrated color temperature to a first value; in response to the skin color pixel's chromaticity data exceeding the lower boundary value of the target chromaticity range at the calibrated color temperature, determine the low color temperature weight of the skin color pixel at the calibrated color temperature according to the degree of exceeding, and set the high color temperature weight of the skin color pixel at the calibrated color temperature to a first value; in response to the skin color pixel's chromaticity data falling within the target chromaticity range at the calibrated color temperature, determine that both the low color temperature weight and the high color temperature weight of the skin color pixel at the calibrated color temperature are second values; wherein, the second value is greater than the first value.

[0143] In one embodiment, the second determining submodule includes: a first adjustment unit, configured to perform cascaded adjustments on the light color parameters corresponding to the initial white balance parameters in the opposite direction of the color cast direction, until the chromaticity data of the skin color pixel points under the white balance parameters corresponding to the adjusted light color parameters fall within the target chromaticity range.

[0144] In one embodiment, the light color parameters include color temperature parameters and color deviation parameters; the first adjustment unit is specifically used to: perform cascaded adjustments on the color temperature parameters in the opposite direction until the chromaticity data of the skin color pixel point under the white balance parameter corresponding to the adjusted color temperature parameter falls within the adjacent area of ​​the target chromaticity range; and perform cascaded adjustments on the color deviation parameters in the opposite direction until the chromaticity data of the skin color pixel point under the white balance parameter corresponding to the adjusted color deviation parameter falls within the target chromaticity range.

[0145] Regarding the modules / units included in the various devices and products described in the above embodiments, they can be software modules / units, hardware modules / units, or a combination of both. For example, for various devices and products applied to or integrated into a chip, all of their modules / units can be implemented using hardware methods such as circuits, or at least some modules / units can be implemented using software programs that run on a processor integrated within the chip, while the remaining (if any) modules / units can be implemented using hardware methods such as circuits; for various devices and products applied to or integrated into a chip module, all of their modules / units can be implemented using hardware methods such as circuits, and different modules / units can be located in the same component (e.g., chip, circuit module, etc.) or different components of the chip module, or at least some modules / units can be implemented using hardware methods such as circuits. The components can be implemented using software programs that run on the processor integrated within the chip module. The remaining (if any) modules / units can be implemented using hardware methods such as circuits. For various devices and products applied to or integrated into the terminal, each of its components / units can be implemented using hardware methods such as circuits. Different modules / units can be located in the same component (e.g., chip, circuit module, etc.) or in different components within the terminal. Alternatively, at least some modules / units can be implemented using software programs that run on the processor integrated within the terminal, while the remaining (if any) modules / units can be implemented using hardware methods such as circuits.

[0146] In one exemplary embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 10As shown, the computer device includes a processor, memory, input / output interfaces, a communication interface, a display unit, and an input device. The processor, memory, and input / output interfaces are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interfaces. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The input / output interfaces are used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, Near Field Communication (NFC), or other technologies. When the computer program is executed by the processor, it implements a facial white balance processing method. The display unit is used to form a visually visible image and can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.

[0147] Those skilled in the art will understand that Figure 10 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0148] In one exemplary embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the above-described face white balance processing method.

[0149] Based on the same inventive concept, this application also provides a chip, including a processor and a communication interface; the communication interface is used to receive or send data; the processor is configured to cause the chip to perform the steps of the above-described face white balance processing method.

[0150] It is understood that the chip involved in the embodiments of this application may be a field-programmable gate array (FPGA), may be an application-specific integrated circuit (ASIC), may be a system on chip (SoC), may be a central processor unit (CPU), may be a network processor (NP), may be a digital signal processor (DSP), may be a microcontroller unit (MCU), may be a programmable logic device (PLD), or other integrated chips, etc.

[0151] Based on the same inventive concept, this application also provides a chip module, such as... Figure 11 As shown, the chip module includes a communication module, a power module, a storage module, and a chip. Specifically: the power module provides power to the chip module; the storage module stores data and instructions; the communication module enables internal communication within the chip module or communication between the chip module and external devices; and the chip corresponds to the chip in the aforementioned chip embodiment. The implementation of this chip module can be found in the relevant content of the aforementioned chip embodiment, and will not be repeated here.

[0152] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, which, when executed by a processor, implements the steps of the above-described face white balance processing method.

[0153] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps of the above-described face white balance processing method.

[0154] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.

[0155] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0156] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A method for processing facial white balance, characterized in that, include: Extract skin color pixels from the face region of the image to be processed; Based on the calibrated white balance parameters of the ambient brightness corresponding to the image to be processed under different calibrated color temperatures, determine the chromaticity data of the skin color pixel at the corresponding calibrated color temperature; Based on the degree of deviation between the chromaticity data of the skin-colored pixel at each calibrated color temperature and the target chromaticity range, the target white balance parameter of the skin-colored pixel under the ambient brightness is determined. The face region is subjected to white balance processing based on the target white balance parameters.

2. The method according to claim 1, characterized in that, The step of determining the target white balance parameter of the skin-tone pixel under the ambient brightness based on the degree of deviation between the chromaticity data of the skin-tone pixel at each calibrated color temperature and the target chromaticity range includes: Based on the degree of each deviation, the initial white balance parameters of the skin color pixel under the ambient brightness are determined; The target white balance parameter is determined based on the color cast direction of the skin-colored pixels under the initial white balance parameter.

3. The method according to claim 2, characterized in that, The step of determining the initial white balance parameters of the skin-colored pixel under the ambient brightness based on the degree of each deviation includes: Based on the degree of deviation described above, select the target calibration color temperature from the calibration color temperatures described above; Determine the initial white balance parameters based on the target calibrated color temperature; Wherein, the target calibrated color temperature is the calibrated color temperature corresponding to the target chromaticity data; the target chromaticity data is selected based on the proximity of each chromaticity data to the boundary value in the target chromaticity range.

4. The method according to claim 3, characterized in that, The step of selecting a target calibration color temperature from the calibration color temperatures based on the degree of deviation includes: For each calibrated color temperature, the color temperature weight of the skin-colored pixel at the calibrated color temperature is determined according to the degree of deviation corresponding to the calibrated color temperature; wherein, the color temperature weight of the skin-colored pixel at the calibrated color temperature is used to characterize the degree of closeness between the chromaticity data of the skin-colored pixel at the calibrated color temperature and the boundary value in the target chromaticity range. Based on the color temperature weights corresponding to each of the calibrated color temperatures, the target calibrated color temperature is selected from each of the calibrated color temperatures; Accordingly, determining the initial white balance parameters based on the target calibrated color temperature includes: The initial white balance parameters are determined based on the target calibrated color temperature and the corresponding color temperature weight.

5. The method according to claim 4, characterized in that, Each calibrated color temperature corresponds to a color temperature weight including a low color temperature weight and a high color temperature weight; correspondingly, determining the color temperature weight of the skin-tone pixel at the calibrated color temperature based on the degree of deviation corresponding to the calibrated color temperature includes: In response to the skin color pixel's chromaticity data exceeding the upper boundary value of the target chromaticity range at the calibrated color temperature, the high color temperature weight of the skin color pixel at the calibrated color temperature is determined according to the degree of excess, and the low color temperature weight of the skin color pixel at the calibrated color temperature is set to a first value. In response to the skin color pixel's chromaticity data exceeding the lower boundary value of the target chromaticity range at the calibrated color temperature, the low color temperature weight of the skin color pixel at the calibrated color temperature is determined according to the degree of excess, and the high color temperature weight of the skin color pixel at the calibrated color temperature is set to a first value. In response to the skin color pixel's chromaticity data falling within the target chromaticity range at the calibrated color temperature, the low color temperature weight and high color temperature weight of the skin color pixel at the calibrated color temperature are both determined to be a second value; wherein the second value is greater than the first value.

6. The method according to claim 2, characterized in that, The step of determining the target white balance parameters based on the color cast direction of the skin-colored pixels under the initial white balance parameters includes: In the opposite direction of the color cast, the light color parameters corresponding to the initial white balance parameters are cascaded and adjusted until the chromaticity data of the skin color pixel falls within the target chromaticity range under the white balance parameters corresponding to the adjusted light color parameters.

7. The method according to claim 6, characterized in that, The light color parameters include color temperature parameters and color deviation parameters; correspondingly, the step of cascading adjustment of the light color parameters corresponding to the initial white balance parameters in the opposite direction of the color deviation direction until the chromaticity data of the skin color pixel point under the white balance parameters corresponding to the adjusted light color parameters falls within the target chromaticity range includes: In the opposite direction, the color temperature parameters are cascaded and adjusted until the chromaticity data of the skin color pixel falls within the vicinity of the target chromaticity range under the white balance parameters corresponding to the adjusted color temperature parameters. In the opposite direction, the color deviation parameters are cascaded and adjusted until the chromaticity data of the skin-colored pixel falls within the target chromaticity range under the white balance parameters corresponding to the adjusted color deviation parameters.

8. A facial white balance processing device, characterized in that, include: The first extraction module is used to extract skin color pixels from the face region of the image to be processed; The first determining module is used to determine the chromaticity data of the skin color pixel at the corresponding calibrated color temperature based on the calibrated white balance parameters of the ambient brightness corresponding to the image to be processed at different calibrated color temperatures. The second determining module is used to determine the target white balance parameter of the skin color pixel under the ambient brightness based on the degree of deviation between the chromaticity data of the skin color pixel at each calibrated color temperature and the target chromaticity range. The white balance processing module is used to perform white balance processing on the face region according to the target white balance parameters.

9. A chip, characterized in that, The device includes a processor and a communication interface, wherein the processor is configured to cause the chip to perform the steps of the method described in any one of claims 1 to 7.

10. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 7.