Face image processing method and device, storage medium and computer equipment

By annotating key facial features and determining the scene in face image processing, and using differentiated enhancement strategies and noise reduction algorithms, the problem of low recognition accuracy and liveness detection rate under extreme lighting conditions is solved, achieving efficient image processing under different lighting conditions.

CN121838236APending Publication Date: 2026-04-10ZKTECO CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610046856.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-01-14
Publication Date
2026-04-10

AI Technical Summary

Technical Problem

Existing facial image processing methods lack scene awareness capabilities and cannot meet the dual requirements of anti-spoofing and recognition, resulting in a significant drop in recognition accuracy and liveness detection pass rate under extreme lighting conditions.

Method used

By acquiring the facial region in the face image and annotating the key points of the facial features, the brightness channel image is separated for scene determination. Differential enhancement strategies are used to perform layered correction of facial feature brightness, dynamic range compression or limit histogram equalization, and combined with the noise reduction algorithm corresponding to the scene category for processing to generate the final detection image.

Benefits of technology

It improves the recognition accuracy and liveness detection pass rate in extreme lighting conditions, ensures image quality and feature clarity, and meets the dual needs of anti-counterfeiting and recognition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121838236A_ABST
    Figure CN121838236A_ABST
Patent Text Reader

Abstract

According to the face image processing method and device, the storage medium and the computer equipment provided by the invention, after the to-be-processed face image is acquired, the face region in the face image is firstly determined, and the key points of the five sense organs are marked, so that a space coordinate basis of the key region is provided for subsequent processing; and then, a brightness channel image is separated from the face region, and the scene category of the face image is judged by quantifying the illumination distribution characteristics of the face region, so that a decision basis is provided for subsequent processing. For example, in a dark scene, five-sense-organ brightness hierarchical correction is performed to maintain skin pore-level textures while brightening; performing dynamic range compression in a strong backlight scene to balance light and shade transitions; limited histogram equalization is performed in a normal illumination scene to prevent over-sharpening or noisy explicit of the image. In addition, noise reduction processing, detail restoration and feature enhancement are sequentially carried out on the image after enhancement processing, and the finally generated image can greatly improve the recognition accuracy and the living body detection passing rate.
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 face image processing method, apparatus, storage medium and computer equipment. Background Technology

[0002] With the widespread application of facial recognition technology in security, payment, and other fields, its accuracy, security, and scene adaptability have become key indicators. Current facial image processing mainly relies on single brightness adjustment techniques, such as gamma correction, which can improve details in dark areas through nonlinear mapping, and high dynamic range (HDR) algorithms, which can balance brightness and darkness.

[0003] However, in low-light environments, the overstretching of low-grayscale regions by gamma correction leads to a surge in noise, causing image distortion. In strong backlighting scenarios, HDR algorithms over-smooth skin textures, affecting the pore-level features required for liveness detection. Using general noise reduction algorithms blurs facial features, directly reducing the recognizability of key feature points. Therefore, current face image processing methods lack scene awareness and cannot simultaneously meet the dual requirements of anti-spoofing and recognition, resulting in a significant drop in recognition accuracy and liveness detection pass rate in extreme lighting conditions. Summary of the Invention

[0004] The purpose of this application is to at least address one of the aforementioned technical deficiencies, particularly the lack of scene awareness in existing face image processing methods, which fails to meet the dual requirements of anti-spoofing and recognition, resulting in a significant decrease in recognition accuracy and liveness detection pass rate under extreme lighting conditions.

[0005] This application provides a face image processing method, the method comprising: Acquire a face image to be processed and determine the face region in the face image; the face region is marked with key facial features; A luminance channel image is separated from the face region, and a scene determination is performed on the luminance channel image to obtain the scene category of the face image; the scene category includes low light scene, strong backlight scene, and normal lighting scene; A differentiated enhancement strategy is adopted to perform facial feature brightness layer correction on the face region corresponding to the low-light scene, dynamic range compression on the face region corresponding to the strong backlight scene, and restricted histogram equalization on the face region corresponding to the normal lighting scene to obtain an enhanced image. The enhanced image is denoised using a denoising algorithm corresponding to the scene category to obtain a denoised image. The denoised image is then subjected to detail restoration and feature enhancement to generate the final detection image.

[0006] Optionally, the step of determining the scene category of the face image by analyzing the brightness channel image includes: The brightness channel image is divided into multiple pixel sub-blocks according to a preset size, and the average grayscale value of each pixel sub-block is determined. The global grayscale value of the face region and the proportion of highlight pixels, the proportion of low light pixels, and the backlight feature value corresponding to the key points of the facial features are determined based on the average grayscale values ​​of each grayscale value. If the global grayscale value is less than a preset dark light threshold and the proportion of low-light pixels is greater than a first proportion threshold, then the scene category of the face image is determined to be a dark light scene. If the global grayscale value is greater than the preset strong backlight threshold, the proportion of highlight pixels is greater than the second proportion threshold, and the backlight feature value is 1, then the scene category of the face image is determined to be a strong backlight scene. If the scene category of the face image is not a low-light scene or a strong backlight scene, then the scene category of the face image is confirmed to be a normal lighting scene.

[0007] Optionally, the step of performing facial feature brightness layering correction on the facial region corresponding to the low-light scene includes: When the scene category is a low-light scene, based on the facial key points, the brightness channel image is divided into multiple square regions, and each square region is divided into a facial core area or a non-core area. Based on the mapping coefficients of the core area and the non-core area of ​​the facial features in different grayscale ranges, the brightness of each square region is layered and mapped to obtain a brightness mapping image. Determine the global grayscale value of the face region, and determine the nonlinear adjustment coefficient based on the global grayscale value; The brightness mapping image is gamma-corrected based on the nonlinear adjustment coefficient, and the corrected brightness mapping image is merged with other channel images obtained after separating the face region.

[0008] Optionally, the dynamic range compression of the facial region corresponding to the strong backlight scene includes: When the scene category is a strong backlight scene, the brightness channel image is decomposed into a 4-layer Gaussian pyramid to obtain the top layer image; The top-level image is divided into sub-blocks, and the contrast of each sub-block is calculated based on the brightness value of each sub-block. The compression coefficient corresponding to each sub-block is determined based on each contrast ratio, and the brightness of each sub-block is compressed based on each compression coefficient to obtain a brightness compressed image. The fusion weight of each sub-block is determined based on the key points of the facial features. The luminance compressed image and the luminance channel image are then fused across layers based on the fusion weights to obtain a cross-layer fused image. A multi-level exposure fusion strategy is used to perform brightness equalization on the cross-layer fused image, and the equalized cross-layer fused image is merged with other channel images obtained after separating the face region.

[0009] Optionally, the step of restricting histogram equalization of the face region corresponding to the normal lighting scene includes: When the scene category is a normal lighting scene, determine the enhancement intensity parameter; Histogram equalization with limited contrast is performed on the face region based on the enhancement intensity parameter.

[0010] Optionally, the step of using a denoising algorithm corresponding to the scene category to denoise the enhanced image to obtain a denoised image includes: When the scene category is a low-light scene, each pixel in the enhanced image is divided into facial feature edge pixels and non-edge pixels based on the facial feature key points. Based on the noise judgment criteria of the facial feature edge pixels and the non-edge pixels, a face multi-frame noise reduction operation is performed on the enhanced image, and a bilateral filtering operation is performed on the noise-reduced enhanced image to obtain a noise-reduced image. When the scene category is a strong backlight scene, the highlight area and shadow area in the enhanced image are determined, and a dark channel prior dehazing operation is performed on the highlight area and a guided filtering operation is performed on the shadow area to obtain a noise-reduced image; When the scene category is a normal lighting scene, a Gaussian filtering operation is performed on the enhanced image to obtain a denoised image.

[0011] Optionally, the step of performing detail restoration and feature enhancement on the denoised image to generate the final detection image includes: Determine whether the scene category of the denoised image is a normal lighting scene; If so, the denoised image is directly used as the restored image; If not, when the scene category is a low-light scene, the edge gradient and morphological refinement of the facial feature edge pixels in the denoised image are performed to generate a repaired image; and when the scene category is a strong backlight scene, the skin texture in the highlight area of ​​the denoised image is transferred to the shadow area to generate a repaired image. The texture blurring region in the repaired image is determined by local binary mode, and grayscale stretching is performed on the texture blurring region in the repaired image. Then, facial feature contrast enhancement is performed on the grayscale stretched repaired image based on facial feature key points to form the final detection image.

[0012] This application also provides a face image processing apparatus, including: The region determination module is used to acquire a face image to be processed and determine the face region in the face image; the face region is marked with key facial features; The scene classification module is used to separate the brightness channel image from the face region, and to determine the scene category of the face image by judging the scene of the brightness channel image; the scene category includes low light scene, strong backlight scene and normal lighting scene; The differentiation processing module is used to employ a differentiation enhancement strategy to perform facial feature brightness layer correction on the face region corresponding to the low-light scene, dynamic range compression on the face region corresponding to the strong backlight scene, and restricted histogram equalization on the face region corresponding to the normal lighting scene, so as to obtain an enhanced image. The feature enhancement module is used to perform noise reduction processing on the enhanced image using a noise reduction algorithm corresponding to the scene category to obtain a noise-reduced image, and to perform detail restoration and feature enhancement on the noise-reduced image to generate the final detection image.

[0013] This application also provides a storage medium storing computer-readable instructions that, when executed by one or more processors, cause the one or more processors to perform the steps of the face image processing method as described in any of the above embodiments.

[0014] This application also provides a computer device, including: one or more processors, and memory; The memory stores computer-readable instructions, which, when executed by the one or more processors, perform the steps of the face image processing method as described in any of the above embodiments.

[0015] As can be seen from the above technical solutions, the embodiments of this application have the following advantages: The face image processing method, apparatus, storage medium, and computer equipment provided in this application, after acquiring a face image to be processed, can first determine the face region in the face image to accurately locate the processing range. Furthermore, the face region is marked with key facial features, providing a spatial coordinate basis for subsequent processing and preventing over-smoothing or distortion. Subsequently, a brightness channel image can be separated from the face region. By quantifying the illumination distribution characteristics of the face region, the scene category of the face image can be determined, providing a decision-making basis for subsequent processing. For example, in low-light scenes, facial feature brightness layer correction can be performed, thereby preserving skin pore-level texture while brightening; in strong backlight scenes, dynamic range compression can be performed, thereby balancing the transition between light and dark; in normal lighting scenes, limited histogram equalization can be performed, thereby preventing excessive image sharpening or noise enhancement. In addition, this application can also use a noise reduction algorithm corresponding to the scene category to perform noise reduction processing on the enhanced image to obtain a noise-reduced image; in order to take into account both anti-counterfeiting and recognition needs, the noise-reduced image can also be repaired for details and enhanced for features to generate the final detection image, which greatly improves the recognition accuracy and liveness detection pass rate. Attached Figure Description

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

[0017] Figure 1 A flowchart illustrating a face image processing method provided in an embodiment of this application; Figure 2 A flowchart illustrating a low-light scene image processing procedure provided in an embodiment of this application; Figure 3 A flowchart illustrating a strong backlight scene image processing procedure provided in this application embodiment; Figure 4 This is a schematic diagram of the structure of a face image processing device provided in an embodiment of this application; Figure 5 This is a schematic diagram of the internal structure of a computer device provided in an embodiment of this application. Detailed Implementation

[0018] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0019] In low-light environments, the overstretching of low grayscale ranges by gamma correction leads to a surge in noise, causing image distortion. In strong backlighting scenarios, HDR algorithms excessively smooth skin textures, affecting the pore-level features required for liveness detection. Using general noise reduction algorithms blurs facial features, directly reducing the recognizability of key feature points. Therefore, current facial image processing methods lack scene awareness and cannot simultaneously meet the dual requirements of anti-spoofing and recognition, resulting in a significant drop in recognition accuracy and liveness detection pass rate in extreme lighting conditions.

[0020] Based on this, this application proposes the following technical solution, which specifically includes the following: In one embodiment, such as Figure 1 As shown, Figure 1 This is a flowchart illustrating a face image processing method provided in an embodiment of this application. The present application provides a face image processing method, specifically including the following: S110: Obtain the face image to be processed and determine the face region in the face image; the face region is marked with key facial features.

[0021] In this step, after the computer device acquires the face image to be processed, it can first determine the face region in the face image to accurately locate the processing range. In addition, the face region is marked with key facial features, which can provide the spatial coordinate basis of key areas for subsequent processing and avoid excessive smoothing or distortion.

[0022] Specifically, a face image consists of a face region and a background region. To avoid background noise interfering with image processing, computer devices can use the CenterNet detection algorithm to locate the face region in the face image. Then, a key point detection algorithm is used to generate detection boxes at the locations of the facial features, and the key points of the eyes, nose tip, and corners of the mouth, as well as their coordinates, are accurately labeled. This clarifies the boundaries of the face region and local illumination-sensitive points, avoiding the mishandling of background noise in traditional global processing, and providing a spatial coordinate basis for subsequent differential enhancement.

[0023] Furthermore, after acquiring the face image, this application can further preprocess the face image to improve the quality of the image to be processed. For example, the computer device can perform geometric correction and pose normalization on the face portion of the face image, compensating for the effects of face tilt and rotation caused by different shooting angles, so that the overall structure of the face is kept in a standardized spatial position; when necessary, the image size can be scaled or cropped to meet the model input requirements and reduce interference from irrelevant backgrounds; in addition, the computer device can also convert or normalize the image color space of the face image to ensure consistency across channels in the subsequent feature extraction process.

[0024] S120: Separate the luminance channel image from the face region, and determine the scene of the luminance channel image to obtain the scene category of the face image; the scene category includes low light scene, strong backlight scene and normal lighting scene.

[0025] In this step, after the face region is determined in step S110, the computer device can separate the brightness channel image from the face region. By quantifying the illumination distribution characteristics of the face region, the scene category of the face image is determined, providing a basis for decision-making in subsequent processing.

[0026] Specifically, the computer device can convert the face region into the HSV color space to separate the luminance channel (V channel) image. Based on the characteristic that the luminance information in the luminance channel image is highly sensitive to lighting conditions, this application can more accurately capture fine-grained features such as the intensity of light, the direction of the light source, and the distribution of light and dark in the scene, thereby identifying whether there are obvious lighting anomalies such as shadows, backlighting, and strong light, and making a judgment on the scene category of the face image, such as a dark light scene, a strong backlight scene, and a normal lighting scene.

[0027] It is understandable that by separating the brightness channels and quantizing the illumination distribution, computer devices can improve the scene understanding ability of image processing, and thus automatically select the most suitable processing strategy according to different scenes, thereby improving the accuracy and stability of the image processing method of this application in various scenes.

[0028] S130: A differentiated enhancement strategy is adopted to perform facial feature brightness layer correction on the face region corresponding to low-light scenes, dynamic range compression on the face region corresponding to strong backlight scenes, and restricted histogram equalization on the face region corresponding to normal lighting scenes, so as to obtain an enhanced image.

[0029] In this step, after determining the scene category of the face image through step S120, the computer device can perform differential processing on the face image in the face image based on the scene category and adopt a differential enhancement strategy.

[0030] Specifically, for low-light scenes, computer devices can perform layered brightness correction of facial features, thereby preserving skin pore-level texture while brightening; for strong backlight scenes, computer devices can perform dynamic range compression, thereby balancing the transition between light and dark; for normal lighting scenes, computer devices can perform limited histogram equalization, thereby preventing over-sharpening of the image or the display of noise.

[0031] Understandably, by using facial feature brightness layer correction, computer equipment can address the brightness differences between facial and non-facial areas, progressively increasing the grayscale values ​​in darker areas. Through local contrast enhancement, facial images in low-light scenes can retain skin texture down to the pore level while brightening, meeting the needs of liveness detection. Through dynamic range compression, computer equipment can compress the grayscale values ​​of highlight areas, such as the cheekbone area, to avoid uneven lighting and texture blurring. At the same time, it can also increase the brightness of low-light areas, such as the eye socket area, balancing the transition between light and dark and preventing a decrease in feature recognition under backlight. By limiting histogram equalization, computer equipment can limit the contrast stretching of facial images, preventing over-sharpening or noise enhancement in normal lighting scenes, thus maintaining a natural look.

[0032] S140: The enhanced image is denoised using a denoising algorithm corresponding to the scene category to obtain a denoised image. The denoised image is then repaired for details and enhanced for features to generate the final detection image.

[0033] In this embodiment, after obtaining the enhanced image through step S130, the computer device can also use a noise reduction algorithm corresponding to the scene category to perform noise reduction processing on the enhanced image to obtain a noise-reduced image. In addition, in order to take into account both anti-counterfeiting and recognition needs, the computer device can perform detail repair and feature enhancement on the noise-reduced image to generate the final detection image, which greatly improves the recognition accuracy and liveness detection pass rate.

[0034] Specifically, by selecting appropriate denoising algorithms based on scene categories to optimize the enhanced image, clean and reliable imaging results can be achieved under different lighting and noise conditions. For example, high-sensitivity noise is more likely to occur in low-light scenes, so computer equipment can employ robust denoising methods to suppress noise in the enhanced image. In strong backlight scenes, there may be a problem of noise in bright areas mixed with texture in dark areas, so computer equipment can adopt a regional denoising strategy to process highlight areas and shadow areas separately, thereby effectively protecting the structural details of dark areas while maintaining the smoothness and naturalness of bright areas. Based on this, this application can improve image quality while avoiding the smearing effect caused by excessive denoising, keeping the edges, textures, and key parts of the face area clear.

[0035] Furthermore, to simultaneously meet the requirements of face recognition and liveness detection, computer equipment can perform further detail restoration and feature enhancement processing on the denoised images. On the one hand, by locally refining and compensating for information such as facial edge contours, wrinkle textures, and skin unevenness, slight detail loss caused by noise reduction can be repaired, making the image closer to the real shooting effect. On the other hand, by appropriately enhancing high-value feature areas such as eye features, lip lines, and nasal structure, the distinguishability of these areas during feature extraction can be improved. In person recognition scenarios, stable identity feature data can be easily captured. In liveness detection scenarios, the enhanced real skin texture, lighting change details, and subtle structural undulations can help the detection system more accurately distinguish between real faces and forged images such as photoshopped, printed, or screen-generated images, thereby significantly improving the liveness detection pass rate and anti-counterfeiting reliability.

[0036] In the above embodiments, after obtaining the face image to be processed, the face region in the face image can be determined first to accurately locate the processing range. Furthermore, the face region is marked with key facial features, providing a spatial coordinate basis for subsequent processing and preventing over-smoothing or distortion. Subsequently, a brightness channel image can be separated from the face region. By quantifying the illumination distribution characteristics of the face region, the scene category of the face image can be determined, providing a decision-making basis for subsequent processing. For example, for low-light scenes, facial feature brightness layer correction can be performed, thus preserving skin pore-level texture while brightening; for strong backlight scenes, dynamic range compression can be performed to balance the transition between light and dark; for normal lighting scenes, limited histogram equalization can be performed to prevent over-sharpening or increased noise. In addition, this application can also use a denoising algorithm corresponding to the scene category to denoise the enhanced image, obtaining a denoised image. To meet the dual requirements of anti-spoofing and recognition, detail restoration and feature enhancement can be performed on the denoised image to generate the final detection image, greatly improving the recognition accuracy and liveness detection pass rate.

[0037] In one embodiment, the process of determining the scene category of the face image by analyzing the brightness channel image in step S120 may include: S121: Divide the luminance channel image into multiple pixel sub-blocks according to a preset size, and determine the average grayscale value of each pixel sub-block.

[0038] S122: Determine the global grayscale value of the face region and the proportion of highlight pixels, the proportion of low-light pixels, and the backlight feature value corresponding to the key points of the facial features based on the average grayscale values ​​of each grayscale value.

[0039] S123: If the global grayscale value is less than the preset dark light threshold and the proportion of low-light pixels is greater than the first proportion threshold, then the scene category of the face image is determined to be a dark light scene.

[0040] S124: If the global grayscale value is greater than the preset strong backlight threshold, the proportion of highlight pixels is greater than the second proportion threshold, and the backlight feature value is 1, then the scene category of the face image is determined to be a strong backlight scene.

[0041] S125: If the scene category of the face image is not a dark scene or a strong backlight scene, then the scene category of the face image is confirmed to be a normal lighting scene.

[0042] In this embodiment, the computer device can divide the luminance channel image into multiple pixel sub-blocks according to a preset size and determine the average grayscale value of each pixel sub-block. The preset size can be adapted according to the requirements of facial detail scale. For example, this application can use 8×8 pixels for sub-block division. Subsequently, the computer device can determine the global grayscale value of the face region and the proportion of highlight pixels, low light pixels, and backlight feature values ​​corresponding to the key points of the facial features based on the average grayscale values. Then, it can determine the scene category of the face image based on these data, including low light scene, strong backlight scene, and normal lighting scene.

[0043] Specifically, for the global grayscale value, the computer device can calculate the average grayscale value of each pixel sub-block. For the highlight pixel ratio, the computer device can filter out forehead and cheekbone sub-blocks from each pixel sub-block based on facial feature key points, and calculate the proportion of sub-blocks with an average grayscale value greater than 230 in these two types of sub-blocks as the highlight pixel ratio. For the low-light pixel ratio, the computer device can filter out eye socket and nasal wing sub-blocks from each pixel sub-block based on facial feature key points, and calculate the proportion of sub-blocks with an average grayscale value less than 30 in these two types of sub-blocks as the low-light pixel ratio. For the backlight feature value, if the ratio of the number of adjacent highlight and low-light sub-blocks is greater than 1:2, the computer device can determine its backlight feature value as 1; otherwise, it is 0.

[0044] Subsequently, the computer device can establish three types of scene determination rules based on global grayscale value, highlight pixel ratio, low-light pixel ratio, and backlight feature value, thereby enabling dynamic threshold scene determination of facial images. Specifically, through a dynamic threshold update mechanism, the computer device can adjust each threshold based on the grayscale distribution histogram of the facial region after processing 100 frames of facial images, thus adapting to the characteristics of different acquisition devices. In this application, when the global grayscale value is less than 50 and the low-light pixel ratio is greater than 45%, the scene category of the facial image can be determined as a dark light scene; when the global grayscale value is greater than 180, the highlight pixel ratio is greater than 35%, and the backlight feature value is 1, the scene category of the facial image can be determined as a strong backlight scene; if the facial image does not meet the first two conditions, its scene category can be determined as a normal lighting scene.

[0045] Furthermore, when determining the scene category, the computer device can also calculate the grayscale standard deviation of each pixel sub-block. This grayscale standard deviation reflects the brightness uniformity of a single sub-block; a high standard deviation indicates a large difference in brightness within the sub-block, while a low standard deviation indicates concentrated brightness within the sub-block. Therefore, the computer device can use the grayscale standard deviation to assist in determining the scene type. For example, in a strong backlight scene, if the grayscale standard deviation of the highlight sub-block is too large, it can be further confirmed that the sub-block is a localized overexposure of highlights rather than global brightness, avoiding misjudgment.

[0046] Furthermore, computer equipment can also calculate the contrast ratio of facial features, obtained by subtracting the average grayscale values ​​of the eye sub-blocks and the eye socket sub-blocks. Since this contrast ratio is derived from the average grayscale values ​​of specific sub-blocks, it can serve as an auxiliary quantitative feature for scene lighting differences. For example, in strong backlighting scenes, the contrast ratio of facial features can accurately quantify the difference in brightness between highlight and shadow areas. The larger the difference, the more it matches the characteristics of a face with varying shades in strong backlighting, thus indirectly verifying the reliability of the backlight feature value = 1. In low-light scenes, the contrast ratio of facial features is usually extremely low. It can help confirm the judgment result that the global grayscale value is less than a preset low-light threshold and the proportion of low-light pixels is greater than a first proportion threshold, avoiding misjudging images with normal lighting but obscured facial features as low-light scenes.

[0047] In one embodiment, such as Figure 2 As shown, Figure 2 A flowchart illustrating a low-light scene image processing procedure provided in an embodiment of this application; Figure 2 In step S130, the process of performing facial feature brightness layering correction on the face area corresponding to the low-light scene may include: S1311: When the scene category is a low-light scene, based on the key points of the facial features, the brightness channel image is divided into multiple square regions, and each square region is divided into the core area or non-core area of ​​the facial features.

[0048] S1312: Based on the mapping coefficients of the core area and non-core area of ​​the facial features in different grayscale ranges, perform layered brightness mapping on each square region to obtain a brightness mapping image.

[0049] S1313: Determine the global grayscale value of the face region and determine the nonlinear adjustment coefficient based on the global grayscale value.

[0050] S1314: Perform gamma correction on the brightness mapping image based on the nonlinear adjustment coefficient, and merge the corrected brightness mapping image with other channel images obtained after separating the face region.

[0051] In this embodiment, when enhancing a face image in a low-light scene, the computer device can first divide the brightness channel image into multiple square regions based on the key points of the facial features, and then divide each square region into a core area or a non-core area of ​​the facial features. Then, based on the mapping coefficients of the core area and the non-core area of ​​the facial features in different grayscale ranges, the computer device can perform layered brightness mapping on each square region to obtain a brightness mapping image. Subsequently, the computer device can determine the nonlinear adjustment coefficient based on the global grayscale value of the face region, and then perform gamma correction on the brightness mapping image based on the nonlinear adjustment coefficient. The corrected brightness mapping image is then merged with other channel images obtained after separating the face region to obtain an enhanced image.

[0052] Specifically, when dividing the face into square regions, the computer device can use the coordinates of each key facial feature as the center and divide the luminance channel image into multiple square regions of 10×10 pixels. Each square region can then be labeled as a core area or a non-core area. For example, square regions divided around the pupil key point, covering the eyelids and iris, and square regions centered on the corner of the mouth key point, covering the lip line, can both be labeled as core facial features. Square regions divided around the face outside the core areas, including the cheeks, forehead, and jaw, can be labeled as non-core areas. It should be noted that the total area ratio of the core and non-core areas is approximately 3:7.

[0053] In layered brightness mapping, since the grayscale of the brightness channel is concentrated between 0-49 in low-light scenes, grayscale ranges and mapping coefficients can be set separately for the core and non-core areas of the facial features according to the principles of step size and differentiation coefficient. Specifically, within the five grayscale ranges [0-9, 10-19, 20-29, 30-39, 40-49], the mapping coefficients for the core areas of the facial features can be set to [3.5, 3.1, 2.8, 2.5, 2.2], while the mapping coefficients for non-core areas can be relatively lower, such as [3.0, 2.6, 2.3, 2.0, 1.7]. Based on these coefficients, layered brightness mapping can be performed on each square area to obtain a brightness-mapped image. It should be noted that the lower the grayscale, the larger the mapping coefficient, ensuring that extremely dark areas are brightened first, and the brightness of the facial features is increased preferentially.

[0054] During gamma correction, the computer device can first obtain the global grayscale values ​​of the face region. Then through Dynamically adjust the nonlinear adjustment coefficient The value, typically ranging from [0.5, 0.75], is then used by the computer to optimize contrast using non-linear grayscale stretching, performing the following steps on the layered luminance-mapped image: Correction, specifically By merging the gamma-corrected V channel (i.e., the luminance mapping image) with the H and S channels in the HSV color space and then converting it back to the RGB color space, an enhanced image with priority enhancement of facial feature brightness and global contrast optimization can be obtained, thus ensuring that facial features are clearly visible in the image.

[0055] In one embodiment, such as Figure 3 As shown, Figure 3 A flowchart illustrating a strong backlight scene image processing procedure provided in this application embodiment; Figure 3 In step S130, the process of dynamically compressing the face region corresponding to a strong backlight scene may include: S1321: When the scene category is a strong backlight scene, perform a 4-layer Gaussian pyramid decomposition on the brightness channel image to obtain the top layer image.

[0056] S1322: Divide the top-level image into sub-blocks and calculate the contrast of each sub-block using the brightness value of each sub-block.

[0057] S1323: Determine the compression coefficient corresponding to each sub-block based on each contrast ratio, and perform brightness compression on each sub-block based on each compression coefficient to obtain a brightness compressed image.

[0058] S1324: Determine the fusion weight of each sub-block based on the key points of the facial features, and perform cross-layer fusion of the luminance compressed image and the luminance channel image based on each fusion weight to obtain a cross-layer fused image.

[0059] S1325: A multi-level exposure fusion strategy is used to perform brightness equalization on the cross-layer fusion image, and the equalized cross-layer fusion image is merged with other channel images obtained after separating the face region.

[0060] In this embodiment, when enhancing a face image in a strong backlight scene, the computer device can first perform a four-layer Gaussian pyramid decomposition on the luminance channel image to obtain the top layer image. Then, the top layer image is divided into sub-blocks, and the contrast of each sub-block is calculated based on the luminance value of each sub-block. Subsequently, the compression coefficient corresponding to each sub-block can be determined based on the contrast, and the luminance of each sub-block is compressed based on the compression coefficient to obtain a luminance compressed image. Then, the computer device can determine the fusion weight of each sub-block based on the facial key points, and perform cross-layer fusion of the luminance compressed image and the luminance channel image based on the fusion weight to obtain a cross-layer fused image. A multi-level exposure fusion strategy is used to perform luminance equalization on the cross-layer fused image, and the equalized cross-layer fused image is merged with other channel images obtained after separating the face region.

[0061] Specifically, during dynamic range compression, the computer device can divide the top-level image obtained from the four-layer Gaussian pyramid decomposition into multiple sub-blocks at 8×8 pixels, and then calculate the contrast of each sub-block. The expression for calculating the contrast C can be as follows:

[0062] In the formula, This indicates the maximum brightness value of the sub-block; This represents the minimum brightness value of the sub-block; This represents the average brightness of the sub-block.

[0063] If the contrast ratio is greater than 0.6, the sub-block is considered a high-contrast sub-block, often located at the edges of facial features; if the contrast ratio is less than 0.3, the sub-block is considered a high-contrast sub-block, often located in the cheek area; if the contrast ratio is in the range of [0.3, 0.6], the sub-block is considered an unclassified sub-block. For high-contrast sub-blocks, the compression coefficient can be assigned a value of k1=0.5, indicating weak compression, which can be used to preserve edge details; for low-contrast sub-blocks, the compression coefficient can be assigned a value of k2=0.3, indicating strong compression, which can be used to suppress highlights; for unclassified sub-blocks, the compression coefficient can be assigned a value of k3=0.4. After the coefficients are assigned, the computer can perform dynamic range compression calculations. Based on the compression coefficients of each sub-block, the dynamic range compression can be calculated. Dynamic compression is used to limit the upper limit of brightness and avoid overexposure of highlights.

[0064] During image compositing, the computer device can divide the image into facial feature sub-blocks and non-facial feature sub-blocks based on facial feature key points. The fusion weight for facial feature sub-blocks is set to 0.9, and the fusion weight for non-facial feature sub-blocks is set to 0.6. The luminance-compressed image and the luminance channel image are then fused across layers to obtain a fused image. Subsequently, the computer device can generate three images based on the fused image: the original image with normal brightness, an underexposed image (-1.5EV), and an overexposed image (+1.5EV). When performing multi-level exposure fusion on these three images, for highlight areas such as the forehead, the computer device can fuse and darken the three images in a 3:4:3 ratio; for shadow areas such as the eye sockets, the computer device can fuse and brighten the three images in a 3:3:4 ratio; and for normally lit areas such as the facial features, the computer device can fuse the three images evenly. Finally, the computer device can re-merge the fused image with the H and S channels in the HSV color space and then convert it back to the RGB color space to obtain an enhanced image with balanced brightness and complete details.

[0065] In one embodiment, the process of performing restricted histogram equalization on the face region corresponding to a normal lighting scene in step S130 may include: S1331: When the scene category is a normal lighting scene, determine the enhancement intensity parameter.

[0066] S1332: Perform contrast-limited histogram equalization on the face region based on the enhancement intensity parameter.

[0067] In this embodiment, when enhancing a face image in a strong backlight scene, the computer device can use a mild CLAHE enhancement algorithm. Here, the enhancement intensity parameter can be set to 2.0, and then the enhancement intensity parameter can be used to perform histogram equalization with limited contrast on the face region to obtain an enhanced image, thereby avoiding overexposure of skin color.

[0068] In one embodiment, step S140, which involves using a denoising algorithm corresponding to the scene category to denoise the enhanced image and obtain a denoised image, may include: S141: When the scene category is a low-light scene, the pixels in the enhanced image are divided into edge pixels and non-edge pixels based on the key points of the facial features. Based on the noise judgment criteria of the edge pixels and non-edge pixels, the enhanced image is subjected to multi-frame face denoising operation, and the enhanced image after denoising is subjected to bilateral filtering operation to obtain the denoised image.

[0069] S142: When the scene category is a strong backlight scene, determine the highlight area and shadow area in the enhanced image, and perform dark channel prior dehazing operation on the highlight area and guided filtering operation on the shadow area to obtain a denoised image.

[0070] S143: When the scene category is a normal lighting scene, perform a Gaussian filter operation on the enhanced image to obtain a denoised image.

[0071] In this embodiment, in order to further improve image quality, the computer device can also select the corresponding noise reduction algorithm to reduce noise in the enhanced image based on the scene type, so as to protect the edges of facial features and skin texture, thereby adapting to the requirements of liveness detection.

[0072] Specifically, in low-light scenes, computer devices can employ multi-frame statistical denoising combined with edge protection filtering. In detail, the computer device can use the Sobel operator to detect facial features on the enhanced image and label each pixel as an edge pixel and a non-edge pixel based on the detection results. Then, it can cache multiple frames of enhanced images. For pixels at the same location in each enhanced image frame, the computer device can calculate its average grayscale value and standard deviation, and obtain the current grayscale value of that pixel in the current frame. It can then calculate the absolute difference between the current grayscale value and the average grayscale value of pixels at that location across multiple enhanced images. If the difference for edge pixels is greater than three times the standard deviation, or the difference for non-edge pixels is greater than two times the standard deviation, it can be identified as noise, and the noise in the current enhanced image frame can be replaced with the average grayscale value. After noise replacement, the computer device can also perform bilateral filtering to protect subtle textures within a small spatial range and preserve edge grayscale differences.

[0073] In strong backlighting scenes, computer equipment can combine highlight dehazing with shadow-guided filtering. Specifically, the computer equipment can first identify the highlight and shadow areas in the enhanced image; for the highlight areas, dark channel prior dehazing can be performed. This application allows setting atmospheric light A=255 and transmittance... Then calculate This avoids highlighting too dark; for shadow areas, a guided filter with a filter radius of 3 can be used for noise reduction, which can smooth noise without destroying the shadow outline.

[0074] In normally lit images, computer equipment can use a Gaussian filter with σ=1.2 to perform noise reduction on the face region in the enhanced image, thereby removing slight random noise without affecting skin texture.

[0075] In one embodiment, the process of performing detail restoration and feature enhancement on the denoised image in step S140 to generate the final detection image may include: S141: Determine whether the scene category of the denoised image is a normal lighting scene.

[0076] S142: If so, the denoised image is used directly as the repaired image.

[0077] S143: If not, when the scene category is a low-light scene, perform edge gradient and morphological refinement on the edge pixels of the facial features in the denoised image to generate a repaired image; and when the scene category is a strong backlight scene, transfer the skin texture of the highlight area in the denoised image to the shadow area to generate a repaired image.

[0078] S144: Determine the texture blurry areas in the repaired image through local binary mode, perform grayscale stretching on the texture blurry areas in the repaired image, and perform facial feature contrast enhancement on the grayscale stretched repaired image based on facial feature key points to form the final detection image.

[0079] In this embodiment, when the scene category of the denoised image is a low-light scene or a strong backlight scene, the computer device can further repair the details due to the influence of light. This includes edge gradient and morphological refinement of the facial feature edges in the low-light scene image, and transferring the skin texture in the highlight areas of the image to the shadow areas in the strong backlight scene image, thereby repairing facial features and texture details and enhancing key features for face anti-spoofing and recognition. Finally, the computer device can determine the texture blurry areas in the repaired image through local binary mode, perform grayscale stretching on the texture blurry areas in the repaired image, and perform facial feature contrast enhancement on the grayscale stretched repaired image based on facial feature key points to form the final detection image.

[0080] Specifically, in detail restoration, for low-light scenes, for blurred facial features such as eyelid contours and lip lines, computer equipment can calculate edge gradients using the Laplacian operator with a gain of 1.4, and then perform morphological refinement using 3×3 structuring elements to optimize edge sharpness; for strong backlight scenes, computer equipment can extract skin texture from surrounding normal brightness areas using the LBP operator, and use Poisson fusion to transfer the skin texture to the shadow area, thereby repairing texture loss and ensuring skin tone consistency.

[0081] Feature enhancement can include skin texture enhancement and facial feature enhancement. During skin texture enhancement, the computer can calculate the LBP variance of the facial skin region in the image using local binary mode, marking areas with an LBP variance less than 10 as texture-blurred regions. These regions can then undergo grayscale stretching from 60 to 190 to improve texture discernibility and assist in liveness detection, such as distinguishing a real face from a photograph. During facial feature enhancement, the computer can perform local contrast enhancement with a gain of 1.5 on areas such as the eyes and lips, ensuring that the grayscale difference between the pupil and iris, and between the lip line and skin, is no less than 30, thereby improving the success rate of facial feature extraction.

[0082] The face image processing apparatus provided in the embodiments of this application will be described below. The face image processing apparatus described below can be referred to in correspondence with the face image processing method described above.

[0083] In one embodiment, such as Figure 4 As shown, Figure 4This application provides a schematic diagram of the structure of a face image processing device according to an embodiment of the present application; the present application also provides a face image processing device, including a region determination module 210, a scene classification module 220, a differential processing module 230, and a feature enhancement module 240, specifically including the following: The region determination module 210 is used to acquire the face image to be processed and determine the face region in the face image; the face region is marked with key points of facial features.

[0084] The scene classification module 220 is used to separate the brightness channel image from the face region and perform scene determination on the brightness channel image to obtain the scene category of the face image; the scene categories include low light scene, strong backlight scene and normal lighting scene.

[0085] The differentiation processing module 230 is used to employ a differentiation enhancement strategy to perform facial feature brightness layer correction on the facial region corresponding to low-light scenes, dynamic range compression on the facial region corresponding to strong backlight scenes, and restricted histogram equalization on the facial region corresponding to normal lighting scenes, thereby obtaining an enhanced image.

[0086] The feature enhancement module 240 is used to perform noise reduction processing on the enhanced image using a noise reduction algorithm corresponding to the scene category to obtain a noise-reduced image, and to perform detail restoration and feature enhancement on the noise-reduced image to generate the final detection image.

[0087] In the above embodiments, after obtaining the face image to be processed, the face region in the face image can be determined first to accurately locate the processing range. Furthermore, the face region is marked with key facial features, providing a spatial coordinate basis for subsequent processing and preventing over-smoothing or distortion. Subsequently, a brightness channel image can be separated from the face region. By quantifying the illumination distribution characteristics of the face region, the scene category of the face image can be determined, providing a decision-making basis for subsequent processing. For example, for low-light scenes, facial feature brightness layer correction can be performed, thus preserving skin pore-level texture while brightening; for strong backlight scenes, dynamic range compression can be performed to balance the transition between light and dark; for normal lighting scenes, limited histogram equalization can be performed to prevent over-sharpening or increased noise. In addition, this application can also use a denoising algorithm corresponding to the scene category to denoise the enhanced image, obtaining a denoised image. To meet the dual requirements of anti-spoofing and recognition, detail restoration and feature enhancement can be performed on the denoised image to generate the final detection image, greatly improving the recognition accuracy and liveness detection pass rate.

[0088] In one embodiment, the scene classification module 220 may include: The sub-block division sub-module is used to divide the luminance channel image into multiple pixel sub-blocks according to a preset size and determine the average grayscale value of each pixel sub-block.

[0089] The feature value calculation submodule is used to determine the global gray value of the face region and the proportion of highlight pixels, the proportion of low light pixels, and the backlight feature value corresponding to the key points of the facial features based on the average gray value of each gray value.

[0090] The first scene determination submodule is used to determine the scene category of a face image as a dark scene if the global grayscale value is less than the preset dark light threshold and the proportion of low-light pixels is greater than the first proportion threshold.

[0091] The second scene determination submodule is used to determine the scene category of a face image as a strong backlight scene if the global grayscale value is greater than the preset strong backlight threshold, the proportion of highlight pixels is greater than the second proportion threshold, and the backlight feature value is 1.

[0092] The third scene determination submodule is used to confirm that the scene category of the face image is a normal lighting scene if the scene category of the face image is not a dark light scene or a strong backlight scene.

[0093] In one embodiment, the differentiation processing module 230 may include: The region segmentation submodule is used to divide the brightness channel image into multiple square regions based on facial key points when the scene category is a low-light scene, and then divide each square region into a facial core area or a non-core area.

[0094] The brightness mapping submodule is used to perform layered brightness mapping on each square region based on the mapping coefficients of the core and non-core areas of the facial features in different grayscale ranges, so as to obtain a brightness mapping image.

[0095] The coefficient determination submodule is used to determine the global grayscale value of the face region and determine the nonlinear adjustment coefficient based on the global grayscale value.

[0096] The gamma correction submodule is used to perform gamma correction on the brightness mapping image based on the nonlinear adjustment coefficient, and then merge the corrected brightness mapping image with other channel images obtained after separating the face region.

[0097] In one embodiment, the differentiation processing module 230 may further include: The image decomposition submodule is used to perform a 4-layer Gaussian pyramid decomposition on the brightness channel image when the scene category is a strong backlight scene, to obtain the top layer image.

[0098] The contrast calculation submodule is used to divide the top-level image into sub-blocks and calculate the contrast of each sub-block using the brightness value of each sub-block.

[0099] The luminance compression submodule is used to determine the compression coefficient corresponding to each sub-block based on the contrast ratio, and to perform luminance compression on each sub-block based on the compression coefficient to obtain a luminance compressed image.

[0100] The cross-layer fusion submodule is used to determine the fusion weight of each sub-block based on the key points of the facial features, and to perform cross-layer fusion of the luminance compressed image and the luminance channel image based on each fusion weight to obtain the cross-layer fused image.

[0101] The brightness equalization submodule is used to perform brightness equalization on the cross-layer fused image using a multi-level exposure fusion strategy, and then merge the equalized cross-layer fused image with other channel images obtained after separating the face region.

[0102] In one embodiment, the differentiation processing module 230 may further include: The parameter determination submodule is used to determine the enhancement intensity parameters when the scene category is a normal lighting scene.

[0103] The equalization submodule is used to perform contrast-limited histogram equalization on the face region based on the enhancement intensity parameter.

[0104] In one embodiment, the feature enhancement module 240 may include: The first noise reduction submodule is used to divide each pixel in the enhanced image into edge pixels and non-edge pixels based on the key points of the facial features when the scene category is a low-light scene. Based on the noise judgment criteria of the edge pixels and non-edge pixels, it performs multi-frame face noise reduction on the enhanced image and performs bilateral filtering on the denoised enhanced image to obtain the denoised image.

[0105] The second noise reduction submodule is used to determine the highlight and shadow regions in the enhanced image when the scene category is a strong backlight scene, and to perform dark channel prior dehazing operation on the highlight region and guided filtering operation on the shadow region to obtain a noise-reduced image.

[0106] The third noise reduction submodule is used to perform Gaussian filtering on the enhanced image to obtain a noise-reduced image when the scene category is a normal lighting scene.

[0107] In one embodiment, the feature enhancement module 240 may further include: The scene determination submodule is used to determine whether the scene category of the denoised image is a normal lighting scene.

[0108] The first repair submodule is used to directly use the denoised image as the repaired image if the condition is met.

[0109] The second repair submodule is used to perform edge gradient and morphological refinement on the edge pixels of facial features in the denoised image to generate a repaired image if the scene category is a low-light scene, and to transfer the skin texture of the highlight area in the denoised image to the shadow area to generate a repaired image if the scene category is a strong backlight scene.

[0110] The feature enhancement submodule is used to determine the texture blurry areas in the repaired image through local binary mode, perform grayscale stretching on the texture blurry areas in the repaired image, and perform facial feature contrast enhancement on the grayscale stretched repaired image based on facial feature key points to form the final detection image.

[0111] In one embodiment, this application also provides a storage medium storing computer-readable instructions that, when executed by one or more processors, cause the one or more processors to perform the steps of the face image processing method as described in any of the above embodiments.

[0112] In one embodiment, this application also provides a computer device storing computer-readable instructions that, when executed by one or more processors, cause the one or more processors to perform the steps of the face image processing method as described in any of the above embodiments.

[0113] Indicatively, such as Figure 5 As shown, Figure 5 This is a schematic diagram of the internal structure of a computer device 300 provided in an embodiment of this application. The computer device 300 can be provided as a server. (Refer to...) Figure 5 The computer device 300 includes a processing component 302, which further includes one or more processors, and memory resources represented by memory 301 for storing instructions, such as application programs, that can be executed by the processing component 302. The application programs stored in memory 301 may include one or more modules, each corresponding to a set of instructions. Furthermore, the processing component 302 is configured to execute instructions to perform the face image processing method of any of the above embodiments.

[0114] The computer device 300 may also include a power supply component 303 configured to perform power management of the computer device 300, a wired or wireless network interface 304 configured to connect the computer device 300 to a network, and an input / output (I / O) interface 305. The computer device 300 may operate on an operating system stored in memory 301, such as Windows Server™, Mac OS X™, Unix™, Linux™, Free BSD™, or similar.

[0115] Those skilled in the art will understand that Figure 5 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.

[0116] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0117] The various embodiments in this specification are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. The various embodiments can be combined as needed, and the same or similar parts can be referred to each other.

[0118] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A face image processing method, characterized in that, The method includes: Acquire a face image to be processed and determine the face region in the face image; the face region is marked with key facial features; A luminance channel image is separated from the face region, and a scene determination is performed on the luminance channel image to obtain the scene category of the face image; the scene category includes low light scene, strong backlight scene, and normal lighting scene; A differentiated enhancement strategy is adopted to perform facial feature brightness layer correction on the face region corresponding to the low-light scene, dynamic range compression on the face region corresponding to the strong backlight scene, and restricted histogram equalization on the face region corresponding to the normal lighting scene to obtain an enhanced image. The enhanced image is denoised using a denoising algorithm corresponding to the scene category to obtain a denoised image. The denoised image is then subjected to detail restoration and feature enhancement to generate the final detection image.

2. The face image processing method according to claim 1, characterized in that, The step of determining the scene category of the face image by analyzing the brightness channel image includes: The brightness channel image is divided into multiple pixel sub-blocks according to a preset size, and the average grayscale value of each pixel sub-block is determined. The global grayscale value of the face region and the proportion of highlight pixels, the proportion of low light pixels, and the backlight feature value corresponding to the key points of the facial features are determined based on the average grayscale values ​​of each grayscale value. If the global grayscale value is less than a preset dark light threshold and the proportion of low-light pixels is greater than a first proportion threshold, then the scene category of the face image is determined to be a dark light scene. If the global grayscale value is greater than the preset strong backlight threshold, the proportion of highlight pixels is greater than the second proportion threshold, and the backlight feature value is 1, then the scene category of the face image is determined to be a strong backlight scene. If the scene category of the face image is not a low-light scene or a strong backlight scene, then the scene category of the face image is confirmed to be a normal lighting scene.

3. The face image processing method according to claim 1, characterized in that, The step of performing facial feature brightness layering correction on the facial area corresponding to the low-light scene includes: When the scene category is a low-light scene, based on the facial key points, the brightness channel image is divided into multiple square regions, and each square region is divided into a facial core area or a non-core area. Based on the mapping coefficients of the core area and the non-core area of ​​the facial features in different grayscale ranges, the brightness of each square region is layered and mapped to obtain a brightness mapping image. Determine the global grayscale value of the face region, and determine the nonlinear adjustment coefficient based on the global grayscale value; The brightness mapping image is gamma-corrected based on the nonlinear adjustment coefficient, and the corrected brightness mapping image is merged with other channel images obtained after separating the face region.

4. The face image processing method according to claim 1, characterized in that, The dynamic range compression of the facial region corresponding to the strong backlight scene includes: When the scene category is a strong backlight scene, the brightness channel image is decomposed into a 4-layer Gaussian pyramid to obtain the top layer image; The top-level image is divided into sub-blocks, and the contrast of each sub-block is calculated based on the brightness value of each sub-block. The compression coefficient corresponding to each sub-block is determined based on each contrast ratio, and the brightness of each sub-block is compressed based on each compression coefficient to obtain a brightness compressed image. The fusion weight of each sub-block is determined based on the key points of the facial features. The luminance compressed image and the luminance channel image are then fused across layers based on each fusion weight to obtain a cross-layer fused image. A multi-level exposure fusion strategy is used to perform brightness equalization on the cross-layer fused image, and the equalized cross-layer fused image is merged with other channel images obtained after separating the face region.

5. The face image processing method according to claim 1, characterized in that, The step of performing restricted histogram equalization on the face region corresponding to the normal lighting scene includes: When the scene category is a normal lighting scene, determine the enhancement intensity parameter; Histogram equalization with limited contrast is performed on the face region based on the enhancement intensity parameter.

6. The face image processing method according to claim 1, characterized in that, The step of applying a noise reduction algorithm corresponding to the scene category to the enhanced image to obtain a noise-reduced image includes: When the scene category is a low-light scene, each pixel in the enhanced image is divided into facial feature edge pixels and non-edge pixels based on the facial feature key points. Based on the noise judgment criteria of the facial feature edge pixels and the non-edge pixels, a face multi-frame noise reduction operation is performed on the enhanced image, and a bilateral filtering operation is performed on the noise-reduced enhanced image to obtain a noise-reduced image. When the scene category is a strong backlight scene, the highlight area and shadow area in the enhanced image are determined, and a dark channel prior dehazing operation is performed on the highlight area and a guided filtering operation is performed on the shadow area to obtain a noise-reduced image; When the scene category is a normal lighting scene, a Gaussian filtering operation is performed on the enhanced image to obtain a denoised image.

7. The face image processing method according to claim 1, characterized in that, The step of performing detail restoration and feature enhancement on the denoised image to generate the final detection image includes: Determine whether the scene category of the denoised image is a normal lighting scene; If so, the denoised image is directly used as the restored image; If not, when the scene category is a low-light scene, the edge gradient and morphological refinement of the facial feature edge pixels in the denoised image are performed to generate a repaired image; and when the scene category is a strong backlight scene, the skin texture in the highlight area of ​​the denoised image is transferred to the shadow area to generate a repaired image. The texture blurring region in the repaired image is determined by local binary mode, and grayscale stretching is performed on the texture blurring region in the repaired image. Then, facial feature contrast enhancement is performed on the grayscale stretched repaired image based on facial feature key points to form the final detection image.

8. A face image processing device, characterized in that, include: The region determination module is used to acquire the face image to be processed and determine the face region in the face image; The facial features are marked in the facial area; The scene classification module is used to separate the brightness channel image from the face region, and to determine the scene of the face image by judging the scene of the brightness channel image. The scene categories include low-light scenes, strong backlight scenes, and normal lighting scenes; The differentiation processing module is used to employ a differentiation enhancement strategy to perform facial feature brightness layer correction on the face region corresponding to the low-light scene, dynamic range compression on the face region corresponding to the strong backlight scene, and restricted histogram equalization on the face region corresponding to the normal lighting scene, so as to obtain an enhanced image. The feature enhancement module is used to perform noise reduction processing on the enhanced image using a noise reduction algorithm corresponding to the scene category to obtain a noise-reduced image, and to perform detail restoration and feature enhancement on the noise-reduced image to generate the final detection image.

9. A storage medium, characterized in that: The storage medium stores computer-readable instructions that, when executed by one or more processors, cause the one or more processors to perform the steps of the face image processing method as described in any one of claims 1 to 7.

10. A computer device, characterized in that, include: One or more processors, and memory; The memory stores computer-readable instructions, which, when executed by the one or more processors, perform the steps of the face image processing method as described in any one of claims 1 to 7.