Dark circle detection method, electronic device, storage medium, and computer program product

By utilizing the color component difference in the LAB color space to determine dark circle information in image processing, the accuracy and efficiency problems of dark circle detection in existing technologies are solved, enabling accurate judgment of information such as the size and severity of dark circles.

CN116740779BActive Publication Date: 2026-07-07BEIJING KUANGSHI TECHNOLOGY CO LTD +1

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING KUANGSHI TECHNOLOGY CO LTD
Filing Date
2023-04-19
Publication Date
2026-07-07

AI Technical Summary

Technical Problem

Existing technologies struggle to accurately and efficiently determine the size and severity of dark circles under the eyes. Manual assessment is time-consuming and labor-intensive, while neural network-based detection methods suffer from high costs, low efficiency, and significant subjective randomness.

Method used

By acquiring the image to be processed, the target color component difference between the dark circle detection area and the cheek area is determined. The color component difference in the LAB color space is used to determine the dark circle information, including size, proportion, color depth and severity.

Benefits of technology

It achieves accurate detection of different types of dark circles, reduces the cost of manual annotation, improves detection efficiency, and overcomes the weakness of neural networks in judging irregular shapes and color depth.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116740779B_ABST
    Figure CN116740779B_ABST
Patent Text Reader

Abstract

This application provides a method, electronic device, storage medium, and computer program product for detecting dark circles under the eyes. The method includes: acquiring an image to be processed, the image containing a human face; determining a first color value of a target color component in a dark circle detection region of the image to be processed, and determining a second color value of a target color component in a cheek region, the target color components corresponding to the type of dark circles to be detected; calculating the color component difference between the first color value of the target color component in the dark circle detection region and the second color value of the target color component in the cheek region; and determining dark circle information within the dark circle detection region based on the color component difference. This solution can automatically detect dark circle information within a dark circle region and can accurately detect information such as the size and severity of dark circles.
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 more specifically to a method for detecting dark circles under the eyes, an electronic device, a storage medium, and a computer program product. Background Technology

[0002] With the rise of live streaming and short videos, people have increasingly higher demands for appearance. Accurately assessing the condition of one's dark circles, such as their size and severity, is crucial for skincare and makeup. As a direct indicator of age and the degree of aging, dark circles are receiving growing attention. To effectively improve dark circles, it's essential to accurately understand one's own dark circle characteristics.

[0003] However, accurately judging dark circles is never easy. Manual judgment requires specialized knowledge and is time-consuming, labor-intensive, and has limited efficiency. Current artificial intelligence-based neural network models also struggle to make accurate judgments on such fine-grained issues as dark circles. This is because different types of dark circles exhibit subtle color differences, which neural networks find difficult to accurately distinguish. Furthermore, the judgment of dark circle size and severity is highly subjective, and manually labeled data is inherently random, making it difficult for neural networks to accurately differentiate these parameters. Therefore, accurately and efficiently judging the condition of dark circles remains a significant challenge. Summary of the Invention

[0004] This application is made in view of the above-mentioned problems. This application provides a method for detecting dark circles under the eyes, an electronic device, a storage medium, and a computer program product.

[0005] According to one aspect of this application, a method for detecting dark circles under the eyes is provided, comprising: acquiring an image to be processed, the image to be processed containing a human face; determining a dark circle detection region and a cheek region in the image to be processed; determining a first color value of a target color component of the dark circle detection region and a second color value of a target color component of the cheek region, the target color components corresponding to the type of dark circles to be detected; calculating a color component difference between the first color value of the target color component of the dark circle detection region and the second color value of the target color component of the cheek region; and determining dark circle information within the dark circle detection region based on the color component difference, the dark circle information including one or more of the following: the size of the dark circle, the proportion of the dark circle, the color depth information of the dark circle, and the severity of the dark circle.

[0006] According to another aspect of this application, an electronic device is also provided, including a processor and a memory, wherein the memory stores computer program instructions, which are executed by the processor to perform the above-described dark circle detection method.

[0007] According to another aspect of this application, a storage medium is also provided, on which program instructions are stored, wherein the program instructions are used to execute the above-described dark circle detection method when running.

[0008] According to another aspect of this application, a computer program product is also provided, the computer program product comprising a computer program, wherein the computer program, when running, is used to perform the above-described dark circle detection method.

[0009] According to the embodiments of this application, the method, electronic device, storage medium, and computer program product for detecting dark circles under the eyes determine the dark circle information within the detection area by calculating the color component difference between the color values ​​of the target color components corresponding to the dark circle detection area and the cheek area in the image to be processed. The aforementioned target color components correspond to the type of dark circle to be detected. Therefore, the dark circle detection scheme according to the embodiments of this application can perform more targeted detection of different types of dark circles, effectively improving the accuracy of dark circle information judgment. Furthermore, the above scheme can perform dark circle detection based on quantified color features on the image, eliminating the need for manual annotation of dark circle information, effectively solving the problems of high cost, low efficiency, and high subjective randomness in methods using neural network models for dark circle detection. In addition, dark circle detection based on quantified color features on the image can overcome the weakness of neural network models in judging the size, color depth, and severity of irregular shapes like dark circles, accurately detecting the size, proportion, color depth, and severity of dark circles. Attached Figure Description

[0010] The above and other objects, features, and advantages of this application will become more apparent from the more detailed description of the embodiments of this application in conjunction with the accompanying drawings. The accompanying drawings are used to provide a further understanding of the embodiments of this application and form part of the specification. They are used together with the embodiments of this application to explain this application and do not constitute a limitation thereof. In the accompanying drawings, the same reference numerals generally represent the same components or steps.

[0011] Figure 1 A schematic block diagram of an example electronic device for implementing the dark circle detection method and apparatus according to embodiments of this application is shown;

[0012] Figure 2A schematic flowchart of a dark circle detection method according to an embodiment of this application is shown;

[0013] Figure 3 A schematic diagram showing the results of facial landmark detection according to an embodiment of this application is illustrated;

[0014] Figure 4 A schematic flowchart of a dark circle detection device according to an embodiment of this application is shown; and

[0015] Figure 5 A schematic block diagram of an electronic device according to an embodiment of this application is shown. Detailed Implementation

[0016] In recent years, significant progress has been made in research on technologies based on artificial intelligence, such as computer vision, deep learning, machine learning, image processing, and image recognition. Artificial intelligence (AI) is an emerging science and technology that studies and develops theories, methods, technologies, and application systems to simulate and extend human intelligence. AI is a comprehensive discipline involving numerous technologies, including chips, big data, cloud computing, the Internet of Things, distributed storage, deep learning, machine learning, and neural networks. Computer vision, as an important branch of AI, specifically enables machines to recognize the world. Computer vision technologies typically include facial recognition, image processing, fingerprint recognition and anti-counterfeiting verification, biometric recognition, face detection, pedestrian detection, object detection, image processing, image recognition, image semantic understanding, image retrieval, text recognition, video processing, video content recognition, 3D reconstruction, virtual reality, augmented reality, simultaneous localization and mapping (SLAM), computational photography, and robot navigation and localization. With the research and advancement of artificial intelligence technology, this technology has been applied in numerous fields, such as urban management, traffic management, building management, park management, facial recognition access control, facial recognition attendance, logistics management, warehouse management, robotics, intelligent marketing, computational photography, mobile imaging, cloud services, smart homes, wearable devices, autonomous driving, autonomous driving, smart healthcare, facial payment, facial unlocking, fingerprint unlocking, identity verification, smart screens, smart TVs, cameras, mobile internet, live streaming, beauty filters, cosmetics, medical aesthetics, and intelligent temperature measurement.

[0017] To make the objectives, technical solutions, and advantages of this application more apparent, exemplary embodiments according to this application will be described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are merely some embodiments of this application, and not all embodiments of this application. It should be understood that this application is not limited to the exemplary embodiments described herein. Based on the embodiments of this application described herein, all other embodiments obtained by those skilled in the art without inventive effort should fall within the protection scope of this application.

[0018] This application provides a method for detecting dark circles under the eyes, an electronic device, a storage medium, and a computer program product. The method for detecting dark circles according to this application can effectively detect information such as the size, proportion, color depth, and severity of dark circles. The dark circle detection technology according to this application can be applied to any field involving dark circle detection.

[0019] First, refer to Figure 1 This describes an example electronic device 100 for implementing the dark circle detection method and apparatus according to embodiments of this application.

[0020] like Figure 1 As shown, the electronic device 100 includes one or more processors 102 and one or more storage devices 104. Optionally, the electronic device 100 may also include an input device 106, an output device 108, and an image acquisition device 110, these components being interconnected via a bus system 112 and / or other forms of connection mechanisms (not shown). It should be noted that... Figure 1 The components and structure of the electronic device 100 shown are merely exemplary and not limiting; the electronic device may also have other components and structures as needed.

[0021] The processor 102 may be implemented in at least one of the following hardware forms: digital signal processor (DSP), field-programmable gate array (FPGA), programmable logic array (PLA), and microprocessor. The processor 102 may be one or a combination of several of the following: central processing unit (CPU), graphics processing unit (GPU), application-specific integrated circuit (ASIC), or other processing units with data processing capabilities and / or instruction execution capabilities. It may also control other components in the electronic device 100 to perform the desired functions.

[0022] The storage device 104 may include one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may include, for example, random access memory (RAM) and / or cache memory. The non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium, and the processor 102 may execute the program instructions to implement the client functions (implemented by the processor) in the embodiments of this application described below, and / or other desired functions. Various applications and various data may also be stored in the computer-readable storage medium, such as various data used and / or generated by the applications.

[0023] The input device 106 may be a device used by a user to input commands, and may include one or more of the following: keyboard, mouse, microphone, and touch screen.

[0024] The output device 108 can output various information (e.g., images and / or sound) to the outside (e.g., a user), and may include one or more of a display, speaker, etc. Optionally, the input device 106 and the output device 108 can be integrated together and implemented using the same interactive device (e.g., a touch screen).

[0025] The image acquisition device 110 can acquire images and store the acquired images in the storage device 104 for use by other components. The image acquisition device 110 can be a standalone camera or a camera in a mobile terminal, etc. It should be understood that the image acquisition device 110 is only an example, and the electronic device 100 may not include the image acquisition device 110. In this case, other devices with image acquisition capabilities can be used to acquire images and send the acquired images to the electronic device 100.

[0026] For example, the example electronic device used to implement the dark circle detection method and apparatus according to the embodiments of this application can be implemented on devices such as personal computers, terminal devices, time and attendance machines, panel displays, cameras, or remote servers. Terminal devices include, but are not limited to, tablet computers, mobile phones, PDAs (Personal Digital Assistants), touchscreen all-in-one machines, wearable devices, etc.

[0027] Below, we will refer to Figure 2 This application describes a method for detecting dark circles under the eyes according to an embodiment of the present application. Figure 2 A schematic flowchart of a dark circle detection method 200 according to an embodiment of this application is shown. Figure 2As shown, the dark circle detection method 200 includes the following steps S210, S220, S230, S240 and S250.

[0028] Step S210: Obtain the image to be processed, which contains a human face.

[0029] The image to be processed can be an original image acquired by an image acquisition device (such as the image acquisition device 110 described above), or an image obtained after preprocessing the original image acquired by the image acquisition device. Preprocessing may include normalization, scaling, smoothing, and other processing. Preprocessing may also include the operation of extracting a portion of the image containing a face from the original image acquired by the image acquisition device to obtain the image to be processed.

[0030] The image to be processed can come from an external device and be transmitted to the electronic device 100 for dark circle detection. Alternatively, the image to be processed can also be acquired by the electronic device 100 itself. For example, the electronic device 100 can use an image acquisition device 110 (e.g., a separate camera) to acquire the image to be processed. The image acquisition device 110 can then transmit the acquired image to the processor 102 for dark circle detection.

[0031] Step S220: Determine the dark circle detection area and cheek area in the image to be processed.

[0032] The dark circle detection area is the region used to detect dark circle information contained therein, and it can be a portion of facial skin located below either eye. The cheek area is the facial skin region located on either side of the nose and below the eye. The dark circle detection area and the cheek area may overlap at least partially, and the area of ​​the dark circle detection area may be smaller than the area of ​​the cheek area. It can be understood that the face has its own corresponding dark circle detection area and cheek area on the left and right sides, respectively. The cheek area and dark circle detection area determined in step S220 are mutually corresponding, located on the same side of the face. For example, it can be a left dark circle detection area located on the left side of the face (i.e., below the left eye) and its corresponding left cheek area, or a right dark circle detection area located on the right side of the face (i.e., below the right eye) and its corresponding right cheek area.

[0033] For example, any suitable existing or future facial region recognition network model can be used end-to-end to determine the dark circle detection region and / or cheek region in the image to be processed. Exemplarily, and not limitingly, the facial region recognition network model can be implemented using an image segmentation network. For example, the facial region recognition network model can be implemented using one or more of the following networks: Fully Convolutional Networks (FCN), U-shaped networks (Unet), DeepLab series, V-shaped networks (Vnet), etc. For example, keypoint detection can also be performed on the image to be processed to determine facial keypoints, and then the dark circle detection region and / or cheek region can be segmented based on these facial keypoints.

[0034] Step S230: Determine the first color value of the target color component in the dark circle detection area and the second color value of the target color component in the cheek area. The target color component corresponds to the type of dark circle to be detected.

[0035] Dark circles under the eyes can be categorized into different types, such as pigmented dark circles and vascular dark circles. Different types of dark circles exhibit different colors; therefore, different target color components can be used to detect different types of dark circles. After determining the type of dark circle to be detected, the target color component corresponding to that type can be used for detection. For example, if it is determined that pigmented dark circles are to be detected, dark brown can be used as the target color component; if it is determined that vascular dark circles are to be detected, blue-purple can be used as the target color component. Exemplarily, the type of dark circle to be detected can be a default value. For example, for any acquired image to be processed, pigmented dark circles can be detected by default, or vascular dark circles can be detected by default, or both pigmented and vascular dark circles can be detected by default. Exemplarily, the type of dark circles to be detected can be specified by the user. For example, the user can input type information into the electronic device 100 through the input device 106 to specify the type of dark circles to be detected. When the dark circles to be detected include two or more types of dark circles, the dark circle detection method 200 described herein can be performed separately for each type of dark circle, or at least steps S230 to S250 can be performed separately for each type of dark circle.

[0036] For example, the target color component can be a single-channel color component corresponding to any color space such as RGB, LAB, or HSV, or a composite color component determined based on at least two single-channel color components from the aforementioned color spaces. Preferably, the target color component can be a composite color component determined based on the single-channel color components corresponding to the LAB color space. The LAB color space can be divided into L channels, A channels, and B channels, each with its own corresponding single-channel color components, namely L, A, and B components. In the LAB color space, the dark circle detection area and the cheek area can each contain corresponding L, A, and B components. The L component represents brightness, with a value range of [0, 100]. The A component represents the transition from green to red, with a value range of [-128, 127] or [0, 255]. The B component represents the transition from blue to yellow, with a value range of [-128, 127] or [0, 255]. The color value of the target color component can be determined by any two or more of the L component, A component, and B component.

[0037] Step S240: Calculate the color component difference between the first color value of the target color component in the dark circle detection area and the second color value of the target color component in the cheek area.

[0038] By way of example, and not limitation, the first color value of the target color component in the dark circle detection region can refer to the color value of the target color component of each pixel in the dark circle detection region, while the second color value of the target color component in the cheek region can be the overall color value obtained by combining the color values ​​of the target color components of each pixel in the cheek region. That is, the second color value of the target color component in the cheek region can be a single, combined color value that represents the magnitude of the target color component in the entire cheek region (which can be called the reference color value). The color values ​​of the target color components of each pixel in the dark circle detection region can be compared with the aforementioned reference color value to determine whether each pixel within the dark circle belongs to the dark circle to be detected, thereby determining the dark circle information within the dark circle detection region. For example, the target color component can be represented as an X component. The color component difference delta1 between the color value of the X component of each pixel in the dark circle detection region and the second color value of the X component in the cheek region can be calculated. Subsequently, dark circle information can be determined based on this color component difference. In one embodiment, the second color value of the X component in the cheek region can be determined by calculating the arithmetic mean, weighted average, etc., of the color values ​​of the X components corresponding to each pixel in the cheek region. Optionally, similar to the cheek region, a first color value of the target color component of the dark circle detection region can be obtained by synthesizing the color values ​​of the target color components of each pixel in the dark circle detection region. Dark circle information can be determined by calculating the color component difference between the first color value of the target color component of the dark circle detection region and the second color value of the target color component of the cheek region. For example, in this case, if the color component difference is greater than a certain target threshold, it can be determined that a dark circle exists in the dark circle detection region; otherwise, it is determined that no dark circle exists in the dark circle detection region. In this case, the dark circle information can include information about whether a dark circle exists in the dark circle detection region.

[0039] Step S250: Based on the color component difference, determine the dark circle information within the dark circle detection area. The dark circle information may include one or more of the following: the size of the dark circle, the proportion of the dark circle, the color depth of the dark circle, and the severity of the dark circle.

[0040] For example, based on the obtained color component difference value delta1, information about dark circles within the dark circle detection area can be determined. For instance, the dark circle region can be determined based on the color component difference value delta1 corresponding to each pixel within the dark circle detection area. Based on the determined dark circle region, the size, proportion, color depth, and severity of the dark circle can be obtained. For example, the size of the dark circle can be represented by its area.

[0041] For example, steps S230 to S250 can be executed in parallel for different types of dark circles. Alternatively, steps S230 to S250 can be executed for one type of dark circle before executing steps S230 to S250 for the next type. Of course, steps S230 to S250 can also have other reasonable execution orders, which are not limited in this document.

[0042] During image acquisition, significant variations in exposure, background, brightness, and facial orientation can introduce environmental noise into the color representation of the face. For example, lower ambient brightness can cause the dark circle area to appear darker, while overexposure can introduce reflective noise. Furthermore, the facial orientation can cause shadows to affect the dark circle area on one side. If only the target color component within the dark circle detection area is used to determine dark circle information, the differences in environmental noise across different images can drastically impact the accuracy of the detection results. However, determining dark circle information based on color component differences avoids the influence of environmental noise. Because environmental noise during acquisition has a similar effect on the dark circle and cheek areas on the same side, the difference in the color values ​​of the corresponding target color components effectively characterizes the depth of the dark circle relative to normal skin color, effectively eliminating environmental noise. In other words, environmental noise has virtually no impact on the magnitude of the color component difference between the dark circle and cheek areas. Therefore, this detection method provides more accurate dark circle information.

[0043] According to the dark circle detection method of this application, the dark circle information within the dark circle detection area is determined by calculating the color component difference between the color values ​​of the target color components corresponding to the dark circle detection area and the cheek area in the image to be processed. The aforementioned target color components correspond to the type of dark circle to be detected. Therefore, the dark circle detection scheme according to the embodiments of this application can perform more targeted detection of different types of dark circles, effectively improving the accuracy of dark circle information judgment. Furthermore, the above scheme can perform dark circle detection based on quantified color features on the image, eliminating the need for manual annotation of dark circle information, effectively solving the problems of high cost, low efficiency, and high subjective randomness in methods using neural network models for dark circle detection. In addition, dark circle detection based on quantified color features on the image can overcome the weakness of neural network models in judging the size, color depth, and severity of irregular shapes like dark circles, accurately detecting the size, proportion, color depth, and severity of dark circles.

[0044] For example, the dark circle detection method according to the embodiments of this application can be implemented in a device, apparatus or system having a memory and a processor.

[0045] The dark circle detection method according to the embodiments of this application can be deployed at the image acquisition end, for example, at a personal terminal or a server.

[0046] Alternatively, the dark circle detection method according to the embodiments of this application can also be deployed distributedly on a server (or cloud) and at a personal terminal. For example, an image can be acquired on the client side, and the client can transmit the acquired image to the server (or cloud) side for dark circle detection.

[0047] For example, determining a first color value of the target color component of the dark circle detection region and a second color value of the target color component of the cheek region may include: converting the pixel values ​​of each pixel in the dark circle detection region to the LAB color space to obtain the L component, A component, and B component of each pixel in the dark circle detection region; determining the color value of the target color component of each pixel in the dark circle detection region based on at least a portion of the L component, A component, and B component of each pixel in the dark circle detection region, as the first color value of the target color component of the dark circle detection region; converting the pixel values ​​of each pixel in the cheek region to the LAB color space to obtain the L component, A component, and B component of each pixel in the cheek region; determining the color value of the target color component of each pixel in the cheek region based on at least a portion of the L component, A component, and B component of each pixel in the cheek region; and determining the color average of the color values ​​of the target color component of each pixel in the cheek region as the second color value of the target color component of the cheek region.

[0048] By way of example, but not limitation, the `cv.cvtColor` and `cv.inRange` functions from the OpenCV library can be used to convert the pixel values ​​of each pixel within the dark circle detection area to the LAB color space to obtain the L, A, and B components of each pixel within the dark circle detection area, i.e., to obtain the color values ​​corresponding to the L, A, and B components of each pixel within the dark circle detection area. Subsequently, the color values ​​of the target color components of each pixel within the dark circle detection area can be determined based on at least a portion of the L, A, and B components (i.e., based on the color values ​​of at least a portion of the L, A, and B components of each pixel). The color values ​​of the target color components corresponding to each pixel within the dark circle detection area are then used as the first color values ​​of the target color components of the dark circle detection area.

[0049] Using a method similar to that described in the previous embodiments, the pixel values ​​of each pixel within the cheek region can be converted to the LAB color space to obtain the color values ​​corresponding to the L, A, and B components of each pixel within the cheek region. Furthermore, the color value of the target color component of each pixel can be determined based on at least a portion of the L, A, and B components of each pixel within the cheek region (i.e., based on the color values ​​of at least a portion of the L, A, and B components of each pixel within the cheek region), thereby determining the second color value of the target color component of the cheek region. For example, the second color value of the target color component of the cheek region can be determined by calculating an arithmetic mean or a weighted average of the color values ​​of the target color components of each pixel within the cheek region.

[0050] Generally, dark circles under the eyes are divided into pigmented dark circles and vascular dark circles. Both types have distinct color characteristics; for example, pigmented dark circles appear distinctly dark brown, while vascular dark circles appear distinctly bluish-purple. The perception of color depth is highly subjective and random. People often perceive the depth of dark circles by comparing them to the surrounding skin color. The most obvious contrast is with the cheeks, which generally have a normal skin color. The darker the dark circles, the greater the visual difference between them and the cheek area. However, the common RGB color space does not have a uniform distribution of chromaticity; changes in the R, G, and B channel values ​​do not produce equivalent visually perceived changes in R, G, and B colors. Therefore, this embodiment of the invention uses the LAB color space to represent the image. The L, A, and B channels all have clear physical meaning in visual perception. Therefore, the LAB color space can be used to construct a specific color component (i.e., the target color component). For example, for pigmented dark circles, it could be dark brown, while for vascular dark circles, it could be bluish-purple. After constructing the target color component, the depth of the dark circle in a specific color can be determined by the color value of the target color component.

[0051] In one embodiment, the color value of the target color component of each pixel in the cheek area can be obtained using the formula... or Calculate the average, such as the arithmetic mean or weighted average, and use the calculated average as the second color value of the target color component in the cheek region. Color_cheek represents the color value of the target color component (i.e., the target color component corresponding to pigmented dark circles) of each pixel in the cheek area when detecting pigmented dark circles. pig This represents the second color value of the target color component in the cheek area when detecting pigmented dark circles. Color_cheek represents the color value of the target color component (i.e., the target color component corresponding to vascular dark circles) of each pixel in the cheek area when detecting vascular dark circles. vas This represents the second color value of the target color component in the cheek region when detecting vascular dark circles. The second color value of the target color component in the cheek region is obtained by averaging the color values ​​of the target color components of each pixel within the cheek region. This method can effectively reduce the error when judging the second color value of the target color component in the cheek region.

[0052] According to the above technical solution, by converting the pixel values ​​of each pixel in the dark circle detection area and the cheek area to the LAB color space, the first color value of the target color component of each pixel in the dark circle detection area and the second color value of the target color component in the cheek area are determined. As mentioned above, the target color component constructed using the color components of the LAB color space can more closely approximate the visual effect of dark circle color perceived by the human eye. Therefore, using this target color component can more accurately determine dark circle information.

[0053] For example, if the dark circles are pigmented dark circles, determining the color value of the target color component of each pixel in the dark circle detection area based on at least a portion of the L, A, and B components of each pixel in the dark circle detection area may include: for any pixel in the dark circle detection area, using a first color mapping formula, determining the color value of the target color component of that pixel based on the L and B components of that pixel; determining the color value of the target color component of each pixel in the cheek area based on at least a portion of the L, A, and B components of each pixel in the cheek area may include: for any pixel in the cheek area, using a first color mapping formula, determining the color value of the target color component of that pixel based on the L and B components of that pixel; wherein, in the first color mapping formula, the color value of the target color component is positively correlated with the B component and negatively correlated with the L component.

[0054] In one embodiment, if the dark circles are pigmented dark circles, for any (or every) pixel within the dark circle detection area, the color value of the target color component of that pixel can be determined based on its L and B components using a first color mapping formula. The color value of the target color component is positively correlated with the B component and negatively correlated with the L component. As described above, pigmented dark circles can be detected by constructing a dark brown color component. The color value of the dark brown color component can be positively correlated with the B component and negatively correlated with the L component. Therefore, using the corresponding first color mapping formula, the color value of the target color component representing the dark brown can be determined relatively accurately, facilitating a more accurate subsequent determination of the distribution of pigmented dark circles.

[0055] For example, in the first color mapping formula, the color value of the target color component can be calculated by linearly combining the L component and the B component. For instance, the first color mapping formula could be: color pig = k1*b - k2*l; where, color pig This represents the color value of the target color component, where b represents the B component and l represents the L component. For the dark circle detection area, color... pig It can be represented as For the cheek area, color pig It can be represented as This formula is merely an example. For instance, both k1 and k2 are positive constants, and the ratio between them can range from 0.5 to 2. For example, if k1 = k2, the first color mapping formula is expressed as: color pig =bl.

[0056] Similarly, using the first color mapping formula described above, the color value of the target color component of any (or every) pixel within the cheek area can be determined. For simplicity, this will not be elaborated further here.

[0057] According to the above technical solution, the color values ​​of the target color components corresponding to each pixel in the dark circle detection area and the cheek area are obtained by using the first color mapping formula. This method can accurately determine the color values ​​of the target color components used to represent pigmented dark circles, which are consistent with the user's visual perception effect and help improve the detection accuracy of pigmented dark circles.

[0058] For example, if the dark circles are vascular dark circles, determining the color value of the target color component of each pixel in the dark circle detection area based on at least some of the L, A, and B components of each pixel in the dark circle detection area may include: for any pixel in the dark circle detection area, using a second color mapping formula, determining the pixel value of the target color component of that pixel based on the B and A components of that pixel; determining the color value of the target color component of each pixel in the cheek area based on at least some of the L, A, and B components of each pixel in the cheek area may include: for any pixel in the cheek area, using a second color mapping formula, determining the color value of the target color component of that pixel based on the B and A components of that pixel; wherein, in the second color mapping formula, the color value of the target color component is negatively correlated with the B component and positively correlated with the A component.

[0059] In one embodiment, if the dark circles are vascular dark circles, for any (or every) pixel within the dark circle detection area, the color value of the target color component of that pixel can be determined based on its B and A components using a second color mapping formula. In this second color mapping formula, the color value of the target color component is negatively correlated with the B component and positively correlated with the A component. As mentioned above, vascular dark circles can be detected by constructing a blue-purple color component. The color value of the blue-purple color component can be negatively correlated with the B component and positively correlated with the A component. Therefore, using the corresponding second color mapping formula, the color value of the target color component representing blue-purple can be determined relatively accurately, facilitating a more accurate subsequent determination of the distribution of vascular dark circles.

[0060] For example, in the second color mapping formula, the color value of the target color component can be determined by linearly combining the A component and the B component. For instance, the second color mapping formula could be: color vas = -b*k3 + a*k4; where, color vas This represents the color value of the target color component, where b represents the B component and a represents the A component. For the dark circle detection area, color... vas It can be represented as For the cheek area, color vas It can be represented as This formula is merely an example. For instance, k3 and k4 are both positive constants, and the ratio between them can range from 4 to 10. For example, the second color mapping formula can be expressed as: color vas = -b*2.7+a*0.3.

[0061] Similarly, the second color mapping formula described above can be used to determine the color value of the target color component of any (or every) pixel within the cheek area. For simplicity, this will not be elaborated further here.

[0062] According to the above technical solution, the color values ​​of the target color components corresponding to each pixel in the dark circle detection area and the cheek area are obtained by the second color mapping formula. This method can accurately determine the color values ​​of the target color components used to represent vascular dark circles, which are consistent with the user's visual perception effect and help improve the detection accuracy of vascular dark circles.

[0063] For example, the first color value of the target color component of the dark circle detection region includes the color value of the target color component of each pixel in the dark circle detection region, and the color component difference includes the pixel color component difference between the color value of the target color component of each pixel in the dark circle detection region and the second color value of the target color component of the cheek region. Based on the color component difference, determining the dark circle information in the dark circle detection region may include: for any pixel in the dark circle detection region, comparing the pixel color component difference corresponding to the pixel with a difference threshold; if the pixel color component difference corresponding to the pixel is greater than the difference threshold, then determining that the pixel belongs to the dark circle, otherwise determining that the pixel does not belong to the dark circle, thereby obtaining a dark circle region containing the dark circle; and determining the dark circle information based on the dark circle region.

[0064] Each target color component can have a corresponding difference threshold, meaning each type of dark circle can have a corresponding difference threshold. In one embodiment, the difference threshold can be preset to filter the differences between pixel color components. The difference threshold can be set to different values ​​depending on the target color component. For example, for the first target color component (i.e., the target color component corresponding to the first type of dark circle), the difference threshold Th1 can be equal to 30; for the second target color component (i.e., the target color component corresponding to the second type of dark circle), the difference threshold Th2 can be equal to 35; for the third target color component (i.e., the target color component corresponding to the third type of dark circle), the difference threshold Th3 can be equal to 50, and so on. For the same target color component, the difference threshold corresponding to different faces can be fixed or non-fixed. For example, it can be an adaptive threshold determined based on the color information of each face (this approach will be described below).

[0065] For any (or every) pixel within the dark circle detection area, the difference in the pixel color components corresponding to that pixel is compared with the corresponding difference threshold. For example, if the target color component is the first type of target color component mentioned above, and the difference in the pixel color components corresponding to that pixel is greater than the difference threshold Th1, then the pixel can be determined to belong to the dark circle; otherwise, the pixel is determined not to belong to the dark circle. Based on the comparison result, the region to which all pixels belonging to the dark circle belong can be obtained, and this region can be considered as the dark circle region containing the dark circle.

[0066] According to the above technical solution, the dark circle area is determined based on the difference threshold. This method is simple to implement and can quickly and accurately obtain the dark circle area.

[0067] For example, before comparing the difference of the pixel color components corresponding to any (or every) pixel in the dark circle detection area with a difference threshold, the method may further include: converting the pixel values ​​of each pixel in the cheek area to the LAB color space to obtain at least some of the L, A, and B components of each pixel in the cheek area; and determining the difference threshold based at least on at least some of the L, A, and B components of each pixel in the cheek area.

[0068] In one embodiment, if the pixel values ​​of each pixel in the current cheek region have already been converted to the LAB color space, then in this embodiment, at least some of the L, A, and B components of each pixel in the previously converted cheek region can be directly obtained. If the pixel values ​​of each pixel in the current cheek region have not been converted to the LAB color space, then the pixel values ​​of each pixel in the cheek region can be converted to the LAB color space in a manner similar to that in the previous embodiment. The difference threshold can be determined based at least on all or some of the L, A, and B components of each pixel in the cheek region.

[0069] To effectively determine information about dark circles, it is possible to base it on the pixel color component difference delta. eye Screening is performed. For pigmented dark circles, delta... eye It can be represented as For vascular dark circles, delta eye It can be represented as The dark circles that humans perceive are actually the pixels in the dark circle area appearing to be a certain shade darker than the average color of the cheek, hence the so-called visually noticeable dark circles. If the color of the dark circle is not much different from the surrounding skin color, people will perceive it as not having dark circles, or not having noticeable dark circles. To determine the location of the dark circle, a reasonable threshold can be set. When the color component difference is greater than this threshold, it can be determined as a dark circle (or a noticeable dark circle), and conversely, when the color component difference is less than or equal to the threshold, it can be determined as not having a dark circle. Through extensive experiments, it has been found that the human eye perceives the presence or absence of dark circles differently on images with different brightness and colors. Fixed threshold determination is difficult to apply to real-world scenarios. Therefore, this invention provides an adaptive threshold setting method, which determines the difference threshold based on at least some of the L, A, and B components.

[0070] According to the above technical solution, the difference threshold is determined by at least some of the L, A, and B components of each pixel in the cheek area. This method can accurately determine the pixel region where dark circles are located through an adaptive difference threshold, and it has good adaptability to images of different brightness and color. It can obtain the pixel-level distribution of dark circles, which helps to accurately determine dark circle information.

[0071] For example, if the dark circles are pigmented dark circles, before comparing the difference of the pixel color components corresponding to any (or every) pixel in the dark circle detection area with the difference threshold, the method may further include: converting the pixel values ​​of each pixel in the cheek area to the LAB color space to obtain the L components of each pixel in the cheek area; averaging the L components of each pixel in the cheek area to obtain the average L component in the cheek area; and determining the difference threshold based on the average L component in the cheek area using a first threshold calculation formula; wherein, in the first threshold calculation formula, the difference threshold is positively correlated with the average L component.

[0072] Converting the pixel values ​​of each pixel within the cheek region to the LAB color space yields the L component of each pixel within the cheek region. In one embodiment, the L components of each pixel within the cheek region can be averaged to obtain the average L component of the cheek region. This averaging can be an arithmetic average or a weighted average, etc. Subsequently, a difference threshold can be determined based on the average L component of the cheek region. For detecting pigmented dark circles, a first threshold calculation formula can be used to determine the difference threshold based on the average L component of the cheek region. Exemplarily, the first threshold calculation formula can be expressed as Th... pig = 18 + (l - 270) / 2. Where, Th pig The constant represents the difference threshold, and l represents the average L component within the cheek region. It is understood that the constants in this formula are merely examples, and this application does not impose any limitations on them.

[0073] For pigmented dark circles, the main form of dark circles is dark brown. When the image brightness is low, even if the color difference is limited, dark brown dark circles will become very obvious. When the image brightness is high, the color difference requirement for "obvious" dark circles will be greater. Therefore, the difference threshold corresponding to pigmented dark circles can be increased as the image brightness increases, so as to more accurately determine pigmented dark circles.

[0074] Using the first threshold calculation formula described above, the difference threshold corresponding to pigmented dark circles increases as the L component in the cheek area increases. This ensures that pigmented dark circles can still be detected effectively and accurately even when image brightness changes.

[0075] For example, if the dark circles are vascular dark circles, before comparing the difference of the pixel color components corresponding to any (or every) pixel in the dark circle detection area with a difference threshold, the method may further include: converting the pixel values ​​of each pixel in the cheek area to the LAB color space to obtain the L component of each pixel in the cheek area; converting the pixel values ​​of each pixel in the dark circle detection area to the LAB color space to obtain the B component of each pixel in the dark circle detection area; averaging the L components of each pixel in the cheek area to obtain the average L component in the cheek area; for any (or every) pixel in the dark circle detection area, using a second threshold calculation formula, based on the B component of the pixel and the average L component in the cheek area, determining the difference threshold corresponding to the pixel; wherein, in the second threshold calculation formula, the difference threshold is negatively correlated with the average L component and positively correlated with the B component.

[0076] In one embodiment, if the pixel values ​​of each pixel in the current cheek region have been converted to the LAB color space, the L component of each pixel in the cheek region obtained through the previous conversion can be directly obtained in this embodiment. If the pixel values ​​of each pixel in the current cheek region have not been converted to the LAB color space, they can be converted to the LAB color space in a similar manner to the previous embodiment. Similarly, if the pixel values ​​of each pixel in the current dark circle detection region have been converted to the LAB color space, the B component of each pixel in the current dark circle detection region obtained through the previous conversion can be directly obtained in this embodiment. If the pixel values ​​of each pixel in the current dark circle detection region have not been converted to the LAB color space, they can be converted to the LAB color space in a similar manner to the previous embodiment. Averaging the L components of each pixel in the cheek region yields the average L component of the cheek region. The calculation method for averaging has been described in detail in the previous embodiments and will not be repeated here for brevity. For detecting vascular dark circles, a second threshold calculation formula can be used to determine the difference threshold based on the B component of the pixel and the average L component in the cheek area. In the second threshold calculation formula, the difference threshold is negatively correlated with the average L component and positively correlated with the B component. Vascular dark circles are primarily characterized by a bluish-purple hue. Generally, the stronger the image brightness, the clearer the bluish-purple hue will appear; the lower the image brightness, the less easily the bluish-purple hue will be recognized and the less visually noticeable it will be. The B component in the LAB color space represents the change from blue to yellow. A larger B component indicates a weaker blue component, thus increasing the threshold for "obvious" dark circles. Conversely, a smaller B component indicates a stronger blue component, making vascular dark circles appear more "obvious." Therefore, the difference threshold can be set to be negatively correlated with the average L component and positively correlated with the B component.

[0077] For example, the formula for calculating the second threshold can be expressed as follows: Among them, the difference threshold Th vas It is negatively correlated with the average L component (denoted by l) and positively correlated with the B component (denoted by b). It is understood that the constants in this formula are merely illustrative and are not intended to limit the application.

[0078] According to the above technical solution, the difference threshold corresponding to vascular dark circles can be made to decrease as the L component increases and increase as the B component increases through the second threshold calculation formula. This ensures that vascular dark circles can still be effectively and accurately detected even when the image brightness or B component changes.

[0079] For example, determining dark circle information within a dark circle detection area based on color component differences may include: determining a dark circle region containing dark circles based on color component differences; performing one or more of the following operations on the dark circle region to determine the dark circle information: calculating the area ratio between the dark circle region and the dark circle detection area as the dark circle percentage; calculating the average value of the pixel color component differences corresponding to each pixel within the dark circle region as the dark circle color depth information; and determining the severity of the dark circles based on the dark circle percentage and / or the dark circle color depth information.

[0080] In one embodiment, the area ratio R between the dark circle area and the dark circle detection area can be calculated. pig or R vas This indicates the percentage of dark circles in the dark circle area. Among them, R... pig This indicates the area ratio between the pigmented dark circle area and the detected pigmented dark circle area. R vas This represents the area ratio between the vascular dark circle region and the detected vascular dark circle region. The area ratio R between the pigmented dark circle region and the detected pigmented dark circle region is calculated. pig For example, it can be done using formula R pig =area(delta) pig >Th pig ) / area(delta pig The area ratio R between the vascular dark circle region and the detected vascular dark circle region can be calculated in a similar way. vas .

[0081] In one embodiment, the average value S of the pixel color component differences corresponding to pixels within the dark circle area can be calculated. pig or S vas This serves as information about the depth of color in dark circles. Among them, S pigThis represents the average value of the pixel color component differences within the pigmented dark circle area. vas This represents the average value of the pixel color component differences corresponding to pixels within the vascular dark circle region. The average value S is used to calculate the average value of the pixel color component differences corresponding to pixels within the pigmented dark circle region. pig For example, it can be done through formula S pig =mean(delta) pig delta pig >Th pig The result is obtained by calculation. Among them, "[delta]" pig >Th pig "]" indicates that the color component difference within the dark circle detection area is greater than the difference threshold Th. pig The pixels (i.e., pixels within the dark circle area) are indexed or their pixel coordinates are taken. Similarly, the average value S of the pixel color component differences corresponding to pixels within the vascular dark circle area can be calculated. vas .

[0082] In one embodiment, the severity of dark circles can be determined based on one or more of the following: size, proportion, and color intensity. It is understood that in embodiments where the severity of dark circles is determined based on any two or three of these factors, two or three of these factors can be determined first before determining the severity. For example, separate threshold ranges can be set for each of the size, proportion, and color intensity information, with different threshold ranges corresponding to different degrees of dark circle severity. Taking the percentage of dark circles under the eyes as an example, where the value range of the percentage of dark circles is [0,1], a first threshold range can be set to [0,0.2] to represent no dark circles, a second threshold range to [0.2,0.5] to represent mild dark circles, a third threshold range to [0.5,0.7] to represent moderate dark circles, and a fourth threshold range to [0.7,1] to represent severe dark circles. It is understood that the above threshold range settings are merely exemplary, and this application does not impose any limitations on them. For example, in another embodiment, the threshold range corresponding to no dark circles can be [0,0.1], the threshold range corresponding to mild dark circles can be [0.1,0.3], the threshold range corresponding to moderate dark circles can be [0.3,0.6], and the threshold range corresponding to severe dark circles can be [0.6,1]. Similarly, threshold ranges can be set for the color depth and / or size information of dark circles to distinguish their severity. For simplicity, this will not be elaborated further here. The value range of the color depth information of dark circles can be consistent with the value range of pixel values ​​in the image to be processed, that is, the value range of the color depth information of dark circles can be [0, 255].

[0083] According to the above technical solution, the proportion of dark circles is determined by calculating the area ratio between the dark circle region and the dark circle detection region. This calculation method is simple and easy to implement. The average value of the pixel color component differences corresponding to pixels within the dark circle region is used as the color depth information of the dark circle. This method can intuitively represent the color depth information of dark circles, thereby improving the accuracy of judging the severity of dark circles. Based on the proportion of dark circles and / or the color depth information of dark circles, the severity of dark circles is determined. This method can intuitively and accurately judge the severity of dark circles.

[0084] For example, determining the dark circle detection region in the image to be processed may include: performing keypoint detection on the image to be processed to obtain facial keypoints, the facial keypoints including a set of eye keypoints; selecting a first set of eye keypoints and a second set of eye keypoints from the set of eye keypoints, wherein the first set of eye keypoints may include at least one eye keypoint located on the lower eyelid and whose distance from the inner corner of the eye keypoint is less than or equal to a first distance threshold, the second set of eye keypoints includes at least one eye keypoint located on the lower eyelid and whose distance from the middle of the eye keypoint is less than or equal to a second distance threshold, the middle of the eye keypoint is the eye keypoint located on the lower eyelid and closest to the midpoint between the inner corner of the eye keypoint and the outer corner of the eye keypoint, the inner corner of the eye keypoint and the outer corner of the eye keypoint are the eye keypoints located at the inner corner of the eye and the outer corner of the eye keypoint respectively in the set of eye keypoints; moving each eye keypoint in the selected set of eye keypoints to produce a first target displacement, and moving... Each eye keypoint is then identified as the first set of dark circle keypoints, wherein the angle between the first target displacement and the first direction is less than 90 degrees, and the first direction is downward along the midline of the face in the image to be processed; at least one of the selected eye keypoints is moved to generate a second target displacement, and the moved at least one eye keypoint is identified as the second set of dark circle keypoints, wherein the angle between the second target displacement and the first direction is less than 90 degrees, and the component of the second target displacement corresponding to the same eye keypoint in the first direction is greater than the component of the first target displacement corresponding to that eye keypoint in the first direction; at least the first set of dark circle keypoints and the second set of dark circle keypoints are merged together to obtain a total set of dark circle keypoints; a dark circle boundary line is generated based on each keypoint in the total set of dark circle keypoints, and the area within the dark circle boundary line is identified as the dark circle detection area.

[0085] In one embodiment, a facial landmark detection model can be used to detect landmarks in the image to be processed to obtain facial landmarks. Exemplarily, but not limitingly, the facial landmark detection model can be implemented using any one or more network models, such as a 3D-2D deep convolutional neural network (DCNN) based on ResNet, or a task-constrained deep convolutional network (TCDCN). The facial landmarks obtained by the facial landmark detection model can include sets of eye landmarks, nose landmarks, and facial contour landmarks. The facial landmark detection models used for any two facial parts (e.g., eyes and nose) can be the same neural network model or different neural network models. The facial landmarks detected by the landmark detection operation can be dense points, meaning their density can be greater than a certain threshold.

[0086] For example, the facial key points described herein may include one or more of the following: a set of eye key points, a set of nose key points, a set of mouth key points, a set of eyebrow key points, a set of facial midline key points, a set of ear key points, and a set of facial contour key points, etc. It is understood that the set of eye key points may include eye key points located on either side of the face, the set of eyebrow key points may include eyebrow key points located on either side of the face, and the set of ear key points may include ear key points located on either side of the face. For example, the set of eye key points may include the set of eye key points corresponding to the left eye and / or the set of eye key points corresponding to the right eye. For example, the set of eye key points on either side may include the set of key points on the outer rim of the eye and / or the set of key points on the inner rim of the eye. Those skilled in the art will understand that the set of key points on the outer rim of the eye may include key points on the outer rim contour of the eye, and the set of key points on the inner rim of the eye may include key points on the outer rim contour of the eye. The inner rim contour of the eye may be a contour line that generally surrounds the eyeball. The outer contour of the eye can be a line roughly surrounding the eyeball, inner canthus, and outer canthus. That is, the outer contour of the eye is larger than the inner contour, essentially enclosing it. Both contours reflect the position, shape, and size of the eye. The set of key points for facial contours can include the entire face contour set, or it can include the upper face contour set and / or the lower face contour set. The upper face contour set can primarily include key points along the contour line from one ear through the hairline to the other ear (upper face contour line), and the lower face contour set can primarily include key points along the contour line from one ear through the chin to the other ear (lower face contour line). The positions of the upper and lower face contour lines can be defined and differentiated as needed.

[0087] The facial landmark detection model used in this embodiment can be trained using a training dataset. The training dataset may include multiple sample face images and corresponding ground truth information. The ground truth information may include multiple landmarks corresponding to the left and right eyes (e.g., 64 landmarks for each outer rim of the eyes), landmarks corresponding to the nose (e.g., 126 landmarks for the outer contour of the nose), and landmarks corresponding to the upper and lower contours of the face (e.g., 128 landmarks for the lower contour and 145 landmarks for the upper contour). It is understood that the number of landmarks labeled for each part of the face in this embodiment is merely exemplary, and the number of landmarks can be arbitrary. Inputting multiple sample face images into the initial facial landmark detection model yields corresponding landmark prediction results. This initial facial landmark detection model has the same network structure as the facial landmark detection model used in step S220, but the parameters may differ. After training the parameters in the initial facial landmark detection model, the resulting model is the facial landmark detection model used in step S220. The predicted keypoints and the annotation information of multiple sample face images can be substituted into a preset loss function to calculate the predicted loss value. Then, based on the predicted loss value, the parameters in the initial face keypoint detection model can be optimized using backpropagation and gradient descent algorithms. Parameter optimization can be iteratively performed until the face keypoint detection model reaches convergence. After training, the obtained face keypoint detection model can be used for subsequent face keypoint detection; this stage can be called the model inference stage. Of course, when different face keypoint detection models are used to predict face keypoints in different locations, each face keypoint detection model can be trained based on sample face images annotated with face keypoints of the corresponding location. Those skilled in the art will understand the implementation method, and it will not be elaborated further.

[0088] Figure 3 A schematic diagram illustrating the facial landmark detection results according to an embodiment of this application is shown. Figure 3 As shown, facial landmarks can be obtained through the facial landmark detection model. Figure 3 The set of facial contour key points shown is the set of key points for the entire face contour. See also... Figure 3 It also shows the cheek area 310 and the dark circle detection area 320. Note that... Figure 3For convenience, the cheek area 310 is shown as a triangle, and the dark circle detection area 320 is shown as an ellipse; however, these shapes are merely examples. The shape and size of each area on the face can be set as needed, and these areas are not limited to regular geometric shapes. For example, the dark circle detection area proposed in this invention can appropriately avoid the eyelashes and can optionally be concentrated in a thumb-shaped area below the corner of the eye, and it can avoid covering the entire area below the eye.

[0089] When detecting dark circles under the left eye, the set of key points used in this embodiment can be either the set of key points on the outer rim of the eye or the set of key points on the inner rim of the eye corresponding to the left eye. Conversely, when detecting dark circles under the right eye, the set of key points used in this embodiment can be either the set of key points on the outer rim of the eye or the set of key points on the inner rim of the eye corresponding to the right eye. The following describes an exemplary method for determining the dark circle detection area using the detection of dark circles under the left eye as an example. The detection area for dark circles under the right eye can be determined in the same way. For example, the detected set of key points is the set of key points on the outer rim of the eye corresponding to the left eye, which may include the key points at the inner corner of the left eye, the key points in the middle of the eye, and the key points at the outer corner of the left eye. The key points at the inner corner and outer corner of the left eye are the key points located at the inner and outer corners of the left eye, respectively. That is, the key point at the inner corner of the left eye can be the rightmost key point on the left eye (i.e., closest to the midline of the face), for example... Figure 3 Key point a of the eye. The key point at the outer corner of the left eye can be the leftmost key point on the left eye (i.e., the one furthest from the midline of the face), for example, Figure 3 Key point b in the middle of the eye. The key point in the middle of the eye is the eye key point located on the lower eyelid that is closest to the midpoint between the inner corner key point and the outer corner key point. For example, Figure 3 The key point of the eye in the image is c.

[0090] A first set of eye keypoints and a second set of eye keypoints can be selected from the set of keypoints for the left eye. Each set of eye keypoints can include one or more eye keypoints. For the first set of eye keypoints, at least one eye keypoint is located on the lower eyelid of the left eye and its distance from the inner corner of the left eye keypoint is less than or equal to a first distance threshold. The first distance threshold can be any suitable value, which can be set as needed. For example, the first distance threshold can be in the range of [0, 3] mm, such as equal to 2 mm. That is, the keypoint in the first set of eye keypoints is a keypoint on the lower eyelid near the inner corner of the eye. For the second set of eye keypoints, at least one eye keypoint is located on the lower eyelid and its distance from the middle keypoint of the eye is less than or equal to a second distance threshold. The second distance threshold can also be any suitable value. For example, the second distance threshold can be in the range of [0, 3] mm, such as equal to 2 mm. That is, the keypoint in the second set of eye keypoints is a keypoint on the lower eyelid near the midline of the eye. It is understood that the first distance threshold and the second distance threshold can be the same or different.

[0091] In one embodiment, the first set of eye keypoints may include inner corner eye keypoints, and the second set of eye keypoints may include mid-eye keypoints. This will be illustrated below using this as an example. Two movements can be performed on the first and second sets of eye keypoints. The objects moved each time can be completely identical or partially different. For example, for the first movement, selected eye keypoints a and c can be moved, causing these two eye keypoints to produce a first target displacement. The direction of the first target displacement can be parallel to the midline of the face and downward, or an acute angle between the first target displacement and the downward direction along the midline of the face. It should be noted that in the first movement, the first target displacements corresponding to any two different eye keypoints can be the same or different. That is, the selected eye keypoints move downward as a whole, but the direction and / or distance of movement can be equal or unequal. It is understood that the directional terms such as "up," "down," "left," and "right" described herein are based on the definition of a face. For example, the midline of the face can be determined based on a set of midline keypoints or based on any other method. The moved eye key points a and c can be identified as the first set of key points for dark circles.

[0092] For the second movement, at least one of the selected eye keypoints can be moved to produce a second target displacement. For example, eye keypoints a and c can be moved, or only eye keypoint c can be moved. The at least one moved eye keypoint is defined as the second set of dark circle keypoints. The meaning of the second target displacement can be understood by referring to the relevant description of the first target displacement, and will not be repeated here. Similar to the first target displacement, in the second movement, the second target displacements corresponding to any two different eye keypoints can be the same or different. The execution order of the first and second movements is not limited; they can be executed sequentially or in parallel. Furthermore, for an eye keypoint involved in both movements (e.g., eye keypoint c), the component of the second target displacement corresponding to that eye keypoint in the first direction is greater than the component of the first target displacement corresponding to that eye keypoint in the first direction, meaning that the eye keypoint moves further downwards in the second movement. In one embodiment, the first and second sets of dark circle keypoints can be merged to obtain a total set of dark circle keypoints. In an embodiment where eye keypoints a and c are moved in the first instance, and only eye keypoint c is moved in the second instance, the total set of dark circle keypoints can contain three eye keypoints. In another embodiment, other keypoints (such as the third and fourth sets of dark circle keypoints described below) can be further combined to obtain the total set of dark circle keypoints. For example, based on each keypoint in the total set of dark circle keypoints, the boundary points of the dark circle detection region can be obtained through interpolation. Based on the obtained boundary points of the dark circle detection region, the boundary points can be connected directly or using a Bézier curve to determine the dark circle detection region.

[0093] According to the above technical solution, by performing key point detection on the image to be processed, facial key points can be obtained, and then the dark circle detection area can be determined based on the facial key points. This method can avoid the phenomenon of inaccurate dark circle detection areas obtained due to differences in faces, and can ensure the effectiveness of the obtained dark circle detection areas, thereby improving the accuracy of dark circle detection.

[0094] For example, during the movement of any (or each) of the selected eye key points, the farther the eye key point is from the inner corner of the eye key point, the greater the component of the corresponding first target displacement and / or second target displacement in the first direction.

[0095] In one embodiment, during the first movement, as any (potentially every) eye keypoint is moved, the farther the eye keypoint is from the inner corner keypoint, the greater the component of the corresponding first target displacement in the first direction (downward along the midline of the face), i.e., the lower it is moved. Similarly, during the second movement, as any (potentially every) eye keypoint is moved, the farther the eye keypoint is from the inner corner keypoint, the greater the component of the corresponding second target displacement in the first direction (downward along the midline of the face). This method of moving the outermost keypoints downwards helps to form a near-thumb-shaped dark circle detection area. Because most people's dark circles are approximately thumb-shaped, this setting of the dark circle detection area closely resembles the typical shape of dark circles, helping to detect dark circles faster and more accurately.

[0096] For example, before moving each of the selected eye keypoints to produce a first target displacement, the method may further include: determining a first reference distance based on the positional difference between the inner corner eye keypoint and the outer corner eye keypoint; or, if the face keypoints also include a set of face midline keypoints, selecting two face midline keypoints from the set of face midline keypoints and determining a first reference distance based on the positional difference between the two face midline keypoints; determining a first target displacement based on the first reference distance, wherein the magnitude of the first target displacement is proportional to the first reference distance by a first target.

[0097] Before moving each of the selected eye keypoints to produce a first target displacement, a first reference distance can be determined to control the eye keypoints to produce appropriate displacement based on this distance. The first reference distance can be determined based on any two or more detected facial keypoints. For example, the positional difference between the inner and outer corner keypoints can be calculated, and the first reference distance can be determined based on this positional difference. The first target displacement can then be set according to a first target ratio proportional to the first reference distance. The first target ratio can be set to any suitable value as needed. For example, the first target ratio can fall within the range of (0, 0.2) for the positional difference between the inner corner of the eye and the outer corner of the eye. For instance, the magnitude of the first target displacement can be equal to 0.2 times the first reference distance, and the direction of the first target displacement can be set according to the direction in which the eye key points are desired to move. Furthermore, if the acquired facial key points include facial midline key points, then any two facial midline key points can be selected from the set of facial midline key points, such as any two adjacent facial midline key points, and the positional difference between these two key points can be determined as the first reference distance. For example, the first target ratio can fall within the range of (0, 5) for the positional difference between two adjacent facial midline key points.

[0098] Using the above method, a first reference distance suitable for each individual can be determined, thereby determining the first target displacement. Since different people typically have different face shapes, this method can determine a first target displacement that is appropriate for each person, making the obtained first target displacement more targeted and effectively improving the accuracy of dark circle detection.

[0099] For example, before moving at least one of the selected eye keypoints to cause the at least one eye keypoint to produce a second target displacement, the method may further include: calculating the positional difference between the inner corner eye keypoint and the outer corner eye keypoint to obtain a second reference distance; or, if the face keypoints also include a set of face midline keypoints, selecting two face midline keypoints from the set of face midline keypoints and calculating the distance between the two face midline keypoints to obtain a second reference distance; determining a second target displacement based on the second reference distance, wherein the magnitude of the second target displacement is proportional to the second reference distance in a second target ratio.

[0100] Before moving at least one of the selected eye keypoints to produce a second target displacement, a second reference distance can also be determined to control the eye keypoints to produce appropriate displacement based on this distance. The method for obtaining the second reference distance is similar to that for obtaining the first reference distance, and will not be repeated here for simplicity. The magnitude of the second target displacement is determined by multiplying the obtained second reference distance by a second target ratio. The second target ratio can be set to any suitable value as needed. For example, for the positional difference between the inner and outer corner eye keypoints, the second target ratio can fall within the range of (0, 0.2]. For example, the magnitude of the second target displacement can be equal to 0.2 times the second reference distance. Furthermore, for the positional difference between two adjacent facial midline keypoints, the second target ratio can fall within the range of (0, 5).

[0101] Using the above method, a second reference distance suitable for each individual can be determined, thereby determining the second target displacement. Since different people typically have different face shapes, this method can determine a second target displacement adapted to each individual, making the obtained second target displacement more targeted and effectively improving the accuracy of dark circle detection.

[0102] For example, the facial key points also include a set of nose key points. Before merging at least the first set of dark circle key points and the second set of dark circle key points to obtain a total set of dark circle key points, the method may further include: selecting a first set of nose key points and a second set of nose key points from the set of nose key points, wherein the first set of nose key points includes at least one nose key point located on a first side and whose distance from the nasal roof key point is less than or equal to a third distance threshold; the second set of nose key points includes at least one nose key point located on a first side and whose distance from the nasal roof key point is greater than or equal to a fourth distance threshold and less than or equal to a fifth distance threshold; when the eye key point set belongs to the left eye, the first side is the left side of the nose; when the eye key point set belongs to the right eye, the first side is the right side of the nose; the nasal roof key point is the nose key point located at the top of the first side; the fourth distance threshold is greater than the third distance threshold; moving each nose key point in the selected set of nose key points to produce a third target displacement, and determining the moved nose key points as the third set of dark circle key points. In the process, the angle between the third target displacement and the second direction is less than 90 degrees. The second direction is perpendicular to the first direction and faces the second side. When the eye key point set belongs to the left eye, the second side is the left side of the face; when the eye key point set belongs to the right eye, the second side is the right side of the face. Move at least one of the selected nose key points to make at least one nose key point generate a fourth target displacement, and determine the at least one nose key point after the movement as the fourth set of dark circle key points. The angle between the fourth target displacement and the second direction is less than 90 degrees. The component of the fourth target displacement corresponding to the same nose key point in the selected nose key points in the second direction is greater than the component of the third target displacement corresponding to that nose key point in the second direction. At least the first set of dark circle key points and the second set of dark circle key points are merged together to obtain the total set of dark circle key points. This may include: merging the first set of dark circle key points, the second set of dark circle key points, the third set of dark circle key points, and the fourth set of dark circle key points together to obtain the total set of dark circle key points.

[0103] Facial key points may also include a set of nose key points. Before merging at least the first set of dark circle key points and the second set of dark circle key points to obtain the total set of dark circle key points, an additional set of dark circle key points may be determined based on the set of nose key points.

[0104] Before selecting the first and second sets of nasal key points from the set of nasal key points, it is known that the nasal roof key point is the nasal key point located at the top of the first side, for example, Figure 3 Nasal key point d. The alar key point is the nasal key point located on the first side and on the alar, for example, Figure 3The nose keypoint e. For example, if the set of eye keypoints belongs to the left eye, then the first side is the left side of the nose; if the set of eye keypoints belongs to the right eye, then the first side is the right side of the nose. The first set of nose keypoints and the second set of nose keypoints may each contain one or more keypoints.

[0105] The first group of nasal keypoints may include at least one nasal keypoint located on the first side and whose distance from the nasal roof keypoint is less than or equal to a third distance threshold. The third distance threshold can be any suitable value, which can be set as needed. For example, the third distance threshold can be in the range of [0, 3] mm, such as equal to 2 mm. The second group of nasal keypoints may include at least one nasal keypoint located on the first side and whose distance from the nasal roof keypoint is greater than or equal to a fourth distance threshold and less than or equal to a fifth distance threshold. The fourth and fifth distance thresholds can be any suitable values, which can be set as needed. For example, the fourth distance threshold can be in the range of [10, 15] mm, such as equal to 12 mm. For example, the fifth distance threshold can be in the range of [15, 20] mm, such as equal to 16 mm. It can be understood that the fourth distance threshold is any value greater than the third distance threshold and less than the fifth distance threshold. Referring to the above description, the first group of nasal keypoints are keypoints close to the nasal roof, and the second group of nasal keypoints is a group of keypoints located lower than the first group of nasal keypoints. The second set of key points for the nose can be distributed in the target area near the lower contour line of the target dark circle. The lower contour line of the target dark circle can be the location where the lower contour of the dark circle is usually located, which can be determined based on experience or theory.

[0106] Similar to eye keypoints, for selected nose keypoints, a set of dark circle keypoints can also be obtained through two movements. For ease of distinction, these two movements are referred to as the third and fourth movements, and the execution order of these two movements is also unrestricted. For example, for the third movement, each nose keypoint in the selected nose keypoints can be moved to produce a third target displacement, and the moved nose keypoints are determined as the third set of dark circle keypoints. The angle between the third target displacement and the second direction is less than 90 degrees, and the second direction can represent a direction perpendicular to the first direction and pointing towards the second side. That is, if the eye keypoint set belongs to the left eye, then the second side is the left side of the face. If the eye keypoint set belongs to the right eye, then the second side is the right side of the face. For example, for the left eye, the nose keypoints selected from the left nose keypoints can be moved by the third target displacement towards the left side of the face. In one embodiment, the first set of nose keypoints and the second set of nose keypoints each include one keypoint, for example... Figure 3The key points d and f mentioned above can be moved towards the left side of the face by a third target displacement. The third target displacement corresponding to any two different nose key points can be the same or different. That is to say, the selected nose key points are generally moved towards the second side, but the direction and / or distance of movement can be equal or unequal.

[0107] For the fourth movement, at least one of the selected nose key points can be moved to produce a fourth target displacement. The at least one moved nose key point is defined as the fourth set of dark circle key points. For example, both nose key points d and f can be moved by the fourth target displacement, or only nose key point f can be moved to produce the fourth target displacement. The angle between the fourth target displacement and the second direction is less than 90 degrees. The fourth target displacements corresponding to any two different nose key points can be the same or different. For a nose key point that participates in both movements (e.g., nose key point f), the component of the fourth target displacement corresponding to that nose key point in the second direction is greater than the component of the fourth target displacement corresponding to that nose key point in the second direction, meaning that the fourth movement of that nose key point moves it further to the second side.

[0108] By combining the above sets of key points for the first, second, third, and fourth dark circles, we can obtain the total set of key points for dark circles.

[0109] The calculation methods for the first and second target displacements in the previous embodiments can be referenced. The third and / or fourth target displacements can be determined by using the positional difference between the key point of the top of the nose and the key point of the inner corner of the eye, or by using the positional difference between the two key points of the midline of the face, or by using the positional information of other key points of the face. For the sake of simplicity, they will not be described in detail here.

[0110] Based on the above technical solution, the total set of key points for dark circles can be determined by combining key points of the nose, thus making the determined dark circle detection area more accurate.

[0111] For example, determining the cheek region in the image to be processed may include: performing keypoint detection on the image to be processed to obtain facial keypoints, including a set of eye keypoints, a set of nose keypoints, and a set of lower facial contour keypoints; selecting a third set of eye keypoints and a fourth set of eye keypoints from the set of eye keypoints, wherein the third set of eye keypoints may include at least one eye keypoint located on the lower eyelid and whose distance from the inner corner of the eye keypoint is less than or equal to a sixth distance threshold, the second set of eye keypoints includes at least one eye keypoint located on the lower eyelid and whose distance from the outer corner of the eye keypoint is less than or equal to a seventh distance threshold, and the inner corner of the eye keypoint and the outer corner of the eye keypoint are respectively located on the inner corner of the lower eyelid and the outer corner of the eye keypoint. Key points for the eyes at the inner and outer corners; move each key point in the selected key points to generate a fifth target displacement, and determine the moved key points as the first cheek key point set, wherein the angle between the fifth target displacement and the first direction is less than 90 degrees, and the first direction is the direction downward along the midline of the face in the image to be processed; select a third group of nose key points and a fourth group of nose key points from the nose key point set, wherein the third group of nose key points includes at least one nose key point located on the first side and whose distance from the nasal roof key point is less than or equal to an eighth distance threshold, and the fourth group of nose key points may include at least one nose key point located on the first side and whose distance from the nasal ala key point is less than or equal to an eighth distance threshold. The nose keypoints equal to the ninth distance threshold are defined as follows: when the eye keypoint set belongs to the left eye, the first side is the left side of the nose; when the eye keypoint set belongs to the right eye, the first side is the right side of the nose; the nasal roof keypoint is the top nose keypoint on the first side; and the nasal wing keypoint is the nose keypoint on the first side and located on the nasal wing. The selected nose keypoints are moved to generate a sixth target displacement, and the moved nose keypoints are defined as the second cheek keypoint set. The angle between the sixth target displacement and the second direction is less than 90 degrees. The second direction is perpendicular to the first direction and faces the second side. When the eye keypoint set belongs to the left eye, the second side is the left side of the face; when the eye keypoint set belongs to the right eye, the first side is the right side of the nose. The nasal roof keypoint is the top nose keypoint on the first side; and the nasal wing keypoint is the top nose keypoint on the first side and located on the nasal wing. The two sides are the right side of the face; select a portion of the lower contour key points from the set of lower contour key points of the face according to the target interval; for each lower contour key point of the face selected, interpolate between the target point and the lower contour key point of the face based on the distance between the target point and the lower contour key point of the face to obtain the third cheek key point set, wherein the distance between the target point and the midline of the face in the image to be processed is less than or equal to the tenth distance threshold; merge the first cheek key point set, the second cheek key point set, and the third cheek key point set together to obtain the total cheek key point set; generate the cheek boundary line based on each key point in the total cheek key point set, and determine the area within the cheek boundary line as the cheek region.

[0112] Using the facial landmark detection model described in the previous embodiments, we can obtain sets of eye landmarks, nose landmarks, and facial contour landmarks. Figure 3 The diagram shows the key points of the entire face contour. Based on these key points, the cheek area can be determined. See again. Figure 3 The image shows the cheek region 310. Since dark circles are mainly located below the eyes, the lower facial contour key points are more closely associated with the dark circle detection area and the cheek region. Therefore, the cheek region can be determined primarily based on the lower facial contour key points. For example, the cheek region can avoid the boundaries of facial features and be appropriately narrowed inwards compared to the outer contour of the face; this approach will be described below.

[0113] The method for selecting the third and fourth sets of eye keypoints from the set of eye keypoints is similar to the method for selecting the first and second sets of keypoints in the previous embodiment, and will not be repeated here for the sake of simplicity. The sixth and seventh distance thresholds can be set to any suitable value as needed; for example, the sixth and seventh distance thresholds can be within the range of [0, 3] millimeters, such as 2 millimeters.

[0114] The selected eye keypoints are moved to generate a fifth target displacement, and these moved eye keypoints are defined as the first cheek keypoint set. The angle between the fifth target displacement and the first direction is less than 90 degrees, and the first direction is downward along the midline of the face in the image to be processed. The method for obtaining the first cheek keypoint set is similar to that for obtaining the first dark circle keypoint set, and will not be elaborated here for simplicity. The fifth target displacement and the first target displacement can be the same or different. For example, the magnitude of the fifth target displacement can be greater than the magnitude of the first target displacement. The fifth target displacements corresponding to any two different eye keypoints can be the same or different.

[0115] Before selecting the third and fourth sets of nose keypoints from the set of nose keypoints, it is known that the nasal roof keypoint is the top nose keypoint located on the first side, and the nasal wing keypoint is the nose keypoint located on the first side and on the nasal wing. For example, when detecting dark circles under the left eye, the nasal roof keypoint can be the top keypoint on the left, and the nasal wing keypoint can be the keypoint on the left furthest from the midline of the face. When detecting dark circles under the right eye, the nasal roof keypoint can be the top keypoint on the right, and the nasal wing keypoint can be the keypoint on the right furthest from the midline of the face. The third set of nose keypoints can include at least one nose keypoint located on the first side whose distance from the nasal roof keypoint is less than or equal to an eighth distance threshold. The fourth set of nose keypoints can include at least one nose keypoint located on the first side whose distance from the nasal wing keypoint is less than or equal to a ninth distance threshold. The eighth and ninth distance thresholds can be set to any suitable value as needed; for example, the eighth and ninth distance thresholds can be within the range of [0, 3] mm, such as 2 mm.

[0116] The selected nose keypoints can be moved to generate a sixth target displacement, and these moved nose keypoints are defined as the second cheek keypoint set. The method of moving the selected nose keypoints to obtain the second cheek keypoint set is similar to the method of moving the nose keypoints to obtain the third dark circle keypoint set in the previous embodiment, and will not be repeated here for simplicity. The sixth target displacement and the third target displacement can be the same or different. For example, the magnitude of the sixth target displacement can be greater than the magnitude of the third target displacement. The sixth target displacements corresponding to any two different nose keypoints can be the same or different.

[0117] The calculation methods for the first and second target displacements can be referred to in the previous embodiments. The fifth and / or sixth target displacements can be determined by using the positional difference between the key point of the top of the nose and the key point of the inner corner of the eye, or by using the positional difference between the two key points of the midline of the face, or by using the positional information of other key points of the face. For the sake of simplicity, they will not be described in detail here.

[0118] As mentioned above, the cheek area can avoid the dividing lines of facial features and be appropriately recessed inwards compared to the outer contour of the face. This avoids color distortion in the outer contour area of ​​the face due to its irregular shape. This solution is described below.

[0119] In one embodiment, for multiple key points on the lower contour of the face, the user can pre-set a target interval to select a subset of key points from the key points on the lower contour of the face as initial cheek outer boundary points according to the target interval. The target interval can be any value greater than 0, such as an interval of 5 key points, 8 key points, 10 key points, etc. The user can also select any key point on the face as the target point, which can be any point such as the center point of both eyes, the center point of both eyebrows, etc. For example, the target point can be the center point of the line connecting the pupils of both eyes, or the center point of the line connecting the two inner corners of the eyes, or the intersection of any of the above connecting lines with the midline of the face. The distance between the target point and the midline of the face is less than or equal to the tenth distance threshold. The tenth distance threshold can be set to any suitable value as needed, for example, the tenth distance threshold can be in the range of [0,3] mm, for example, equal to 2 mm. For any (or each) initial cheek outer boundary point among multiple initial cheek outer boundary points, interpolation is performed between the target point and the initial cheek outer boundary point according to the target ratio based on the distance between the target point and the initial cheek outer boundary point. By way of example, and not limitation, the target ratio can be the ratio of the distance between the target point and the new cheek outer boundary point to the distance between the initial cheek outer boundary point and the target point. The target ratio can range from [0, 1], for example, 0.9. That is, the ratio of the distance between the interpolated new cheek outer boundary point and the target point to the distance between the initial cheek outer boundary point and the target point is 0.9. Similarly, interpolation can be performed between the target point and each initial cheek outer boundary point to obtain new cheek outer boundary points. Finally, the determined new cheek outer boundary points can be used as the third set of cheek keypoints.

[0120] The obtained sets of first, second, and third cheek keypoints are merged together to form the overall cheek keypoint set. Optionally, the keypoints in the overall cheek keypoint set can be directly connected or connected using Bézier curves to generate the cheek boundary line. Alternatively, the overall cheek keypoint set can be interpolated before directly connecting the interpolated keypoints or connecting them using Bézier curves to obtain the cheek boundary line. The area within the cheek boundary line can be defined as the cheek region.

[0121] According to the above technical solution, by performing keypoint detection on the image to be processed, facial keypoints can be obtained, and the cheek region can be determined based on these keypoints. This method can avoid the inaccuracy of the obtained cheek region due to facial differences, ensuring the validity of the obtained cheek region and improving the efficiency of dark circle detection. Furthermore, the cheek outer boundary points obtained through interpolation are more accurate and can avoid errors caused by facial differences, further ensuring the validity of the dark circle detection results.

[0122] For example, the dark circle detection area is a thumb-shaped area located below the target eye. The angle between the third direction where the axis of the thumb-shaped area is located and the first direction is less than 90 degrees. The first direction is the downward direction along the midline of the face in the image to be processed, and the third direction is the direction towards the tip of the thumb.

[0123] For the first projection of the boundary line of the thumb-shaped region in the first direction, the distance between the first end of the first projection and the inner corner of the target eye in the first direction is less than or equal to the eleventh distance threshold, the distance between the second end of the first projection and the inner corner of the eye in the first direction is greater than or equal to the twelfth distance threshold and less than or equal to the thirteenth distance threshold, and the eleventh distance threshold is less than the twelfth distance threshold.

[0124] For the second projection of the boundary line of the thumb-shaped region in the second direction, the distance between the first end of the second projection and the inner corner of the eye in the second direction is greater than or equal to the fourteenth distance threshold, and the distance between the second end of the second projection and the center point of the target eye in the second direction is less than or equal to the fifteenth distance threshold. The second direction is the direction perpendicular to the first direction and facing the second side. When the target eye is the left eye, the second side is the left side of the face. When the target eye is the right eye, the second side is the right side of the face.

[0125] As described above, the dark circle detection area can be a thumb-shaped region. The above describes an embodiment of obtaining a thumb-shaped region by moving eye key points and optionally nose key points; however, this is merely an example, and the thumb-shaped region can be obtained in any other suitable manner.

[0126] The axis of the thumb-shaped area is the axis of the thumb shape corresponding to the thumb-shaped area. The center point of the eye is the center point of the pupil. The angle between the third direction containing the axis of the thumb-shaped area and the first direction is less than 90 degrees, where the third direction is the direction towards the tip of the thumb. That is to say, the third direction containing the axis of the thumb-shaped area is inclined downwards towards the face.

[0127] For the first projection of the boundary line of the thumb-shaped region in the first direction, the distance between the first end of the first projection and the inner corner of the eye in the first direction is greater than or equal to the fourteenth distance threshold. That is, the first end of the first projection is closer to the inner corner of the eye in the first direction. The distance between the second end of the first projection and the inner corner of the eye in the first direction is greater than or equal to the twelfth distance threshold and less than or equal to the thirteenth distance threshold. That is, compared with the first end of the first projection, the second end of the first projection is farther from the inner corner of the eye in the first direction. For example, the second end of the first projection can be located in the target area near the lower contour line of the target dark circle. As mentioned above, the lower contour line of the target dark circle can be the location where the lower contour of the dark circle is usually located, which can be determined based on experience or theory. The target area can include at least a portion of the lower contour line of the target dark circle, that is, at least a portion of the lower contour line of the target dark circle passes through the target area. It can be understood that the thumb-shaped region extends approximately from near the inner corner of the eye to near the lower contour line of the target dark circle in the first direction.

[0128] For the second projection of the boundary line of the thumb-shaped region in the second direction, the distance between the first end of the second projection and the inner corner of the eye in the second direction is greater than or equal to the fourteenth distance threshold. That is, the first end of the second projection is closer to the inner corner of the eye in the second direction. The distance between the second end of the second projection and the center point of the target eye in the second direction is less than or equal to the fifteenth distance threshold. That is, the second end of the second projection is closer to the center point of the eye in the second direction. It can be understood that the thumb-shaped region extends approximately from near the inner corner of the eye to near the center point of the eye in the second direction.

[0129] The eleventh, twelfth, thirteenth, fourteenth, and fifteenth distance thresholds can be set to any suitable value as needed, for example, within the range of [0, 3] millimeters, such as equal to 2 millimeters.

[0130] Any two of the aforementioned first, second, third, sixth, seventh, eighth, ninth, tenth, eleventh, twelfth, thirteenth, fourteenth, and fifteenth distance thresholds may be the same or different. It is understood that the first to tenth distance thresholds in the preceding embodiments can be adjusted according to facial differences, and this application does not impose any restrictions on this.

[0131] For example, before determining the first color value of the target color component of the dark circle detection area and the second color value of the target color component of the cheek area, the method may further include: obtaining type information input by the user, the type information being used to indicate the type of dark circle; determining the first color value of the target color component of the dark circle detection area and the second color value of the target color component of the cheek area may include: determining the first color value of the target color component of the dark circle detection area and the second color value of the target color component of the cheek area based on the type of dark circle indicated by the type information.

[0132] In one embodiment, before determining the first color value of the target color component of the dark circle detection area and the second color value of the target color component of the cheek area, the type information input by the user can be obtained first. The apparatus for implementing the dark circle detection method of this application (e.g., the electronic device 100 described above) may include a display module. The display module can display the type of dark circle to facilitate user selection. For example, the display module can display "vascular dark circle" and "pigmented dark circle," and a selection control can be provided next to each dark circle type. The user can click on the selection control next to any dark circle type to indicate that the currently input type is that dark circle type. In another embodiment, the apparatus for implementing the dark circle detection method of this application (e.g., the electronic device 100 described above) may include an input module (e.g., the input device 106 described above). The user can also directly input the type information of the dark circle using an input module such as a keyboard or mouse. For example, inputting text information such as "pigmented dark circle" indicates that the currently input type is pigmented dark circle. Based on the type of dark circles indicated by the user's input, the target color component can be determined, which facilitates the determination of the first color value of the target color component in the dark circle detection area and the second color value of the target color component in the cheek area.

[0133] Based on the above technical solution, obtaining the type information input by the user allows for quick and easy identification of the type of dark circles to be detected, thus improving the efficiency of dark circle detection results. Furthermore, this solution grants users the authority to set the type of dark circles, thereby better meeting their personalized needs and providing a better user experience.

[0134] According to another aspect of this application, a dark circle detection device is provided. Figure 4 A schematic block diagram of a dark circle detection device 400 according to an embodiment of this application is shown.

[0135] like Figure 4 As shown, the dark circle detection device 400 according to an embodiment of this application includes an acquisition module 410, a first determination module 420, a second determination module 430, a calculation module 440, and a third determination module 450. Each module can respectively perform the functions described above. Figure 2 The following describes the steps of the dark circle detection method. Only the main functions of each component of the dark circle detection device 400 are described below, omitting the details already described above.

[0136] The acquisition module 410 is used to acquire the image to be processed, which contains a human face. The acquisition module 410 can be... Figure 1 The processor 102 in the illustrated electronic device executes program instructions stored in the storage device 104 to achieve this.

[0137] The first determining module 420 is used to determine the dark circle detection region and the cheek region in the image to be processed. The first determining module 420 can be composed of... Figure 1 The processor 102 in the illustrated electronic device executes program instructions stored in the storage device 104 to achieve this.

[0138] The second determining module 430 is used to determine a first color value of the target color component in the dark circle detection area and a second color value of the target color component in the cheek area, wherein the target color component corresponds to the type of dark circle to be detected. The second determining module 430 can be configured by... Figure 1 The processor 102 in the illustrated electronic device executes program instructions stored in the storage device 104 to achieve this.

[0139] The calculation module 440 is used to calculate the color component difference between the first color value of the target color component in the dark circle detection area and the second color value of the target color component in the cheek area. The calculation module 440 can be... Figure 1 The processor 102 in the illustrated electronic device executes program instructions stored in the storage device 104 to achieve this.

[0140] The third determining module 450 is used to determine dark circle information within the dark circle detection area based on color component differences. This dark circle information includes one or more of the following: size of the dark circle, proportion of the dark circle, color depth of the dark circle, and severity of the dark circle. The third determining module 450 can be composed of... Figure 1 The processor 102 in the illustrated electronic device executes program instructions stored in the storage device 104 to achieve this.

[0141] Figure 5 A schematic block diagram of an electronic device 500 according to an embodiment of this application is shown. The electronic device 500 includes a memory 510 and a processor 520.

[0142] The memory 510 stores computer program instructions for implementing the corresponding steps in the dark circle detection method according to the embodiments of this application.

[0143] The processor 520 is used to run computer program instructions stored in the memory 510 to perform corresponding steps of the dark circle detection method according to the embodiments of this application.

[0144] For example, the electronic device 500 may also include an image acquisition device 530. The image acquisition device 530 is used to acquire an image to be processed. The image acquisition device 530 is optional, and the electronic device 500 may also exclude the image acquisition device 530. In this case, the processor 520 may acquire the image to be processed by other means, such as from an external device or from the memory 510.

[0145] Furthermore, according to embodiments of this application, a storage medium is also provided, on which program instructions are stored. When the program instructions are run by a computer or processor, they are used to execute corresponding steps of the dark circle detection method of this application embodiment and to implement corresponding modules in the dark circle detection device according to embodiments of this application. The storage medium may include, for example, a memory card of a smartphone, a storage component of a tablet computer, a hard disk of a personal computer, a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a portable compact disc read-only memory (CD-ROM), a USB memory, or any combination of the above storage media.

[0146] In one embodiment, when the program instructions are executed by a computer or processor, the computer or processor may implement the various functional modules of the dark circle detection device according to the embodiments of this application, and / or may execute the dark circle detection method according to the embodiments of this application.

[0147] Furthermore, according to an embodiment of this application, a computer program product is also provided, which includes a computer program that, when running, is used to execute the aforementioned dark circle detection method 200.

[0148] Each module in the electronic device according to the embodiments of this application can be implemented by the processor of the electronic device implementing dark circle detection or dark circle detection according to the embodiments of this application running computer program instructions stored in memory, or by computer instructions stored in a computer-readable storage medium of a computer program product according to the embodiments of this application being executed by a computer.

[0149] Furthermore, according to an embodiment of this application, a computer program is also provided, which, when running, is used to execute the above-described dark circle detection method 200.

[0150] Although exemplary embodiments have been described herein with reference to the accompanying drawings, it should be understood that the above exemplary embodiments are merely illustrative and are not intended to limit the scope of this application. Various changes and modifications can be made therein by those skilled in the art without departing from the scope and spirit of this application. All such changes and modifications are intended to be included within the scope of this application as claimed in the appended claims.

[0151] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0152] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another device, or some features may be ignored or not executed.

[0153] Numerous specific details are set forth in the specification provided herein. However, it will be understood that embodiments of this application may be practiced without these specific details. In some instances, well-known methods, structures, and techniques have not been shown in detail so as not to obscure the understanding of this specification.

[0154] Similarly, it should be understood that, in order to simplify this application and aid in understanding one or more aspects of the various applications, features of this application are sometimes grouped together in a single embodiment, figure, or description thereof in the description of exemplary embodiments of this application. However, this approach should not be construed as reflecting an intention that the claimed application requires more features than are expressly recited in each claim. Rather, as reflected in the corresponding claims, the inventive point lies in solving the corresponding technical problem with fewer features than all features of a single disclosed embodiment. Therefore, the claims following the detailed description are hereby expressly incorporated into that detailed description, wherein each claim itself is a separate embodiment of this application.

[0155] Those skilled in the art will understand that, apart from the mutual exclusion of features, all features disclosed in this specification (including the accompanying claims, abstract, and drawings) and all processes or units of any method or apparatus so disclosed can be combined in any combination. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstract, and drawings) may be replaced by an alternative feature that serves the same, equivalent, or similar purpose.

[0156] Furthermore, those skilled in the art will understand that although some embodiments herein include certain features included in other embodiments but not others, combinations of features from different embodiments are intended to be within the scope of this application and form different embodiments. For example, in the claims, any of the claimed embodiments can be used in any combination.

[0157] The various component embodiments of this application can be implemented in hardware, or as software modules running on one or more processors, or a combination thereof. Those skilled in the art will understand that microprocessors or digital signal processors (DSPs) can be used in practice to implement some or all of the functions of some modules in the dark circle detection device according to the embodiments of this application. This application can also be implemented as an apparatus program (e.g., a computer program and computer program product) for performing part or all of the methods described herein. Such an implementation of this application can be stored on a computer-readable medium, or can be in the form of one or more signals. Such signals can be downloaded from an Internet website, provided on a carrier signal, or provided in any other form.

[0158] It should be noted that the above embodiments are illustrative of this application and not restrictive, and that those skilled in the art can devise alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses should not be construed as limiting the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. This application can be implemented by means of hardware comprising several different elements and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by the same item of hardware. The use of the words first, second, and third, etc., does not indicate any order. These words can be interpreted as names.

[0159] The above are merely specific embodiments or descriptions of specific embodiments of this application. The scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. The scope of protection of this application shall be determined by the scope of the claims.

Claims

1. A method for detecting dark circles under the eyes, comprising: Acquire an image to be processed, the image containing a human face; Determine the dark circle detection area and cheek area in the image to be processed; A first color value of the target color component of the dark circle detection area is determined, and a second color value of the target color component of the cheek area is determined. The target color component corresponds to the type of dark circle to be detected. If the dark circle is a pigmented dark circle, the target color component is a composite color component determined based on the L component and B component in the LAB color space. If the dark circle is a vascular dark circle, the target color component is a composite color component determined based on the A component and B component in the LAB color space. Calculate the color component difference between the first color value of the target color component in the dark circle detection area and the second color value of the target color component in the cheek area; Based on the color component difference, dark circle information within the dark circle detection area is determined. The dark circle information includes one or more of the following: size of the dark circle, proportion of the dark circle, color depth of the dark circle, and severity of the dark circle.

2. The method as described in claim 1, wherein, The process of determining the first color value of the target color component in the dark circle detection area and the second color value of the target color component in the cheek area includes: The pixel values ​​of each pixel in the dark circle detection area are converted to the LAB color space to obtain the L component, A component and B component of each pixel in the dark circle detection area. Based on at least some of the L, A and B components of each pixel in the dark circle detection area, the color value of the target color component of each pixel in the dark circle detection area is determined as the first color value of the target color component of the dark circle detection area. The pixel values ​​of each pixel in the cheek area are converted to the LAB color space to obtain the L component, A component and B component of each pixel in the cheek area. Based on at least some of the L, A, and B components of each pixel in the cheek region, determine the color value of the target color component of each pixel in the cheek region. The average color value of the target color component of each pixel in the cheek region is determined as the second color value of the target color component of the cheek region.

3. The method as described in claim 2, wherein, If the dark circles are pigmented dark circles, determining the color value of the target color component of each pixel in the dark circle detection area based on at least a portion of the L, A, and B components of each pixel in the dark circle detection area includes: For any pixel within the dark circle detection area, the first color mapping formula is used to determine the color value of the target color component of the pixel based on the L component and B component of the pixel. Determining the color value of the target color component of each pixel in the cheek region based on at least a portion of the L, A, and B components of each pixel in the cheek region includes: For any pixel within the cheek area, the first color mapping formula is used to determine the color value of the target color component of the pixel based on the L component and B component of the pixel. In the first color mapping formula, the color value of the target color component is positively correlated with the B component and negatively correlated with the L component.

4. The method of claim 3, wherein, The first color mapping formula is: color pig = k1*b - k2*l; Among them, color pig The color value of the target color component is represented by b, the B component is represented by l, and k1 and k2 are both positive numbers.

5. The method of claim 2, wherein, If the dark circles are vascular dark circles, determining the color value of the target color component of each pixel in the dark circle detection area based on at least a portion of the L, A, and B components of each pixel in the dark circle detection area includes: For any pixel within the dark circle detection area, the second color mapping formula is used to determine the color value of the target color component of the pixel based on the B component and A component of the pixel. Determining the color value of the target color component of each pixel in the cheek region based on at least a portion of the L, A, and B components of each pixel in the cheek region includes: For any pixel within the cheek area, the second color mapping formula is used to determine the color value of the target color component of the pixel based on the B component and A component of the pixel. In the second color mapping formula, the color value of the target color component is negatively correlated with the B component and positively correlated with the A component.

6. The method of claim 5, wherein, The second color mapping formula is: color vas = -b * k3 + a * k4; Among them, color vas The color value of the target color component is represented by b, the B component is represented by a, and k3 and k4 are both positive numbers.

7. The method according to any one of claims 1-6, wherein, The first color value of the target color component of the dark circle detection area includes the color value of the target color component of each pixel in the dark circle detection area. The color component difference includes the pixel color component difference between the color value of the target color component of each pixel in the dark circle detection area and the second color value of the target color component of the cheek area. Determining the dark circle information in the dark circle detection area based on the color component difference includes: For any pixel within the dark circle detection area, The difference between the pixel color components corresponding to the pixel is compared with the difference threshold. If the difference in the pixel color components corresponding to the pixel is greater than the difference threshold, then the pixel is determined to belong to the dark circle; otherwise, the pixel is determined not to belong to the dark circle, so as to obtain the dark circle area containing the dark circle. The dark circle information is determined based on the dark circle area.

8. The method of claim 7, wherein, If the dark circles are pigmented dark circles, before comparing the difference between the pixel color components corresponding to any pixel within the dark circle detection area and a difference threshold, the method further includes: The pixel values ​​of each pixel in the cheek area are converted to the LAB color space to obtain the L component of each pixel in the cheek area. The average L component of each pixel in the cheek region is obtained by averaging the L components of the cheek region. The difference threshold is determined based on the average L component within the cheek region using the first threshold calculation formula. In the first threshold calculation formula, the difference threshold is positively correlated with the average L component.

9. The method of claim 7, wherein, If the dark circles are vascular dark circles, before comparing the difference between the pixel color components corresponding to any pixel within the dark circle detection area and a difference threshold, the method further includes: The pixel values ​​of each pixel in the cheek area are converted to the LAB color space to obtain the L component of each pixel in the cheek area. The pixel values ​​of each pixel in the dark circle detection area are converted to the LAB color space to obtain the B component of each pixel in the dark circle detection area. The average L component of each pixel in the cheek region is obtained by averaging the L components of the cheek region. For any pixel within the dark circle detection area, the second threshold calculation formula is used to determine the difference threshold corresponding to the pixel based on the B component of the pixel and the average L component within the cheek area. In the second threshold calculation formula, the difference threshold is negatively correlated with the average L component and positively correlated with the B component.

10. The method according to any one of claims 1-6, wherein, The step of determining the dark circle information within the dark circle detection area based on the color component difference includes: Based on the color component difference, the dark circle area containing the dark circle is determined; Perform one or more of the following operations on the dark circle area to determine the dark circle information: The area ratio between the dark circle region and the dark circle detection region is calculated as the dark circle percentage. The average value of the pixel color component differences corresponding to each pixel in the dark circle area is calculated as the color depth information of the dark circle; The severity of the dark circles is determined based on the proportion of dark circles and / or the color depth of the dark circles.

11. The method according to any one of claims 1-6, wherein, Determining the dark circle detection region in the image to be processed includes: Key point detection is performed on the image to be processed to obtain facial key points, which include a set of eye key points; Select a first group of eye key points and a second group of eye key points from the set of eye key points. The first group of eye key points includes at least one eye key point located on the lower eyelid and whose distance from the inner corner key point is less than or equal to a first distance threshold. The second group of eye key points includes at least one eye key point located on the lower eyelid and whose distance from the middle key point of the eye is less than or equal to a second distance threshold. The middle key point of the eye is the eye key point located on the lower eyelid and closest to the midpoint between the inner corner key point and the outer corner key point. The inner corner key point and the outer corner key point are the eye key points located at the inner corner and outer corner of the eye, respectively, in the set of eye key points. Move each eye key point among the selected eye key points to make each eye key point generate a first target displacement, and determine the moved eye key points as a first set of dark circle key points, wherein the angle between the first target displacement and the first direction is less than 90 degrees, and the first direction is the downward direction along the face midline of the face in the image to be processed. Move at least one of the selected eye key points to cause a second target displacement of the at least one eye key point, and determine the at least one eye key point after the movement as a second set of dark circle key points, wherein the angle between the second target displacement and the first direction is less than 90 degrees, and the component of the second target displacement in the first direction corresponding to the same eye key point among the selected eye key points is greater than the component of the first target displacement in the first direction corresponding to that eye key point; At least the first set of key points for dark circles and the second set of key points for dark circles are combined to obtain a total set of key points for dark circles. Based on each key point in the set of key points for dark circles, a boundary line for dark circles is generated, and the area within the boundary line is determined as the dark circle detection area.

12. The method of claim 11, wherein, During the movement of any of the selected eye key points, the farther the eye key point is from the inner corner of the eye key point, the greater the component of the first target displacement and / or the second target displacement in the first direction. And / or, Before moving each of the selected eye keypoints to produce a first target displacement, the method further includes: Based on the positional difference between the inner corner of the eye key point and the outer corner of the eye key point, a first reference distance is determined; or, if the facial key points also include a set of facial midline key points, two facial midline key points are selected from the set of facial midline key points, and the first reference distance is determined based on the positional difference between the two facial midline key points. The first target displacement is determined based on the first reference distance, and the magnitude of the first target displacement is proportional to the first reference distance by a first target ratio. And / or, Before moving at least one of the selected eye keypoints to produce a second target displacement, the method further includes: Based on the positional difference between the inner corner of the eye key point and the outer corner of the eye key point, a second reference distance is determined; or, if the facial key points also include a set of facial midline key points, two facial midline key points are selected from the set of facial midline key points, and the second reference distance is determined based on the distance between the two facial midline key points. The second target displacement is determined based on the second reference distance, and the magnitude of the second target displacement is proportional to the second reference distance in a second target ratio. And / or, The facial key points also include a set of nose key points. Before merging at least the first set of dark circle key points and the second set of dark circle key points to obtain a total set of dark circle key points, the method further includes: A first group of nose key points and a second group of nose key points are selected from the set of nose key points. The first group of nose key points includes at least one nose key point located on the first side and whose distance from the nose roof key point is less than or equal to a third distance threshold. The second group of nose key points includes at least one nose key point located on the first side and whose distance from the nose roof key point is greater than or equal to a fourth distance threshold and less than or equal to a fifth distance threshold. When the set of eye key points belongs to the left eye, the first side is the left side of the nose. When the set of eye key points belongs to the right eye, the first side is the right side of the nose. The nose roof key point is the nose key point located at the top of the first side. The fourth distance threshold is greater than or equal to the third distance threshold. Move each of the selected nose key points to generate a third target displacement, and determine the moved nose key points as the third set of dark circle key points. The angle between the third target displacement and the second direction is less than 90 degrees. The second direction is a direction that is perpendicular to the first direction and faces the second side. When the eye key point set belongs to the left eye, the second side is the left side of the face. When the eye key point set belongs to the right eye, the second side is the right side of the face. Move at least one of the selected nose key points to generate a fourth target displacement, and determine the moved at least one nose key point as the fourth set of dark circle key points, wherein the angle between the fourth target displacement and the second direction is less than 90 degrees, and the component of the fourth target displacement corresponding to the same nose key point in the second direction is greater than the component of the third target displacement corresponding to that nose key point in the second direction; The step of merging at least the first set of key points for dark circles and the second set of key points for dark circles together to obtain a total set of key points for dark circles includes: The first set of key points for dark circles, the second set of key points for dark circles, the third set of key points for dark circles, and the fourth set of key points for dark circles are merged together to obtain the total set of key points for dark circles.

13. The method according to any one of claims 1-6, wherein, Determining the cheek region in the image to be processed includes: Key point detection is performed on the image to be processed to obtain facial key points, which include a set of eye key points, a set of nose key points, and a set of lower facial contour key points. Select a third group of eye key points and a fourth group of eye key points from the set of eye key points. The third group of eye key points includes at least one eye key point located on the lower eyelid and whose distance from the inner corner of the eye key point is less than or equal to a sixth distance threshold. The fourth group of eye key points includes at least one eye key point located on the lower eyelid and whose distance from the outer corner of the eye key point is less than or equal to a seventh distance threshold. The inner corner of the eye key point and the outer corner of the eye key point are eye key points located at the inner corner of the eye and the outer corner of the eye, respectively, in the set of eye key points. Move each of the selected eye key points to generate a fifth target displacement, and determine the moved eye key points as a first cheek key point set, wherein the angle between the fifth target displacement and the first direction is less than 90 degrees, and the first direction is the downward direction along the face midline of the face in the image to be processed. A third group of nasal key points and a fourth group of nasal key points are selected from the set of nasal key points. The third group of nasal key points includes at least one nasal key point located on the first side and whose distance from the nasal roof key point is less than or equal to an eighth distance threshold. The fourth group of nasal key points includes at least one nasal key point located on the first side and whose distance from the nasal wing key point is less than or equal to a ninth distance threshold. When the set of eye key points belongs to the left eye, the first side is the left side of the nose. When the set of eye key points belongs to the right eye, the first side is the right side of the nose. The nasal roof key point is the nasal key point located at the top of the first side. The nasal wing key point is the nasal key point located on the first side and on the nasal wing. Move each of the selected nose key points to generate a sixth target displacement, and determine the moved nose key points as the second cheek key point set, wherein the angle between the sixth target displacement and the second direction is less than 90 degrees, the second direction is a direction perpendicular to the first direction and facing the second side, the second side is the left side of the face when the eye key point set belongs to the left eye, and the second side is the right side of the face when the eye key point set belongs to the right eye; Select a portion of the lower facial contour key points from the set of lower facial contour key points at target intervals; For each of the selected lower facial contour key points, interpolation is performed between the target point and the lower facial contour key point based on the distance between the target point and the lower facial contour key point to obtain a third set of cheek key points. The distance between the target point and the midline of the face in the image to be processed is less than or equal to the tenth distance threshold. The first set of cheek key points, the second set of cheek key points, and the third set of cheek key points are merged together to obtain the total set of cheek key points; A cheek boundary line is generated based on each key point in the set of cheek key points, and the area within the cheek boundary line is defined as the cheek region.

14. The method according to any one of claims 1-6, wherein, The dark circle detection area is a thumb-shaped region located below the target eye. The angle between the third direction containing the axis of the thumb-shaped region and the first direction is less than 90 degrees. The first direction is downward along the midline of the face in the image to be processed, and the third direction is towards the tip of the thumb. For the first projection of the boundary line of the thumb-shaped region in the first direction, the distance between the first end of the first projection and the inner corner of the target eye in the first direction is less than or equal to the eleventh distance threshold, the distance between the second end of the first projection and the inner corner of the eye in the first direction is greater than or equal to the twelfth distance threshold and less than or equal to the thirteenth distance threshold, and the eleventh distance threshold is less than the twelfth distance threshold. For the second projection of the boundary line of the thumb-shaped region in the second direction, the distance between the first end of the second projection and the inner corner of the eye in the second direction is greater than or equal to the fourteenth distance threshold, and the distance between the second end of the second projection and the center point of the target eye in the second direction is less than or equal to the fifteenth distance threshold. The second direction is a direction perpendicular to the first direction and facing the second side. When the target eye is the left eye, the second side is the left side of the face. When the target eye is the right eye, the second side is the right side of the face.

15. The method according to any one of claims 1-6, wherein, Before determining the first color value of the target color component of the dark circle detection area and the second color value of the target color component of the cheek area, the method further includes: Obtain type information input by the user, which indicates the type of dark circles under the eyes; The determination of the first color value of the target color component of the dark circle detection area and the second color value of the target color component of the cheek area includes: Based on the type of dark circles indicated by the type information, a first color value of the target color component of the dark circle detection area and a second color value of the target color component of the cheek area are determined.

16. An electronic device comprising a processor and a memory, wherein, The memory stores computer program instructions, which, when executed by the processor, are used to perform the dark circle detection method as described in any one of claims 1 to 15.

17. A storage medium on which program instructions are stored, wherein, The program instructions, when executed, are used to perform the dark circle detection method as described in any one of claims 1 to 15.

18. A computer program product, the computer program product comprising a computer program, wherein, The computer program, when running, is used to perform the dark circle detection method as described in any one of claims 1 to 15.