Skin treatment, live broadcast method, computer device and storage medium
By convolutional processing and color adjustment of the oily light in the skin area of the person in the image data, the problems of high complexity, large resource utilization and long time removal in the prior art are solved, and real-time and simple skin treatment effects are achieved.
Patent Information
- Application Number
- CN202010921248.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-09-04
- Publication Date
- 2025-02-28
- Estimated Expiration
- 2040-09-04
AI Technical Summary
The prior art has complex operations when removing oil and light, and it consumes a lot of resources and consumes time, making it difficult to meet the high-level tasks such as live broadcasts and other real-time requirements.
By collecting image data, identifying the skin area of the character image, and convolution processing is performed on the area with oily light in at least two directions to obtain the target oily light area, and then adjusting the color of the skin area with the brightness value of the target oily light area as a reference.
It realizes smooth treatment of oil, adjusts the color of the skin area, makes it softer and closes to the shiny skin texture of the skin, while reducing operation complexity, reducing resource usage and time consumption. It is suitable for real-time tasks such as live broadcasts.
Smart Images

Figure 00000000_0000_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the technical field of computer vision, and in particular to a skin processing, live broadcast method, computer device and storage medium. Background Art
[0002] With the development of society, computer devices such as mobile phones and tablet computers have been widely used in learning, entertainment, work, etc., playing an increasingly important role.
[0003] Many computer devices are equipped with cameras, which can be used for taking photos, recording videos, live streaming, etc.
[0004] The user's skin will secrete oil. Due to the complex environment of taking photos, recording videos, live streaming and other operations, in poor lighting conditions, the user's skin will appear oily.
[0005] In order to remove the oily sheen, the oily sheen area is usually processed at multiple levels, such as deepening, overlaying, bilateral filtering, feathering, etc. The operation is relatively complex, occupies more resources, and is more time-consuming. Summary of the invention
[0006] The embodiment of the present invention proposes a skin treatment and live broadcast method, a computer device and a storage medium to solve the problem of how to reduce the complexity of removing oily shine.
[0007] In a first aspect, an embodiment of the present invention provides a skin treatment method, comprising:
[0008] Collecting image data, wherein the image data contains a human image;
[0009] identifying the skin of the human figure in the image data as a skin region;
[0010] identifying an area with oily sheen in the skin area as an original oily sheen area;
[0011] Performing convolution processing on the original oily glossy area along at least two directions to obtain a target oily glossy area;
[0012] The color of the skin area is adjusted using the brightness value of the target oily area as a reference.
[0013] In a second aspect, an embodiment of the present invention further provides a live broadcast method, comprising:
[0014] Collecting video data, wherein the video data includes multiple frames of image data, and the image data includes a host user;
[0015] Receives an operation that represents the removal of shine;
[0016] In response to the operation, identifying the skin of the anchor user in the image data as a skin area;
[0017] identifying an area with oily sheen in the skin area as an original oily sheen area;
[0018] Performing convolution processing on the original oily glossy area along at least two directions to obtain a target oily glossy area;
[0019] Using the brightness value of the target oily area as a reference, adjusting the color of the skin area;
[0020] The video data after the oily gloss is removed is published in the live broadcast room opened by the anchor user.
[0021] In a third aspect, an embodiment of the present invention further provides a skin treatment device, comprising:
[0022] An image data acquisition module, used for acquiring image data, wherein the image data contains a human figure;
[0023] A skin region recognition module, used to recognize the skin of the character image in the image data as a skin region;
[0024] An original oily-glossy area recognition module, used to recognize an area with oiliness in the skin area as an original oily-glossy area;
[0025] A target glossy region generating module, used for performing convolution processing on the original glossy region along at least two directions to obtain a target glossy region;
[0026] The skin color adjustment module is used to adjust the color of the skin area by taking the brightness value of the target oily area as a reference.
[0027] In a fourth aspect, an embodiment of the present invention further provides a live broadcast device, including:
[0028] A video data acquisition module, used to acquire video data, wherein the video data includes multiple frames of image data, and the image data includes a host user;
[0029] A user operation receiving module is used to receive an operation for removing gloss;
[0030] A skin region identification module, configured to identify the skin of the anchor user as a skin region in the image data in response to the operation;
[0031] An original oily-glossy area recognition module, used to recognize an area with oiliness in the skin area as an original oily-glossy area;
[0032] A target glossy region generating module, used for performing convolution processing on the original glossy region along at least two directions to obtain a target glossy region;
[0033] A skin color adjustment module, used to adjust the color of the skin area by taking the brightness value of the target oily area as a reference;
[0034] The video data publishing module is used to publish the video data after the gloss is removed in the live broadcast room opened by the anchor user.
[0035] In a fifth aspect, an embodiment of the present invention further provides a computer device, the computer device comprising:
[0036] one or more processors;
[0037] a memory for storing one or more programs,
[0038] When the one or more programs are executed by the one or more processors, the one or more processors implement the skin treatment as described in the first aspect or the live broadcast method as described in the second aspect.
[0039] In a sixth aspect, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it implements the skin treatment as described in any one of the first aspects or the live broadcast method as described in the second aspect.
[0040] In this embodiment, image data is collected, and the image data contains a human image. The skin of the human image is identified in the image data as a skin area, and an area with oiliness is identified in the skin area as an original oily area. Convolution processing is performed on the original oily area along at least two directions to obtain a target oily area. The brightness value of the target oily area is used as a reference to adjust the color of the skin area. On the one hand, the oiliness is smoothed by convolution processing, and this is used as a basis for adjusting the color of the skin area, making the skin area softer, removing oiliness, and getting close to the skin texture of skin luster. On the other hand, operations such as convolution processing and adjusting the color of the skin area are relatively simple, which can reduce occupied resources and time consumption, and are suitable for tasks with high real-time requirements such as live broadcasting. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1 A flowchart of a skin treatment method provided in Embodiment 1 of the present invention;
[0042] FIG. 2A to FIG. 2F This is an example diagram for identifying a skin area provided in the first embodiment of the present invention;
[0043] FIG. 3A to FIG. 3BThis is an example diagram of a convolution operation provided in the first embodiment of the present invention;
[0044] Figure 4 is a flow chart of a live broadcast method provided by Embodiment 2 of the present invention;
[0045] Figure 5 This is a schematic diagram of the structure of a skin treatment device provided in Embodiment 3 of the present invention;
[0046] Figure 6 A schematic diagram of the structure of a live broadcast device provided in Embodiment 4 of the present invention;
[0047] Figure 7 A schematic diagram of the structure of a computer device provided in Embodiment 5 of the present invention. DETAILED DESCRIPTION
[0048] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only parts related to the present invention, rather than all structures, are shown in the accompanying drawings.
[0049] Embodiment 1
[0050] Figure 1 This is a flow chart of a skin treatment and skin color adjustment method provided in the first embodiment of the present invention. This embodiment is applicable to the case where the color of the skin color is adjusted by the brightness of the oily sheen. The method can be performed by a skin treatment and skin color adjustment device. The skin treatment device can be implemented by software and / or hardware and can be configured in a computer device, for example, a mobile terminal (such as a mobile phone, a flat panel light, a PDA (personal digital assistant), etc.), a smart wearable device (such as smart glasses, smart watches, etc.), a personal computer, etc., and specifically includes the following steps:
[0051] Step 101: Collect image data.
[0052] In a specific implementation, the operating system of the computer device may include Android, IOS, Windows, etc., which support running applications that can perform image processing, such as live broadcast applications, image editing applications, camera applications, instant messaging tools, gallery applications, etc.
[0053] Applications such as image editing applications, instant messaging tools, and gallery applications may have a UI (User Interface) that provides imported controls. Users may operate the imported controls through touch or a mouse or other peripheral device to select locally stored image data (represented by a thumbnail or path) or network stored image data (represented by a URL (Uniform Resource Locators)) so that the application can capture the image data.
[0054] Applications such as live broadcast applications, image editing applications, camera applications, and instant messaging tools may provide controls for taking photos and recording videos in their UI. Users can operate the controls through touch or external devices such as a mouse to notify the application to call the camera to collect image data.
[0055] Step 102: Identify the skin of the human figure in the image data as a skin area.
[0056] In this embodiment, the image data contains a person image, and the so-called person image may refer to the pixel points in the image data used to represent the person.
[0057] Furthermore, the character image at least includes facial data (pixel points) for representing the face. In addition, it may also include hair data (pixel points) for representing hair, body data (pixel points) for representing the torso, limb data (pixel points) for representing the limbs, and so on. The embodiment of the present invention is not limited to this.
[0058] For human figures, skin color detection can be performed to identify the skin area Face representing the skin in the face data, body data, limbs data, etc. mask (pixels).
[0059] In one embodiment of the present invention, the skin of a human face in a human image can be identified as the skin region Face. mask , then in this embodiment, step 102 may include the following steps:
[0060] Step 1021, identifying feature points representing the face of a person in the image data as facial key points.
[0061] In the embodiment of the present invention, face detection may be performed on the image data to identify key face points contained in the face data, where the key face points are used to characterize feature points of the face of a human image.
[0062] Among them, face detection is also called face key point detection, positioning or face alignment. It means locating the key areas of the face, including eyebrows, eyes, nose, mouth, facial contours, etc., given face data.
[0063] In the specific implementation, face detection can be performed on image data in the following ways:
[0064] 1. Use artificially extracted features, such as Haar features, use the features to train classifiers, and use the classifiers for face detection.
[0065] 2. Inherit face detection from general object detection algorithms, for example, using Faster R-CNN to detect faces.
[0066] 3. Use cascaded convolutional neural networks, for example, Cascade CNN (Cascaded Convolutional Neural Networks), MTCNN (Multi-task Cascaded Convolutional Networks).
[0067] These methods for implementing face detection can be integrated into an application module, and the application can directly call the module to detect facial key points in image data. These methods for implementing face detection can also be integrated into an SDK (Software Development Kit). The SDK serves as assembly data for the application, and the application can request the SDK to perform face detection on image data. The SDK detects facial key points in the image data and returns the facial key points to the application.
[0068] It should be noted that the number of facial key points can be set by technical personnel in this field according to actual conditions. For static image processing, the real-time requirement is relatively low, and relatively dense facial key points, such as 1000, can be detected. In addition to locating important feature points of the face, the contours of the facial features can also be accurately described; for live broadcasting, etc., the real-time requirement is relatively high, and relatively sparse facial key points, such as 68, 81, and 106, can be detected to locate relatively obvious and important feature points on the face (such as eye key points, eyebrow key points, nose key points, mouth key points, contour key points, etc.) to reduce the processing volume, reduce processing time, etc., and the embodiments of the present invention are not limited to this.
[0069] In order to enable those skilled in the art to better understand the embodiments of the present invention, in the embodiments of the present invention, relatively sparse key points of a human face are used as an example for description.
[0070] For example, Figure 2A The image data shown in the figure is used for face detection, and the output is as follows Figure 2B The 68 facial key points can also be output as Figure 2C The 106 facial landmarks shown.
[0071] When outputting facial key points, you can assign numbers to the facial key points, for example Figure 2E As shown, there are 68 facial key points, numbered as follows:
[0072] There are 17 contour key points, numbered 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, and 17.
[0073] There are 10 key points of the eyebrows, numbered 18, 19, 20, 21, 22, 23, 24, 25, 26, and 27 respectively.
[0074] There are 9 key points of the nose, namely 28, 29, 30, 31, 32, 33, 34, 35, and 36.
[0075] There are 12 key points of the eyes, numbered 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, and 48 respectively.
[0076] There are 20 key points of the mouth, numbered 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, and 68 respectively.
[0077] Generally, facial key points are not detected in the forehead area, but the forehead area is an integral part of the facial skin. Therefore, in this embodiment, the forehead key points representing the forehead can be identified as facial key points, thereby ensuring the integrity of the skin color area in the face and ensuring the effect of removing oiliness.
[0078] In a specific implementation, the eye key point representing the eye and the eyebrow key point representing the eyebrow center can be read from the face key points, wherein the eye key point can be any detected feature point (such as Figure 2E The numbered feature points shown are any of 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, and 48, or feature points representing pupils), or feature points generated with reference to detected eye key points (such as midpoints), and the eyebrow key points can be directly detected feature points, or feature points generated with reference to detected eyebrow key points (such as any pair of matching eyebrow key points (such as Figure 2E The eyebrow key points shown are numbered 22 and 23, the eyebrow key points numbered 21 and 24, the eyebrow key points numbered 20 and 25, the eyebrow key points numbered 19 and 26, and the midpoints of the eyebrow key points numbered 18 and 27).
[0079] It should be noted that there is a one-to-one correspondence between the eye key points and the eyes of the character image, that is, one eye key point is selected for one eye.
[0080] like Figure 2DAs shown, if the eyebrow key point 201 and the eye key point 202 are selected, the eye key point 202 can be mapped along the eyebrow key point 201 along the line indication to obtain the forehead key point 203.
[0081] Generally, the eye key point 202 and the forehead key point 203 are symmetrical about the eyebrow key point 201, that is, the distance between the eye key point 202 and the eyebrow key point 201 is generally equal to the distance between the forehead key point 203 and the eyebrow key point 201.
[0082] In addition, in order to prevent the forehead key points from being sparse, one or more feature points may be inserted between the original forehead key points 203 by interpolation as new forehead key points 204 .
[0083] For the key points on the forehead, you can configure the numbering, for example Figure 2E As shown, for the key points on the forehead, the configurable numbers are 69, 70, and 71.
[0084] Step 1022: sequentially connect the key points of the face at the edge of the face to obtain the skin of the face as the skin area.
[0085] In this embodiment, the key points of the face at the edge of the face can be screened out, and these key points of the face can be connected in sequence to form a closed area, which represents the skin of the face and can be used as the skin area Face mask .
[0086] In one example, if the contour key points, forehead key points and other face key points are at the edge of the face, the contour key points, forehead key points and other face key points can be connected in sequence according to the number to obtain the skin of the face as the skin area Face mask .
[0087] For example, Figure 2F As shown, the contour key points numbered 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, and the forehead key points numbered 69, 70, 71 are connected in sequence to obtain the skin area Face mask .
[0088] Of course, in addition to the skin of the face, the skin of other parts of the character (such as the neck, hands, legs, etc.) can also be recognized as the skin area Face mask , this embodiment does not limit this.
[0089] Step 103: Identify an oily area in the skin area as an original oily area.
[0090] If the character's skin has oily sheen, then in the skin area Face mask In the image, the area where the oily light is located has some characteristics in terms of brightness, color components, etc. Therefore, the area with oily light can be identified in the skin area by brightness value division, clustering (such as fuzzy clustering), etc., as the original oily light area Light mask .
[0091] In one embodiment of the present invention, step 103 may include the following steps:
[0092] Step 1031: Enhance the contrast of the skin area.
[0093] In this embodiment, the skin area Face can be extracted from the image data. mask The skin area of Face can be enhanced by power function, histogram equalization, Laplace operator, logarithmic (LOG) transformation, gamma transformation, etc. mask The contrast can increase the details of the area with high grayscale values and emphasize the area with high grayscale values, thereby enhancing the contrast between the highlight area and the skin color. Since oily light is usually a highlight area, enhancing the contrast can reduce the difficulty of identifying oily light and ensure the accuracy of identifying oily light.
[0094] Taking the power function as an example, an API (Application Programming Interface), such as SENSOR_REFERENCE_ILLUMINANT1_ISO_STUDIO_TUNGSTEN, etc., may be called to detect the amount of light R entering the computer device when collecting image data.
[0095] The target value P is determined based on the amount of light entering R, wherein the target value P is positively correlated with the amount of light entering R, that is, the more the amount of light entering R is, the larger the target value P is, and conversely, the less the amount of light entering R is, the smaller the target value P is.
[0096] In one example, the relationship between the target value P and the incoming light amount R is as follows:
[0097] P=k*R
[0098] Among them, k is the adjustment coefficient and is a constant.
[0099] Target skin area Face mask The color component specified in the target value is used as the exponent of the color component, and the color component is converted into a power function to enhance the skin area Face maskSince the target value is related to the amount of light entering when collecting image data, the contrast enhancement amplitude can be optimized, thereby improving the accuracy of identifying the area where the oily light is located.
[0100] Generally, the image data is in the RGB (red, green, and blue) color space, that is, the color components of the image data include R (red), G (green), and B (blue). Under the B component, the contrast between the highlight area and the skin color will be more obvious. Therefore, the target value can be used as the index of the color component under the B component to perform a power function conversion on the color component, thereby enhancing the skin area Face. mask The contrast of the skin area Face mask It can be expressed as:
[0101] B'=B P
[0102] Among them, B' is the B component after contrast enhancement, and P is the target value.
[0103] Step 1032: Filter out the non-oily area in the target skin area to obtain the original oily area.
[0104] In a specific implementation, a threshold may be set, which is related to the environment in which the computer device is located (eg, a live broadcast environment), and statistics are generated in the environment.
[0105] Skin area Face mask The brightness value of each pixel in the image is compared with the preset threshold.
[0106] If the brightness value is greater than or equal to the threshold, the pixel is kept, that is, the value of the color component (such as the B component) of the pixel is kept unchanged, thereby retaining the glossy area.
[0107] If the brightness value is less than the threshold, the color component of the pixel (such as the B component) is set to 0, and the pixel is filtered out, thereby filtering out the non-oily area.
[0108] Step 104: Perform convolution processing on the original oily glossy area along at least two directions to obtain a target oily glossy area.
[0109] In this embodiment, at least two independent directions can be set, that is, each direction is different, and at least two directions are separated to the original oil light area Light mask Perform convolution processing to smooth the oily light and obtain the target oily light area Light mask '.
[0110] In one embodiment of the present invention, step 104 may include the following steps:
[0111] Step 1041 , performing convolution processing on the original oily glossy area along a first direction to obtain a candidate oily glossy area.
[0112] Step 1042: Perform convolution processing on the candidate oily glossy area along the second direction to obtain a target oily glossy area.
[0113] In this embodiment, two directions are set to perform convolution processing on the original oily glossy area, and the two directions are respectively a first direction and a second direction.
[0114] The first direction and the second direction are perpendicular to each other. For example, if the first direction is the X-axis direction, the second direction is the Y-axis direction; if the first direction is the Y-axis direction, the second direction is the X-axis direction.
[0115] In a specific implementation, first, the original oily gloss area is convolved along a first direction to obtain a candidate oily gloss area, and then the candidate oily gloss area is convolved along a second direction to obtain a target oily gloss area.
[0116] In one example, the convolution process is a weighted average process. In this example, the convolution process in the first direction and the convolution process in the second direction are as follows:
[0117] 1. Convolution processing in the first direction:
[0118] Each pixel point in the original oil-glossy area is traversed in sequence, so that each pixel point in the original oil-glossy area is taken as the first target point in sequence.
[0119] Taking the first target point as a base point, a first range is determined along a first direction. Generally, in order to improve the smoothing effect, the first target point is located at the center of the first range.
[0120] For example, Figure 3A As shown, on the X-axis, for the first target point 301, N (N is a positive integer) pixel points can be included before the first target point 301, and N pixel points can be included after the first target point 301, so that the pixel points in the first range are 2N+1.
[0121] A first weight is configured for each pixel point within the first range. The first weight may be the same or negatively correlated with the distance from the first target point, etc. This embodiment does not impose any limitation on this.
[0122] A first product between the brightness value of the pixel point and the first weight is calculated, and a sum of all the first products is calculated as the brightness value of the first target point.
[0123] At this time, the brightness value of the first target point is expressed as follows:
[0124]
[0125]
[0126] Among them, i and k are coordinates in the first direction (such as the X-axis), L(i) is the brightness value of the i-th pixel point (i.e., the first target point), S(i) is the first range, f(k) is the brightness value of the k-th pixel point, and m(k) is the first weight.
[0127] 2. Convolution processing in the second direction
[0128] Traversing each pixel point in the candidate oil-shiny area in turn, so as to take each pixel point in the candidate oil-shiny area as the second target point in turn;
[0129] The second target point is used as a base point to determine the second range along the second direction. Generally, in order to improve the smoothing effect, the first target point is located at the center of the first range.
[0130] For example, Figure 3B As shown, on the Y axis, for the second target point 302, N pixel points may be included before the second target point 302, and N pixel points may be included after the second target point 302, so that the number of pixel points in the second range is 2N+1.
[0131] A second weight is configured for each pixel point within the second range. The first weight may be the same as or negatively correlated with the distance from the second target point, etc. This embodiment does not impose any limitation on this.
[0132] The second product between the brightness value of the pixel point and the second weight is calculated, and the sum of all the second products is calculated as the brightness value of the second target point.
[0133] At this time, the brightness value of the second target point is expressed as follows:
[0134]
[0135]
[0136] Among them, j and l are coordinates in the second direction (such as the Y axis), L(j) is the brightness value of the jth pixel point (i.e., the second target point), S(j) is the second range, f(l) is the brightness value of the lth pixel point, and m(l) is the second weight.
[0137] Of course, the weighted average is only used as an example of convolution processing. When implementing the embodiment of the present invention, other convolution processing can be set according to actual conditions, and the embodiment of the present invention does not limit this. In addition, in addition to the above convolution processing, those skilled in the art can also use other convolution processing according to actual needs, and the embodiment of the present invention does not limit this.
[0138] Step 105: Using the brightness value of the target oily area as a reference, adjust the color of the skin area.
[0139] In this embodiment, the target glossy area Light after smoothing the glossy mask ' as a reference to comprehensively adjust the skin area Face mask The color of the skin area Face is adjusted mask The color is softer and closer to the skin texture with skin luster.
[0140] In one embodiment of the present invention, step 105 may include the following steps:
[0141] Step 1051: Count the average values of the color components in the skin area as the characteristic color components.
[0142] In this embodiment, the skin area Face can be mask The values of each pixel in each color component are accumulated and then divided by the number of pixels to obtain the skin area Face mask The average value of the color components in is used as the characteristic color component.
[0143] Taking RGB color space as an example, for the skin area Face mask The values of each pixel in the R component are accumulated and then divided by the number of pixels to obtain the skin area Face mask The average value of the R component in the skin area Face mask The values of each pixel in the G component are accumulated and then divided by the number of pixels to obtain the skin area Face mask The average value of the G component in the skin area Face mask The values of each pixel in the B component are accumulated and then divided by the number of pixels to obtain the skin area Face mask The average value of the B component in the image. At this time, the characteristic color component can be expressed as Skin rgb .
[0144] Step 1052: Superimpose the color component of the skin area and the characteristic color component based on the brightness value of the target oily area.
[0145] In this embodiment, the target oily area Light mask ' is used as the coefficient for the skin area Face mask The color component of the skin area Face is linearly fused with the characteristic color component to superimpose the skin area Face maskThe superimposed color component and the characteristic color component, because the two superimposed color components both belong to the skin color area, the superimposed color component is softer and closer to the real texture of the skin color.
[0146] In the specific implementation, the target oily area Light mask The brightness value of ' is set as a third weight, and the fourth weight is calculated based on the third weight, for example, the third weight is subtracted from one to obtain the fourth weight.
[0147] Calculate the third product between the characteristic color component and the third weight to calculate the skin area Face mask The fourth product between the color component in and the fourth weight.
[0148] The sum of the third product and the fourth product is calculated as a new color component of the skin area.
[0149] At this point, the superposition process can be expressed as follows:
[0150] T=a*Skin rgb +(1-a)*Face mask
[0151] Among them, a is the target oil light area Light mask ' is the brightness value (i.e. the third weight), 1-a is the fourth weight, Skin rgb is the characteristic color component, Face mask For skin area Face mask The color components in .
[0152] In this embodiment, image data is collected, and the image data contains a human image. The skin of the human image is identified in the image data as a skin area, and an area with oiliness is identified in the skin area as an original oily area. Convolution processing is performed on the original oily area along at least two directions to obtain a target oily area. The brightness value of the target oily area is used as a reference to adjust the color of the skin area. On the one hand, the oiliness is smoothed by convolution processing, and this is used as a basis for adjusting the color of the skin area, making the skin area softer, removing oiliness, and getting close to the skin texture of skin luster. On the other hand, operations such as convolution processing and adjusting the color of the skin area are relatively simple, which can reduce occupied resources and time consumption, and are suitable for tasks with high real-time requirements such as live broadcasting.
[0153] Embodiment 2
[0154] Figure 4This is a flowchart of a live broadcast method provided in Embodiment 2 of the present invention. This embodiment is applicable to the case where the color of skin color is adjusted by the brightness of oily light during live broadcast. The method can be executed by a live broadcast device, which can be implemented by software and / or hardware and can be configured in a computer device, for example, a mobile terminal (such as a mobile phone, a flat panel light, a PDA (personal digital assistant), etc.), a smart wearable device (such as smart glasses, smart watches, etc.), a personal computer, etc., and specifically includes the following steps:
[0155] Step 401: Collect video data.
[0156] In a specific implementation, the operating system of the computer device may include Android, IOS, Windows, etc., and these operating systems support running a live broadcast application that can perform image processing.
[0157] It should be noted that the live broadcast application can be an independent application or a component in other applications (such as social applications, instant messaging tools, etc.), such as SDK, and the embodiments of the present invention are not limited to this.
[0158] The anchor user logs in the user account to the live broadcast platform in the live broadcast application, and sends the live broadcast title to the live broadcast platform to generate a live broadcast room for the user account according to the live broadcast title.
[0159] Thereafter, the live broadcast application may call the camera of the computer device to collect video data, wherein the video data includes multiple frames of image data, and at least part of the image data contains the anchor user.
[0160] Of course, the anchor user in the image data may refer to the pixel points used to represent the anchor user. Generally, the anchor at least includes facial data (pixel points) used to represent the face. In addition, it may also include hair data (pixel points) used to represent hair, body data (pixel points) used to represent the torso, limb data (pixel points) used to represent the limbs, and so on. The embodiment of the present invention is not limited to this.
[0161] Step 402: Receive an operation for removing gloss.
[0162] In a specific implementation, the UI of the live broadcast application may provide a beautification control, wherein the control is associated with multiple sub-controls, some of which may be used to remove greasiness. The host user may operate the sub-control through touch or external devices such as a mouse to trigger the greasiness removal operation.
[0163] Step 403: In response to the operation, the skin of the anchor user is identified in the image data as a skin area.
[0164] For the shine removal operation triggered by the anchor user, the skin color of the anchor user can be detected in the image data, so as to identify the skin area (pixel points) representing the skin in the face data, body data, limb data and other areas.
[0165] In one embodiment of the present invention, the skin of a face in a human figure may be identified as the skin region. In this embodiment, step 403 may include the following steps:
[0166] Step 4031: Identify feature points in the image data that represent the face of the anchor user as facial key points.
[0167] In a specific implementation, the facial key points include a forehead key point representing the forehead, an eye key point representing the eyes, and an eyebrow key point representing the center of the eyebrows, and the forehead key point is located at the edge of the face.
[0168] Then in step 4031, the eye key points are mapped along the eyebrow key points to obtain the forehead key points; and new forehead key points are inserted between the forehead key points.
[0169] Step 4032: sequentially connect the facial key points at the edge of the face to obtain the skin of the face as the skin area.
[0170] Step 404: Identify an oily area in the skin area as an original oily area.
[0171] If the host user has oily skin, the area in the skin area where the oily skin is located has some characteristics in terms of brightness, color components and other features. Therefore, the area with oily skin can be identified in the skin area as the original oily area through brightness value division, clustering (such as fuzzy clustering) and other methods.
[0172] In one embodiment of the present invention, step 404 may include the following steps:
[0173] Step 4041: Enhance the contrast of the skin area.
[0174] Exemplarily, the amount of incoming light when collecting image data is detected; and a target value is determined based on the amount of incoming light, wherein the target value is positively correlated with the amount of incoming light.
[0175] For a specified color component in the skin area, a power function conversion is performed on the color component with a target value as an exponent of the color component.
[0176] Step 4042: If the contrast enhancement is completed, filter out the non-oily area to obtain the original oily area.
[0177] In a specific implementation, the brightness value of each pixel in the skin area can be compared with a preset threshold; if the brightness value is greater than or equal to the threshold, the pixel is retained; if the brightness value is less than the threshold, the pixel is filtered out.
[0178] Step 405: Perform convolution processing on the original oily glossy area along at least two directions to obtain a target oily glossy area.
[0179] In this embodiment, at least two independent directions may be set, that is, each direction is different, and at least two directions are separated to perform convolution processing on the original oily gloss area, so as to smooth the oily gloss and obtain the target oily gloss area.
[0180] In one embodiment of the present invention, step 405 may include the following steps:
[0181] Step 4051: Perform convolution processing on the original oily glossy area along a first direction to obtain a candidate oily glossy area.
[0182] Exemplarily, the pixel points in the original oily gloss area are taken as the first target points in turn; the first range is determined along the first direction with the first target point as the base point; a first weight is assigned to each pixel point in the first range; the first product between the brightness value of the pixel point and the first weight is calculated; and the sum of all the first products is calculated as the brightness value of the first target point.
[0183] Step 4052: Perform convolution processing on the candidate oily glossy area along the second direction to obtain the target oily glossy area.
[0184] The first direction and the second direction are perpendicular to each other.
[0185] Exemplarily, pixel points in the candidate oily gloss area are taken as the second target points in turn; the second range is determined along the second direction with the second target point as the base point; a second weight is assigned to each pixel point in the second range; the second product between the brightness value of the pixel point and the second weight is calculated; and the sum of all the second products is calculated as the brightness value of the second target point.
[0186] Step 406: Using the brightness value of the target oily area as a reference, adjust the color of the skin area.
[0187] In this embodiment, the brightness value of the target oily area after oily sheen is smoothed is used as a reference to comprehensively adjust the color of the skin area so that the color of the adjusted skin area is softer and closer to the skin texture of the skin luster.
[0188] In one embodiment of the present invention, step 406 may include the following steps:
[0189] Step 4061: Count the average values of the color components in the skin area as the characteristic color components.
[0190] Step 4062: Superimpose the color component of the skin area and the characteristic color component based on the brightness value of the target oily area.
[0191] Exemplarily, the brightness value of the target oily glossy area is set as a third weight, and the fourth weight is calculated based on the third weight.
[0192] A third product between the characteristic color component and the third weight is calculated, and a fourth product between the color component in the skin region and the fourth weight is calculated.
[0193] The sum of the third product and the fourth product is calculated as a new color component of the skin area.
[0194] Step 407: Publish the video data after the oily shine is removed in the live broadcast room opened by the anchor user.
[0195] In a specific implementation, if the host user's luster in the video data is removed, the live broadcast application can send the video data to the live broadcast platform (live broadcast server) through protocols such as RTSP (Real Time Streaming Protocol), RTMP (Real Time Messaging Protocol), and HLS (HTTP Live Streaming, dynamic bit rate adaptation technology). The live broadcast platform (live broadcast server) publicly discloses the live broadcast room opened by the host user (indicated by ID and other identifiers), so that the audience users can open the live broadcast room in the client, receive the video data and play it.
[0196] In the embodiment of the present invention, since the operation of removing the gloss is basically similar to the application of the first embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the first embodiment, and the embodiment of the present invention is not described in detail here.
[0197] In this embodiment, video data is collected, the video data includes multiple frames of image data, and the image data contains a host user; an operation indicating the removal of oily shine is received; in response to the operation, the skin of the host user is identified in the image data as a skin area; an area with oily shine is identified in the skin area as an original oily shine area; convolution processing is performed on the original oily shine area along at least two directions to obtain a target oily shine area; the color of the skin area is adjusted based on the brightness value of the target oily shine area; and the video data after the oily shine is removed is published in the live broadcast room opened by the host user. On the one hand, the oily shine is smoothed by convolution processing, and the color of the skin area is adjusted based on this, so that the skin area is softer, the oily shine can be removed, and the skin texture is close to the skin's gloss. On the other hand, operations such as convolution processing and adjusting the color of the skin area are relatively simple, which can reduce occupied resources and time consumption, thereby reducing the delay during transmission, ensuring real-time performance, and being suitable for live broadcasting.
[0198] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.
[0199] Embodiment 3
[0200] Figure 5 This is a structural block diagram of a skin treatment device provided in Embodiment 3 of the present invention, which may specifically include the following modules:
[0201] An image data acquisition module 501 is used to acquire image data, wherein the image data includes a human figure;
[0202] A skin region identification module 502, used to identify the skin of the character in the image data as a skin region;
[0203] An original oily sheen region identification module 503, used to identify an oily sheen region in the skin region as an original oily sheen region;
[0204] A target glossy region generating module 504 is used to perform convolution processing on the original glossy region along at least two directions to obtain a target glossy region;
[0205] The skin color adjustment module 505 is used to adjust the color of the skin area by taking the brightness value of the target oily area as a reference.
[0206] In one embodiment of the present invention, the skin region identification module 502 includes:
[0207] A facial key point recognition submodule, used to recognize feature points representing the face of the character in the image data as facial key points;
[0208] The face key point connection submodule is used to sequentially connect the face key points at the edge of the face to obtain the skin of the face as the skin area.
[0209] In one embodiment of the present invention, the facial key points include a forehead key point representing the forehead, an eye key point representing the eyes, and an eyebrow key point representing the center of the eyebrows, and the forehead key point is located at the edge of the face;
[0210] The facial key point recognition submodule includes:
[0211] A forehead key point mapping unit, used for mapping the eye key point along the eyebrow key point to obtain the forehead key point;
[0212] A forehead key point insertion unit is used to insert a new forehead key point between the forehead key points.
[0213] In one embodiment of the present invention, the original oily area recognition module 503 includes:
[0214] A contrast enhancement submodule, used to enhance the contrast of the skin area;
[0215] The non-oil-light filtering submodule is used to filter out the non-oil-light area after contrast enhancement is completed to obtain the original oil-light area.
[0216] In one embodiment of the present invention, the contrast enhancement submodule comprises:
[0217] An incoming light monitoring unit, used to detect the incoming light amount when collecting the image data;
[0218] a target value determining unit, configured to determine a target value based on the amount of incoming light, wherein the target value is positively correlated with the amount of incoming light;
[0219] A power function conversion unit is used to perform a power function conversion on a color component specified in the skin area by taking the target value as an exponent of the color component.
[0220] In one embodiment of the present invention, the non-oil light filtering submodule comprises:
[0221] A brightness comparison unit, used to compare the brightness value of each pixel in the skin area with a preset threshold;
[0222] a pixel point holding unit, configured to hold the pixel point if the brightness value is greater than or equal to the threshold value;
[0223] A pixel point filtering unit is used to filter out the pixel point if the brightness value is less than the threshold value.
[0224] In one embodiment of the present invention, the target oily area generation module 504 includes:
[0225] A first convolution submodule, configured to perform convolution processing on the original glossy area along a first direction to obtain a candidate glossy area;
[0226] The second convolution submodule is used to perform convolution processing on the candidate glossy area along a second direction to obtain a target glossy area, and the first direction is perpendicular to the second direction.
[0227] In one embodiment of the present invention, the first convolution submodule includes:
[0228] A first target point determination unit, used to sequentially use pixel points in the original oily light area as first target points;
[0229] A first range determining unit, configured to determine a first range along a first direction with the first target point as a base point;
[0230] A first weight configuration unit, configured to configure a first weight for each pixel point within the first range;
[0231] A first product calculation unit, used to calculate a first product between the brightness value of the pixel and the first weight;
[0232] The first brightness value calculation unit is used to calculate the sum of all the first products as the brightness value of the first target point.
[0233] In one embodiment of the present invention, the second convolution submodule includes:
[0234] A second target point determination unit, used to sequentially use pixel points in the candidate oily light area as second target points;
[0235] A second range determining unit, configured to determine a second range along a second direction with the second target point as a base point;
[0236] A second weight configuration unit, configured to configure a second weight for each pixel point within the second range;
[0237] A second product calculation unit, used to calculate a second product between the brightness value of the pixel and the second weight;
[0238] The second brightness value calculation unit is used to calculate the sum of all the second products as the brightness value of the second target point.
[0239] In one embodiment of the present invention, the skin color adjustment module 505 includes:
[0240] A characteristic color component statistics submodule, used for counting the average value of the color component in the skin area as the characteristic color component;
[0241] The color component superposition submodule is used to superimpose the color component of the skin area and the characteristic color component based on the brightness value of the target oily area.
[0242] In one embodiment of the present invention, the color component superposition submodule includes:
[0243] A third weight setting unit, used to set the brightness value of the target oily gloss area to a third weight;
[0244] a fourth weight calculation unit, configured to calculate a fourth weight based on the third weight;
[0245] A third product calculation unit, used for calculating a third product between the characteristic color component and the third weight;
[0246] a fourth weight calculation unit, configured to calculate a fourth product between the color component in the skin area and the fourth weight;
[0247] The new color component calculation unit is used to calculate the sum of the third product and the fourth product as the new color component of the skin area.
[0248] The skin treatment device provided in the embodiment of the present invention can execute the skin treatment method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0249] Embodiment 4
[0250] Figure 6 A structural block diagram of a live broadcast device provided in Embodiment 4 of the present invention may specifically include the following modules:
[0251] The video data acquisition module 601 is used to acquire video data, wherein the video data includes multiple frames of image data, and the image data includes a host user;
[0252] The user operation receiving module 602 is used to receive an operation for removing gloss;
[0253] A skin region identification module 603, configured to identify the skin of the anchor user as a skin region in the image data in response to the operation;
[0254] An original oily sheen region identification module 604, used to identify an area with oiliness in the skin region as an original oily sheen region;
[0255] A target oily gloss region generating module 605 is used to perform convolution processing on the original oily gloss region along at least two directions to obtain a target oily gloss region;
[0256] A skin color adjustment module 606, configured to adjust the color of the skin area by taking the brightness value of the target oily area as a reference;
[0257] The video data publishing module 607 is used to publish the video data after the gloss is removed in the live broadcast room opened by the anchor user.
[0258] In one embodiment of the present invention, the skin area identification module 603 includes:
[0259] A facial key point recognition submodule, used to recognize feature points representing the face of the anchor user in the image data as facial key points;
[0260] The face key point connection submodule is used to sequentially connect the face key points at the edge of the face to obtain the skin of the face as the skin area.
[0261] In one embodiment of the present invention, the facial key points include a forehead key point representing the forehead, an eye key point representing the eyes, and an eyebrow key point representing the center of the eyebrows, and the forehead key point is located at the edge of the face;
[0262] The facial key point recognition submodule includes:
[0263] A forehead key point mapping unit, used for mapping the eye key point along the eyebrow key point to obtain the forehead key point;
[0264] A forehead key point insertion unit is used to insert a new forehead key point between the forehead key points.
[0265] In one embodiment of the present invention, the original oily area identification module 604 includes:
[0266] A contrast enhancement submodule, used to enhance the contrast of the skin area;
[0267] The non-oil-light filtering submodule is used to filter out the non-oil-light area after contrast enhancement is completed to obtain the original oil-light area.
[0268] In one embodiment of the present invention, the contrast enhancement submodule comprises:
[0269] An incoming light monitoring unit, used to detect the incoming light amount when collecting the image data;
[0270] a target value determining unit, configured to determine a target value based on the amount of incoming light, wherein the target value is positively correlated with the amount of incoming light;
[0271] A power function conversion unit is used to perform a power function conversion on a color component specified in the skin area by taking the target value as an exponent of the color component.
[0272] In one embodiment of the present invention, the non-oil light filtering submodule comprises:
[0273] A brightness comparison unit, used to compare the brightness value of each pixel in the skin area with a preset threshold;
[0274] a pixel point holding unit, configured to hold the pixel point if the brightness value is greater than or equal to the threshold value;
[0275] A pixel point filtering unit is used to filter out the pixel point if the brightness value is less than the threshold value.
[0276] In one embodiment of the present invention, the target oily area generation module 605 includes:
[0277] A first convolution submodule, configured to perform convolution processing on the original glossy area along a first direction to obtain a candidate glossy area;
[0278] The second convolution submodule is used to perform convolution processing on the candidate glossy area along a second direction to obtain a target glossy area, and the first direction is perpendicular to the second direction.
[0279] In one embodiment of the present invention, the first convolution submodule includes:
[0280] A first target point determination unit, used to sequentially use pixel points in the original oily light area as first target points;
[0281] A first range determining unit, configured to determine a first range along a first direction with the first target point as a base point;
[0282] A first weight configuration unit, configured to configure a first weight for each pixel point within the first range;
[0283] A first product calculation unit, used to calculate a first product between the brightness value of the pixel and the first weight;
[0284] The first brightness value calculation unit is used to calculate the sum of all the first products as the brightness value of the first target point.
[0285] In one embodiment of the present invention, the second convolution submodule includes:
[0286] A second target point determination unit, used to sequentially use pixel points in the candidate oily light area as second target points;
[0287] A second range determining unit, configured to determine a second range along a second direction with the second target point as a base point;
[0288] A second weight configuration unit, configured to configure a second weight for each pixel point within the second range;
[0289] A second product calculation unit, used to calculate a second product between the brightness value of the pixel and the second weight;
[0290] The second brightness value calculation unit is used to calculate the sum of all the second products as the brightness value of the second target point.
[0291] In one embodiment of the present invention, the skin color adjustment module 606 includes:
[0292] A characteristic color component statistics submodule, used for counting the average value of the color component in the skin area as the characteristic color component;
[0293] The color component superposition submodule is used to superimpose the color component of the skin area and the characteristic color component based on the brightness value of the target oily area.
[0294] In one embodiment of the present invention, the color component superposition submodule includes:
[0295] A third weight setting unit, used to set the brightness value of the target oily gloss area to a third weight;
[0296] a fourth weight calculation unit, configured to calculate a fourth weight based on the third weight;
[0297] A third product calculation unit, used for calculating a third product between the characteristic color component and the third weight;
[0298] a fourth weight calculation unit, configured to calculate a fourth product between the color component in the skin area and the fourth weight;
[0299] The new color component calculation unit is used to calculate the sum of the third product and the fourth product as the new color component of the skin area.
[0300] The live broadcast device provided in the embodiment of the present invention can execute the live broadcast method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0301] Embodiment 5
[0302] Figure 7 A schematic diagram of the structure of a computer device provided in Embodiment 5 of the present invention. Figure 7 A block diagram of an exemplary computer device 12 suitable for use in implementing embodiments of the present invention is shown. Figure 7 The computer device 12 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0303] like Figure 7 As shown, the computer device 12 is in the form of a general-purpose computing device. The components of the computer device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 that connects various system components (including the system memory 28 and the processing unit 16).
[0304] Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor or a local bus using any of a variety of bus architectures. By way of example, these architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MAC) bus, an Enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.
[0305] The computer device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the computer device 12, including volatile and non-volatile media, removable and non-removable media.
[0306] The system memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. The computer device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 34 may be used to read and write non-removable, non-volatile magnetic media ( Figure 7 not shown, usually called a "hard drive"). Although Figure 7Not shown in the figure, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, a DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to the bus 18 via one or more data medium interfaces. The memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the various embodiments of the present invention.
[0307] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in the memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. The program modules 42 generally perform the functions and / or methods of the embodiments described herein.
[0308] The computer device 12 may also communicate with one or more external devices 14 (e.g., keyboards, pointing devices, displays 24, etc.), may communicate with one or more devices that enable a user to interact with the computer device 12, and / or may communicate with any device that enables the computer device 12 to communicate with one or more other computing devices (e.g., network cards, modems, etc.). Such communication may be performed via an input / output (I / O) interface 22. Furthermore, the computer device 12 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter 20. As shown, the network adapter 20 communicates with other modules of the computer device 12 via a bus 18. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the computer device 12, including, but not limited to, microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0309] The processing unit 16 executes various functional applications and data processing by running the programs stored in the system memory 28, such as implementing the skin processing method or the live broadcast method provided in the embodiment of the present invention.
[0310] Embodiment 6
[0311] Embodiment 6 of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the various processes of the above-mentioned skin treatment method or live broadcast method are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0312] Among them, computer-readable storage media may include, for example, but are not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or devices, or any combination of the above. More specific examples of computer-readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, device or device.
[0313] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.
Claims
1. A skin treatment method, characterized in that: include: Collecting image data, wherein the image data contains a human image; identifying the skin of the human figure in the image data as a skin region; identifying an area with oily sheen in the skin area as an original oily sheen area; Performing convolution processing on the original glossy area along at least two directions to obtain a target glossy area, wherein the convolution processing is a weighted average processing; Using the brightness value of the target oily area as a reference, adjusting the color of the skin area; The step of performing convolution processing on the original glossy area along at least two directions to obtain a target glossy area includes: Performing convolution processing on the original oily glossy area along a first direction to obtain a candidate oily glossy area; Performing convolution processing on the candidate oily glossy area along a second direction to obtain a target oily glossy area, wherein the first direction is perpendicular to the second direction; The step of adjusting the color of the skin area by taking the brightness value of the target oily area as a reference comprises: Accumulating the values of each pixel in the skin area under each color component, and then dividing by the number of pixels, so as to obtain an average value of the color component in the skin area as a characteristic color component; The color component of the skin area and the characteristic color component are superimposed based on the brightness value of the target oily area.
2. The method according to claim 1, characterized in that: The step of identifying the skin of the person image as a skin region in the image data includes: Identify feature points representing the face of the person in the image data as facial key points; The facial key points at the edge of the face are connected in sequence to obtain the skin of the face as the skin area.
3. The method according to claim 2, characterized in that The facial key points include a forehead key point representing the forehead, an eye key point representing the eyes, and an eyebrow key point representing the center of the eyebrows, and the forehead key point is located at the edge of the face; The step of identifying feature points representing the face of the person in the image data as face key points includes: Mapping the eye key point along the eyebrow key point to obtain the forehead key point; Insert new forehead key points between the forehead key points.
4. The method according to claim 1, characterized in that: The step of identifying an area with oiliness in the skin area as an original oiliness area comprises: enhancing the contrast of the skin region; If contrast enhancement is completed, the non-glossy area is filtered out to obtain the original glossy area.
5. The method according to claim 4, characterized in that The step of enhancing the contrast of the skin area comprises: detecting an amount of light entering when collecting the image data; Determine a target value based on the amount of incoming light, wherein the target value is positively correlated with the amount of incoming light; For a color component specified in the skin area, a power function conversion is performed on the color component using the target value as an exponent of the color component.
6. The method according to claim 4, characterized in that The filtering out of the non-oily area to obtain the original oily area includes: Comparing the brightness value of each pixel in the skin area with a preset threshold; If the brightness value is greater than or equal to the threshold, the pixel is maintained; If the brightness value is less than the threshold, the pixel is filtered out.
7. The method according to claim 1, characterized in that The step of performing convolution processing on the original glossy region along the first direction to obtain a candidate glossy region includes: sequentially taking pixel points in the original oily light area as first target points; Taking the first target point as a base point, determining a first range along a first direction; Assigning a first weight to each pixel within the first range; Calculating a first product between the brightness value of the pixel and the first weight; The sum of all the first products is calculated as the brightness value of the first target point.
8. The method according to claim 1, characterized in that The step of performing convolution processing on the candidate oily glossy region along the second direction to obtain a target oily glossy region includes: sequentially taking pixel points in the candidate oily light area as second target points; Taking the second target point as a base point, determining a second range along a second direction; Assigning a second weight to each pixel within the second range; Calculating a second product between the brightness value of the pixel and the second weight; The sum of all the second products is calculated as the brightness value of the second target point.
9. A live broadcast method, characterized in that: include: Collecting video data, wherein the video data includes multiple frames of image data, and the image data includes a host user; Receives an operation that represents the removal of shine; In response to the operation, identifying the skin of the anchor user in the image data as a skin area; identifying an area with oily sheen in the skin area as an original oily sheen area; Performing convolution processing on the original glossy area along at least two directions to obtain a target glossy area, wherein the convolution processing is a weighted average processing; Using the brightness value of the target oily area as a reference, adjusting the color of the skin area; Posting the video data after the oil gloss is removed in the live broadcast room opened by the anchor user; The step of performing convolution processing on the original glossy area along at least two directions to obtain a target glossy area includes: Performing convolution processing on the original oily glossy area along a first direction to obtain a candidate oily glossy area; Performing convolution processing on the candidate oily glossy area along a second direction to obtain a target oily glossy area, wherein the first direction is perpendicular to the second direction; The step of adjusting the color of the skin area by taking the brightness value of the target oily area as a reference comprises: Accumulating the values of each pixel in the skin area under each color component, and then dividing by the number of pixels, so as to obtain an average value of the color component in the skin area as a characteristic color component; The color component of the skin area and the characteristic color component are superimposed based on the brightness value of the target oily area.
10. A computer device, characterized in that: The computer device comprises: one or more processors; a memory for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the skin treatment method as described in any one of claims 1-8 or the live broadcast method as described in claim 9.
11. 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, it implements the skin treatment method as described in any one of claims 1 to 8 or the live broadcast method as described in claim 9.
Citation Information
Patent Citations
Automatic gloss removing method and system for face area and shooting terminal
CN105719234A
Shine removing method and device for human face area, and terminal
CN107194374A