A skin detection method, device, equipment and medium
By determining the skin area in the image to be detected in image processing technology and converting the color space, the problems of poor convenience, low efficiency and high cost of sensitive skin detection in the prior art are solved, and convenient and efficient skin sensitivity detection is achieved.
Patent Information
- Application Number
- CN202111029147.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-01
- Publication Date
- 2025-03-14
- Estimated Expiration
- 2041-09-01
AI Technical Summary
In the prior art, sensitive skin detection methods have problems such as poor convenience, low efficiency and high cost.
By determining the skin area to be detected in the object in the image to be detected, it is converted into color space to obtain LAB color space information, and skin sensitivity detection is performed based on this information.
It realizes that the sensitive areas of the skin can be automatically detected by inputting face images without going to the skin detection mechanism, reducing detection costs and improving convenience and efficiency.
Smart Images

Figure CN113936292B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to a skin detection method, device, equipment and medium. Background Art
[0002] Sensitive skin is a type of problematic skin, and its pathological manifestations are thinning of the stratum corneum, dilation of subcutaneous capillaries, and congestion, which results in red areas on the face. Usually, sensitive skin can be tested by skin testing institutions using special instruments.
[0003] However, the current method of using skin testing institutions to detect sensitive skin using special instruments is cumbersome and expensive, resulting in poor convenience, low efficiency and high cost of sensitive skin testing. Summary of the invention
[0004] The embodiments of the present application provide a skin detection method, device, equipment and medium to solve the problems of poor convenience, low efficiency and high cost in the sensitive skin detection methods in the prior art.
[0005] The technical solutions provided by the embodiments of this application are as follows:
[0006] In a first aspect, an embodiment of the present application provides a skin detection method, comprising:
[0007] Determine a skin area to be detected of a target object in the image to be detected;
[0008] Performing color space conversion on the skin area to be detected to obtain LAB color space information of the skin area to be detected;
[0009] Based on the LAB color space information of the skin area to be detected, skin sensitivity detection is performed on the skin area to be detected.
[0010] In a second aspect, an embodiment of the present application provides a skin detection device, comprising:
[0011] A skin region determination unit, used to determine a skin region to be detected of a target object in an image to be detected;
[0012] A space conversion unit, used for performing color space conversion on the skin area to be detected to obtain LAB color space information of the skin area to be detected;
[0013] The sensitivity detection unit is used to perform skin sensitivity detection on the skin area to be detected based on the LAB color space information of the skin area to be detected.
[0014] In a third aspect, an embodiment of the present application provides an electronic device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the skin detection method provided in the embodiment of the present application is implemented when the processor executes the computer program.
[0015] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores computer instructions. When the computer instructions are executed by a processor, the skin detection method provided by the embodiment of the present application is implemented.
[0016] The beneficial effects of the embodiments of the present application are as follows:
[0017] In an embodiment of the present application, by determining the skin area to be detected of the target object in the image to be detected, performing color space conversion on the skin area to be detected, and using the LAB color space information of the skin area to be detected obtained after the conversion to perform skin sensitivity detection on the skin area to be detected, automatic detection of skin sensitive areas can be achieved by inputting a face image without going to a skin detection agency, thereby reducing the cost of sensitive skin detection and improving the convenience and efficiency of sensitive skin detection.
[0018] Other features and advantages of the present application will be described in the following description, or some features and advantages can be inferred or determined without doubt from the description, or can be learned by implementing the above technology disclosed in the present application. In order to make the above objects, features and advantages of the present application more obvious and easy to understand, the following is a detailed description of the preferred embodiments in conjunction with the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the specific implementation of the present application or the technical solutions in the prior art, the following will briefly introduce the drawings required for the specific implementation or the prior art description. Obviously, the drawings described below are some implementations of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:
[0020] Figure 1 A schematic diagram of an overview of the skin detection method provided in an embodiment of the present application;
[0021] Figure 2 A schematic diagram of facial key point information provided in an embodiment of the present application;
[0022] Figure 3 A schematic diagram of the sensitive area detection results provided in an embodiment of the present application;
[0023] Figure 4a A schematic diagram of the functional structure of a skin detection device provided in an embodiment of the present application;
[0024] Figure 4b A functional structural diagram of another skin detection device provided in an embodiment of the present application;
[0025] Figure 5 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0026] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0027] In order to facilitate those skilled in the art to better understand the present application, the technical terms involved in the present application are briefly introduced below.
[0028] 1. LAB color space information is data used to describe the display method of color, which consists of three elements: L related to brightness and A and B related to color. Among them, L represents lightness, A represents the range from magenta to green, and B represents the range from yellow to blue.
[0029] 2. A facial key point detection model is a neural network model for detecting key points of a target face by training each sample face image. In the embodiment of the present application, the key points of the target face include at least: facial contour key points, eyebrow key points, nose key points, eye key points, etc.
[0030] It should be noted that the "first", "second", "third", etc. mentioned in this application are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that such terms can be interchanged where appropriate, so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. In addition, the "and / or" mentioned in this application 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. The character " / " generally indicates that the objects associated before and after are in an "or" relationship.
[0031] After introducing the technical terms involved in this application, the application scenarios and design concepts of the embodiments of this application are briefly introduced.
[0032] At present, for sensitive skin, users usually need to go to a skin testing agency to use special instruments for testing. The convenience of sensitive skin testing is poor, the efficiency is low, and the cost is high. To this end, the embodiment of the present application proposes a method for automatically detecting the skin sensitive area of the target face in a face image based on a face image. Specifically, after obtaining the image to be detected, the skin area to be detected of the target object in the image to be detected is determined, and the skin area to be detected is converted into a color space to obtain the LAB color space information of the skin area to be detected. Based on the LAB color space information of the skin area to be detected, the sensitivity of the skin area to be detected is detected. In this way, without going to a skin testing agency, automatic detection of skin sensitivity can be achieved by inputting a face image, thereby reducing the cost of sensitive skin detection and improving the convenience and efficiency of sensitive skin detection.
[0033] After introducing the application scenarios and design concepts of the embodiments of the present application, the technical solutions provided by the embodiments of the present application are described below.
[0034] The present application embodiment provides a skin detection method, which can be applied to electronic devices such as mobile phones, tablet computers, and computers. Figure 1 As shown, the general process of the skin detection method provided in the embodiment of the present application is as follows:
[0035] S102: Determine a skin area to be detected of a target object in the image to be detected.
[0036] In a specific implementation, in one embodiment, a user can take a facial image by calling an image acquisition device of an electronic device, and the electronic device uses the facial image taken by the user by calling the image acquisition device as the image to be detected; in another embodiment, the user can also upload pre-taken photos saved locally to the electronic device, and the electronic device uses the photos uploaded by the user as the image to be detected.
[0037] The above-mentioned image to be detected is an image obtained by an electronic device using any of the above-mentioned methods, and the target object is an object containing a skin area in the image, such as any skin area of a face, gums, neck, hands, arms, legs, etc. Correspondingly, the image to be detected is an image containing the above-mentioned target object. For example, when the image to be detected is a face image, the target object corresponds to the target face; when the image to be detected is an oral image, the target object corresponds to the gum area.
[0038] S104: Perform color space conversion on the skin area to be detected to obtain LAB color space information of the skin area to be detected.
[0039] It can be understood that since the color space of the image to be detected is the RGB color space, the skin area to be detected is also in the RGB color space. Considering that the LAB color space information is designed based on people's perception of color and has the characteristic of uniform perception, the visual changes brought by color are similar to the changes in LAB color space information. Therefore, the RGB color space of the skin area to be detected can be converted into LAB color space information.
[0040] S106: Perform skin sensitivity detection on the skin area to be detected based on the LAB color space information of the skin area to be detected.
[0041] In practical applications, since color and brightness are separated in the LAB color space information, the A channel color value of the LAB color space information represents the degree from magenta to green. Therefore, the embodiment of the present application can represent the reddish area in the skin through the A channel color value of the LAB color space information, thereby determining the sensitivity of the skin area to be detected. Specifically, the larger the A channel color value, the darker the red degree, and the more sensitive the skin area to be detected.
[0042] In the skin detection method provided in the embodiment of the present application, the facial area to be detected of the target object in the image to be detected is determined, and the color space conversion is performed on the skin area to be detected to obtain the LAB color space information of the skin area to be detected, and then skin sensitivity detection can be performed based on the LAB color space information of the skin area to be detected. This enables fast and accurate detection of sensitive skin for the facial image provided by the user, without the need for the user to go to a skin detection agency, thereby effectively saving time and money costs and improving user convenience.
[0043] Optionally, in a specific embodiment, the above-mentioned image to be detected may be a face image, and the target object in the image to be detected is the target face. Accordingly, in order to ensure the accuracy of the obtained skin area to be detected, the face image may be a high-definition face image obtained under a flash environment. In order to effectively identify the sensitive muscle area of the face, the general area of the face may be delineated based on the key facial feature points (landmarks). Therefore, when determining the skin area to be detected of the target object in the image to be detected, the following steps 2.1) to 2.2) may be included:
[0044] Step 2.1), obtaining facial key point information of the target face in the image to be detected;
[0045] Step 2.2), based on the facial key point information, determine the skin area to be detected on the target face.
[0046] With respect to the above step 2.1), in practical applications, the electronic device can perform key point detection on the target face in the image to be detected through the face key point detection model to obtain the face key point information of the target face in the image to be detected. Among them, the face key point detection model is a neural network model that performs model training on each sample face image to obtain each key point for detecting the target face. The main purpose of key point detection through the face key point detection model is to obtain the face contour and limit the sensitive muscle area. Therefore, as long as the neural network model can obtain the key points of the face contour, it will not be specifically limited here.
[0047] In the process of detecting key points of a face image through a face key point detection model, if the face image is detected to contain only one face, the face can be determined as the target face; if the face image is detected to contain two or more faces, the face with the largest facial area can be determined as the target face, or the face actually triggered and selected by the user can be determined as the target face. In addition, if the face image to be detected does not contain a face, it returns null and prompts the user to re-enter the image.
[0048] Furthermore, after the electronic device performs key point detection on the target face through the face key point detection model, the two-dimensional coordinates of multiple face key points can be obtained, that is, the face key point information of the target face. The face key point information can include the key point position information of the face contour and the key point position information of the facial organ position. The key point position information of the facial organ position includes such as the key point position information of the eyebrows, the key point position information of the eyes, the key point position information of the nose, and the key point position information.
[0049] Since the above-mentioned facial key point information includes the facial contour key point position information, in one embodiment, the area formed by the facial contour key points of the target face can be determined as the facial area of the target face based on the facial contour key point position information included in the facial key point information. Figure 2 A schematic diagram of facial key point information is shown, and the key point detection includes 80 key points, see Figure 2 The key point number, such as Figure 2 The key points 0-18 shown in correspond to the position information of the facial contour key points.
[0050] In addition, the facial key point information of the target face may include different numbers of facial key points. The facial key point information corresponding to different numbers of key points may be detected using different facial key point detection models.
[0051] Considering that the facial key point information detected by the facial key point detection model is usually the facial organ key points and facial contour key points below the eyebrows, and the forehead area above the eyebrows also needs to be detected during sensitive skin detection. Therefore, in order to ensure the comprehensiveness of facial skin sensitive skin detection, the above step 2.2) can further include the following steps 3.1) to 3.3) during specific implementation:
[0052] Step 3.1), based on the facial key point information, determine the facial area of the target face;
[0053] Step 3.2), based on the facial key point information and the facial segmentation ratio, determine the forehead area of the target face;
[0054] In step 3.3), the face area and the forehead area are determined as the skin area to be detected of the target face.
[0055] The facial key point information includes the position information of the facial contour key points, and the position information can be represented by coordinates. Accordingly, for the above step 3.1), when implemented specifically, the following steps 4.1) to 4.2) can be included:
[0056] Step 4.1), based on the position information of the facial contour key points, determine the facial contour area formed by each facial contour key point.
[0057] The facial contour key points may include key point information of the facial contour below the eyebrows, such as the left cheek key points, the right cheek key points and the chin key points. Correspondingly, the facial contour area is the facial contour line surrounded by the facial contour key points.
[0058] Step 4.2), based on the facial contour area, determine the facial area of the target face.
[0059] When the facial contour area is determined, the inner area surrounded by the facial contour lines is the facial area of the target face. It can be understood that the facial area is the facial area corresponding to the contour point information, that is, the facial area below the eyebrows.
[0060] Regarding the above step 3.2), since the facial area of the target face obtained by the facial key point detection model is usually the facial area below the eyebrows, and considering that the skin in the forehead area is also a sensitive area when performing sensitive skin detection, after the facial area of the target face is obtained by key point detection, it is necessary to further determine the forehead area of the target face.
[0061] Considering that human faces usually conform to certain facial local proportions, such as "three parts and five eyes", the approximate area of the forehead area can be determined based on the facial key point information and face division ratio obtained by detection. Since the detection of sensitive skin only requires determining the approximate range of the skin area, the forehead area determined by the face division ratio can meet the detection requirements of sensitive skin.
[0062] After determining the face area and the forehead area, the skin area to be detected of the target face including the face area and the forehead area can be determined. Therefore, in one embodiment, for the above step 3.3), the skin area to be detected of the target face can be determined by merging the face area and the forehead area. The skin area to be detected can be a mask of the entire facial skin area.
[0063] In order to make the determined facial area only contain the skin area, so as to better meet the requirements of sensitivity detection, when determining the facial area, the facial area surrounded by the facial contour area can also be further processed. Considering that the eyebrows and eyes are usually not in the range of sensitive muscle detection, in another embodiment, for the above step 3.3), the skin area to be detected can also be the skin area after the facial area and the forehead area are merged and the eyebrow area and the eye area are removed. In the specific implementation, the eyebrow area of the target face can be determined based on the position information of the eyebrow key point; and the eye area of the target face can be determined based on the position information of the eyebrow key point, and then the eyebrow area and the eye area are removed from the facial contour area to obtain the facial area.
[0064] When removing the eyebrow and eye areas, first use the area enclosed by the key points of the face and forehead areas as the initial mask, and then remove the eyebrow and eye areas.
[0065] Considering that the eyebrow and eye regions may have relatively hard edges (i.e., hard edges) when directly removing the eyebrow and eye regions, the edge frames of the eyebrow and eye regions may be further blurred when processing the non-skin regions, so as to form a transition between the removed non-skin regions and the skin regions. For ease of understanding, a specific example of removing the non-skin regions is given. Figure 2 The key points shown in FIG. 7 are used to enclose the area enclosed by key points 73 to key points 80 through a polygon frame, and the framed polygonal area is determined as the eyebrow area. By performing a blurring process (such as a Gaussian blurring process) on the polygonal frame, an eyebrow area with a relatively smooth edge can be obtained. By performing a smoothing process on the edge portions of the eyebrow area and the eye area after the eyebrow area and the eye area are removed, a final mask, i.e., a final face area, can be obtained. Further, the eyebrow area and the eye area can be removed from the red area map of the face area.
[0066] Preferably, if a facial image to be detected is obtained and a flash or additional fill light is used when shooting, the sensitive skin detection effect will be improved.
[0067] Since the determination of the forehead area of the standard face needs to include the values of the two dimensions of vertical height and horizontal width to determine the range, in order to meet the accuracy of the forehead area division, the above-mentioned face division ratio includes the face vertical division ratio and the face horizontal division ratio. Accordingly, when determining the forehead area of the target face based on the face key point information and the face division ratio, the following steps 5.1) to 5.3) can be included:
[0068] Step 5.1), based on the facial key point information and the face vertical division ratio, determine the position information of the center point of the upper edge of the forehead of the target face;
[0069] Step 5.2), based on the facial key point information and the horizontal division ratio of the face, determine the position information of the key points on the left edge of the forehead and the position information of the key points on the right edge of the forehead of the target face;
[0070] Step 5.3), based on the position information of the center point of the upper edge of the forehead, the position information of the key points of the left edge of the forehead, and the position information of the key points of the right edge of the forehead, determine the forehead area of the target face.
[0071] With respect to the above step 5.1), when determining the position information of the center point of the upper edge of the forehead, in order to use a fixed key point as a reference and ensure that the determined center point of the upper edge is relatively accurate, the following steps 6.1) and 6.2) may be included in the specific implementation:
[0072] Step 6.1), based on the facial key point information, determine the position information of the eyebrow key point of the target face;
[0073] Step 6.2), based on the position information of the key point of the center of the center of the forehead of the target face and the vertical division ratio of the face, determine the position information of the center point of the upper edge of the forehead of the target face.
[0074] With respect to the above step 6.1), the above facial key point information may also include the position information of the eyebrow key point. Accordingly, in one embodiment, when determining the position information of the center point of the upper edge of the forehead of the target face, the position information of the eyebrow center key point of the target face may be determined based on the position information of the eyebrow key point. Figure 2The facial key points shown in the figure, the position information of the eyebrow center key point can be determined by the left eyebrow key point and the right eyebrow key point at a symmetrical position, for example, the eyebrow center position information can be determined by the midpoint of point 34 and point 79. In practical applications, other key points can also be selected to determine the eyebrow center key point. This method only needs to obtain the eyebrow key point to directly determine the position information of the eyebrow center key point. The determination method is direct and simple, and the calculation efficiency is high.
[0075] Furthermore, the above-mentioned facial key point information may also include the position information of the facial contour key points and the position information of the nose key points, and the face longitudinal division ratio includes the first face longitudinal division ratio. Therefore, in another embodiment, when step 6.1) is implemented, in order to further ensure the accuracy of the position information of the eyebrow key point, the position information of the chin key point of the target face may be determined based on the position information of the facial contour key points, and then the position information of the eyebrow key point of the target face may be determined based on the position information of the chin key point, the position information of the nose key point and the first face longitudinal division ratio.
[0076] The above-mentioned chin key point information can be determined by the lowest key point among the facial contour key points, and the standard facial proportions usually conform to the "three-thirds and five-eyes". Therefore, after determining the position information of the chin key point and the position information of the nose key point, the distance between the position information of the chin key point and the position information of the nose key point can be calculated first. The distance can actually be roughly determined as 1 / 3 of the overall face length. At this time, the first face longitudinal division ratio can be set in two ways: (1) the first face longitudinal division ratio is 1; (2) the first face longitudinal division ratio is 2.
[0077] For the first setting method: after determining the distance between the position information of the chin key point and the position information of the nose key point, the position information of the eyebrow key point can be used as a reference, and then the same length of distance can be selected to extend upward to determine the position information of the eyebrow key point.
[0078] For the second setting method: after determining the distance between the position information of the chin key point and the position information of the nose key point, use the position information of the chin key point as a reference, and then select a length twice the distance between the position information of the chin key point and the position information of the nose key point and extend upward to determine the position information of the center of the eyebrows key point.
[0079] In addition, since the proportions of a human face may not necessarily conform to the standard proportions, the first human face longitudinal division proportions may also be adjusted on the basis of the above, such as by setting an adjustment threshold to match the facial skin of different face shapes.
[0080] Furthermore, after determining the position information of the key point of the center of the eyebrow, the position information of the center point of the upper edge of the forehead of the target face can be determined in the following two ways:
[0081] (1) The longitudinal division ratio of the face includes the second longitudinal division ratio of the face: based on the position information of the facial contour key points, the position information of the chin key point of the target face is determined; based on the position information of the chin key point, the position information of the eyebrow key point and the second longitudinal division ratio of the face, the position information of the center point of the upper edge of the forehead of the target face is determined.
[0082] For easier understanding, example 1 is provided:
[0083] See also Figure 2 As shown, the chin position information corresponds to the position of the key point numbered 0, and the eyebrow center position information can be determined by the midpoint of point 34 and point 79. The distance from the eyebrow center to the chin can be divided by 4 or 3 to obtain the height of the forehead. Therefore, the longitudinal division ratio of the second face can be 1 / 4 or 1 / 3 of the position from the eyebrow center to the chin, and based on the determined height and eyebrow center position, the position information of the center point of the upper edge of the forehead of the target face is accurately determined.
[0084] (2) The vertical division ratio of the face includes the vertical division ratio of the third face: Based on the position information of the nose key point, the position information of the eyebrow key point and the vertical division ratio of the third face, the position information of the center point of the upper edge of the forehead of the target face is determined.
[0085] For easier understanding, Example 2 is provided:
[0086] See also Figure 2 As shown, the position information of the nose key point can be the 63rd point of the highest point of the nose tip. Then, according to the distance between the chin key point 0 and the nose key point 63, there can be a third face vertical division ratio from the nose key point to the eyebrow key point. For example, the third face vertical division ratio can be determined to be about 1.3 times, that is, the distance from point 0 to point 63 can be equal to 1.3 times the distance from the nose tip to the eyebrow, so the eyebrow position information can be determined. Furthermore, the distance between the position information of the center point of the upper edge of the forehead and the nose key point 63 can be about 1.5 times the distance between the chin key point 0 and the nose key point 63. At this time, the third face vertical division ratio is 1.5, and the position information of the center point of the upper edge of the forehead of the target face can be determined.
[0087] Regarding the above step 5.2), in the specific implementation, the following steps 7.1) and 7.2) may be further included:
[0088] Step 7.1), based on the position information of the eyebrow key points, determine the position information of the first eyebrow key point and the position information of the second eyebrow key point; wherein the position information of the first eyebrow key point and the position information of the second eyebrow key point are symmetrical to each other, such as Figure 2 Among them, points 32 and 73, points 34 and 79, points 35 and 78, points 28 and 77, etc.
[0089] Step 7.2), based on the position information of the first eyebrow key point, the position information of the second eyebrow key point and the horizontal division ratio of the face, determine the position information of the key point on the left edge of the forehead and the position information of the key point on the right edge of the forehead. The horizontal division ratio of the face can be adjusted according to the eyebrow key point information selected at different positions. For example, when the selected eyebrow key points are point 35 and point 78, the eyebrow key point spacing can be determined according to point 35 and point 78, and the horizontal division ratio of the face is determined to be 3, that is, the distance between the left side of the forehead position information and the right side of the forehead position information is 3 times the eyebrow key point spacing determined by point 35 and point 78. This is only an example. When it is specifically implemented, the horizontal division ratio of the face can be determined according to the selected eyebrow key point position, which will not be repeated here.
[0090] With respect to the above step 5.3), the forehead area can be determined based on the position information of the center point of the upper edge of the forehead, the position information of the key points of the left edge of the forehead, and the position information of the key points of the right edge of the forehead. In specific implementation, for example, the key points of the center point of the upper edge of the forehead can be respectively fitted with the key points of the key points of the left edge of the forehead and the key points of the key points of the right edge of the forehead to obtain the forehead area. Since the forehead area does not need to be calculated completely accurately, the forehead area can be determined by using the arc fitting method for the key point information, which can simply and quickly determine the forehead area, while the amount of calculation is small and the calculation efficiency is high.
[0091] When the color space conversion is performed on the skin area to be detected to obtain the LAB color space information of the skin area to be detected, since the image of the skin area to be detected is usually an image in the RGB color space, it is necessary to convert the RGB image of the skin area to be detected into the LAB color space information as a whole. The conversion specifically includes the following steps A to C:
[0092] Step A: First, convert from RGB color space to CIE color space, and the conversion method is as shown in Formula 1.
[0093]
[0094] Step B, then complete the conversion from CIE space to LMS space, the conversion formula is as shown in Formula 2.
[0095]
[0096] Considering that the LMS space is more dispersed after transformation, it is further transformed into logarithmic space.
[0097] Step C: convert the LMS space to LAB color space information, and the conversion method is as shown in Formula 3.
[0098]
[0099] Furthermore, the A channel color value of the LAB color space information corresponding to each pixel point in the skin area can be extracted according to the converted LAB color space information.
[0100] After the RGB color space of the skin area to be detected is converted into LAB color space information, in order to be able to intuitively and accurately characterize the skin sensitivity of the skin area to be detected through the components corresponding to the LAB color space information, the above step S106 may include the following steps (1) and (2) when implemented:
[0101] Step (1) determines the sensitivity value corresponding to each pixel point in the skin area to be detected based on the A channel color value in the LAB color space information corresponding to each pixel point in the skin area to be detected.
[0102] Step (2), based on the sensitivity values corresponding to the respective pixel points in the skin area to be detected, the skin sensitivity detection result of the skin area to be detected is determined.
[0103] For the above step (1), the A channel color value, that is, the A channel color value corresponding to the LAB color space information, can be implemented by the following steps (1a) and (1b):
[0104] Step (1a), mapping the A channel color value in the LAB color space information corresponding to each pixel point in the skin area to be detected to the corresponding sensitive response value;
[0105] Step (1b), determining the sensitivity value corresponding to each pixel point in the skin area to be detected based on the sensitivity response value corresponding to each pixel point in the skin area to be detected;
[0106] In one embodiment, the above-mentioned sensitive response value can be directly determined as a sensitivity value. For example, if the sensitive response value is directly determined as a sensitivity value, the above-mentioned sensitivity value can be the same value as the color value of the A channel in the LAB color space information; in another embodiment, the sensitivity value can also be calculated based on the sensitive response value. For example, when the sensitivity value is calculated based on the sensitive response value, the sensitivity value can be determined as a value that is a certain proportion to the color value of the A channel. The sensitive response values corresponding to different pixels may be different, and they are represented by sensitive response values, so that the sensitivity corresponding to different pixels can be intuitively seen.
[0107] In addition, when calculating the sensitivity value based on the sensitive response value, the following steps (1c) and (1d) can also be used to implement it:
[0108] Step (1c), mapping the A channel color values in the LAB color space information corresponding to each pixel point in the skin area to be detected to the corresponding sensitive response intervals;
[0109] Step (1d), based on the sensitive response interval corresponding to each pixel point in the skin area to be detected, determine the sensitivity value corresponding to each pixel point in the skin area to be detected.
[0110] Among them, in one embodiment, there are at least two sensitive response intervals, and one sensitive response interval represents a skin sensitivity. For example, the A channel color value response can be mapped to a 0-1 interval, that is, 1 represents very sensitive and 0 represents insensitive. In another embodiment, the value corresponding to the above sensitive response interval can also represent a possibility, the closer the A channel color value is to 1, the more sensitive it is, and conversely, the closer it is to 0, the less sensitive it is.
[0111] By mapping the red and green value scores in the above two ways, the A channel color value of the LAB color space information can correspond to the skin sensitivity, which is convenient for subsequent determination of the skin sensitive area based on the sensitivity value.
[0112] For the above step (2), in order to flexibly characterize the skin sensitivity test results, in specific implementation, the following steps (2a) and / or step (2b) may be adopted:
[0113] Step (2a), determining the sensitivity value corresponding to each pixel point in the skin area to be detected as the skin sensitivity detection result of the skin area to be detected;
[0114] Step (2b), based on the sensitivity values corresponding to each pixel point in the skin area to be detected, determine the skin sensitive area in the skin area to be detected, and determine the skin sensitive area as the skin sensitivity detection result of the skin area to be detected.
[0115] For step (2a), the sensitivity value corresponding to each pixel point can be represented by a red zone map, that is, the skin sensitivity detection result can be determined by the red degree of the red and green components represented by the color values of each A channel of the LAB color space information.
[0116] For step (2b), for example, an area where the sensitivity values corresponding to each pixel point are relatively high and where the high values are relatively dense can be determined as a skin sensitive area.
[0117] The test results of skin sensitivity caused by acne are usually in a small range, so step (2a) can be used to characterize the test results. The test results of sex caused by a thin stratum corneum are usually in a small range, so step (2b) can be used to characterize the test results. For the skin to be tested that contains both small sensitive skin areas and large sensitive skin areas, it can also be characterized by both steps (2a) and (2b). In actual applications, the characterization method of the test results can also be selected according to needs. This is only an example and is not specifically limited.
[0118] Furthermore, after determining the A channel color value in the LAB color space information corresponding to each pixel point in the skin area to be detected, in order to make the detection result more intuitive and vivid, a skin sensitivity image corresponding to the skin area to be detected can also be generated based on the A channel color value in the LAB color space information corresponding to each pixel point in the skin area to be detected. Figure 3 As shown. Since the A channel color value in the LAB color space information only represents the degree of red, the larger the value, the more obvious the red in the color, so the sensitivity of the skin corresponding to the skin area to be detected can be determined by extracting the A channel color value. In addition, the color depth of the pixel points in the above-mentioned face sensitive area image is positively correlated with the size of the A channel color value.
[0119] In one embodiment, in order to intuitively display the skin sensitivity, when generating a skin sensitivity image corresponding to the skin area to be detected based on the A channel color value in the LAB color space information corresponding to each pixel point in the skin area to be detected, the following steps 31-32 may be included:
[0120] Step 31, for each pixel point in the skin area to be detected, based on the A channel color value corresponding to the pixel point, determine the target weight coefficient corresponding to the pixel point;
[0121] Step 32, generating a skin sensitivity image based on the A channel color value, target weight coefficient and background color value corresponding to each pixel point.
[0122] For the above step 31, after extracting the LAB color space information from the image to be detected, three color channels of L, A, and B are obtained:
[0123] L c ∈R h×w , A c ∈R h×w , B c ∈R h×w ;
[0124] Among them, R value is a constant, h and w variables input the length and width of the face image. The A channel color value corresponding to the pixel point is also A c Considering that different images have different color space value ranges, we can further analyze the A channel color value (i.e. A c ) to make the color ranges of different images consistent.
[0125] The above-mentioned target weight coefficient is the weight value of the pixel point determined for the A channel color value. For face images, since the sensitivity of different skin areas may be different, the target weight coefficient can be multiple different coefficient values corresponding to the A channel color value range.
[0126] Furthermore, in order to make the generated skin sensitivity image better visualized and to make the distinction between different skin areas better, when the above step 31 is implemented, when determining the target weight coefficient corresponding to the pixel point based on the A channel color value corresponding to the pixel point, the following steps 311 to 313 may be specifically included:
[0127] Step 311, based on the A channel color value corresponding to the pixel point, the minimum A channel color value and the maximum A channel color value in the skin area to be detected, determine the initial weight coefficient corresponding to the pixel point. The range of the A channel color value of the current skin area to be detected can be determined by the minimum A channel color value and the maximum A channel color value in the skin area to be detected. Therefore, the target weight coefficient alpha is obtained. The target weight coefficient alpha can be, for example, as follows: alpha = (A c -min(A c )) / (max(A c )-min(A c )) for calculation.
[0128] Step 312, based on the color value range interval to which the A channel color value corresponding to the pixel point belongs, determine the superimposed weight value of the initial weight coefficient corresponding to the pixel point. In practical applications, after determining the A channel color value range consisting of the minimum A channel color value and the maximum A channel color value in the skin area to be detected, the A channel color value range can be divided into multiple intervals. Since the A channel color values of pixels at different positions may be different, pixels at different positions can be characterized by initial weight coefficients corresponding to different intervals, so that the sensitivity of different skin areas can be more obvious and the visualization effect can be better.
[0129] Step 313, based on the initial weight coefficient and the superposition weight value corresponding to the pixel point, determine the target weight coefficient corresponding to the pixel point. When the A channel color value is in different ranges, the corresponding superposition weight value of the pixel point is different. For example, in a specific embodiment, for different A channel value ranges, the corresponding superposition weight value is different, where alpha is the initial weight value, and 1, 0.5, 0.3, ... 0.05, 0.0 are the superposition weight values corresponding to different A channel value ranges, as shown in the following table:
[0130]
[0131] Among them, the above table only exemplifies a possible division method of the A channel color value, and it rationally lists the superposition weight values corresponding to the A channel color values within each range, and does not constitute a limitation on the embodiments of the present application.
[0132] The target weight value corresponding to each A channel value range is the product of the initial weight value and the superimposed weight value.
[0133] In order to further eliminate some extreme strong light and dark light situations, before determining the initial weight coefficient corresponding to the pixel based on the A channel color value corresponding to the pixel, the minimum A channel color value and the maximum A channel color value in the skin area to be detected, the various pixels in the skin area to be detected can also be screened based on the L channel pixel value corresponding to each pixel in the skin area to be detected, and the initial weight coefficient corresponding to the pixel is calculated based on the A channel color value corresponding to the pixel, the minimum A channel color value and the maximum A channel color value in the skin area to be detected for the pixel in the skin area to be detected that satisfies the L channel pixel value greater than or equal to the first threshold and less than or equal to the second threshold. Among them, since the L channel pixel value is less than 50, it is dark light, and greater than 200 is strong light, the first threshold can be set to 50, the second threshold can be set to 200, and the L channel pixel value can be limited to the range of 50-200, which can ensure that the converted LAB color space information is as little affected by extreme strong light and dark light as possible.
[0134] Furthermore, in order to eliminate the influence of extreme strong light and dark light, for the pixel points in the skin area to be detected that satisfy the L channel pixel value less than the first threshold or greater than the second threshold, the initial weight coefficient of the pixel point can be determined as the first target value. In specific implementation, the first target value can be 0, and accordingly, the alpha value of the area with the L channel color value less than 50 and greater than 200 in the LAB color space information can be set to 0, that is:
[0135]
[0136] Among them, i and j represent the positions of pixels in the image.
[0137] For the above step 32, the background color value is the all-white image value of the same size as the image to be detected, that is, when generating a skin sensitivity image, the all-white image of the same size as the image to be detected can be used as the background, combined with the A channel color value and the target weight coefficient for superposition to obtain the final skin sensitivity image.
[0138] In one implementation, when generating a skin sensitivity image based on the A channel color value, target weight coefficient, and background color value corresponding to each pixel point, the following steps 321 and 322 may be included:
[0139] Step 321, for each pixel, determine the first product value of the A channel color value corresponding to the pixel and the target weight coefficient corresponding to the pixel, determine the difference between the second target value and the target weight coefficient corresponding to the pixel, and calculate the second product value of the difference and the A channel color value corresponding to the pixel. The first product value can be represented by red_foreground*alpha, the second target value can be set to 1, and correspondingly, the second product value can be (1-alpha)*background.
[0140] Step 322: Generate a skin sensitivity image based on the sum of the first product value and the second product value corresponding to each pixel point. The generated skin sensitivity image can be characterized as follows: paint = red_foreground*alpha+(1-alpha)*background. The skin-sensitive image is obtained by superimposing a full white image of the same size as the image to be detected as the background and a full red image with alpha as the weight.
[0141] In addition, in order to facilitate users to view the detection results more intuitively, the skin sensitivity image can also be enhanced, and the image enhancement processing includes but is not limited to methods such as image binarization and histogram equalization. In addition, a zoom operation can also be performed on a specified area in the skin sensitivity image. The zoom operation can be, for example, segmenting the specified area from the skin sensitivity image and amplifying the segmented local image to achieve the effect of emphasizing the display. The specified area includes the skin sensitive area and / or the user's area of interest.
[0142] In summary, the embodiment of the present application determines the skin area by detecting the key point information of the face, and determines the forehead area according to the key point information of the face and the face division ratio. The skin sensitive area of the target face is determined according to the LAB color space information of the determined skin area, so as to perform skin detection. Based on this, the embodiment of the present application can quickly and accurately detect sensitive skin without the user having to go to a skin detection agency, which saves time and money costs and improves the convenience of user use.
[0143] In addition, in recent years, research on computer vision, deep learning, machine learning, image processing, image recognition and other technologies based on artificial intelligence has made important progress. Artificial Intelligence (AI) is an emerging science and technology that studies and develops theories, methods, technologies and application systems for simulating and extending human intelligence. Artificial intelligence is a comprehensive discipline involving many types of technologies such as chips, big data, cloud computing, the Internet of Things, distributed storage, deep learning, machine learning, neural networks, etc. Computer vision, as an important branch of artificial intelligence, specifically allows machines to recognize the world. Computer vision technology usually includes face recognition, liveness detection, fingerprint recognition and anti-counterfeiting verification, biometric recognition, face detection, pedestrian detection, target detection, pedestrian recognition, image processing, image recognition, image semantic understanding, image retrieval, text recognition, video processing, video content recognition, behavior recognition, 3D reconstruction, virtual reality, augmented reality, simultaneous localization and mapping (SLAM), computational photography, robot navigation and positioning and other technologies. With the research and advancement of artificial intelligence technology, this technology has been applied in many fields, such as security, urban management, traffic management, building management, park management, facial access, facial attendance, logistics management, warehouse management, robots, intelligent marketing, computational photography, mobile phone imaging, cloud services, smart homes, wearable devices, unmanned driving, automatic driving, smart medical care, facial payment, facial unlocking, fingerprint unlocking, identity verification, smart screens, smart TVs, cameras, mobile Internet, live streaming, beauty, makeup, medical beauty, and smart temperature measurement.
[0144] The skin detection method provided in the embodiment of the present application can also be implemented through artificial intelligence. For example, after training a skin detection model for skin sensitivity detection through machine learning, deep learning and other technologies, the image to be detected is input into the skin detection model to obtain the skin sensitivity detection result of the skin area to be detected in the image to be detected, thereby realizing automatic detection of skin sensitive areas based on artificial intelligence, thereby reducing the cost of sensitive skin detection and improving the convenience and efficiency of sensitive skin detection.
[0145] Based on the above embodiments, the present application provides a skin detection device. Figure 4a As shown, the skin detection device 400 provided in the embodiment of the present application at least includes:
[0146] The skin region determining unit 402 is used to determine the skin region to be detected corresponding to the target object in the image to be detected;
[0147] A space conversion unit 404 is used to perform color space conversion on the skin area to be detected to obtain LAB color space information of the skin area to be detected;
[0148] The sensitivity detection unit 406 is used to perform skin sensitivity detection on the skin area to be detected based on the LAB color space information of the skin area to be detected.
[0149] In a possible implementation manner, the image to be detected is a face image, and the target object is a target face; when determining the skin area to be detected corresponding to the target object in the image to be detected, the skin area determination unit 402 is specifically used to:
[0150] Obtain facial key point information of a target face in an image to be detected; based on the facial key point information, determine the skin area to be detected corresponding to the target face.
[0151] In a possible implementation manner, when determining the skin area to be detected corresponding to the target face based on the facial key point information, the skin area determination unit 402 is specifically configured to:
[0152] Based on the facial key point information, the facial area of the target face is determined; based on the facial key point information and the face division ratio, the forehead area of the target face is determined; the facial area and the forehead area are determined as the skin area to be detected of the target face.
[0153] In a possible implementation manner, the facial key point information includes position information of facial contour key points; accordingly, when determining the facial area of the target face based on the facial key point information, the skin area determination unit 402 is specifically used to:
[0154] Based on the position information of the facial contour key points, the facial contour area formed by each facial contour key point is determined; based on the facial contour area, the facial area of the target face is determined.
[0155] In a possible implementation manner, the face division ratio includes a face longitudinal division ratio and a face transverse division ratio; accordingly, when determining the forehead area of the target face based on the face key point information and the face division ratio, the skin area determination unit 402 is specifically used to:
[0156] Based on the facial key point information and the face vertical division ratio, determine the position information of the center point of the upper edge of the forehead of the target face; based on the facial key point information and the face horizontal division ratio, determine the position information of the key points of the left edge of the forehead and the position information of the key points of the right edge of the forehead of the target face; based on the position information of the center point of the upper edge of the forehead, the position information of the key points of the left edge of the forehead and the position information of the key points of the right edge of the forehead, determine the forehead area of the target face.
[0157] In a possible implementation, when determining the forehead area of the target face based on the position information of the center point of the upper edge of the forehead, the position information of the key points of the left edge of the forehead, and the position information of the key points of the right edge of the forehead, the skin area determination unit 402 is specifically used to:
[0158] Based on the position information of the center point of the upper edge of the forehead, the position information of the key points of the left edge of the forehead, and the position information of the key points of the right edge of the forehead, the center point of the upper edge of the forehead is respectively fitted with the key points of the left edge of the forehead and the key points of the right edge of the forehead to obtain the forehead area of the target face.
[0159] In a possible implementation, when performing skin sensitivity detection on the skin area to be detected based on the LAB color space information of the skin area to be detected, the sensitivity detection unit 406 is specifically used to:
[0160] Based on the A channel color value in the LAB color space information corresponding to each pixel point in the skin area to be detected, the sensitivity value corresponding to each pixel point in the skin area to be detected is determined; based on the sensitivity value corresponding to each pixel point in the skin area to be detected, the skin sensitivity detection result of the skin area to be detected is determined.
[0161] In a possible implementation, when determining the sensitivity value corresponding to each pixel point in the skin area to be detected based on the A channel color value in the LAB color space information corresponding to each pixel point in the skin area to be detected, the sensitivity detection unit 406 is specifically used to:
[0162] Map the A channel color values in the LAB color space information corresponding to each pixel point in the skin area to be detected to the corresponding sensitive response values respectively; determine the sensitivity level values corresponding to each pixel point in the skin area to be detected based on the sensitive response values corresponding to each pixel point in the skin area to be detected; or map the A channel color values in the LAB color space information corresponding to each pixel point in the skin area to be detected to the corresponding sensitive response intervals; determine the sensitivity level values corresponding to each pixel point in the skin area to be detected based on the sensitive response intervals corresponding to each pixel point in the skin area to be detected.
[0163] In a possible implementation, when determining the skin sensitivity detection result of the skin area to be detected based on the sensitivity values corresponding to the respective pixel points in the skin area to be detected, the sensitivity detection unit 406 is specifically used to:
[0164] The sensitivity values corresponding to each pixel point in the skin area to be detected are determined as the skin sensitivity detection result of the skin area to be detected; and / or, based on the sensitivity values corresponding to each pixel point in the skin area to be detected, the skin sensitive area in the skin area to be detected is determined, and the skin sensitive area is determined as the skin sensitivity detection result of the skin area to be detected.
[0165] In one possible implementation, see Figure 4b As shown, the skin detection device 400 provided in the embodiment of the present application further includes:
[0166] The image generation unit 408 is used to generate a skin sensitivity image corresponding to the skin area to be detected based on the A channel color value in the LAB color space information corresponding to each pixel point in the skin area to be detected; wherein the color depth of each pixel point in the skin sensitivity image is positively correlated with the size of the A channel color value.
[0167] In a possible implementation, when generating a skin sensitivity image corresponding to the skin area to be detected based on the A channel color value in the LAB color space information corresponding to each pixel point in the skin area to be detected, the image generating unit 408 is specifically used to:
[0168] For each pixel point in the skin area to be detected, the target weight coefficient corresponding to the pixel point is determined based on the A channel color value corresponding to the pixel point; based on the A channel color value corresponding to each pixel point, the target weight coefficient and the background color value, a skin sensitivity image is generated.
[0169] In a possible implementation, when determining the target weight coefficient corresponding to the pixel point based on the A channel color value corresponding to the pixel point, the image generation unit 408 is specifically used to:
[0170] Based on the A-channel color value corresponding to the pixel point, the minimum A-channel color value and the maximum A-channel color value in the skin area to be detected, the initial weight coefficient corresponding to the pixel point is determined; based on the color value range interval to which the A-channel color value corresponding to the pixel point belongs, the superimposed weight value of the initial weight coefficient corresponding to the pixel point is determined; based on the initial weight coefficient and the superimposed weight value corresponding to the pixel point, the target weight coefficient corresponding to the pixel point is determined.
[0171] In a possible implementation, before determining the initial weight coefficient corresponding to the pixel point based on the A channel color value corresponding to the pixel point, the minimum A channel color value and the maximum A channel color value in the skin area to be detected, the image generating unit 408 is further used to:
[0172] Based on the L channel pixel value corresponding to each pixel point in the skin area to be detected, each pixel point in the skin area to be detected is screened;
[0173] Determine the initial weight coefficient corresponding to the pixel point whose L channel pixel value is less than the first threshold or greater than the second threshold as the first target value;
[0174] Accordingly, for each pixel in the skin area to be detected, when calculating the initial weight coefficient corresponding to the pixel based on the A channel color value corresponding to the pixel, the minimum A channel color value and the maximum A channel color value in the skin area to be detected, the image generating unit 408 is specifically used to:
[0175] For pixels in the skin area to be detected that satisfy the L channel pixel value greater than or equal to the first threshold and less than or equal to the second threshold, the initial weight coefficient corresponding to the pixel point is calculated based on the A channel color value corresponding to the pixel point, the minimum A channel color value and the maximum A channel color value in the skin area to be detected.
[0176] In a possible implementation, when generating a skin sensitivity image based on the A channel color value, the target weight coefficient, and the background color value corresponding to each pixel point, the image generating unit 408 is specifically used to:
[0177] For each pixel, determine the first product value of the A channel color value corresponding to the pixel and the target weight coefficient corresponding to the pixel, and determine the difference between the second target value and the target weight coefficient corresponding to the pixel, and calculate the second product value of the difference and the A channel color value corresponding to the pixel; based on the sum of the first product value and the second product value corresponding to each pixel, generate a skin sensitivity image.
[0178] It should be noted that the principle of solving the technical problem by the skin detection device 400 provided in the embodiment of the present application is similar to the skin detection method provided in the embodiment of the present application. Therefore, the implementation of the skin detection device 400 provided in the embodiment of the present application can refer to the implementation of the skin detection method provided in the embodiment of the present application, and the repeated parts will not be repeated.
[0179] The skin detection device 400 provided in the embodiment of the present application determines the facial area to be detected of the target object in the image to be detected through a skin area determination module, and performs color space conversion on the skin area to be detected through a space conversion unit to obtain LAB color space information of the skin area to be detected, and then can perform skin sensitivity detection based on the LAB color space information of the skin area to be detected through a sensitivity detection unit, thereby being able to quickly and accurately detect sensitive skin for the facial image provided by the user, without the user having to go to a skin detection agency, thereby effectively saving time and money costs and improving user convenience.
[0180] See also Figure 5 As shown, the electronic device 500 provided in the embodiment of the present application includes at least: a processor 501, a memory 502, and a computer program stored in the memory 502 and executable on the processor 501. When the processor 501 executes the computer program, the skin detection method provided in the embodiment of the present application is implemented.
[0181] The electronic device 500 provided in the embodiment of the present application may further include a bus 503 connecting different components (including the processor 501 and the memory 502). The bus 503 represents one or more of several types of bus structures, including a memory bus, a peripheral bus, a local bus, and the like.
[0182] The memory 502 may include a readable medium in the form of a volatile memory, such as a random access memory (RAM) 5021 and / or a cache memory 5022 , and may further include a read-only memory (ROM) 5023 .
[0183] The memory 502 may also include a program tool 5025 having a set (at least one) of program modules 5024, wherein the program modules 5024 include but are not limited to: an operating subsystem, one or more application programs, other program modules, and program data, each of which or some combination may include the implementation of a network environment.
[0184] The electronic device 500 may also communicate with one or more external devices 504 (e.g., keyboards, remote controls, etc.), and may also communicate with one or more devices that enable a user to interact with the electronic device 500 (e.g., mobile phones, computers, etc.), and / or communicate with any device that enables the electronic device 500 to communicate with one or more other electronic devices 500 (e.g., routers, modems, etc.). Such communication may be performed through an input / output (I / O) interface 505. Furthermore, the electronic device 500 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) through a network adapter 506. Figure 5 As shown, the network adapter 506 communicates with other modules of the electronic device 500 via the bus 503. It should be understood that although Figure 5 Not shown, other hardware and / or software modules may be used in conjunction with the electronic device 500, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, disk arrays (Redundant Arrays of Independent Disks, RAID) subsystems, tape drives, and data backup storage subsystems.
[0185] It should be noted that Figure 5 The electronic device 500 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0186] The embodiment of the present application provides a computer-readable storage medium, which stores computer instructions, and when the computer instructions are executed by a processor, the skin detection method provided in the embodiment of the present application is implemented. Specifically, the executable program can be built-in or installed in the electronic device 500, so that the electronic device 500 can implement the skin detection method provided in the embodiment of the present application by executing the built-in or installed executable program.
[0187] The skin detection method provided in the embodiment of the present application can also be implemented as a program product, which includes a program code. When the program product can be run on an electronic device, the program code is used to enable the electronic device 500 to execute the skin detection method provided in the embodiment of the present application.
[0188] The program product provided in the embodiments of the present application may adopt any combination of one or more readable media, wherein the readable medium may be a readable signal medium or a readable storage medium, and the readable storage medium may be but is not limited to an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus or device, or any combination of the above. Specifically, more specific examples of readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable disk, a hard disk, RAM, ROM, Erasable Programmable Read Only Memory (EPROM), optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0189] The program product provided in the embodiment of the present application may adopt a CD-ROM and include program code, and may also be run on a computing device. However, the program product provided in the embodiment of the present application is not limited thereto. In the embodiment of the present application, the readable storage medium may be any tangible medium containing or storing a program, and the program may be used by or in combination with an instruction execution system, apparatus, or device.
[0190] It should be noted that, although several units or subunits of the device are mentioned in the above detailed description, this division is merely exemplary and not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more units described above can be embodied in one unit. Conversely, the features and functions of one unit described above can be further divided into multiple units to be embodied.
[0191] In addition, although the operations of the method of the present application are described in a specific order in the drawings, this does not require or imply that the operations must be performed in this specific order, or that all the operations shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps.
[0192] Although the preferred embodiments of the present application have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present application.
[0193] Obviously, those skilled in the art can make various changes and modifications to the embodiments of the present application without departing from the spirit and scope of the embodiments of the present application. Thus, if these modifications and variations of the embodiments of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A skin detection method, characterized in that: include: Determine a skin area to be detected corresponding to the target object in the image to be detected; Performing color space conversion on the skin area to be detected to obtain LAB color space information of the skin area to be detected; Based on the LAB color space information of the skin area to be detected, performing skin sensitivity detection on the skin area to be detected; Wherein, the skin detection method further comprises: Screening each pixel point in the skin area to be detected based on the L channel pixel value corresponding to each pixel point in the skin area to be detected; For the pixel points in the skin area to be detected that satisfy the L channel pixel value less than the first threshold or greater than the second threshold, the initial weight coefficient corresponding to the pixel point is determined as the first target value; for the pixel points in the skin area to be detected that satisfy the L channel pixel value greater than or equal to the first threshold and less than or equal to the second threshold, based on the A channel color value corresponding to the pixel point, the minimum A channel color value and the maximum A channel color value in the skin area to be detected, the initial weight coefficient corresponding to the pixel point is calculated; Determine the superposition weight value of the initial weight coefficient corresponding to the pixel point based on the color value range interval to which the A channel color value corresponding to the pixel point belongs; Determining a target weight coefficient corresponding to the pixel point based on an initial weight coefficient corresponding to the pixel point and a superimposed weight value; A skin sensitivity image is generated based on the A channel color value, target weight coefficient and background color value corresponding to each of the pixel points.
2. The skin detection method according to claim 1, characterized in that: The image to be detected is a face image, and the target object is a target face; Accordingly, the step of determining the skin area to be detected corresponding to the target object in the image to be detected includes: Obtaining facial key point information of a target face in the image to be detected; Based on the facial key point information, a skin area to be detected corresponding to the target face is determined.
3. The skin detection method according to claim 2, characterized in that: The step of determining the skin area to be detected corresponding to the target face based on the facial key point information includes: Determining the facial region of the target face based on the facial key point information; Determining the forehead area of the target face based on the facial key point information and the face division ratio; The face area and the forehead area are determined as the skin areas to be detected.
4. The skin detection method according to claim 3, characterized in that: The facial key point information includes the position information of the facial contour key points; Accordingly, determining the facial region of the target face based on the facial key point information includes: Based on the position information of the facial contour key points, determining the facial contour area formed by each of the facial contour key points; Based on the facial contour area, a facial area of the target face is determined.
5. The skin detection method according to claim 3, characterized in that: The face division ratio includes the face vertical division ratio and the face horizontal division ratio; Accordingly, determining the forehead area of the target face based on the facial key point information and the face division ratio includes: Determine the position information of the center point of the upper edge of the forehead of the target face based on the facial key point information and the vertical division ratio of the face; Based on the facial key point information and the horizontal division ratio of the face, determining the position information of the key points on the left edge of the forehead and the position information of the key points on the right edge of the forehead of the target face; Based on the position information of the center point of the upper edge of the forehead, the position information of the key points of the left edge of the forehead and the position information of the key points of the right edge of the forehead, the forehead area of the target face is determined.
6. The skin detection method according to claim 5, characterized in that: Determining the forehead area of the target face based on the position information of the center point of the upper edge of the forehead, the position information of the key points of the left edge of the forehead, and the position information of the key points of the right edge of the forehead includes: Based on the position information of the center point of the upper edge of the forehead, the position information of the key points of the left edge of the forehead and the position information of the key points of the right edge of the forehead, arc fitting is performed on the center point of the upper edge of the forehead with the key points of the left edge of the forehead and the key points of the right edge of the forehead respectively to obtain the forehead area of the target face.
7. The skin detection method according to any one of claims 1 to 6, characterized in that: Based on the LAB color space information of the skin area to be detected, skin sensitivity detection is performed on the skin area to be detected, including: Determine the sensitivity value corresponding to each pixel point in the skin area to be detected based on the A channel color value in the LAB color space information corresponding to each pixel point in the skin area to be detected; Based on the sensitivity values corresponding to the respective pixel points in the skin area to be detected, the skin sensitivity detection result of the skin area to be detected is determined.
8. The skin detection method according to claim 7, characterized in that: Determining the sensitivity value corresponding to each pixel point in the skin area to be detected based on the A channel color value in the LAB color space information corresponding to each pixel point in the skin area to be detected, including: Mapping the A channel color values in the LAB color space information corresponding to each pixel point in the skin area to be detected to corresponding sensitivity response values respectively; determining the sensitivity value corresponding to each pixel point in the skin area to be detected based on the sensitivity response value corresponding to each pixel point in the skin area to be detected; or, The A channel color values in the LAB color space information corresponding to each pixel point in the skin area to be detected are respectively mapped to corresponding sensitive response intervals; based on the sensitive response intervals corresponding to each pixel point in the skin area to be detected, the sensitivity values corresponding to each pixel point in the skin area to be detected are determined.
9. The skin detection method according to claim 7, characterized in that: Determining the skin sensitivity detection result of the skin area to be detected based on the sensitivity values corresponding to the respective pixel points in the skin area to be detected, including: Determine the sensitivity value corresponding to each pixel point in the skin area to be detected as the skin sensitivity detection result of the skin area to be detected; and / or, Based on the sensitivity values corresponding to the respective pixel points in the skin area to be detected, a skin sensitive area in the skin area to be detected is determined, and the skin sensitive area is determined as the skin sensitivity detection result of the skin area to be detected.
10. The skin detection method according to claim 1, characterized in that: The step of generating the skin sensitivity image based on the A channel color value, the target weight coefficient and the background color value corresponding to each pixel point includes: For each of the pixels, determine a first product value of the A channel color value corresponding to the pixel and the target weight coefficient corresponding to the pixel, determine a difference between a second target value and the target weight coefficient corresponding to the pixel, and calculate a second product value of the difference and the A channel color value corresponding to the pixel; The skin sensitivity image is generated based on the sum of the first product value and the second product value corresponding to each of the pixel points.
11. A skin detection device, characterized in that: The device comprises: A skin region determination unit, used to determine a skin region to be detected corresponding to a target object in an image to be detected; A space conversion unit, used for performing color space conversion on the skin area to be detected to obtain LAB color space information of the skin area to be detected; A sensitivity detection unit, configured to perform skin sensitivity detection on the skin area to be detected based on the LAB color space information of the skin area to be detected; Wherein, the device further comprises: The image generating unit is used to screen each pixel point in the skin area to be detected based on the L channel pixel value corresponding to each pixel point in the skin area to be detected; for the pixel points in the skin area to be detected that satisfy the L channel pixel value less than the first threshold or greater than the second threshold, the initial weight coefficient corresponding to the pixel point is determined as the first target value; for the pixel points in the skin area to be detected that satisfy the L channel pixel value greater than or equal to the first threshold and less than or equal to the second threshold, based on the A channel color value corresponding to the pixel point, the minimum A channel color value and the maximum A channel color value in the skin area to be detected, the initial weight coefficient corresponding to the pixel point is calculated; based on the color value range interval to which the A channel color value corresponding to the pixel point belongs, the superposition weight value of the initial weight coefficient corresponding to the pixel point is determined; based on the initial weight coefficient and the superposition weight value corresponding to the pixel point, the target weight coefficient corresponding to the pixel point is determined; based on the A channel color value corresponding to each of the pixels, the target weight coefficient and the background color value, a skin sensitivity image is generated.
12. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the skin detection method according to any one of claims 1 to 10 when executing the computer program.
13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the skin detection method according to any one of claims 1 to 10 is implemented.
Citation Information
Patent Citations
Hairline contour locating method and device, and computer readable storage medium
CN111295664A
Method for generating human face skin sensitive graph and related device thereof
CN112215808A
Face target area detection method, device and apparatus
CN112699760A