Portrait skin color detection method and device

By shooting portraits under multiple light sources to obtain the standard chrominance value range and judging the chrominance value in the image to be detected, the problem of color casting of the portrait skin color is solved, and the accuracy of detection and user experience are improved.

CN119296146APending Publication Date: 2025-01-10HONOR DEVICE CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202310844508.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-07-10
Publication Date
2025-01-10

AI Technical Summary

Technical Problem

The prior art is difficult to accurately detect whether the skin color of a portrait is cast due to different shooting light sources, affecting the user experience.

Method used

By taking multiple portraits under multiple different light sources, a standard chromaticity value range is obtained, and the skin area is extracted based on the key point data of the face in the image to be detected, and whether its chromaticity value is within the standard chromaticity value range is determined. If there is, it is sure that the skin color is not cast.

Benefits of technology

It realizes accurate detection of whether the portrait skin color is cast due to different light sources, improving the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119296146A_ABST
    Figure CN119296146A_ABST
Patent Text Reader

Abstract

The invention provides a portrait skin color detection method and device, and the method can detect whether the skin color of a human face in a to-be-detected image is cast or not by comparing the chromatic value of a skin color region of the human face in the to-be-detected image with a standard chromatic value range. The method comprises the following steps: performing face detection and face segmentation extraction on a to-be-detected image to obtain key point data in a face in the to-be-detected image; a target image is obtained based on the key point data corresponding to the five sense organs of the face in the to-be-detected image and the key point data of the face contour, and the target image does not include the five sense organs; converting the color values of the plurality of pixel points of the target image into chromatic values of the target image; based on the chromatic value of the target image and a standard chromatic value range parameter, whether the skin color of the face in the to-be-detected image has color cast or not is judged, and the standard chromatic value range is determined based on the chromatic value of the skin color area of the face in multiple first images shot under multiple different light sources.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of terminal technology, and in particular to a method and device for detecting skin color of a portrait. Background Art

[0002] In the case where the image to be detected includes a portrait, the color cast of the skin color in the portrait will affect the user experience. Therefore, the terminal device or other device usually needs to detect the skin color in the portrait to determine whether the skin color in the portrait has a color cast. In an example scenario, since the terminal device adjusts the white balance parameters of the camera according to the light at the time of shooting and the entire scene content in the shooting picture when shooting an image or video, the skin color of the portrait taken in different scenes may have a color cast. Therefore, after the terminal device shoots a portrait, the terminal device or other device can detect the skin color of the portrait, and display the portrait if the skin color of the portrait is not cast; if the skin color of the portrait has a color cast, the terminal device or other device can first adjust the portrait, such as adjusting the RGB component of the portrait data, to reduce the color cast of the skin color of the portrait taken in different scenes, thereby improving the user's shooting experience.

[0003] There is an urgent need to provide a method for detecting whether the skin color in a portrait is color cast. Summary of the invention

[0004] The present application provides a method and device for detecting skin color of a portrait, which can detect whether the skin color of the face in the image to be detected is color cast by comparing the chromaticity value of the skin color area of ​​the face in the image to be detected with a standard chromaticity value range.

[0005] In a first aspect, a method for detecting skin color of a portrait is provided, the method comprising: performing face detection and face segmentation extraction on an image to be detected to obtain key point data of the face in the image to be detected, the key point data including key point data corresponding to facial features of the face in the image to be detected and key point data of facial contour; obtaining a target image based on the key point data corresponding to the facial features of the face in the image to be detected and the key point data of facial contour, the target image not including the facial features; converting color values ​​of multiple pixel points of the target image into chromaticity values ​​of the target image; judging whether there is color cast in the skin color of the face in the image to be detected based on the chromaticity value of the target image and a standard chromaticity value range parameter, the standard chromaticity value range being determined based on the chromaticity values ​​of the skin color areas of the faces in multiple first images taken under multiple different light sources.

[0006] The method for detecting the skin color of a portrait of the present application first takes multiple portraits under multiple different light sources, and the standard chromaticity value range can be obtained through the chromaticity values ​​of the multiple portraits. When it is necessary to determine whether the skin color of the face in the image to be detected is color cast, the skin area in the face is extracted based on the key point data of the face in the image to be detected, and it is determined whether the chromaticity value of the skin area is within the standard chromaticity value range. If so, it is determined that the skin color of the face in the image to be detected does not have a color cast. Since the multiple portraits are taken under multiple light sources, the standard chromaticity value range can represent the chromaticity value range of the skin color of the portrait under the multiple light sources; therefore, if the chromaticity value of the skin area in the image to be detected taken under the first light source is within the standard chromaticity value range, it means that the deviation of the skin color of the portrait caused by the different light sources is within the acceptable range, so it can be determined that the skin color of the face of the image to be detected has no deviation. It can be seen that such a method for detecting the skin color of a portrait can accurately detect whether the skin color of the portrait is color cast due to different shooting light sources.

[0007] It should be understood that the image to be detected can be an image taken by the terminal device, or an image taken by other devices and sent to the terminal device. Face detection on the image to be detected can be a process of face recognition and key point positioning on the image to be detected. Through face detection, the terminal device can determine the position of the face in the image to be detected; and the terminal device can locate the key points of the face in the image to be detected. Face segmentation and extraction can be understood as the process of the terminal device extracting the face image through the key points of the face, and the extracted face image includes the key point data of the face. The key point data corresponding to the facial features can include the key point data corresponding to the eyes of the face, the key point data corresponding to the eyebrows of the face, the key point data corresponding to the nose of the face, and the key point data corresponding to the lips of the face.

[0008] In certain implementations of the first aspect, the standard chromaticity value range parameter is used to indicate the chromaticity value inside the graphic area obtained by calibrating the chromaticity value of the skin color area of ​​the face in the multiple first images in the chromaticity space.

[0009] It should be understood that the number of chromaticity values ​​of the skin color area of ​​the face in the plurality of first images is the same as the number of the first images. The chromaticity value may be a two-dimensional value, and correspondingly, the chromaticity space may refer to a coordinate system that can be used to determine the position of the chromaticity value. The graphic area may be a regular or irregular graphic. The chromaticity value inside the graphic area may also include the chromaticity value corresponding to the edge of the graphic area.

[0010] In certain implementations of the first aspect, the graphic area is a circular area, and the standard chromaticity value range parameters include the chromaticity value of the center of the circular area and the radius of the circular area.

[0011] It should be understood that the chromaticity value at the center of the circular area can also be called the standard skin color center, and the radius of the circular area can also be called the range radius. Through the chromaticity value at the center of the circular area and the radius of the circular area, a circular area in the chromaticity space can be determined, and the chromaticity value covered by the circular area is within the standard chromaticity value range. By calibrating the chromaticity values ​​of the skin color areas of the faces in the multiple first images in the chromaticity space to obtain a graphic area, it is convenient for the terminal device to determine whether the chromaticity value of the target image is within the standard chromaticity value range through the chromaticity value at the center of the circular area and the radius of the circular area, which helps to improve the efficiency of the method for detecting the skin color of the portrait.

[0012] In certain implementations of the first aspect, the graphic area is an elliptical area, and the standard chromaticity value range parameters include the chromaticity value of the center of the elliptical area, the major radius and the minor radius of the elliptical area.

[0013] It should be understood that when the distribution of the chromaticity values ​​of the skin color area of ​​the face in the plurality of first images in the chromaticity space is close to an ellipse, the graphic area may be an elliptical area, which helps to improve the accuracy of the standard chromaticity value range.

[0014] In certain implementations of the first aspect, determining whether the skin color of the face in the image to be detected has color cast based on the chromaticity values ​​of the target image and the standard chromaticity value range parameters includes: determining whether the chromaticity values ​​of the target image are within a graphic area obtained based on the standard chromaticity value range parameters; if so, determining that the skin color of the face in the image to be detected has no color cast.

[0015] It should be understood that the standard chromaticity value range parameter can indicate the standard chromaticity value range, and the chromaticity value covered by the graphic area is a chromaticity value within the standard chromaticity value range, so when the chromaticity value of the target image is within the graphic area, it means that the chromaticity value of the target image is within the standard chromaticity value range. When the chromaticity value of the target image is within the standard chromaticity value range, it means that the change in the chromaticity value of the skin color of the portrait due to the different light sources is small, indicating that there is no color cast in the skin color of the face in the image to be detected.

[0016] In certain implementations of the first aspect, the method further includes: performing face detection and face segmentation extraction on the multiple first images to obtain key point data in the face of each of the multiple first images; obtaining multiple second images based on the key point data of the face contour and the key point data corresponding to the facial features in each of the first images, wherein each of the multiple second images does not include the facial features; converting the color values ​​of multiple pixel points of each second image into chromaticity values ​​of each second image, and determining the chromaticity values ​​of each second image as the chromaticity values ​​of the skin color area of ​​each first image; calibrating the chromaticity values ​​of the skin color area of ​​the multiple first images in the chromaticity space to obtain the standard chromaticity value range parameters.

[0017] It should be understood that the above steps can be understood as a method for determining the standard chromaticity value range parameters. The method for determining the standard chromaticity value range parameters can be executed by the terminal device or by other devices.

[0018] In certain implementations of the first aspect, obtaining a target image based on key point data corresponding to facial features and key point data of facial contour in the image to be detected includes: extracting an area formed by the key point data of the facial contour in the image to be detected to obtain a third image, and removing an area formed by the key point data corresponding to the facial features in the image to be detected from the third image to obtain the target image.

[0019] It should be understood that the third image includes the complete face area. The target image is an image obtained by removing the facial features in the third image. The facial features may include eyebrows, eyes and lips; or may include eyebrows, eyes, nose and lips.

[0020] In certain implementations of the first aspect, obtaining the target image based on the key point data corresponding to the facial features and the key point data of the facial contour in the image to be detected includes: extracting an area formed by the key point data of the facial contour below a preset position of the face in the image to be detected to obtain a fourth image, and removing an area formed by the key point data corresponding to the lips from the fourth image to obtain the target image.

[0021] It should be understood that since the forehead of a face is easily blocked by objects such as hair and hats, the key points of the face contour do not necessarily include the key points of the contour of the forehead part of the face. When acquiring the target image, the area formed by the key point data of the face contour below the preset position in the face can be extracted to obtain the fourth image, so that the phenomenon of skin being blocked in the fourth image is reduced. The preset position can be any preset position.

[0022] In certain implementations of the first aspect, the preset position is the position of the eyes of the human face in the image to be detected, the position of the nose of the human face in the image to be detected, the position of one-half of the human face in the image to be detected, or the position of one-third of the human face in the image to be detected.

[0023] It should be understood that the one-third position of the face may refer to the one-third position of the upper part of the face or the one-third position of the lower part of the face. When the one-third position of the face refers to the one-third position of the upper part of the face, the area formed by the key point data corresponding to the lips, the area formed by the key point data corresponding to the eyes, and the area formed by the key points corresponding to the eyebrows are removed from the fourth image.

[0024] In certain implementations of the first aspect, the method also includes: extracting the edge line of the face in the image to be detected; selecting key point data within a preset range around the edge line of the face in the image to be detected from the key point data of the face contour in the image to be detected as target edge key point data; determining whether the number of key points corresponding to the target edge key point data is less than or equal to a first threshold; obtaining the target image based on the key point data corresponding to the facial features of the face in the image to be detected and the key point data of the face contour, includes: when the number of key points corresponding to the target edge key point data is less than or equal to the first threshold, obtaining the target image based on the target edge key point data and the key point data corresponding to the facial features in the image to be detected.

[0025] It should be understood that the edge line can also be called a contour line. The preset range can refer to the area formed by points whose shortest distance from the edge line is less than or equal to the preset distance. The key point data within the preset range around the edge line of the face in the image to be detected can be selected in the following way: determine the shortest distance from the edge line to each key point data in the key point data of the face contour, if the shortest distance is less than or equal to the preset distance, then each key point is a key point within the preset range. The above steps can be understood as a process of determining whether the line connecting the key points corresponding to the key point data of the face contour is the edge line of the face. Through this process, the key point data that is not on the edge line of the face can be removed, and at the same time, it can be determined that the line connecting the target edge key points is not the edge line of the face, thereby improving the accuracy of the target image obtained, thereby improving the accuracy of the portrait skin color detection method.

[0026] In certain implementations of the first aspect, the method further includes: when the number of the target edge key points is greater than the first threshold, re-performing face detection and face segmentation extraction on the image to be detected to obtain new key point data in the face in the image to be detected.

[0027] It should be understood that the first threshold is a preset positive value. When the number of key points corresponding to the target edge key point data is greater than the first threshold, it means that the line connecting the target edge key points is not the edge line of the face, which means that the target edge key points obtained by the terminal device are located at other positions of the portrait, such as the hair or neck area of ​​the portrait. Through this solution, the accuracy of the obtained target image can be improved, thereby improving the accuracy of the portrait skin color detection method.

[0028] In certain implementations of the first aspect, the method also includes: determining whether there is an occlusion area in the target image; converting the color values ​​of multiple pixels of the target image into chromaticity values ​​of the target image includes: when there is no occlusion area in the target image, converting the color values ​​of the multiple pixels into chromaticity values ​​of the target image.

[0029] It should be understood that the occluded area may be an area occluded by hair, an area occluded by eyes, an area occluded by a mask, etc. The existence of the occluded area will make it difficult for the chromaticity value of the acquired target image to accurately indicate the chromaticity value of the skin color of the face, thereby reducing the accuracy of the portrait skin color detection method.

[0030] In certain implementations of the first aspect, determining whether there is an occlusion area in the target image includes: determining whether each pixel is an occlusion pixel based on the chromaticity value of each pixel in the target image and the standard chromaticity value range parameter, and determining the number of occlusion pixels; determining whether the number of occlusion pixels is greater than or equal to a second threshold; and determining that there is an occlusion area in the target image when the number of occlusion pixels is greater than or equal to the second threshold.

[0031] It should be understood that the chromaticity value of each pixel in the target image that differs too much from the chromaticity value in the standard chromaticity value range is not the chromaticity value of the normal skin color of the face, and the pixel can be called an occluded pixel. Through the above technical solution, the non-skin area in the target image can be determined. For example, when objects such as hair, glasses, and masks occlude the face, the area in the target image where objects such as hair, glasses, and masks occlude the face is the occluded area. By removing the occluded area, the non-skin area in the target image can be reduced, thereby improving the accuracy of the portrait skin color detection method.

[0032] In certain implementations of the first aspect, the color values ​​of the multiple pixel points are multiple red, green, blue, RGB color values; converting the color values ​​of the multiple pixel points of the target image into chromaticity values ​​of the target image includes: calculating the mean of each component of the multiple RGB color values; converting the mean of each component into a color model LAB color value, wherein the LAB color value includes a brightness value and the chromaticity value of the target image.

[0033] It should be understood that the LAB color value includes the L value and the AB value, wherein the L value is the brightness value of the target image, and the AB value is the chromaticity value of the target image. The RGB color value may be related to the device type and the operating system type of the device, while the LAB value is irrelevant to the device type and the operating system type of the device, and will not vary from device to device. Therefore, by converting multiple RGB color values ​​into LAB values, the accuracy of the portrait skin color detection method can be improved.

[0034] In certain implementations of the first aspect, the method further includes: when there is color cast on the skin color of a face in the image to be detected, adjusting the RGB components of the image to be detected based on the standard chromaticity value range parameter.

[0035] It should be understood that when there is color cast on the skin color of the face in the image to be detected, the terminal device can adjust the image to be detected, for example, adjust the RGB components of the image to be detected, so that the chromaticity value of the target image obtained based on the image to be detected is within the standard chromaticity value range indicated by the standard chromaticity value range parameter. In this way, the terminal device can display the image to be detected without color cast, thereby improving the user experience.

[0036] In certain implementations of the first aspect, the plurality of different light sources include standard light sources and custom light sources.

[0037] It should be understood that the custom light source can be a light source for a specific scene artificially simulated, for example, a light source in a movie theater scene, etc. By shooting a plurality of first images under a standard light source and a custom light source, the standard chromaticity value range indicated by the standard chromaticity value range parameter can indicate the color cast range of the portrait skin color under a plurality of different light sources, which helps to improve the accuracy of the portrait skin color detection method.

[0038] In a second aspect, a device for detecting skin color of a portrait is provided, which is used to execute the method in any possible implementation of the first aspect. Specifically, the device includes a module for executing the method in any possible implementation of the first aspect.

[0039] In a third aspect, the present application provides another device for detecting skin color of a portrait, comprising a processor, the processor being coupled to a memory, and being used to execute instructions in the memory to implement the method in any possible implementation of the first aspect. Optionally, the device further comprises a memory. Optionally, the device further comprises a communication interface, the processor being coupled to the communication interface.

[0040] In another implementation, the device is a chip configured in a terminal device. When the device is a chip configured in a terminal device, the communication interface may be an input / output interface.

[0041] In a fourth aspect, a processor is provided, comprising: an input circuit, an output circuit, and a processing circuit. The processing circuit is used to receive a signal through the input circuit and transmit a signal through the output circuit, so that the processor executes the method in any possible implementation of the first aspect.

[0042] In the specific implementation process, the processor may be a chip, the input circuit may be an input pin, the output circuit may be an output pin, and the processing circuit may be a transistor, a gate circuit, a trigger, and various logic circuits. The input signal received by the input circuit may be received and input by, for example, but not limited to, a receiver, and the signal output by the output circuit may be, for example, but not limited to, output to a transmitter and transmitted by the transmitter, and the input circuit and the output circuit may be the same circuit, which is used as an input circuit and an output circuit at different times. The embodiments of the present application do not limit the specific implementation methods of the processor and various circuits.

[0043] In a fifth aspect, a processing device is provided, comprising a processor and a memory. The processor is used to read instructions stored in the memory, and can receive signals through a receiver and transmit signals through a transmitter to execute the method in any possible implementation of the first aspect.

[0044] Optionally, the number of the processors is one or more, and the number of the memories is one or more.

[0045] Optionally, the memory may be integrated with the processor, or the memory may be provided separately from the processor.

[0046] In the specific implementation process, the memory can be a non-transitory memory, such as a read-only memory (ROM), which can be integrated with the processor on the same chip or can be set on different chips respectively. This application does not limit the type of memory and the setting method of the memory and the processor.

[0047] It should be understood that the related data interaction process, such as sending indication information, may be a process of outputting indication information from a processor, and receiving capability information may be a process of receiving input capability information from a processor.

[0048] The processing device in the fifth aspect mentioned above can be a chip. The processor can be implemented by hardware or by software. When implemented by hardware, the processor can be a logic circuit, an integrated circuit, etc.; when implemented by software, the processor can be a general-purpose processor, which is implemented by reading the software code stored in the memory. The memory can be integrated in the processor or can be located outside the processor and exist independently.

[0049] In a sixth aspect, a computer program product is provided, the computer program product comprising: a computer program (also referred to as code, or instruction), which, when executed, enables a computer to execute a method in any possible implementation of the first aspect.

[0050] In a seventh aspect, a computer-readable storage medium is provided, which stores a computer program (also referred to as code, or instructions) which, when executed on a computer, enables the computer to execute a method in any possible implementation of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] Figure 1 A schematic diagram of the structure of a terminal device provided in an embodiment of the present application;

[0052] Figure 2 A software structure block diagram of a terminal device according to an embodiment of the present application;

[0053] Figure 3 A schematic diagram of a process for detecting skin color of a portrait provided in an embodiment of the present application;

[0054] Figure 4 A schematic diagram of a process of constructing a face model provided in an embodiment of the present application;

[0055] Figure 5 A schematic diagram of a process for determining whether the skin color of a portrait is color cast provided in an embodiment of the present application;

[0056] Figure 6 A flow chart of a method for determining a standard chromaticity value range parameter provided in an embodiment of the present application;

[0057] Figure 7 A schematic diagram of a process for acquiring a target image provided by an embodiment of the present application;

[0058] Figure 8 A schematic diagram of a preset position in a face provided in an embodiment of the present application;

[0059] Fig. 9 A schematic diagram of another process of acquiring a target image provided by an embodiment of the present application;

[0060] Fig.10 A flowchart of a method for determining whether a line connecting key points of a face contour is a face edge line provided in an embodiment of the present application;

[0061] Fig.11 A schematic diagram of another target image acquisition process provided in an embodiment of the present application;

[0062] Fig.12 A flowchart of a method for determining whether there is an occluded area in a target image provided by an embodiment of the present application;

[0063] Fig.13 A schematic diagram of a flow chart of another method for detecting skin color of a portrait provided in an embodiment of the present application;

[0064] Fig.14 A schematic diagram of a process of detecting skin color of a portrait provided in an embodiment of the present application;

[0065] Fig.15 A schematic block diagram of a device for detecting skin color of a portrait provided in an embodiment of the present application;

[0066] Fig.16 A schematic block diagram of another device for detecting skin color of a portrait provided in an embodiment of the present application. DETAILED DESCRIPTION

[0067] The technical solution in this application will be described below in conjunction with the accompanying drawings.

[0068] In the embodiments of the present application, words such as "first" and "second" are used to distinguish between identical or similar items with substantially identical functions and effects. For example, the first value and the second value are only used to distinguish between different values, and do not limit their order. Those skilled in the art will understand that words such as "first" and "second" do not limit the quantity and execution order, and words such as "first" and "second" do not necessarily limit them to be different.

[0069] It should be noted that in the embodiments of the present application, words such as "exemplarily" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplarily" or "for example" in the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplarily" or "for example" is intended to present related concepts in a specific way.

[0070] In the embodiments of the present application, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, a--c, bc, or abc, where a, b, c can be single or multiple.

[0071] The terminal device provided in the embodiment of the present application is a terminal device with a touch screen, which can be a mobile phone, a tablet computer (pad), a desktop computer, a laptop computer, etc. The embodiment of the present application does not limit the specific technology and specific device form adopted by the terminal device.

[0072] In order to better understand the terminal device in the embodiment of the present application, Figure 1 The hardware structure of the terminal device in the embodiment of the present application is described in detail.

[0073] Figure 1 This is a schematic diagram of the structure of the terminal device 100 provided in the embodiment of the present application. Figure 1 As shown, the terminal device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0074] It is understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the terminal device 100. In other embodiments of the present application, the terminal device 100 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0075] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

[0076] The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of instruction fetching and execution.

[0077] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0078] In some embodiments, the processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.

[0079] The I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 may include multiple groups of I2C buses. The processor 110 may be coupled to the touch sensor 180K, the charger, the flash, the camera 193, etc. through different I2C bus interfaces. For example: the processor 110 may be coupled to the touch sensor 180K through the I2C interface, so that the processor 110 communicates with the touch sensor 180K through the I2C bus interface, thereby realizing the touch function of the terminal device 100.

[0080] The I2S interface can be used for audio communication. In some embodiments, the processor 110 can include multiple I2S buses. The processor 110 can be coupled to the audio module 170 via the I2S bus to achieve communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 can transmit an audio signal to the wireless communication module 160 via the I2S interface to achieve the function of answering a call through a Bluetooth headset.

[0081] The PCM interface can also be used for audio communication, sampling, quantizing and encoding analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 can be coupled via a PCM bus interface. In some embodiments, the audio module 170 can also transmit audio signals to the wireless communication module 160 via the PCM interface to realize the function of answering calls via a Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.

[0082] The UART interface is a universal serial data bus for asynchronous communication. The bus can be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, the UART interface is generally used to connect the processor 110 and the wireless communication module 160. For example, the processor 110 communicates with the Bluetooth module in the wireless communication module 160 through the UART interface to implement the Bluetooth function. In some embodiments, the audio module 170 can transmit an audio signal to the wireless communication module 160 through the UART interface to implement the function of playing music through a Bluetooth headset.

[0083] The MIPI interface can be used to connect the processor 110 with peripheral devices such as the display screen 194 and the camera 193. The MIPI interface includes a camera serial interface (CSI), a display serial interface (DSI), etc. In some embodiments, the processor 110 and the camera 193 communicate via the CSI interface to implement the shooting function of the terminal device 100. The processor 110 and the display screen 194 communicate via the DSI interface to implement the display function of the terminal device 100.

[0084] The GPIO interface can be configured by software. The GPIO interface can be configured as a control signal or as a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 with the camera 193, the display 194, the wireless communication module 160, the audio module 170, the sensor module 180, etc. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.

[0085] The USB interface 130 is an interface that complies with the USB standard specification, and specifically can be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 130 can be used to connect a charger to charge the terminal device 100, and can also be used to transmit data between the terminal device 100 and peripheral devices. It can also be used to connect headphones to play audio through the headphones. The interface can also be used to connect other terminal devices, such as AR devices, etc.

[0086] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present application is only a schematic illustration and does not constitute a structural limitation on the terminal device 100. In other embodiments of the present application, the terminal device 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.

[0087] The charging management module 140 is used to receive charging input from a charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 may receive charging input from a wired charger through the USB interface 130. In some wireless charging embodiments, the charging management module 140 may receive wireless charging input through a wireless charging coil of the terminal device 100. While the charging management module 140 is charging the battery 142, it may also power the terminal device through the power management module 141.

[0088] The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and supplies power to the processor 110, the internal memory 121, the display screen 194, the camera 193, and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle number, battery health status (leakage, impedance), etc. In some other embodiments, the power management module 141 can also be set in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 can also be set in the same device.

[0089] The wireless communication function of the terminal device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.

[0090] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in terminal device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.

[0091] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G applied to the terminal device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.

[0092] The modem processor may include a modulator and a demodulator. Among them, the modulator is used to modulate the low-frequency baseband signal to be sent into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to a speaker 170A, a receiver 170B, etc.), or displays an image or video through a display screen 194. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.

[0093] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the terminal device 100. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency of it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.

[0094] In some embodiments, the antenna 1 of the terminal device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the terminal device 100 can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology. The GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a Beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS) and / or a satellite based augmentation system (SBAS).

[0095] The terminal device 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs, which execute program instructions to generate or change display information.

[0096] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light emitting diode or an active-matrix organic light emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the terminal device 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.

[0097] The terminal device 100 can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.

[0098] ISP is used to process the data fed back by camera 193. For example, when taking a photo, the shutter is opened, and the light is transmitted to the camera photosensitive element through the lens. The light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to ISP for processing and converts it into an image visible to the naked eye. ISP can also perform algorithm optimization on the noise, brightness, and skin color of the image. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, ISP can be set in camera 193.

[0099] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then passes the electrical signal to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the terminal device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.

[0100] The digital signal processor is used to process digital signals, and can process not only digital image signals but also other digital signals. For example, when the terminal device 100 is selecting a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.

[0101] Video codecs are used to compress or decompress digital videos. The terminal device 100 may support one or more video codecs. Thus, the terminal device 100 may play or record videos in various coding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.

[0102] NPU is a neural network (NN) computing processor. By drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain, it can quickly process input information and can also continuously self-learn. Through NPU, applications such as intelligent cognition of the terminal device 100 can be realized, such as image recognition, face recognition, voice recognition, text understanding, etc.

[0103] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the terminal device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function, such as storing music, video and other files in the external memory card.

[0104] The internal memory 121 can be used to store computer executable program codes, which include instructions. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the terminal device 100 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc. The processor 110 executes various functional applications and data processing of the terminal device 100 by running instructions stored in the internal memory 121, and / or instructions stored in a memory provided in the processor.

[0105] The terminal device 100 can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.

[0106] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be arranged in the processor 110, or some functional modules of the audio module 170 can be arranged in the processor 110.

[0107] The speaker 170A, also called a "speaker", is used to convert an audio electrical signal into a sound signal. The terminal device 100 can listen to music or listen to a hands-free call through the speaker 170A.

[0108] The receiver 170B, also called a "handset", is used to convert audio electrical signals into sound signals. When the terminal device 100 receives a call or voice message, the voice can be received by placing the receiver 170B close to the ear.

[0109] Microphone 170C, also called "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can speak by putting their mouth close to the microphone 170C to input the sound signal into the microphone 170C. The terminal device 100 can be provided with at least one microphone 170C. In other embodiments, the terminal device 100 can be provided with two microphones 170C, which can not only collect sound signals but also realize noise reduction function. In other embodiments, the terminal device 100 can also be provided with three, four or more microphones 170C to collect sound signals, reduce noise, identify the source of sound, realize directional recording function, etc.

[0110] The earphone interface 170D is used to connect a wired earphone and can be a USB interface 130 or a 3.5 mm open mobile terminal platform (OMTP) standard interface or a cellular telecommunications industry association of the USA (CTIA) standard interface.

[0111] The pressure sensor 180A is used to sense the pressure signal and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A can be set on the display screen 194. There are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, etc. The capacitive pressure sensor can be a parallel plate including at least two conductive materials. When a force acts on the pressure sensor 180A, the capacitance between the electrodes changes. The terminal device 100 determines the intensity of the pressure according to the change in capacitance. When a touch operation acts on the display screen 194, the terminal device 100 detects the touch operation intensity according to the pressure sensor 180A. The terminal device 100 can also calculate the touch position according to the detection signal of the pressure sensor 180A. In some embodiments, touch operations acting on the same touch position but with different touch operation intensities can correspond to different operation instructions. For example: when a touch operation with a touch operation intensity less than the first pressure threshold acts on the short message application icon, an instruction to view the short message is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold acts on the short message application icon, an instruction to create a new short message is executed.

[0112] The gyroscope sensor 180B can be used to determine the motion posture of the terminal device 100. In some embodiments, the angular velocity of the terminal device 100 around three axes (i.e., x, y, and z axes) can be determined by the gyroscope sensor 180B. The gyroscope sensor 180B can be used for anti-shake shooting. For example, when the shutter is pressed, the gyroscope sensor 180B detects the angle of the terminal device 100 shaking, calculates the distance that the lens module needs to compensate based on the angle, and allows the lens to offset the shaking of the terminal device 100 through reverse movement to achieve anti-shake. The gyroscope sensor 180B can also be used for navigation and somatosensory game scenes.

[0113] The air pressure sensor 180C is used to measure air pressure. In some embodiments, the terminal device 100 calculates the altitude through the air pressure value measured by the air pressure sensor 180C to assist positioning and navigation.

[0114] The magnetic sensor 180D includes a Hall sensor. The terminal device 100 can use the magnetic sensor 180D to detect the opening and closing of the flip leather case. In some embodiments, when the terminal device 100 is a flip phone, the terminal device 100 can detect the opening and closing of the flip cover according to the magnetic sensor 180D. Then, according to the detected opening and closing state of the leather case or the opening and closing state of the flip cover, the flip cover automatic unlocking and other features are set.

[0115] The acceleration sensor 180E can detect the magnitude of the acceleration of the terminal device 100 in various directions (generally three axes). When the terminal device 100 is stationary, the magnitude and direction of gravity can be detected. It can also be used to identify the posture of the terminal device and applied to applications such as horizontal and vertical screen switching and pedometers.

[0116] The distance sensor 180F is used to measure the distance. The terminal device 100 can measure the distance by infrared or laser. In some embodiments, when shooting a scene, the terminal device 100 can use the distance sensor 180F to measure the distance to achieve fast focusing.

[0117] The proximity light sensor 180G may include, for example, a light emitting diode (LED) and a light detector, such as a photodiode. The light emitting diode may be an infrared light emitting diode. The terminal device 100 emits infrared light outward through the light emitting diode. The terminal device 100 uses a photodiode to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the terminal device 100. When insufficient reflected light is detected, the terminal device 100 can determine that there is no object near the terminal device 100. The terminal device 100 can use the proximity light sensor 180G to detect that the user holds the terminal device 100 close to the ear to talk, so as to automatically turn off the screen to save power. The proximity light sensor 180G can also be used in leather case mode, and pocket mode automatically unlocks and locks the screen.

[0118] The ambient light sensor 180L is used to sense the ambient light brightness. The terminal device 100 can adaptively adjust the brightness of the display screen 194 according to the perceived ambient light brightness. The ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures. The ambient light sensor 180L can also cooperate with the proximity light sensor 180G to detect whether the terminal device 100 is in a pocket to prevent accidental touch.

[0119] The fingerprint sensor 180H is used to collect fingerprints. The terminal device 100 can use the collected fingerprint characteristics to achieve fingerprint unlocking, access application locks, fingerprint photography, fingerprint call answering, etc.

[0120] The temperature sensor 180J is used to detect temperature. In some embodiments, the terminal device 100 uses the temperature detected by the temperature sensor 180J to execute a temperature processing strategy. For example, when the temperature reported by the temperature sensor 180J exceeds a threshold, the terminal device 100 reduces the performance of the processor located near the temperature sensor 180J to reduce power consumption and implement thermal protection. In other embodiments, when the temperature is lower than another threshold, the terminal device 100 heats the battery 142 to avoid abnormal shutdown of the terminal device 100 due to low temperature. In other embodiments, when the temperature is lower than another threshold, the terminal device 100 performs a boost on the output voltage of the battery 142 to avoid abnormal shutdown caused by low temperature.

[0121] The touch sensor 180K is also called a "touch control device". The touch sensor 180K can be set on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, also called a "touch control screen". The touch sensor 180K is used to detect touch operations acting on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 194. In other embodiments, the touch sensor 180K can also be set on the surface of the terminal device 100, which is different from the position of the display screen 194.

[0122] The bone conduction sensor 180M can obtain a vibration signal. In some embodiments, the bone conduction sensor 180M can obtain a vibration signal of a vibrating bone block of the vocal part of the human body. The bone conduction sensor 180M can also contact the human pulse to receive a blood pressure beat signal. In some embodiments, the bone conduction sensor 180M can also be set in an earphone and combined into a bone conduction earphone. The audio module 170 can parse out a voice signal based on the vibration signal of the vibrating bone block of the vocal part obtained by the bone conduction sensor 180M to realize a voice function. The application processor can parse the heart rate information based on the blood pressure beat signal obtained by the bone conduction sensor 180M to realize a heart rate detection function.

[0123] The key 190 includes a power key, a volume key, etc. The key 190 may be a mechanical key or a touch key. The terminal device 100 may receive key input and generate key signal input related to user settings and function control of the terminal device 100.

[0124] Motor 191 can generate vibration prompts. Motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback. For example, touch operations acting on different applications (such as taking pictures, audio playback, etc.) can correspond to different vibration feedback effects. For touch operations acting on different areas of the display screen 194, motor 191 can also correspond to different vibration feedback effects. Different application scenarios (for example: time reminders, receiving messages, alarm clocks, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization.

[0125] The indicator 192 may be an indicator light, which may be used to indicate the charging status, power changes, messages, missed calls, notifications, etc.

[0126] The SIM card interface 195 is used to connect the SIM card. The SIM card can be connected to and separated from the terminal device 100 by inserting the SIM card interface 195 or pulling it out from the SIM card interface 195. The terminal device 100 can support 1 or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 195 can support Nano SIM card, Micro SIM card, SIM card, etc. Multiple cards can be inserted into the same SIM card interface 195 at the same time. The types of the multiple cards can be the same or different. The SIM card interface 195 can also be compatible with different types of SIM cards. The SIM card interface 195 can also be compatible with external memory cards. The terminal device 100 interacts with the network through the SIM card to realize functions such as calls and data communications. In some embodiments, the terminal device 100 uses an eSIM, i.e., an embedded SIM card. The eSIM card can be embedded in the terminal device 100 and cannot be separated from the terminal device 100. The software system of the terminal device 100 can adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present application takes the Android system with a layered architecture as an example to illustrate the software structure of the terminal device 100.

[0127] Figure 2 This is a software structure block diagram of the terminal device 100 according to an embodiment of the present application.

[0128] The layered architecture divides the software into several layers, each with clear roles and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom: the application layer, the application framework layer, the Android runtime and system library, and the kernel layer.

[0129] The application layer can include a series of application packages. Figure 2 As shown, the application package may include camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message and other applications.

[0130] The application framework layer provides application programming interface (API) and programming framework for the applications in the application layer. The application framework layer includes some predefined functions. Figure 2 As shown, the application framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, and the like.

[0131] The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc.

[0132] Content providers are used to store and retrieve data and make it accessible to applications. The data may include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.

[0133] The view system includes visual controls, such as controls for displaying text, controls for displaying images, etc. The view system can be used to build applications. A display interface can be composed of one or more views. For example, a display interface including a text notification icon can include a view for displaying text and a view for displaying images.

[0134] The phone manager is used to provide communication functions of the terminal device 100, such as management of call status (including connection, disconnection, etc.).

[0135] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.

[0136] The notification manager enables applications to display notification information in the status bar. It can be used to convey notification-type messages and can disappear automatically after a short stay without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as notifications of applications running in the background, or a notification that appears on the screen in the form of a dialog window. For example, a text message is displayed in the status bar, a prompt sound is emitted, the terminal device vibrates, the indicator light flashes, etc.

[0137] Android Runtime includes core libraries and virtual machines. Android runtime is responsible for scheduling and management of the Android system.

[0138] The core library consists of two parts: one is the function that needs to be called by the Java language, and the other is the Android core library.

[0139] The application layer and the application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.

[0140] The system library may include multiple functional modules, such as surface manager, media library, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.

[0141] The surface manager is used to manage the display subsystem and provide the fusion of 2D and 3D layers for multiple applications.

[0142] The media library supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.

[0143] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, synthesis and layer processing.

[0144] A 2D graphics engine is a drawing engine for 2D drawings.

[0145] The kernel layer is a layer between hardware and software. The kernel layer is used to drive the hardware to make the hardware work. The kernel layer at least includes display driver, screen driver, graphics processing unit (GPU) driver, camera, and sensor driver, etc., which are not limited in the embodiments of the present application. For example, the screen driver can drive the screen to turn on or off.

[0146] The photographing, video recording and image processing effects of a terminal device are usually important factors for users to consider when choosing a terminal device. In particular, when a user uses a terminal device to photograph or process a portrait, the color cast of the portrait's skin color will give the user a bad experience. For example, when a user uses a terminal device to image, the terminal device will adjust the camera's white balance parameters according to the light changes during shooting and the entire scene content in the captured image. However, when the terminal device photographs the user's portrait, because the terminal device adjusts the camera's white balance parameters differently in different scenes, the skin color of the user's portrait taken in different scenes may be different, resulting in a poor user experience.

[0147] Therefore, when the terminal device is taking pictures of a portrait or performing image processing on a portrait, the skin color in the portrait can be detected through the terminal device or other devices. If the skin color in the portrait has a large color cast, the portrait data needs to be adjusted to reduce the skin color cast of the portrait and improve the user's shooting experience.

[0148] In order to reduce the color cast phenomenon when a terminal device photographs a portrait or performs image processing on a portrait, it is currently urgent to provide a method for detecting whether the skin color in the portrait has a color cast.

[0149] The method of detecting whether the skin color in a portrait has a color cast can be applied to a variety of scenarios. For example, in one scenario, when developing a camera or image processing function of a terminal device, the performance of the terminal device in photographing a portrait or performing image processing on a portrait is detected by detecting whether the skin color in the portrait has a color cast. When a portrait photographed by the terminal device or a processed portrait has a color cast, the R&D personnel can further optimize the camera or image processing function. In another scenario, after a user uses a terminal device to photograph a portrait, the terminal device first detects the portrait by detecting whether the skin color in the portrait has a color cast before displaying the portrait. If the skin color of the portrait has a color cast, the terminal device can adjust the parameters of the portrait to correct the skin color in the portrait.

[0150] It should be understood that in the above-mentioned example scenario, the skin color of the portrait in the image to be detected can be detected by the terminal device, or the terminal device can send the image to be detected to other devices, and the other devices detect the skin color of the portrait in the image to be detected. This application does not make any specific limitations on this; the other devices can be any type of devices such as terminal devices, servers, etc., and this application does not make any specific limitations on this.

[0151] In order to solve the above technical problems, the present application provides a method and device for detecting skin color of a portrait. First, multiple portraits are taken under multiple different light sources, and a standard chromaticity value range can be obtained through the chromaticity values ​​of the multiple portraits. When it is necessary to determine whether the skin color of the face in the image to be detected is color cast, the skin area in the face is extracted based on the key point data of the face in the image to be detected, and it is determined whether the chromaticity value of the skin area is within the standard chromaticity value range. If so, it is determined that the skin color of the face in the image to be detected does not have a color cast. Since multiple portraits are taken under multiple light sources, the standard chromaticity value range can represent the chromaticity value range of the skin color of the portrait under the multiple light sources; therefore, if the chromaticity value of the skin area in the image to be detected taken under the first light source is within the standard chromaticity value range, it means that the deviation of the skin color of the portrait caused by different light sources is within an acceptable range, so it can be determined that the skin color of the face of the image to be detected has no deviation. It can be seen that such a method for detecting the skin color of a portrait can accurately detect whether the skin color of the portrait is color cast due to different shooting light sources.

[0152] Combine the following Figures 3 to 14The portrait skin color detection method of the present application is described in detail. The embodiments shown in the present application can be executed by terminal devices, such as mobile phones, tablet computers, smart bracelets, etc., and can also be executed by other types of devices such as servers. The present application does not make specific limitations on this. The specific form and quantity of each device shown therein are only examples and should not constitute any limitation on the implementation of the method provided in the present application. Below, taking the terminal device as the execution subject as an example, the portrait skin color detection method of the embodiment of the present application is described in detail.

[0153] It should be understood that the terminal device can be the terminal device itself, or a chip, chip system or processor that supports the terminal device to implement the human skin color detection method, or a logic module or software that can implement all or part of the terminal device functions. The hardware structure of the terminal device can be as follows: Figure 1 As shown, the software structure can be as follows Figure 2 As shown, this application does not make any specific limitation to this.

[0154] Figure 3 FIG. 3 is a flow chart of a method 300 for detecting skin color of a portrait provided in an embodiment of the present application. Figure 3 As shown, the method 300 includes the following steps:

[0155] S301, performing face detection and face segmentation extraction on the image to be detected to obtain key point data of the face in the image to be detected, wherein the key point data includes key point data corresponding to the facial features of the face in the image to be detected and key point data of the face contour.

[0156] It should be understood that the image to be detected can be an image taken by the terminal device, or an image taken by other devices and sent to the terminal device. Performing face detection on the image to be detected can be a process of performing face recognition and key point positioning on the image to be detected. Through face detection, the terminal device can determine the position of the face in the image to be detected; and the terminal device can locate the key points of the face in the image to be detected. Face segmentation and extraction can be understood as the process of extracting a face image by the key points of the face by the terminal device, and the extracted face image includes the key point data of the face. The key point data corresponding to the facial features of the face can include the key point data corresponding to the eyes of the face, the key point data corresponding to the eyebrows of the face, the key point data corresponding to the nose of the face, and the key point data corresponding to the lips of the face. It can be understood that the key points corresponding to the key point data of the facial features of the face are the key points of the facial features of the face located by the terminal device during the face detection process. Exemplarily, during the face detection process, the terminal device locates the key points of the eyes and the key points of the lips of the face in the image to be detected, and the key point data of the facial features of the face include the key data of the eyes of the face and the key data of the lips of the face.

[0157] In a possible implementation, the terminal device inputs the image to be detected into a face model and outputs a processed image to be detected including key point data in the face. The face model may be a convolutional neural network that can be used to identify and locate key points of the face in the image to be detected.

[0158] In a possible implementation, Figure 4 As shown, the face model is constructed by method 400: training face data; obtaining key points of face data; generating face vector data; and constructing a face model.

[0159] It should be understood that face data training can be understood as the process of screening and preprocessing sample image data, such as screening sample image data with correct face posture and not blocked by objects such as glasses and hair; obtaining key points of face data can be understood as manually calibrating the key points of the face in the sample image data to obtain sample image data including face key point data; generating face vector data can be understood as converting sample image data including face key point data into face vector data, which can be used as a data set for training face models, and after training, a face model is constructed. Among them, the data set used for training face models can be downloaded from a database, which stores multiple portrait data with calibrated key points.

[0160] It should be understood that method 400 can be executed by a terminal device or other devices, and this application does not make any specific limitation on this.

[0161] In a possible implementation, before S301, method 300 further includes: determining whether the image to be detected includes a face; S301 is specifically implemented in the following manner: if the image to be detected includes a face, performing face detection and face segmentation extraction on the image to be detected.

[0162] S302, obtaining a target image based on the key point data corresponding to the facial features of the human face in the image to be detected and the key point data of the facial contour, wherein the target image does not include the facial features.

[0163] It should be understood that the target image is an image used to detect whether the skin color in a face is color cast. The target image is a partial area in a face. Since the determination of whether the skin color of a face in the image to be detected is to detect the skin color in the face, non-skin areas such as lips, eyes, and eyebrows in the face will interfere with the determination result. Based on this, the terminal device removes the facial features in the face based on the key point data corresponding to the facial features in the image to be detected, and extracts the target image.

[0164] S303: Convert the color values ​​of multiple pixels of the target image into chromaticity values ​​of the target image.

[0165] It should be understood that the target image includes multiple pixels, each pixel corresponds to a color value, and the color value can refer to the color value in different color modes. For example, in the red-green-blue (RGB) color mode, the color value can refer to the RGB value.

[0166] S304. Based on the chromaticity value of the target image and the standard chromaticity value range parameters, determine whether the skin color of the face in the image to be detected has color cast, wherein the standard chromaticity value range is determined based on the chromaticity values ​​of the skin color areas of the faces in multiple first images taken under multiple different light sources.

[0167] It should be understood that the multiple different light sources can be artificial light sources, such as an inflatable spiral tungsten filament lamp with a color temperature of 285.6K. Each of the multiple first images includes a face, and the multiple first images can be images obtained by photographing the same person, or can be images obtained by photographing different people. The skin color area of ​​the face in the multiple first images refers to the entire skin area or a partial skin area in the face. The skin color area of ​​the face in each of the multiple first images corresponds to a chromaticity value, so the standard chromaticity value range parameter is obtained based on multiple chromaticity values.

[0168] The chromaticity value of the target image may be a two-dimensional value, and the standard chromaticity value range parameter may be used to represent the standard chromaticity value range. When the terminal device determines that the chromaticity value of the target image is within the range represented by the standard chromaticity value range parameter, the terminal device may determine that the skin color of the face in the image to be detected does not have color cast.

[0169] The method for detecting the skin color of a portrait of the present application first takes multiple portraits under multiple different light sources, and the standard chromaticity value range can be obtained through the chromaticity values ​​of the multiple portraits. When it is necessary to determine whether the skin color of the face in the image to be detected is color cast, the skin area in the face is extracted based on the key point data of the face in the image to be detected, and it is determined whether the chromaticity value of the skin area is within the standard chromaticity value range. If so, it is determined that the skin color of the face in the image to be detected does not have a color cast. Since the multiple portraits are taken under multiple light sources, the standard chromaticity value range can represent the chromaticity value range of the skin color of the portrait under the multiple light sources; therefore, if the chromaticity value of the skin area in the image to be detected taken under the first light source is within the standard chromaticity value range, it means that the deviation of the skin color of the portrait caused by the different light sources is within the acceptable range, so it can be determined that the skin color of the face of the image to be detected has no deviation. It can be seen that such a method for detecting the skin color of a portrait can accurately detect whether the skin color of the portrait is color cast due to different shooting light sources.

[0170] As an optional embodiment, the standard chromaticity value range parameter is used to indicate the chromaticity value inside the graphic area obtained by calibrating the chromaticity value of the skin color area of ​​the face in the multiple first images in the chromaticity space.

[0171] It should be understood that the number of chromaticity values ​​of the skin color area of ​​the face in the plurality of first images is the same as the number of the first images. The chromaticity value may be a two-dimensional value, and correspondingly, the chromaticity space may refer to a coordinate system that can be used to determine the position of the chromaticity value. The graphic area may be a regular or irregular graphic. The chromaticity value inside the graphic area may also include the chromaticity value corresponding to the edge of the graphic area.

[0172] In a possible implementation, the graphic region is a region calibrated according to chromaticity values ​​of skin color regions of faces in a plurality of first images, the chromaticity values ​​of which have an occurrence probability in the chromaticity space greater than a preset probability.

[0173] It should be understood that the occurrence probability can be understood as probability density. The preset probability can be any preset positive value less than or equal to 1, such as 90%. The graphic area does not necessarily cover all the chromaticity values ​​of the skin color area of ​​the face in the first image. By selecting the chromaticity value with an occurrence probability greater than the preset probability, the scattered chromaticity values ​​distributed outside the graphic area can be removed, which helps to improve the accuracy of the standard chromaticity value range.

[0174] The graphics area can be of any shape. Two possible shapes of the graphics area are described below.

[0175] In one possibility, the graphic area is a circular area, and the standard chromaticity value range parameters include the chromaticity value of the center of the circular area and the radius of the circular area.

[0176] It should be understood that the chromaticity value at the center of the circular area can also be called the standard skin color center, and the radius of the circular area can also be called the range radius. Through the chromaticity value at the center of the circular area and the radius of the circular area, a circular area in the chromaticity space can be determined, and the chromaticity value covered by the circular area is within the standard chromaticity value range. By calibrating the chromaticity values ​​of the skin color areas of the faces in the multiple first images in the chromaticity space to obtain a graphic area, it is convenient for the terminal device to determine whether the chromaticity value of the target image is within the standard chromaticity value range through the chromaticity value at the center of the circular area and the radius of the circular area, which helps to improve the efficiency of the method for detecting the skin color of the portrait.

[0177] In another possibility, the graphic area is an elliptical area, and the standard chromaticity value range parameters include the chromaticity value of the center of the elliptical area, the major radius and the minor radius of the elliptical area.

[0178] It should be understood that when the distribution of the chromaticity values ​​of the skin color area of ​​the face in the plurality of first images in the chromaticity space is close to an ellipse, the graphic area may be an elliptical area, which helps to improve the accuracy of the standard chromaticity value range.

[0179] As an optional embodiment, the multiple different light sources include standard light sources and custom light sources.

[0180] It should be understood that the custom light source can be a light source for a specific scene artificially simulated, for example, a light source in a movie theater scene, etc. By shooting a plurality of first images under a standard light source and a custom light source, the standard chromaticity value range indicated by the standard chromaticity value range parameter can indicate the color cast range of the portrait skin color under a plurality of different light sources, which helps to improve the accuracy of the portrait skin color detection method.

[0181] In a possible implementation, S304 may be specifically implemented in the following manner: determining whether the chromaticity value of the target image is within a graphic region obtained based on standard chromaticity value range parameters; if so, determining that the skin color of the face in the image to be detected does not have color cast.

[0182] It should be understood that the standard chromaticity value range parameter can indicate the standard chromaticity value range, and the chromaticity value covered by the graphic area is a chromaticity value within the standard chromaticity value range, so when the chromaticity value of the target image is within the graphic area, it means that the chromaticity value of the target image is within the standard chromaticity value range. When the chromaticity value of the target image is within the standard chromaticity value range, it means that the change in the chromaticity value of the skin color of the portrait due to the different light sources is small, indicating that there is no color cast in the skin color of the face in the image to be detected.

[0183] In one possible implementation, the graphic area is a circular area, and the standard chromaticity value range parameters include the chromaticity value of the center of the circular area and the radius of the circular area; S304 can be specifically implemented in the following manner: determine whether the chromaticity difference between the chromaticity value of the target image and the chromaticity value of the center of the circular area is less than or equal to the radius of the circular area; if so, determine that there is no color cast in the skin color of the face in the image to be detected.

[0184] It should be understood that the chromaticity difference can also be understood as the distance between the position of the chromaticity value of the target image in the chromaticity space and the position of the chromaticity value of the center of the circular area in the chromaticity space. For example, the chromaticity value of the target image is (a1, b1), and the chromaticity value of the center of the circular area is (a2, b2), then the chromaticity difference (Δab) can be calculated by the following formula:

[0185]

[0186] In another possible implementation, method 300 further includes: if the chromaticity value of the target image is not within the graphic area obtained based on the standard chromaticity value range parameter, determining that the skin color of the face in the image to be detected has color cast.

[0187] It should be understood that when there is color cast on the skin color of the face in the image to be detected, the R&D personnel can further adjust the parameters of the front camera of the terminal device, or the terminal device can adjust the image data of the image to be detected, so as to reduce the degree of color cast on the skin color of the face.

[0188] Combine the following Figure 5 A detailed description of the process for determining whether a portrait's skin tone is color cast.

[0189] Figure 5 A schematic diagram of a process for determining whether a person's skin color is color cast is provided in an embodiment of the present application. Figure 5 As shown, in process 1, the chromaticity values ​​of the skin color areas of the faces in the first images are calibrated in the chromaticity space to obtain a plurality of points distributed in the chromaticity space, each of which corresponds to a chromaticity value. In process 2, a graphic region is fitted based on the plurality of points distributed in the chromaticity space, and the graphic region is a circular region. In process 3, it is determined whether the chromaticity value of the target image is within the circular region, such as Figure 5 As shown, the chromaticity value of the target image is the chromaticity value corresponding to point A, and point A is not within the circular area. Therefore, the skin color of the face in the image to be detected has color cast.

[0190] It should be understood that fitting a circle based on the multiple points can be achieved through a variety of methods, such as the least squares method, etc., and the present application does not make any specific limitation on this.

[0191] As an optional embodiment, method 300 also includes: performing face detection and face segmentation extraction on multiple first images to obtain key point data in the face of each first image in the multiple first images; obtaining multiple second images based on the key point data of the face contour and the key point data corresponding to the facial features in each first image, and each second image in the multiple second images does not include the facial features; converting the color values ​​of multiple pixel points of each second image into chromaticity values ​​of each second image, and determining the chromaticity value of each second image as the chromaticity value of the skin color area of ​​each first image; calibrating the chromaticity values ​​of the skin color areas of the multiple first images in the chromaticity space to obtain standard chromaticity value range parameters.

[0192] It should be understood that the above steps can be understood as a method for determining the standard chromaticity value range parameters, and the specific implementation of the above steps is similar to S301 to S303, which can be referred to above and will not be repeated here. The method for determining the standard chromaticity value range parameters can be executed by the terminal device or by other devices, and the device that executes the method for determining the standard chromaticity value range parameters can be the same as or different from the device that executes S301 to S304, and this application does not make specific limitations on this.

[0193] In a possible implementation, the plurality of first images are images of human skin color without color cast. Determining whether the plurality of first images are color cast can be implemented in the following manner: determining the average value of the color value of the human face in each of the plurality of images; determining whether the difference between the average value of the color value and the average value of the color value of the standard color card is within a preset range, the standard color card being the standard color card corresponding to the skin color of the real person photographed by each first image, for example, each first image is obtained by photographing real person A, then the standard color card corresponding to each first image is the color card closest to the skin color of the face of real person A; when the difference between the average value of the color value and the average value of the color value of the standard color card is within the preset range, judging by human eyes whether there is a deviation between the skin color of the face in each first image and the skin color of the face of the real person photographed by each first image; if not, determining that each first image is a first image of the skin color of the human face without color cast. If it is determined that the skin color of the face in each first image is color cast, the device photographing each first image is replaced and the first image is re-photographed.

[0194] It should be understood that determining whether multiple first images have color casts can be performed by any device, wherein selecting a standard color card and determining by human eyes whether there is a deviation between the skin color of the face in each first image and the skin color of the face of the real person captured in each first image can be implemented by a real person, and this application does not make any specific limitations on this.

[0195] Combine the following Figure 6 The method for determining the standard chromaticity value range parameters is explained in detail.

[0196] Figure 6 6 is a flow chart of a method 600 for determining a standard chromaticity value range parameter provided in an embodiment of the present application. Figure 6 As shown, the method 600 includes the following steps:

[0197] S601. Capture a plurality of first images under a plurality of different light sources, wherein the plurality of first images are portraits.

[0198] S602: Determine whether the skin color of the face in each of the multiple first images is cast.

[0199] When the skin color of the face in the first image is biased, the device is replaced to re-shoot the first image, and S602 is executed again.

[0200] When the skin color of the face in the first image is not cast in color, S603 is executed.

[0201] S603: Perform face detection on the multiple first images to determine positions of faces in the multiple first images.

[0202] S604: Perform face segmentation and extraction on the multiple first images in which the positions of the faces are determined, and obtain key point data of the faces in each of the multiple first images.

[0203] S605. Based on the key point data of the face contour and the key point data corresponding to the facial features in each first image, obtain multiple second images, each of the multiple second images does not include the facial features.

[0204] It should be understood that the second image may be the area obtained by removing the lip area from the cheeks and the area below the nose of the face in each first image.

[0205] S606: Calculate the average value of the RGB color values ​​of each second image.

[0206] S607: Convert the average value of the RGB color value into a LAB value, where the LAB value includes an AB value, and determine the AB value of each second image as the chromaticity value of the skin color area of ​​each first image.

[0207] S608: Calibrate the chromaticity values ​​of the skin color areas of the plurality of first images in the chromaticity space to obtain standard chromaticity value range parameters.

[0208] It should be understood that S601 to S608 can be executed by any device, and this application does not make any specific limitation on this. The specific implementation of S601 to S608 is similar to that of method 300, and can refer to the above description, which will not be repeated here.

[0209] The following is a detailed description of two methods for determining the target image.

[0210] In method one, S302 can be specifically implemented in the following manner: extract the area formed by the key point data of the facial contour in the image to be detected to obtain a third image, and remove the area formed by the key point data corresponding to the facial features in the image to be detected from the third image to obtain a target image.

[0211] It should be understood that the third image includes the complete face area. The target image is an image obtained by removing the facial features in the third image. The facial features may include eyebrows, eyes and lips; or may include eyebrows, eyes, nose and lips.

[0212] For example, Figure 7 A schematic diagram of a process for acquiring a target image provided by an embodiment of the present application. Figure 7 As shown, image (a) is the third image, and after removing the eye area, eyebrow area and lip area in image (a), image (b) is obtained, and image (b) is the target image.

[0213] In method 2, S302 can be specifically implemented in the following manner: extract the area formed by the key point data of the facial contour below the preset position of the face in the image to be detected to obtain a fourth image, and remove the area formed by the key point data corresponding to the lips from the fourth image to obtain a target image.

[0214] It should be understood that since the forehead of a face is easily blocked by objects such as hair and hats, the key points of the face contour do not necessarily include the key points of the contour of the forehead part of the face. When acquiring the target image, the area formed by the key point data of the face contour below the preset position in the face can be extracted to obtain the fourth image, so that the phenomenon of skin being blocked in the fourth image is reduced. The preset position can be any preset position.

[0215] In a possible implementation, the preset position is the position of the eyes of the face to be detected in the image to be detected, the position of the nose of the face to be detected in the image to be detected, the position of half of the face in the image to be detected, or the position of one-third of the face in the image to be detected.

[0216] It should be understood that the one-third position of the face may refer to the one-third position of the upper part of the face or the one-third position of the lower part of the face. When the one-third position of the face refers to the one-third position of the upper part of the face, the area formed by the key point data corresponding to the lips, the area formed by the key point data corresponding to the eyes, and the area formed by the key points corresponding to the eyebrows are removed from the fourth image.

[0217] Figure 8 A schematic diagram of a preset position in a face provided in an embodiment of the present application. Figure 8 As shown in the figure, below the position where the eyes of the face are located can refer to below the dotted line f; below the position where the nose of the face is located can refer to below the dotted line n; below the position of one-half of the face can refer to below the dotted line l; below the position of one-third of the face can refer to below the dotted line e or below the dotted line m. Among them, the dotted line e can indicate the position of one-third of the upper part of the face; the dotted line m can indicate the position of one-third of the lower part of the face.

[0218] Combine the following Fig. 9 , taking the preset position as the position of the nose of the face in the image to be detected as an example, the fourth image and the target image are further explained.

[0219] Fig. 9 Another schematic diagram of the process of acquiring a target image provided by an embodiment of the present application. Fig. 9 As shown, image (a) is the fourth image, and the fourth image only includes the area below the nose of the face; after removing the area formed by the key point data corresponding to the lips, image (b) is obtained, and image (b) is the target image.

[0220] As an optional embodiment, method 300 also includes: extracting the edge line of the face in the image to be detected; selecting key point data within a preset range around the edge line of the face in the image to be detected from the key point data of the face contour in the image to be detected as target edge key point data; judging whether the number of key points corresponding to the target edge key point data is less than or equal to a first threshold; S302 is specifically implemented in the following manner: when the number of key points corresponding to the target edge key point data is less than or equal to the first threshold, obtaining the target image based on the target edge key point data and the key point data corresponding to the facial features in the image to be detected.

[0221] It should be understood that the edge line can also be called a contour line. The preset range can refer to the area formed by points whose shortest distance from the edge line is less than or equal to the preset distance. The key point data within the preset range around the edge line of the face in the image to be detected can be selected in the following way: determine the shortest distance from the edge line to each key point data in the key point data of the face contour, if the shortest distance is less than or equal to the preset distance, then each key point is a key point within the preset range. The above steps can be understood as a process of determining whether the line connecting the key points corresponding to the key point data of the face contour is the edge line of the face. Through this process, the key point data that is not on the edge line of the face can be removed, and at the same time, it can be determined that the line connecting the target edge key points is not the edge line of the face, thereby improving the accuracy of the target image obtained, thereby improving the accuracy of the portrait skin color detection method.

[0222] In a possible implementation, method 300 further includes: when the number of target edge key points is greater than a first threshold, re-performing face detection and face segmentation extraction on the image to be detected to obtain new key point data in the face of the image to be detected.

[0223] It should be understood that the first threshold is a preset positive value. When the number of key points corresponding to the target edge key point data is greater than the first threshold, it means that the line connecting the target edge key points is not the edge line of the face, which means that the target edge key points obtained by the terminal device are located at other positions of the portrait, such as the hair or neck area of ​​the portrait. Through this solution, the accuracy of the obtained target image can be improved, thereby improving the accuracy of the portrait skin color detection method.

[0224] Fig.10 A flowchart of a method 1000 for determining whether a line connecting key points of a face contour is a face edge line is provided in an embodiment of the present application. The method 1000 comprises the following steps:

[0225] S1001, extracting edge lines of faces in the image to be detected.

[0226] S1002: Select key point data corresponding to the key point data of the face contour whose shortest distance from the edge line is less than or equal to a preset distance as target edge key point data.

[0227] S1003: Determine whether the number of key points corresponding to the target edge key point data is less than or equal to a first threshold.

[0228] If yes, execute S1004; if no, execute S1005.

[0229] S1004: Obtain a target image based on the target edge key point data and the key point data corresponding to the facial features in the image to be detected.

[0230] S1005 , re-perform face detection and face segmentation extraction on the image to be detected to obtain new key point data of the face in the image to be detected.

[0231] Combine the following Fig.11 The process of acquiring the target image is described in detail.

[0232] Fig.11 A schematic diagram of another target image acquisition process provided in an embodiment of the present application. Fig.11 As shown, image (a) is the image to be detected. By performing face detection and face segmentation extraction on the image to be detected, image (b) is obtained, and image (b) includes key point data in the face. The edge line of the face in image (b) is obtained to obtain image (c). Then, it is determined whether the shortest distance between the key point of the face contour and the edge line 1101 of the face is less than or equal to the preset distance. For example, if the shortest distance between key point O and edge line 1101 is greater than the preset distance, key point O is not the target edge key point. When the number of target edge key points is less than the first threshold, the area formed by the key point data below the nose in the target edge key point data is extracted, and the area formed by the key point data corresponding to the lips is removed to obtain image (d), which is the target image.

[0233] As an optional embodiment, method 300 also includes: determining whether there is an occlusion area in the target image; S303 is specifically implemented in the following manner: when there is no occlusion area in the target image, converting the color values ​​of multiple pixels into chromaticity values ​​of the target image.

[0234] It should be understood that the occluded area may be an area occluded by hair, an area occluded by eyes, an area occluded by a mask, etc. The existence of the occluded area will make it difficult for the chromaticity value of the acquired target image to accurately indicate the chromaticity value of the skin color of the face, thereby reducing the accuracy of the portrait skin color detection method.

[0235] In one possible implementation, determining whether there is an occluded area in the target image can be specifically implemented through the following steps: based on the chromaticity value of each pixel in the target image and the standard chromaticity value range parameter, determining whether each pixel is an occluded pixel, and determining the number of occluded pixels; determining whether the number of occluded pixels is greater than or equal to a second threshold; and determining that there is an occluded area in the target image when the number of occluded pixels is greater than or equal to the second threshold.

[0236] It should be understood that the chromaticity value of each pixel in the target image that differs too much from the chromaticity value in the standard chromaticity value range is not the chromaticity value of the normal skin color of the face, and the pixel can be called an occluded pixel. Through the above technical solution, the non-skin area in the target image can be determined. For example, when objects such as hair, glasses, and masks occlude the face, the area in the target image where objects such as hair, glasses, and masks occlude the face is the occluded area. By removing the occluded area, the non-skin area in the target image can be reduced, thereby improving the accuracy of the portrait skin color detection method.

[0237] In a possible implementation, the standard chromaticity value range parameter includes a standard chromaticity value, and the standard chromaticity value is a chromaticity value corresponding to the center of the graphic area. Fig.12 As shown, the method 1200 is used to determine whether there is an occluded area in the target image. The method 1200 includes the following steps:

[0238] S1201. Determine whether the chromaticity difference between the chromaticity value of each pixel in the target image and the standard chromaticity value is greater than or equal to a third threshold.

[0239] If so, execute S1202.

[0240] If not, it is determined that each pixel is not an occluded pixel.

[0241] S1202: Determine each pixel as an occluded pixel.

[0242] S1203: Determine whether the number of blocked pixels is greater than or equal to a second threshold.

[0243] If so, it is determined that there is an occluded area in the target image.

[0244] If not, it is determined that there is no occluded area in the target image.

[0245] As an optional embodiment, the color values ​​of multiple pixel points are multiple red, green, blue, RGB color values; S303 is specifically implemented in the following manner: calculating the mean value of each component of the multiple RGB color values; converting the mean value of each component into a color model LAB color value, where the LAB color value includes a brightness value and a chromaticity value of the target image.

[0246] It should be understood that the LAB color value includes the L value and the AB value, wherein the L value is the brightness value of the target image, and the AB value is the chromaticity value of the target image. The RGB color value may be related to the device type and the operating system type of the device, while the LAB value is irrelevant to the device type and the operating system type of the device, and will not vary from device to device. Therefore, by converting multiple RGB color values ​​into LAB values, the accuracy of the portrait skin color detection method can be improved.

[0247] The process of calculating the chromaticity value is described in detail below.

[0248] Table 1

[0249] Pixels R-Value G-Value B value 1 <![CDATA[R1]]> <![CDATA[G1]]> <![CDATA[B1]]> 2 <![CDATA[R2]]> <![CDATA[G2]]> <![CDATA[B2]]> 3 <![CDATA[R3]]> <![CDATA[G3]]> <![CDATA[B3 <!-- 22 -->]]> 4 <![CDATA[R4]]> <![CDATA[G4]]> <![CDATA[B4]]> 5 <![CDATA[R5]]> <![CDATA[G5]]> <![CDATA[B5]]> 6 <![CDATA[R6]]> <![CDATA[G6]]> <![CDATA[B6]]> 7 <![CDATA[R7]]> <![CDATA[G7]]> <![CDATA[B7]]> 8 <![CDATA[R8]]> <![CDATA[G8]]> <![CDATA[B8]]>

[0250] The color values ​​of the multiple pixels may refer to RGB color values ​​of the multiple pixels, and each of the multiple pixels corresponds to an RGB color value. For example, taking 8 pixels as an example, the RGB color values ​​of the 8 pixels are shown in Table 1.

[0251] The mean values ​​of the RGB color values ​​of multiple pixels are calculated using the following formulas:

[0252]

[0253] Among them, R mean is the average value of R, G mean is the average value of G value, B mean is the average value of B value, g is the number of pixels, R i is the R value of the i-th pixel, G i is the G value of the i-th pixel, B i is the B value of the i-th pixel, and i is a positive integer ranging from 1 to g.

[0254] Then, the mean values ​​of the components of the RGB color values ​​of the multiple pixel points are converted into tristimulus values, and then the tristimulus values ​​are converted into LAB color values. mean , G mean , B mean ) is converted to (x, y, z), and then (x, y, z) is converted to (L, A, B), where (R mean , G mean , B mean ) is the mean value of each component of multiple RGB color values, (x, y, z) is the tristimulus value, and (L, A, B) is the LAB color value.

[0255] It should be understood that in the formula for calculating the mean values ​​of each component of the RGB color values ​​of multiple pixels, the sum of each component in the RGB color values ​​of the multiple pixels can be calculated first, and then divided by the number of pixels; or each component in the RGB color value of each pixel can be divided by the number of pixels and then summed. This application does not make any specific limitations on this.

[0256] As an optional embodiment, the method 300 further includes: when there is color cast on the skin color of the face in the image to be detected, adjusting the RGB components of the image to be detected based on the standard chromaticity value range parameter.

[0257] It should be understood that when there is color cast on the skin color of the face in the image to be detected, the terminal device can adjust the image to be detected, for example, adjust the RGB components of the image to be detected, so that the chromaticity value of the target image obtained based on the image to be detected is within the standard chromaticity value range indicated by the standard chromaticity value range parameter. In this way, the terminal device can display the image to be detected without color cast, thereby improving the user experience.

[0258] Fig.13 FIG. 1 is a flow chart of another method 1300 for detecting skin color of a portrait provided in an embodiment of the present application. Fig.13 As shown, method 1300 includes the following steps:

[0259] S1301, photographing an image to be detected.

[0260] S1302: Determine whether there is a face in the image to be detected.

[0261] If it exists, execute S1303 to S1309; if it does not exist, this process ends.

[0262] S1303: Perform face detection on the image to be detected, and determine key point data of the face in the image to be detected.

[0263] S1304: Based on the key point data, perform face segmentation and extraction on the image to be detected to obtain a face image.

[0264] S1305: extract the area below the position of the nose in the face image.

[0265] S1306: Remove the lip area to obtain a target image.

[0266] S1307: Calculate the mean values ​​of the components of multiple RGB color values ​​of the target image.

[0267] S1308 . Convert the mean values ​​of the components of the multiple RGB color values ​​into LAB values, where LAB includes the chromaticity value of the target image.

[0268] S1309: Determine whether the chromaticity value of the target image is within the image area indicated by the standard chromaticity value range parameter.

[0269] If so, it is determined that the skin color of the face in the image to be detected has no color cast; if not, it is determined that the skin color of the face in the image to be detected has color cast.

[0270] It should be understood that the specific implementation of S1301 to S1309 is similar to the implementation of each step in method 300, and can be found above, and will not be repeated here.

[0271] Combine the following Fig.14 , the process of the portrait skin color detection method is described in detail.

[0272] Fig.14 A schematic diagram of a method for detecting skin color of a portrait provided in an embodiment of the present application. Fig.14 As shown, image (a) is the image to be detected, and face detection is performed on image (a), so that the key points of the face in image (a) can be identified; based on the key point data of the face in image (a) obtained by identification, face segmentation and extraction are performed to obtain image (b), which is a face image and includes the key point data of the face; based on the key points of the face included in image (b), the area below the position of the nose in the face is extracted, and the area formed by the key point data corresponding to the lips is removed to obtain image (c), which is the target image; the chromaticity value of image (c) is calibrated in the chromaticity space, and since the point D obtained by calibrating the chromaticity value of image (c) in the chromaticity space is within the graphic area corresponding to the standard chromaticity value range parameter, there is no color cast in the skin color of the face in image (a).

[0273] It should be understood that the order of execution of the above methods does not necessarily mean the order in which they are executed. The order in which the methods are executed should be determined by their functions and internal logic.

[0274] Combination of the above Figures 3 to 14 , describes in detail the method for detecting skin color of a portrait in an embodiment of the present application, and the following is combined with Fig.15 and Fig.16 , a device for detecting skin color of a portrait according to an embodiment of the present application is described in detail.

[0275] Fig.15 1 is a schematic block diagram of a human skin color detection device 1500 provided in an embodiment of the present application. Fig.15 As shown, the device 1500 includes: an extraction module 1501 and a processing module 1502 .

[0276] The device 1500 is used to implement the steps corresponding to the terminal device in the above method embodiment.

[0277] Extraction module 1501, used to perform face detection and face segmentation extraction on the image to be detected, and obtain key point data of the face in the image to be detected, the key point data including key point data corresponding to the facial features of the face in the image to be detected and key point data of the facial contour; used to obtain a target image based on the key point data corresponding to the facial features of the face in the image to be detected and the key point data of the facial contour, wherein the target image does not include the facial features;

[0278] Processing module 1502 converts the color values ​​of multiple pixel points of the target image into chromaticity values ​​of the target image; based on the chromaticity value of the target image and the standard chromaticity value range parameter, determines whether there is color cast in the skin color of the face in the image to be detected, and the standard chromaticity value range is determined based on the chromaticity values ​​of the skin color area of ​​the face in multiple first images taken under multiple different light sources.

[0279] Optionally, the standard chromaticity value range parameter is used to indicate the chromaticity value inside the graphic area obtained by calibrating the chromaticity value of the skin color area of ​​the face in the multiple first images in the chromaticity space.

[0280] Optionally, the graphic area is a circular area, and the standard chromaticity value range parameters include the chromaticity value of the center of the circular area and the radius of the circular area.

[0281] Optionally, the graphic area is an elliptical area, and the standard chromaticity value range parameters include the chromaticity value of the center of the elliptical area, the major radius and the minor radius of the elliptical area.

[0282] Optionally, the processing module 1502 is specifically used to: determine whether the chromaticity value of the target image is within the graphic area obtained based on the standard chromaticity value range parameter; if so, determine that there is no color cast on the skin color of the face in the image to be detected.

[0283] Optionally, the extraction module 1501 is also used to: perform face detection and face segmentation extraction on multiple first images to obtain key point data in the face of each first image in the multiple first images; obtain multiple second images based on the key point data of the face contour and the key point data corresponding to the facial features in each first image, and each second image in the multiple second images does not include the facial features; the processing module 1502 is also used to: convert the color values ​​of multiple pixel points of each second image into chromaticity values ​​of each second image, and determine the chromaticity value of each second image as the chromaticity value of the skin color area of ​​each first image; calibrate the chromaticity values ​​of the skin color areas of multiple first images in the chromaticity space to obtain standard chromaticity value range parameters.

[0284] Optionally, the extraction module 1501 is specifically used to: extract the area formed by the key point data of the facial contour in the image to be detected to obtain a third image, and remove the area formed by the key point data corresponding to the facial features in the image to be detected from the third image to obtain a target image.

[0285] Optionally, the extraction module 1501 is specifically used to: extract the area formed by the key point data of the facial contour below the preset position of the face in the image to be detected to obtain a fourth image, and remove the area formed by the key point data corresponding to the lips from the fourth image to obtain a target image.

[0286] Optionally, the preset position is the position of the eyes of the face in the image to be detected, the position of the nose of the face in the image to be detected, the position of half of the face in the image to be detected, or the position of one third of the face in the image to be detected.

[0287] Optionally, the processing module 1502 is also used to: extract the edge line of the face in the image to be detected; select key point data within a preset range around the edge line of the face in the image to be detected from the key point data of the face contour in the image to be detected as target edge key point data; determine whether the number of key points corresponding to the target edge key point data is less than or equal to a first threshold; the extraction module 1501 is specifically used to: when the number of key points corresponding to the target edge key point data is less than or equal to the first threshold, obtain the target image based on the target edge key point data and the key point data corresponding to the facial features in the image to be detected.

[0288] Optionally, the extraction module 1501 is further used to: when the number of target edge key points is greater than a first threshold, re-perform face detection and face segmentation extraction on the image to be detected to obtain new key point data in the face of the image to be detected.

[0289] Optionally, the processing module 1502 is further used to: determine whether there is an occlusion area in the target image; the processing module 1502 is specifically used to: when there is no occlusion area in the target image, convert the color values ​​of multiple pixels into chromaticity values ​​of the target image.

[0290] Optionally, the processing module 1502 is specifically used to: determine whether each pixel is an occluded pixel and the number of occluded pixels based on the chromaticity value of each pixel in the target image and the standard chromaticity value range parameter; determine whether the number of occluded pixels is greater than or equal to a second threshold; and determine that there is an occluded area in the target image when the number of occluded pixels is greater than or equal to the second threshold.

[0291] Optionally, the color values ​​of the multiple pixels are multiple red, green, blue (RGB) color values; the processing module 1502 is specifically used to: calculate the mean value of each component of the multiple RGB color values; convert the mean value of each component into a color model LAB color value, where the LAB color value includes a brightness value and a chromaticity value of the target image.

[0292] Optionally, the processing module 1502 is further configured to: when there is color cast on the skin color of a face in the image to be detected, adjust the RGB components of the image to be detected based on a standard chromaticity value range parameter.

[0293] Optionally, the plurality of different light sources include standard light sources and custom light sources.

[0294] It should be understood that the device 1500 here is embodied in the form of a functional module. The term "module" here may refer to an application specific integrated circuit (ASIC), an electronic circuit, a processor (such as a shared processor, a proprietary processor or a group processor, etc.) and a memory for executing one or more software or firmware programs, a merged logic circuit and / or other suitable components that support the described functions. In an optional example, those skilled in the art can understand that the device 1500 can be specifically a terminal device in the above-mentioned embodiment, and the device 1500 can be used to execute the various processes and / or steps corresponding to the terminal device in the above-mentioned method embodiment. To avoid repetition, it will not be repeated here.

[0295] The above-mentioned apparatus 1500 has the function of implementing the corresponding steps executed by the terminal device in the above-mentioned method; the above-mentioned function can be implemented by hardware, or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above-mentioned function.

[0296] In the embodiments of the present application, Fig.15 The device 1500 in the embodiment may also be a chip, such as a SOC. Correspondingly, the processing module 1502 may be a processing circuit of the chip, which is not limited here.

[0297] Fig.16 A schematic block diagram of a portrait skin color detection device 1600 provided in an embodiment of the present application. The device 1600 includes a processor 1601, a communication interface 1602, and a memory 1603. Among them, the processor 1601, the communication interface 1602, and the memory 1603 communicate with each other through an internal connection path, the memory 1603 is used to store instructions, and the processor 1601 is used to execute the instructions stored in the memory 1603. The communication interface 1602 can be used to send signals to other devices (such as the processor 1601 or the touch screen of the terminal device), and can also be used to receive signals from other devices (such as the memory 1603). Exemplarily, the communication interface 1602 reads the instructions stored in the memory 1603 and sends the instructions to the processor 1601.

[0298] It should be understood that the device 1600 can be specifically a terminal device in the above embodiment, and can be used to execute the various steps and / or processes corresponding to the terminal device in the above method embodiment. Optionally, the memory 1603 may include a read-only memory and a random access memory, and provide instructions and data to the processor. A portion of the memory may also include a non-volatile random access memory. For example, the memory may also store information about the device type. The processor 1601 may be used to execute instructions stored in the memory, and when the processor 1601 executes instructions stored in the memory, the processor 1601 is used to execute the various steps and / or processes of the above method embodiment.

[0299] It should be understood that in the embodiments of the present application, the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc.

[0300] In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware in a processor or an instruction in the form of software. The steps of the method disclosed in conjunction with the embodiment of the present application can be directly embodied as a hardware processor for execution, or a combination of hardware and software modules in a processor for execution. The software module can be located in a storage medium mature in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in a memory, and the processor executes the instructions in the memory, and completes the steps of the above method in conjunction with its hardware. To avoid repetition, it is not described in detail here.

[0301] The present application also provides a computer-readable storage medium, which is used to store a computer program, and the computer program is used to implement the method shown in the above method embodiment.

[0302] The present application also provides a computer program product, which includes a computer program (also referred to as code or instruction). When the computer program runs on a computer, the computer can execute the method shown in the above method embodiment.

[0303] Those of ordinary skill in the art will appreciate that the modules and algorithm steps of each example 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 performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0304] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and modules described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0305] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules is only a logical function division. There may be other division methods in actual implementation, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.

[0306] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical modules, that is, they may be located in one place or distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0307] In addition, each functional module in each embodiment of the present application may be integrated into one processing module, or each module may exist physically separately, or two or more modules may be integrated into one module.

[0308] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0309] The above is only a specific implementation of the present application, but the protection scope of the embodiments of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the embodiments of the present application, which should be included in the protection scope of the embodiments of the present application. Therefore, the protection scope of the embodiments of the present application should be based on the protection scope of the claims.

Claims

1. A method for detecting skin color of a portrait, characterized in that: include: Performing face detection and face segmentation extraction on the image to be detected to obtain key point data of the face in the image to be detected, wherein the key point data includes key point data corresponding to the facial features of the face in the image to be detected and key point data of the face contour; Based on the key point data corresponding to the facial features of the human face in the image to be detected and the key point data of the facial contour, a target image is obtained, wherein the target image does not include the facial features; Converting the color values ​​of a plurality of pixels of the target image into chromaticity values ​​of the target image; Based on the chromaticity value of the target image and the standard chromaticity value range parameters, it is determined whether the skin color of the face in the image to be detected has color cast, and the standard chromaticity value range is determined based on the chromaticity value of the skin color area of ​​the face in multiple first images taken under multiple different light sources.

2. The method according to claim 1, characterized in that The standard chromaticity value range parameter is used to indicate the chromaticity value inside the graphic area obtained by calibrating the chromaticity value of the skin color area of ​​the face in the multiple first images in the chromaticity space.

3. The method according to claim 2, characterized in that The graphic area is a circular area, and the standard chromaticity value range parameters include the chromaticity value of the center of the circular area and the radius of the circular area.

4. The method according to claim 2, characterized in that: The graphic area is an elliptical area, and the standard chromaticity value range parameters include the chromaticity value of the center of the elliptical area, the major radius and the minor radius of the elliptical area.

5. The method according to any one of claims 2 to 4, characterized in that The step of judging whether the skin color of the face in the image to be detected has color cast based on the chromaticity value of the target image and the standard chromaticity value range parameter includes: Determining whether the chromaticity value of the target image is within a graphic region obtained based on the standard chromaticity value range parameter; If so, it is determined that there is no color cast on the skin color of the face in the image to be detected.

6. The method according to any one of claims 1 to 5, characterized in that The method further comprises: Performing face detection and face segmentation extraction on the multiple first images to obtain key point data of the face of each first image in the multiple first images; Based on the key point data of the face contour and the key point data corresponding to the facial features in each of the first images, a plurality of second images are obtained, wherein each of the plurality of second images does not include the facial features; Converting color values ​​of a plurality of pixel points of each second image into chromaticity values ​​of each second image, and determining the chromaticity values ​​of each second image as chromaticity values ​​of the skin color area of ​​each first image; The chromaticity values ​​of the skin color areas of the plurality of first images are calibrated in the chromaticity space to obtain the standard chromaticity value range parameter.

7. The method according to any one of claims 1 to 6, characterized in that The step of obtaining a target image based on key point data corresponding to the facial features and key point data of the facial contour in the image to be detected includes: The area formed by the key point data of the face contour in the image to be detected is extracted to obtain a third image, and the area formed by the key point data corresponding to the facial features in the image to be detected is removed from the third image to obtain the target image.

8. The method according to any one of claims 1 to 6, characterized in that The step of obtaining a target image based on key point data corresponding to the facial features and key point data of the facial contour in the image to be detected includes: An area formed by key point data of a facial contour below a preset position of a face in the image to be detected is extracted to obtain a fourth image, and an area formed by key point data corresponding to lips is removed from the fourth image to obtain the target image.

9. The method according to claim 8, characterized in that The preset position is the position of the eyes of the face in the image to be detected, the position of the nose of the face in the image to be detected, the position of one-half of the face in the image to be detected, or the position of one-third of the face in the image to be detected.

10. The method according to any one of claims 1 to 9, characterized in that The method further comprises: Extracting edge lines of the face in the image to be detected; Selecting, from the key point data of the face contour in the image to be detected, key point data within a preset range around the edge line of the face in the image to be detected as target edge key point data; Determine whether the number of key points corresponding to the target edge key point data is less than or equal to a first threshold; The step of obtaining a target image based on key point data corresponding to the facial features and key point data of the facial contour in the image to be detected includes: When the number of key points corresponding to the target edge key point data is less than or equal to the first threshold, the target image is obtained based on the target edge key point data and the key point data corresponding to the facial features in the image to be detected.

11. The method according to claim 10, characterized in that The method further comprises: When the number of key points corresponding to the target edge key point data is greater than the first threshold, face detection and face segmentation extraction are performed again on the image to be detected to obtain new key point data in the face of the image to be detected.

12. The method according to any one of claims 1 to 11, characterized in that The method further comprises: Determine whether there is an occluded area in the target image; The converting the color values ​​of the plurality of pixels of the target image into the chromaticity values ​​of the target image comprises: In the case that there is no occluded area in the target image, the color values ​​of the plurality of pixels are converted into chromaticity values ​​of the target image.

13. The method according to claim 12, characterized in that The determining whether there is an occluded area in the target image includes: Based on the chromaticity value of each pixel in the target image and the standard chromaticity value range parameter, determining whether each pixel is an occluded pixel, and determining the number of the occluded pixels; Determine whether the number of the blocked pixels is greater than or equal to a second threshold; When the number of occluded pixels is greater than or equal to the second threshold, it is determined that an occluded area exists in the target image.

14. The method according to any one of claims 1 to 13, characterized in that The color values ​​of the multiple pixel points are multiple red, green, and blue (RGB) color values; The converting the color values ​​of the plurality of pixels of the target image into the chromaticity values ​​of the target image comprises: Calculate the mean of each component of the plurality of RGB color values; The mean values ​​of the components are converted into LAB color values ​​of the color model, where the LAB color values ​​include the brightness value and the chromaticity value of the target image.

15. The method according to any one of claims 1 to 14, characterized in that The method further comprises: When there is color cast on the skin color of the face in the image to be detected, the RGB components of the image to be detected are adjusted based on the standard chromaticity value range parameter.

16. The method according to any one of claims 1 to 15, characterized in that The plurality of different light sources include standard light sources and custom light sources.

17. A device for detecting skin color of a portrait, characterized in that: Comprising means for performing the method as claimed in any one of claims 1 to 16.

18. A device for detecting skin color of a portrait, characterized in that: include: A processor, wherein the processor is coupled to a memory, wherein the memory is used to store a computer program, and when the processor calls the computer program, the device is caused to execute the method according to any one of claims 1 to 16.

19. A computer-readable storage medium, characterized in that: Used to store a computer program, the computer program comprising instructions for implementing the method according to any one of claims 1 to 16.

20. A computer program product, characterized in that The computer program product includes a computer program code, and when the computer program code is executed on a computer, the computer is enabled to implement the method according to any one of claims 1 to 16.

Citation Information

Cited By

  • Skin color quantification and management method and system, electronic equipment and storage medium

    CN120355636A

  • Skin color quantification and management method, system, electronic device and storage medium

    CN120355636B