Makeup special effect drawing method and device, electronic equipment and storage medium

By obtaining the user's drawing gesture information and utilizing the affine transformation of the standard facial model and the target facial model, personalized makeup special effects drawing of facial video images is achieved, which solves the problem of inflexible makeup drawing in the existing technology and improves the diversity and expressiveness of video creation.

CN114529445BActive Publication Date: 2025-10-21BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202011194032.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-10-30
Publication Date
2025-10-21
Estimated Expiration
2040-10-30

AI Technical Summary

Technical Problem

In the existing technology, it is impossible to perform personalized makeup drawing during the user's facial video processing, which limits the diversity and performance of video creation.

Method used

By obtaining the drawing gesture information input by the user, makeup effects are drawn at the target position of the facial video image according to the gesture information. The target position corresponds to a fixed facial area as the facial video image is played, and personalized drawing of makeup effects is achieved by using affine transformation of the standard facial model and the target facial model.

Benefits of technology

It enables the free generation of makeup effects according to user needs, improves the diversity and expressiveness of video creation, and users are not restricted by fixed template styles.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114529445B_ABST
    Figure CN114529445B_ABST
Patent Text Reader

Abstract

Embodiments of the present disclosure provide a makeup special effect drawing method and device, electronic equipment and storage medium, which display a face video image, obtain drawing gesture information input by a user, wherein the drawing gesture information is used to indicate a face region in the face video image to which a makeup special effect is to be added, draw the makeup special effect at a target position of the face video image according to the drawing gesture information, wherein the target position corresponds to a fixed face region as the face video image plays, and since the makeup special effect is generated in the corresponding face region through the drawing gesture information input by the user, the makeup special effect of the face can be freely generated according to the needs of the user and displayed in real time with the video, thereby providing a personalized makeup drawing mode for the user and improving the diversity and video expressiveness of video creation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present disclosure relate to the field of computers and image processing technologies, and in particular to a makeup special effects rendering method, device, electronic device, and storage medium. Background Art

[0002] In short video software, the short video creation function is the core of the short video software. The richness, diversity and fun of the short video creation function are important factors that attract users and short video creators to use the short video software.

[0003] Currently, in the existing technology, makeup effects can be added to the user's facial image or video, so that the facial image or video taken by the user presents the effect of makeup, thereby increasing the expressiveness of the short video taken by the user.

[0004] However, the processing of user facial images and videos in the existing technology is achieved by setting special effects in a fixed style. It is impossible to perform personalized makeup on the captured videos according to the user's needs, which limits the diversity of user-created videos and affects the video performance effect. Summary of the Invention

[0005] The embodiments of the present disclosure provide a makeup special effects rendering method, device, electronic device and storage medium to overcome the problem in the prior art that personalized makeup rendering cannot be performed, which affects the video performance effect.

[0006] In a first aspect, an embodiment of the present disclosure provides a method for rendering makeup special effects, comprising:

[0007] displaying facial video images;

[0008] Acquiring drawing gesture information input by a user, wherein the drawing gesture information is used to indicate a facial area in the facial video image to which a makeup special effect is to be added;

[0009] A makeup effect is drawn at a target position of the facial video image according to the drawing gesture information, wherein the target position corresponds to a fixed facial area as the facial video image is played.

[0010] In a second aspect, an embodiment of the present disclosure provides a makeup special effects rendering device, comprising:

[0011] a display unit, configured to display a facial video image;

[0012] an acquiring unit, configured to acquire drawing gesture information input by a user, wherein the drawing gesture information is used to indicate a facial area in the facial video image to which a makeup special effect is to be added;

[0013] A drawing unit is used to draw a makeup effect at a target position of the facial video image according to the drawing gesture information, wherein the target position corresponds to a fixed facial area as the facial video image is played.

[0014] In a third aspect, an embodiment of the present disclosure provides an electronic device, including: at least one processor and a memory;

[0015] The memory stores computer-executable instructions;

[0016] The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the makeup special effects drawing method described in the first aspect and various possible designs of the first aspect.

[0017] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the makeup special effects drawing method described in the first aspect and various possible designs of the first aspect is implemented.

[0018] In a fifth aspect, an embodiment of the present disclosure provides a computer program, including program code. When a computer runs the computer program, the program code executes the makeup special effects drawing method described in the first aspect and various possible designs of the first aspect.

[0019] The makeup special effects drawing method, device, electronic device and storage medium provided in this embodiment display a facial video image; obtain drawing gesture information input by a user, wherein the drawing gesture information is used to indicate the facial area in the facial video image to which the makeup special effects are to be added; draw the makeup special effects at a target position in the facial video image according to the drawing gesture information, wherein the target position corresponds to a fixed facial area as the facial video image is played. Since the makeup special effects are generated in the corresponding facial area through the drawing gesture information input by the user, the facial makeup special effects can be freely generated according to the needs of the user and displayed in real time with the video, thereby providing the user with a personalized makeup drawing method and improving the diversity of video creation and the expressiveness of the video. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0021] Figure 1A schematic diagram of a scene of a makeup special effects rendering method provided by an embodiment of the present disclosure;

[0022] Figure 2 This is an example diagram of a makeup special effects rendering method in the prior art;

[0023] Figure 3 Schematic diagram of the makeup special effects rendering method provided in the embodiment of the present disclosure Figure 1 ;

[0024] Figure 4 A schematic diagram of displaying a facial video image provided by an embodiment of the present disclosure;

[0025] Figure 5 A schematic diagram of drawing gesture information provided by an embodiment of the present disclosure;

[0026] Figure 6 A schematic diagram of a correspondence between a target position and a facial area provided in an embodiment of the present disclosure;

[0027] Figure 7 Schematic diagram of the makeup special effects rendering method provided in the embodiment of the present disclosure Figure 2 ;

[0028] Figure 8 A schematic diagram of a facial model provided in an embodiment of the present disclosure;

[0029] Figure 9 A schematic diagram of determining a click area provided by an embodiment of the present disclosure;

[0030] Figure 10 A schematic diagram of a facial video image after applying makeup effects provided by an embodiment of the present disclosure;

[0031] Figure 11 A schematic diagram of another facial video image after applying makeup effects according to an embodiment of the present disclosure;

[0032] Figure 12 A signaling diagram of a makeup special effects rendering method provided by an embodiment of the present disclosure;

[0033] Figure 13 This is a structural block diagram of a makeup special effects rendering device provided by an embodiment of the present disclosure;

[0034] Figure 14 This is a structural block diagram of a makeup special effects rendering device provided by an embodiment of the present disclosure;

[0035] Figure 15 A schematic diagram of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0036] To make the objectives, technical solutions, and advantages of the embodiments of the present disclosure more clear, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present disclosure, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present disclosure without making any creative efforts shall fall within the scope of protection of the present disclosure.

[0037] First, the terms involved in the embodiments of the present disclosure are explained below.

[0038] 1) Makeup effects: This involves adding virtual makeup to characters in an image. This involves adding virtual textures to a character's face, giving it the appearance of makeup, thereby enhancing the character's facial expression. Images can include pictures and videos. Adding appropriate makeup effects to a character's face in a picture or video can enhance their appearance and create a makeup effect. Adding exaggerated makeup effects can also increase the interest of the video.

[0039] 2) Terminal devices, also known as terminals or user equipment, are devices that provide voice and / or data connectivity to users, such as handheld devices and vehicle-mounted devices with wireless connectivity. Terminal devices can also be devices that detect data, such as sensors. Terminal devices can also be smart devices, such as smart home devices deployed indoors and wearable devices. Common terminal devices include: air quality monitoring sensors, temperature sensors, smoke sensors, mobile phones, tablets, laptops, PDAs, mobile internet devices (MIDs), and wearable devices. Wearable devices include: smart watches, smart bracelets, pedometers, etc. Terminal devices are either current or future wireless communication terminal devices or limited communication terminal devices.

[0040] 3) "Multiple" refers to two or more, and other quantifiers are similar. "And / or" describes the relationship between related objects, indicating that three possible relationships exist. For example, "A and / or B" can mean: A exists alone, A and B exist simultaneously, and B exists alone. The character " / " generally indicates that the related objects are in an "or" relationship.

[0041] 4) "Correspondence" can refer to an association relationship or a binding relationship. The correspondence between A and B means that there is an association relationship or a binding relationship between A and B.

[0042] Figure 1 A scene diagram of a makeup special effect rendering method provided by an embodiment of the present disclosure, referring to Figure 1 In the scenario provided by this embodiment, a user conducts a video chat through a terminal device such as a smartphone. While the smartphone is shooting a video image, the smartphone uses an APP built into the smartphone to render the face of the person in the captured video image in real time, draw makeup effects, and generate a video image with makeup effects. The video image can be saved locally or in the cloud through the APP, and can also be displayed in real time to the video chat user on the other end, thereby achieving the purpose of improving the facial appearance of the person in the video image in the video chat scenario.

[0043] Figure 2 This is an example diagram of a makeup special effects rendering method in the prior art. Figure 2 In the prior art, a user's video image is captured and processed by a terminal device such as a smartphone to achieve the purpose of adding makeup effects to the characters in the video image. In this process, the user can only select makeup effects from several preset templates and add them to the video. Figure 2 As shown, in the prior art, after the user selects the "lipstick" special effect in the preset template, the "lipstick" makeup special effect is added to the preset position of the character's face in the video image according to the description of the makeup special effect position in the two templates, thereby realizing the drawing of the makeup special effect.

[0044] However, in the prior art, the process of rendering makeup effects relies solely on fixed templates. Therefore, all users who use the template to create videos will have the same rendered video images with makeup effects, including the same placement and style. This prevents personalized makeup effects, restricting user video creation and reducing the expressiveness of user-created video images. The present disclosure provides a method for rendering makeup effects to address this issue.

[0045] Figure 3 Schematic diagram of the makeup special effects rendering method provided in the embodiment of the present disclosure Figure 1 ,refer to Figure 3 The method of this embodiment can be applied in a terminal device. This embodiment is described with the terminal device as the execution subject. The makeup special effect drawing method includes:

[0046] S101: Displaying facial video images.

[0047] Exemplarily, the terminal device is provided with a display unit for displaying images, such as a touch screen display. More specifically, the terminal device is, for example, a smartphone. The terminal device can display facial video images via the display unit. Furthermore, the facial video image is a video that includes facial information such as a person's facial outline and facial details. The facial video image can be video image data pre-stored in the terminal device, for example, a video containing a person's facial information captured by a user using a terminal device with a camera function, such as a selfie video. The facial video image can also be a real-time online video, for example, a video containing the user's facial information obtained in real time by the user through the terminal device in real-time online video scenarios such as live video streaming and video chat. Figure 4 A schematic diagram of displaying a facial video image provided by an embodiment of the present disclosure, exemplarily, as shown in FIG. Figure 4 As shown, when a user is live streaming a video on a terminal device, the terminal device uses a camera to display a real-time facial video image with the user's facial information on the terminal device's touch screen. In this case, the terminal device's touch screen acts like a mirror, displaying the user's facial information in real time. The user can observe the facial video image displayed on the touch screen to determine how to apply makeup.

[0048] For example, the facial video image may be a video including facial information of one person, or a video including facial information of multiple people, which is not specifically limited here.

[0049] S102: Acquire drawing gesture information input by the user, wherein the drawing gesture information is used to indicate a facial area in a facial video image to which a makeup special effect is to be added.

[0050] For example, the drawing gesture information refers to the operation instructions for drawing makeup effects input by the user through the user interface (UI) of the terminal device, wherein the UI is, for example, a software UI displayed on a touch screen. More specifically, Figure 5 A schematic diagram of drawing gesture information provided by an embodiment of the present disclosure is shown as follows: Figure 5 As shown, drawing gesture information, such as sliding and clicking operations on the UI, can achieve the purpose of selecting a facial region by drawing gesture information. Furthermore, a facial region is the location area corresponding to a person's face in a facial video image. For example, a person's face in a facial video image has multiple facial regions. The higher the accuracy of the location area division of the person's face, the greater the number of facial regions. By drawing the touch point of the gesture information on the UI, the facial region corresponding to the touch point is determined, thereby achieving the rendering of makeup special effects for that facial region.

[0051] More specifically, after observing the facial appearance based on the displayed facial video image, the user can determine a facial area in the facial video image by inputting drawing gesture information to draw makeup special effects. For example, in a pre-recorded facial video image, the terminal device obtains drawing gesture information to draw lipstick makeup effects for the lip area of ​​the character's face; for another example, in a facial video image of a video chat, the terminal device obtains drawing gesture information to draw eye shadow makeup effects for the eye contour area of ​​the character's face.

[0052] S103: Drawing a makeup effect at a target position of the facial video image according to the drawing gesture information, wherein the target position corresponds to a fixed facial area as the facial video image is played.

[0053] In one possible implementation, the method further includes: obtaining configuration parameters. Configuration parameters are parameter information used to set the performance type and effect of makeup special effects. For example, the configuration parameters may include the type of makeup special effects, such as lipstick special effects, blush special effects, eye shadow special effects, etc.; the configuration parameters may also include the effect of the makeup special effects, such as the color, transparency, special effect shape, special effect style, etc. of the makeup special effects. Configuration parameters can be configured by manual selection. For example, the user manually selects the type of makeup special effect in the configuration parameters as lipstick special effect and the color as red 1. Configuration parameters can also be automatically determined by drawing the facial area corresponding to the gesture information. For example, if the facial area corresponding to the gesture information is the lips area, the configuration parameters of the makeup special effect type as lipstick special effect are matched. This will not be described in detail here.

[0054] For example, after determining the facial area based on the drawing gesture information, the facial area is the target position of the facial video image. Then, based on the configuration parameters, the specific type and performance of the makeup effect at the target position are determined, and the corresponding makeup effect is drawn at the target position. The target position corresponds to a fixed facial area, such as the lips, forehead, or an area under the eyes of a person's face. Figure 6 A schematic diagram of the correspondence between a target position and a facial area provided in an embodiment of the present disclosure; Figure 6As shown, when the face of the person in the facial video image moves or rotates as the facial video image is played, the coordinates of the target position on the display unit will change with the movement or rotation of the facial area, so that the target position is always fixedly corresponding to the facial area corresponding to the drawing gesture information. That is, from the perspective of external observation, the makeup special effects drawn in the facial video image displayed on the terminal device always match the fixed facial area of ​​the person's face in the facial video image. For example, the target position corresponding to the lipstick special effect always matches the lip position, and the target position corresponding to the eye shadow special effect always matches the eye position. Afterwards, after drawing the status special effect at the target position of the facial video image, the facial video image after the makeup special effect is drawn is displayed on the UI to show the user the drawing effect of the makeup special effect.

[0055] From the above description, it can be seen that the makeup special effects drawing method provided by this embodiment displays a facial video image; obtains drawing gesture information input by the user, wherein the drawing gesture information is used to indicate the facial area in the facial video image to which the makeup special effects are to be added; according to the drawing gesture information, draws the makeup special effects at the target position of the facial video image, wherein the target position corresponds to a fixed facial area as the facial video image is played. Since the makeup special effects are generated in the corresponding facial area through the drawing gesture information input by the user, the facial makeup special effects can be freely generated according to the needs of the user and displayed in real time with the video, providing the user with a free and personalized makeup drawing method, so that the user is no longer restricted by the fixed style of the template when drawing the makeup special effects, thereby improving the diversity of video creation and the expressiveness of the video.

[0056] Figure 7 Schematic diagram of the makeup special effects rendering method provided in the embodiment of the present disclosure Figure 2 ,refer to Figure 7 , this embodiment Figure 2 On the basis of the embodiment shown, a step of determining a target position is added, and step S103 is further refined. The makeup special effects rendering method includes:

[0057] S201: Displaying facial video images.

[0058] S202: Acquire drawing gesture information input by the user, wherein the drawing gesture information is used to indicate a facial area in a facial video image to which a makeup special effect is to be added.

[0059] S203: Obtain a preset standard facial model, wherein the standard facial model includes a plurality of vertices.

[0060] Figure 8 A schematic diagram of a facial model provided in an embodiment of the present disclosure is shown as follows: Figure 8As shown, exemplarily, the facial model is a three-dimensional model used when modeling a person's face. The facial model includes multiple vertices, wherein each vertex corresponds to an index and a position coordinate. The three-dimensional modeling of the person's face can be achieved through the vertices. The more vertices there are, the higher the precision of the facial model, and vice versa. The number of vertices in the facial model can be configured as needed. The lines between the vertices in the facial model constitute a facial area. Exemplarily, the facial area can be a triangular area surrounded by lines between three vertices, or it can be composed of a plurality of triangular areas surrounded by lines between three vertices; of course, the facial area can also be composed of one or more polygonal areas surrounded by lines between multiple vertices, which will not be repeated here.

[0061] Furthermore, the standard facial model is a data model pre-stored in a local storage medium of the terminal device. The terminal device can add rendering textures to the facial area in the standard facial model through a preset algorithm, so that the standard facial model presents makeup effects.

[0062] S204: Generate a target facial model corresponding to the facial video image according to a preset face detection model, wherein the target facial model includes a plurality of vertices, and the number of vertices in the target facial model is the same as the number of vertices in the standard facial model.

[0063] For example, a face detection model is used to detect facial information of a person in a video. The face detection model may input a facial video image, perform detection on the facial video image, and output a facial model corresponding to the face of the person in the facial video image, i.e., a target facial model. The face detection model can be implemented using existing facial image recognition technology and will not be further described here.

[0064] In order to accurately draw the makeup effects at the target position in the facial video image, it is necessary to match the target facial model corresponding to the facial video image with the standard facial model, so as to add the makeup effects to the target facial model through the standard facial model. In one possible implementation, the target facial model and the standard facial model have the same number of vertices, and the vertices of the target facial model and the standard facial model correspond one-to-one, that is, there is a one-to-one mapping relationship between each vertex of the target facial model and each vertex of the standard facial model.

[0065] S205: Determine a click area of ​​the drawing gesture information on the target facial model, wherein the target facial model is generated based on the facial video image.

[0066] Figure 9 A schematic diagram of determining a click area provided by an embodiment of the present disclosure is shown as follows: Figure 9As shown, in one possible implementation, the target facial model includes multiple facial regions, each of which is formed by connecting lines between vertices. For example, a facial region can be a triangular region enclosed by lines connecting three vertices. Determining the click area for drawing gesture information on the target facial model includes:

[0067] Get the click coordinates mapped on the screen by the drawing gesture information. The coordinate points mapped on the screen by the drawing gesture information are called click coordinates. Depending on the drawing gesture information, click coordinates can include a single 2D coordinate or a set of 2D coordinates. More specifically, for example, when the drawing gesture information is a click on the screen, it corresponds to a single 2D coordinate; when the drawing gesture information is a slide on the screen, it corresponds to a set of 2D coordinates.

[0068] The facial area where the click coordinates are located is determined as the click area.

[0069] Specifically, based on the projection of the target facial model corresponding to the current facial video image on the plane where the screen is located, a two-dimensional plane image containing multiple facial areas can be obtained. According to the position of the click coordinates on the two-dimensional plane image, the facial area where the click coordinates fall is determined, and the facial area can be determined as the click area.

[0070] S206: Determine the target position according to the clicked area.

[0071] Exemplarily, step S206 includes two specific implementation steps: step S2061 and step S2062:

[0072] S2061: Generate an artificial matrix according to the target facial model and the standard facial model, wherein the artificial matrix is ​​used to represent the artificial transformation between the target facial model and the standard facial model.

[0073] For example, an affine transformation, also known as affine mapping, refers to a geometric transformation in which a vector space undergoes a linear transformation followed by a translation, transforming it into another vector space. Because facial information such as facial contours and features in facial video images vary in size and proportion, the target facial model corresponding to the facial video image must be subjected to an affine transformation and mapped to a standard facial model before makeup effects can be rendered. Therefore, it is necessary to determine an affine matrix between the target facial model and the standard facial model. This affine matrix is ​​used to characterize the spatial variation relationship between the target and standard facial models.

[0074] In one possible implementation, each vertex in the standard facial model and the target facial model corresponds to an index identifier, and the index identifiers of the vertices in the target facial model correspond one-to-one with the index identifiers of the vertices in the standard facial model. The simulated matrix can be determined based on the spatial relationship between the corresponding index identifiers. More specifically, generating the simulated matrix includes:

[0075] First, a first vertex corresponding to the click area in the target facial model is obtained, wherein the first vertex includes a plurality of vertices on the target facial model that surround the facial area corresponding to the click area.

[0076] Secondly, according to the index identifier of the first vertex, a second vertex corresponding to the first vertex in the standard facial model is determined, wherein the second vertex includes multiple vertices corresponding to the index identifiers of multiple vertices in the first vertex and located on the representative facial model.

[0077] Finally, an artificial matrix is ​​generated according to the positional relationship of the spatial coordinates between the plurality of vertices in the first vertex and the plurality of vertices in the second vertex, wherein the artificial matrix is ​​used to represent the mapping relationship between the first vertex in the target facial model and the second vertex in the standard facial model.

[0078] S2062: Determine the target position corresponding to the facial area according to the simulated matrix.

[0079] In one possible implementation, a homogeneous transformation is performed on the click coordinates corresponding to the click area to obtain homogeneous transformed coordinates, wherein the homogeneous transformation is used to map the click coordinates to the two-dimensional plane where the facial video image is located; based on the homogeneous transformed coordinates, the target position is determined within the two-dimensional plane where the facial video image is located.

[0080] More specifically, in one possible implementation, the method of determining the target position by drawing gesture information can be implemented as follows:

[0081] Step 1: Get the click coordinates of the drawing gesture information on the screen G .

[0082] Step 2: traverse the standard face model and the target face model according to the sequence identifier corresponding to each vertex in the standard face model. Step 2 includes:

[0083] (2-1) When i≥0, and When index0=index_st 3i , index1 = index_st 3i +1 , index2 = index_st 3i+2 Where 0≤i≤Num Index_st , NumIndex_st is the number of vertices in the standard face model; index_st i is the index identifier of the i-th vertex in the standard facial model, index0, index1, and index2 are the index identifiers of the three vertices that constitute the facial area in the standard facial model, and i is an integer greater than or equal to 0.

[0084] (2-2) As shown in formula (1), take the triangular facial area Triangle in the target facial model Src for:

[0085] Triangle Src ={Vertex_real index0 ,Vertex_real index1 ,Vertex_real index2} (1)

[0086] Among them, Vertex_real index Returns the vertex in the target face model whose index is index.

[0087] (2-3) Determine Point by triangle test G Is it in Triangle Src In the case of Point G Not in Triangle Src If Point G In Triangle Src If yes, go to step 3.

[0088] Step 3: As shown in formula (2), take the triangular facial area Triangle in the standard facial model Dst for:

[0089] Triangle Dst ={Vertex_st index0 ,Vertex_st index1 ,Vertex_st index2} (2)

[0090] Among them, Vertex_st index The vertex in the standard face model identified by index.

[0091] Step 4. Calculate Triangle Src to Triangle Dst Matrix Src2Dst .

[0092] Step 5. Point G Perform a homogeneous transformation to obtain the homogeneous transformation coordinate Point Normalized .

[0093] Step 6: Calculate the target position Point as shown in formula (3) T :

[0094] Point T =Matrix Src2Dst Point Normalized (3)

[0095] S207: Drawing makeup effects at target locations in the facial video image according to the map texture information in the configuration parameters and the drawing gesture information.

[0096] Exemplarily, step S207 includes two specific implementation steps: step S2071 and step S2072:

[0097] S2071: Generate makeup effects based on the texture information of the map.

[0098] In one possible implementation, the configuration parameters include map texture information, the standard facial model includes multiple facial regions, and makeup effects are generated based on the map texture information, including:

[0099] Based on the map texture information, a map texture is determined; map textures are used to achieve makeup effects of different types and effects, such as lipstick effects and eyeshadow effects, each of which corresponds to a different map texture. The map texture is then drawn on the facial area corresponding to the gesture information within the standard facial model to generate a makeup map. For example, based on the map texture information, a texture can be added to the facial area within the standard facial model to generate a makeup map, allowing the standard facial model to exhibit the effect of makeup drawing. In this case, the makeup map is generated by adding the map texture to the standard facial model, and therefore matches the standard facial model. However, due to differences between the target facial model and the standard facial model, the makeup map may not necessarily match the target facial model.

[0100] Furthermore, based on the correspondence between the target facial model and the standard facial model, a makeup texture is drawn on the facial area corresponding to the target facial model to generate a makeup effect. For example, after generating the makeup texture, the makeup texture generated using the standard facial model is mapped to the corresponding position on the target facial model based on the spatial variation relationship between the target facial model and the standard facial model. More specifically, for example, the makeup texture corresponding to the eye shadow effect in the standard facial model is mapped to the target facial model. By adjusting the size, position, and other information of the makeup texture, the makeup texture is drawn on the corresponding facial area of ​​the target facial model, such as the eye area, to generate a makeup effect that matches the target facial model.

[0101] S2072: Superimposing the makeup special effect on the target facial model to generate the makeup special effect at the target position corresponding to the drawing gesture information in the facial video image.

[0102] Exemplarily, the makeup special effects based on the target facial model are superimposed on the target facial model describing the facial expression of the character in the facial video image, so that the target position corresponding to the drawing gesture information of the character's face in the facial video image presents the makeup special effects, thereby achieving the purpose of drawing the makeup special effects.

[0103] From the above description, it can be seen that in this embodiment, by obtaining a standard facial model and a target facial model, and performing an imitation transformation through the relationship between the standard facial model and the target facial model, the purpose of drawing makeup effects on the target facial model through the standard facial model is achieved, so that users are no longer limited to using fixed templates to add makeup effects, but can freely draw makeup effects according to drawing gesture information, thereby expanding the freedom of video creation and improving the expressiveness of the video.

[0104] S208: Displaying the facial video image after the makeup special effects are drawn on the UI in real time.

[0105] For example, an application (Application, APP) for video playback is running in the terminal device, such as an online video APP, a video chat APP, a video live broadcast APP, etc. After the makeup special effects are drawn and generated, the makeup special effects are displayed in real time in the UI of the APP.

[0106] More specifically, in one possible implementation, Figure 10A schematic diagram of a facial video image after drawing makeup special effects is provided in an embodiment of the present disclosure. Referring to 10, a first video display area is provided in the UI of the APP, and the first video display area displays the user's facial video collected in real time by an image acquisition unit, such as a camera. At the same time, after drawing the makeup special effects, the first video display area synchronously displays the makeup special effects in the first video display area, covering the user's facial video, so that the user's facial video presents the makeup special effects.

[0107] In another possible implementation, Figure 11 Another schematic diagram of displaying a facial video image after drawing makeup special effects is provided in an embodiment of the present disclosure. Referring to 11, a first video display area and a second video display area are provided in the UI of the APP, wherein the first video display area displays the user's facial video collected in real time by an image acquisition unit, such as a camera; the second video display area synchronously displays the user's facial video after drawing makeup special effects, so that the user can view the performance effect of the makeup special effects by comparing the first video display area and the second video display area.

[0108] Figure 12 This is a signaling diagram of a makeup special effect rendering method provided by an embodiment of the present disclosure, refer to Figure 12 The method of this embodiment can be applied in a cloud server. For example, the cloud server is in communication with a terminal device. The makeup special effect drawing method includes:

[0109] S301, the cloud server obtains facial video images and drawing gesture information.

[0110] S302, the cloud server draws the makeup effect at a target position of the facial video image according to the drawing gesture information, wherein the target position corresponds to a fixed facial area as the facial video image is played.

[0111] Specifically, in one possible implementation, a cloud server communicates with a terminal device via the internet. The terminal device uses its own image acquisition unit, such as a camera, and an interactive interface to capture a user's facial video image and drawing gesture information. The terminal device then sends this facial video image and drawing gesture information to the cloud server. Optionally, the terminal device also sends configuration information representing the makeup effect style to the cloud server. Based on this configuration information, the cloud server obtains the facial video image and drawing gesture information and can draw the makeup effect at the target location in the facial video image based on the drawing gesture information. The cloud server then sends the facial video image after the makeup effect is drawn to the terminal device, which then displays the facial video image after the makeup effect is drawn.

[0112] Among them, after the cloud server obtains the facial video image and the drawing gesture information, the implementation method of drawing the makeup special effects according to the drawing gesture information is consistent with the present disclosure. Figure 3-Figure 11 In the illustrated embodiment, the implementation method of drawing makeup effects at the target position of the facial video image according to the drawing gesture information executed by the terminal device is the same. Please refer to the description in the above embodiment and will not be repeated here.

[0113] Corresponding to the above Figure 3-Figure 11 The makeup special effects drawing method of the embodiment shown, Figure 13 This is a structural block diagram of a makeup special effect rendering device provided by an embodiment of the present disclosure. For ease of explanation, only the parts related to the embodiment of the present disclosure are shown. Figure 13 The makeup special effect drawing device 4 includes: a display unit 41, an acquisition unit 42 and a drawing unit 43, wherein:

[0114] The display unit 41 is configured to display facial video images.

[0115] The acquisition unit 42 is configured to acquire drawing gesture information input by a user, wherein the drawing gesture information is used to indicate a facial area in a facial video image to which a makeup special effect is to be added.

[0116] The drawing unit 43 is configured to draw a makeup effect at a target position of the facial video image according to the drawing gesture information, wherein the target position corresponds to a fixed facial area as the facial video image is played.

[0117] In one embodiment of the present disclosure, the drawing unit 43 is further configured to: determine a click area of ​​the drawing gesture information on a target facial model, wherein the target facial model is generated based on a facial video image; and determine a target position based on the click area.

[0118] In one embodiment of the present disclosure, the drawing unit 43 is further used to: obtain a preset standard facial model, wherein the standard facial model includes multiple vertices; and generate a target facial model corresponding to the facial video image according to a preset face detection model, wherein the target facial model includes multiple vertices, and the number of vertices in the target facial model is the same as the number of vertices in the standard facial model.

[0119] In one embodiment of the present disclosure, the target facial model includes multiple facial areas, and the facial areas are composed of lines connecting vertices. When determining the click area of ​​the drawing gesture information on the target facial model, the drawing unit 43 is specifically used to: obtain the click coordinates of the drawing gesture information mapped on the screen; and determine the facial area where the click coordinates are located as the click area.

[0120] In one embodiment of the present disclosure, when determining the target position based on the click area, the drawing unit 43 is specifically used to: generate an artificial matrix based on the target facial model and the standard facial model, wherein the artificial matrix is ​​used to represent the artificial transformation between the target facial model and the standard facial model; and determine the target position corresponding to the facial area based on the artificial matrix.

[0121] In one embodiment of the present disclosure, each vertex corresponds to an index identifier, and the index identifiers of the vertices in the target facial model correspond one-to-one to the index identifiers of the vertices in the standard facial model. When the drawing unit 43 generates an artificial matrix based on the target facial model and the standard facial model, it is specifically used to: obtain a first vertex corresponding to the click area in the target facial model; determine a second vertex corresponding to the first vertex in the standard facial model based on the index identifier of the first vertex; and generate an artificial matrix based on the first vertex and the second vertex, wherein the artificial matrix is ​​used to represent the mapping relationship between the first vertex in the target facial model and the second vertex in the standard facial model.

[0122] In one embodiment of the present disclosure, when the drawing unit 43 determines the target position corresponding to the click area according to the simulated matrix, it is specifically used to: perform a homogeneous transformation on the click coordinates corresponding to the click area to obtain homogeneous transformed coordinates, wherein the homogeneous transformation is used to map the click coordinates to the two-dimensional plane where the facial video image is located; and determine the target position within the two-dimensional plane where the facial video image is located according to the homogeneous transformed coordinates.

[0123] In one embodiment of the present disclosure, the configuration parameters include map texture information; when the drawing unit 43 draws the makeup special effect at the target position of the facial video image according to the drawing gesture information, it is specifically used to: generate the makeup special effect according to the map texture information; superimpose the makeup special effect on the target facial model to generate the makeup special effect at the target position corresponding to the drawing gesture information in the facial video image.

[0124] In one embodiment of the present disclosure, the standard facial model includes multiple facial areas. When generating makeup special effects based on the map texture information, the drawing unit 43 is specifically used to: determine the map texture based on the map texture information; draw the map texture in the facial area corresponding to the gesture information in the standard facial model to generate a makeup map; and draw the makeup map on the facial area corresponding to the target facial model based on the correspondence between the target facial model and the standard facial model to generate the makeup special effects.

[0125] In one embodiment of the present disclosure, the display unit 43 is further configured to display the facial video image after the makeup special effects are applied on the user interface in real time.

[0126] In one embodiment of the present disclosure, the makeup special effect drawing device 4 further includes a transceiver unit, which is used to send facial video images and drawing gesture information.

[0127] The device provided in this embodiment can be used to execute the technical solution of the above method embodiment. Its implementation principle and technical effects are similar and will not be described in detail in this embodiment.

[0128] Corresponding to the above Figure 12 The makeup special effects drawing method of the embodiment shown, Figure 14 This is a structural block diagram of a makeup special effect rendering device provided by an embodiment of the present disclosure. For ease of explanation, only the parts related to the embodiment of the present disclosure are shown. Figure 14 The makeup special effect drawing device 5 includes: an acquisition unit 51 and a drawing unit 52, wherein:

[0129] The acquisition unit 51 is configured to acquire a facial video image and drawing gesture information, wherein the drawing gesture information is used to indicate a facial area in the facial video image to which a makeup special effect is to be added.

[0130] The drawing unit 52 is configured to draw a makeup effect at a target position of the facial video image according to the drawing gesture information, wherein the target position corresponds to a fixed facial area as the facial video image is played.

[0131] In one embodiment of the present disclosure, the drawing unit 52 is further configured to: determine a click area of ​​the drawing gesture information on a target facial model, wherein the target facial model is generated based on a facial video image; and determine a target position based on the click area.

[0132] In one embodiment of the present disclosure, the drawing unit 52 is further used to: obtain a preset standard facial model, wherein the standard facial model includes multiple vertices; and generate a target facial model corresponding to the facial video image according to a preset face detection model, wherein the target facial model includes multiple vertices, and the number of vertices in the target facial model is the same as the number of vertices in the standard facial model.

[0133] In one embodiment of the present disclosure, the target facial model includes multiple facial areas, and the facial areas are composed of lines connecting vertices. When determining the click area of ​​the drawing gesture information on the target facial model, the drawing unit 52 is specifically used to: obtain the click coordinates of the drawing gesture information mapped on the screen; and determine the facial area where the click coordinates are located as the click area.

[0134] In one embodiment of the present disclosure, when determining the target position based on the click area, the drawing unit 52 is specifically used to: generate an artificial matrix based on the target facial model and the standard facial model, wherein the artificial matrix is ​​used to represent the artificial transformation between the target facial model and the standard facial model; and determine the target position corresponding to the facial area based on the artificial matrix.

[0135] In one embodiment of the present disclosure, each vertex corresponds to an index identifier, and the index identifiers of the vertices in the target facial model correspond one-to-one to the index identifiers of the vertices in the standard facial model. When the drawing unit 52 generates an artificial matrix based on the target facial model and the standard facial model, it is specifically used to: obtain a first vertex corresponding to the click area in the target facial model; determine a second vertex corresponding to the first vertex in the standard facial model based on the index identifier of the first vertex; and generate an artificial matrix based on the first vertex and the second vertex, wherein the artificial matrix is ​​used to represent the mapping relationship between the first vertex in the target facial model and the second vertex in the standard facial model.

[0136] In one embodiment of the present disclosure, when the drawing unit 52 determines the target position corresponding to the click area according to the simulated matrix, it is specifically used to: perform a homogeneous transformation on the click coordinates corresponding to the click area to obtain homogeneous transformed coordinates, wherein the homogeneous transformation is used to map the click coordinates to the two-dimensional plane where the facial video image is located; and determine the target position within the two-dimensional plane where the facial video image is located according to the homogeneous transformed coordinates.

[0137] In one embodiment of the present disclosure, the configuration parameters include map texture information; when the drawing unit 52 draws the makeup special effect at the target position of the facial video image according to the drawing gesture information, it is specifically used to: generate the makeup special effect according to the map texture information; superimpose the makeup special effect on the target facial model to generate the makeup special effect at the target position corresponding to the drawing gesture information in the facial video image.

[0138] In one embodiment of the present disclosure, the standard facial model includes multiple facial areas. When generating makeup special effects based on the map texture information, the drawing unit 52 is specifically used to: determine the map texture based on the map texture information; draw the map texture in the facial area corresponding to the gesture information in the standard facial model to generate a makeup map; and draw the makeup map on the facial area corresponding to the target facial model based on the correspondence between the target facial model and the standard facial model to generate the makeup special effects.

[0139] The device provided in this embodiment can be used to execute the technical solution of the above method embodiment. Its implementation principle and technical effects are similar and will not be described in detail in this embodiment.

[0140] Figure 15 A schematic diagram of an electronic device provided in an embodiment of the present disclosure, with reference to Figure 15 , which shows a schematic structural diagram of an electronic device 6 suitable for implementing an embodiment of the present disclosure. The electronic device 6 may be a terminal device or a server. The terminal device may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, personal digital assistants (PDAs), tablet computers (Portable Android Devices, PADs), portable multimedia players (PMPs), in-vehicle terminals (such as in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 15 The electronic device shown is only an example and should not limit the functions and scope of use of the embodiments of the present disclosure.

[0141] like Figure 15 As shown, the electronic device 6 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 61, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 62 or a program loaded from a storage device 68 into a random access memory (RAM) 63. The RAM 63 also stores various programs and data required for the operation of the electronic device 6. The processing device 61, ROM 62, and RAM 63 are connected to each other via a bus 64. An input / output (I / O) interface 65 is also connected to the bus 64.

[0142] Typically, the following devices may be connected to the I / O interface 65: an input device 66 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 67 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 68 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 69. The communication device 69 may allow the electronic device 6 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 9 The electronic device 6 is shown with various devices, but it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed instead.

[0143] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network via the communication device 69, or installed from the storage device 68, or installed from the ROM 62. When the computer program is executed by the processing device 61, the above-mentioned functions defined in the method of the embodiment of the present disclosure are performed.

[0144] It should be noted that the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or component, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: 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 the present disclosure, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, device, or component. In the present disclosure, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to wires, optical cables, RF (radio frequency), etc., or any suitable combination thereof.

[0145] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.

[0146] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device executes the method shown in the above embodiment.

[0147] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0148] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the module, program segment, or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of the boxes in the block diagram and / or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0149] The units involved in the embodiments described in this disclosure may be implemented in software or hardware. In some cases, the name of a unit does not limit the unit itself. For example, the first acquisition unit may also be described as a "unit for acquiring at least two Internet Protocol addresses."

[0150] The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, and without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chip (SOCs), complex programmable logic devices (CPLDs), and the like.

[0151] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, 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 foregoing.

[0152] In a first aspect, according to one or more embodiments of the present disclosure, a method for drawing makeup special effects is provided, comprising: displaying a facial video image; obtaining drawing gesture information input by a user, wherein the drawing gesture information is used to indicate a facial area in the facial video image to which makeup special effects are to be added; and drawing the makeup special effects at a target position in the facial video image according to the drawing gesture information, wherein the target position corresponds to a fixed facial area as the facial video image is played.

[0153] According to one or more embodiments of the present disclosure, the method further includes: determining a click area of ​​the drawing gesture information on a target facial model, wherein the target facial model is generated based on a facial video image; and determining a target position based on the click area.

[0154] According to one or more embodiments of the present disclosure, the method further includes: obtaining a preset standard facial model, wherein the standard facial model includes multiple vertices; and generating a target facial model corresponding to the facial video image based on a preset face detection model, wherein the target facial model includes multiple vertices, and the number of vertices in the target facial model is the same as the number of vertices in the standard facial model.

[0155] According to one or more embodiments of the present disclosure, the target facial model includes multiple facial areas, and the facial areas are composed of lines connecting vertices. Determining the click area of ​​the drawing gesture information on the target facial model includes: obtaining the click coordinates of the drawing gesture information mapped on the screen; and determining the facial area where the click coordinates are located as the click area.

[0156] According to one or more embodiments of the present disclosure, determining a target position based on a click area includes: generating an artificial matrix based on a target facial model and a standard facial model, wherein the artificial matrix is ​​used to represent an artificial transformation between the target facial model and the standard facial model; and determining a target position corresponding to the facial area based on the artificial matrix.

[0157] According to one or more embodiments of the present disclosure, each vertex corresponds to an index identifier, and the index identifiers of the vertices in the target facial model correspond one-to-one to the index identifiers of the vertices in the standard facial model. A simulation matrix is ​​generated based on the target facial model and the standard facial model, including: obtaining a first vertex corresponding to the click area in the target facial model; determining a second vertex corresponding to the first vertex in the standard facial model based on the index identifier of the first vertex; and generating a simulation matrix based on the first vertex and the second vertex, wherein the simulation matrix is ​​used to represent the mapping relationship between the first vertex in the target facial model and the second vertex in the standard facial model.

[0158] According to one or more embodiments of the present disclosure, the target position corresponding to the click area is determined according to the simulated matrix, including: performing a homogeneous transformation on the click coordinates corresponding to the click area to obtain homogeneous transformed coordinates, wherein the homogeneous transformation is used to map the click coordinates to the two-dimensional plane where the facial video image is located; and determining the target position within the two-dimensional plane where the facial video image is located according to the homogeneous transformed coordinates.

[0159] According to one or more embodiments of the present disclosure, the configuration parameters include map texture information; based on the drawing gesture information, the makeup special effect is drawn at the target position of the facial video image, including: generating the makeup special effect based on the map texture information; superimposing the makeup special effect on the target facial model to generate the makeup special effect at the target position corresponding to the drawing gesture information in the facial video image.

[0160] According to one or more embodiments of the present disclosure, a standard facial model includes multiple facial areas, and makeup special effects are generated based on map texture information, including: determining the map texture based on the map texture information; drawing the map texture in the facial area corresponding to the gesture information in the standard facial model to generate a makeup map; and drawing the makeup map on the facial area corresponding to the target facial model based on the correspondence between the target facial model and the standard facial model to generate the makeup special effects.

[0161] According to one or more embodiments of the present disclosure, the method further includes: displaying the facial video image after the makeup special effects are drawn on the user interface in real time, and / or receiving the facial video image after the makeup special effects are drawn.

[0162] In a second aspect, an embodiment of the present disclosure provides a method for rendering makeup special effects, comprising:

[0163] Acquire a facial video image and drawing gesture information, wherein the drawing gesture information is used to indicate a facial area in the facial video image to which a makeup special effect is to be added;

[0164] According to the drawing gesture information, a makeup effect is drawn at a target position of the facial video image, wherein the target position corresponds to a fixed facial area as the facial video image is played.

[0165] According to one or more embodiments of the present disclosure, the method further includes: determining a click area of ​​the drawing gesture information on a target facial model, wherein the target facial model is generated based on a facial video image; and determining a target position based on the click area.

[0166] According to one or more embodiments of the present disclosure, the method further includes: obtaining a preset standard facial model, wherein the standard facial model includes multiple vertices; and generating a target facial model corresponding to the facial video image based on a preset face detection model, wherein the target facial model includes multiple vertices, and the number of vertices in the target facial model is the same as the number of vertices in the standard facial model.

[0167] According to one or more embodiments of the present disclosure, the target facial model includes multiple facial areas, and the facial areas are composed of lines connecting vertices. Determining the click area of ​​the drawing gesture information on the target facial model includes: obtaining the click coordinates of the drawing gesture information mapped on the screen; and determining the facial area where the click coordinates are located as the click area.

[0168] According to one or more embodiments of the present disclosure, determining a target position based on a click area includes: generating an artificial matrix based on a target facial model and a standard facial model, wherein the artificial matrix is ​​used to represent an artificial transformation between the target facial model and the standard facial model; and determining a target position corresponding to the facial area based on the artificial matrix.

[0169] According to one or more embodiments of the present disclosure, each vertex corresponds to an index identifier, and the index identifiers of the vertices in the target facial model correspond one-to-one to the index identifiers of the vertices in the standard facial model. A simulation matrix is ​​generated based on the target facial model and the standard facial model, including: obtaining a first vertex corresponding to the click area in the target facial model; determining a second vertex corresponding to the first vertex in the standard facial model based on the index identifier of the first vertex; and generating a simulation matrix based on the first vertex and the second vertex, wherein the simulation matrix is ​​used to represent the mapping relationship between the first vertex in the target facial model and the second vertex in the standard facial model.

[0170] According to one or more embodiments of the present disclosure, the target position corresponding to the click area is determined according to the simulated matrix, including: performing a homogeneous transformation on the click coordinates corresponding to the click area to obtain homogeneous transformed coordinates, wherein the homogeneous transformation is used to map the click coordinates to the two-dimensional plane where the facial video image is located; and determining the target position within the two-dimensional plane where the facial video image is located according to the homogeneous transformed coordinates.

[0171] According to one or more embodiments of the present disclosure, the configuration parameters include map texture information; based on the drawing gesture information, the makeup special effect is drawn at the target position of the facial video image, including: generating the makeup special effect based on the map texture information; superimposing the makeup special effect on the target facial model to generate the makeup special effect at the target position corresponding to the drawing gesture information in the facial video image.

[0172] According to one or more embodiments of the present disclosure, a standard facial model includes multiple facial areas, and makeup special effects are generated based on map texture information, including: determining the map texture based on the map texture information; drawing the map texture in the facial area corresponding to the gesture information in the standard facial model to generate a makeup map; and drawing the makeup map on the facial area corresponding to the target facial model based on the correspondence between the target facial model and the standard facial model to generate the makeup special effects.

[0173] In a third aspect, according to one or more embodiments of the present disclosure, a makeup special effects rendering device is provided, comprising:

[0174] a display unit, configured to display a facial video image;

[0175] an acquiring unit, configured to acquire drawing gesture information input by a user, wherein the drawing gesture information is used to indicate a facial area in a facial video image to which a makeup special effect is to be added;

[0176] The drawing unit is used to draw the makeup effect at a target position of the facial video image according to the drawing gesture information, wherein the target position corresponds to a fixed facial area as the facial video image is played.

[0177] The display unit is also used to display the facial video image after the makeup special effects are drawn on the user interface in real time.

[0178] According to one or more embodiments of the present disclosure, the drawing unit is further used to: determine a click area of ​​the drawing gesture information on a target facial model, wherein the target facial model is generated based on a facial video image; and determine a target position based on the click area.

[0179] According to one or more embodiments of the present disclosure, the drawing unit is further used to: obtain a preset standard facial model, wherein the standard facial model includes multiple vertices; and generate a target facial model corresponding to the facial video image according to a preset face detection model, wherein the target facial model includes multiple vertices, and the number of vertices in the target facial model is the same as the number of vertices in the standard facial model.

[0180] According to one or more embodiments of the present disclosure, the target facial model includes multiple facial areas, and the facial areas are composed of lines connecting vertices. When the drawing unit determines the click area of ​​the drawing gesture information on the target facial model, it is specifically used to: obtain the click coordinates of the drawing gesture information mapped on the screen; and determine the facial area where the click coordinates are located as the click area.

[0181] According to one or more embodiments of the present disclosure, when determining the target position based on the click area, the drawing unit is specifically used to: generate an artificial matrix based on the target facial model and the standard facial model, wherein the artificial matrix is ​​used to represent the artificial transformation between the target facial model and the standard facial model; and determine the target position corresponding to the facial area based on the artificial matrix.

[0182] According to one or more embodiments of the present disclosure, each vertex corresponds to an index identifier, and the index identifiers of the vertices in the target facial model correspond one-to-one to the index identifiers of the vertices in the standard facial model. When the drawing unit generates an artificial matrix based on the target facial model and the standard facial model, it is specifically used to: obtain the first vertex corresponding to the click area in the target facial model; determine the second vertex corresponding to the first vertex in the standard facial model based on the index identifier of the first vertex; and generate an artificial matrix based on the first vertex and the second vertex, wherein the artificial matrix is ​​used to represent the mapping relationship between the first vertex in the target facial model and the second vertex in the standard facial model.

[0183] According to one or more embodiments of the present disclosure, when the drawing unit determines the target position corresponding to the click area according to the simulated matrix, it is specifically used to: perform a homogeneous transformation on the click coordinates corresponding to the click area to obtain homogeneous transformed coordinates, wherein the homogeneous transformation is used to map the click coordinates to the two-dimensional plane where the facial video image is located; and determine the target position within the two-dimensional plane where the facial video image is located according to the homogeneous transformed coordinates.

[0184] According to one or more embodiments of the present disclosure, the configuration parameters include map texture information; when the drawing unit draws the makeup special effects at the target position of the facial video image according to the drawing gesture information, it is specifically used to: generate the makeup special effects according to the map texture information; superimpose the makeup special effects on the target facial model to generate the makeup special effects at the target position corresponding to the drawing gesture information in the facial video image.

[0185] According to one or more embodiments of the present disclosure, the standard facial model includes multiple facial areas. When the drawing unit generates makeup special effects based on the map texture information, it is specifically used to: determine the map texture based on the map texture information; draw the map texture in the facial area corresponding to the gesture information in the standard facial model to generate a makeup map; and draw the makeup map on the facial area corresponding to the target facial model based on the correspondence between the target facial model and the standard facial model to generate the makeup special effects.

[0186] According to one or more embodiments of the present disclosure, the rendering unit is further configured to receive a facial video image after rendering a makeup effect.

[0187] In a fourth aspect, according to one or more embodiments of the present disclosure, a makeup special effects rendering device is provided, comprising:

[0188] an acquisition unit, configured to acquire a facial video image and drawing gesture information, wherein the drawing gesture information is used to indicate a facial area in the facial video image to which a makeup special effect is to be added;

[0189] The drawing unit is used to draw the makeup effect at a target position of the facial video image according to the drawing gesture information, wherein the target position corresponds to a fixed facial area as the facial video image is played.

[0190] According to one or more embodiments of the present disclosure, the drawing unit is further used to: determine a click area of ​​the drawing gesture information on a target facial model, wherein the target facial model is generated based on a facial video image; and determine a target position based on the click area.

[0191] According to one or more embodiments of the present disclosure, the drawing unit is further used to: obtain a preset standard facial model, wherein the standard facial model includes multiple vertices; and generate a target facial model corresponding to the facial video image according to a preset face detection model, wherein the target facial model includes multiple vertices, and the number of vertices in the target facial model is the same as the number of vertices in the standard facial model.

[0192] According to one or more embodiments of the present disclosure, the target facial model includes multiple facial areas, and the facial areas are composed of lines connecting vertices. When the drawing unit determines the click area of ​​the drawing gesture information on the target facial model, it is specifically used to: obtain the click coordinates of the drawing gesture information mapped on the screen; and determine the facial area where the click coordinates are located as the click area.

[0193] According to one or more embodiments of the present disclosure, when determining the target position based on the click area, the drawing unit is specifically used to: generate an artificial matrix based on the target facial model and the standard facial model, wherein the artificial matrix is ​​used to represent the artificial transformation between the target facial model and the standard facial model; and determine the target position corresponding to the facial area based on the artificial matrix.

[0194] According to one or more embodiments of the present disclosure, each vertex corresponds to an index identifier, and the index identifiers of the vertices in the target facial model correspond one-to-one to the index identifiers of the vertices in the standard facial model. When the drawing unit generates an artificial matrix based on the target facial model and the standard facial model, it is specifically used to: obtain the first vertex corresponding to the click area in the target facial model; determine the second vertex corresponding to the first vertex in the standard facial model based on the index identifier of the first vertex; and generate an artificial matrix based on the first vertex and the second vertex, wherein the artificial matrix is ​​used to represent the mapping relationship between the first vertex in the target facial model and the second vertex in the standard facial model.

[0195] According to one or more embodiments of the present disclosure, when the drawing unit determines the target position corresponding to the click area according to the simulated matrix, it is specifically used to: perform a homogeneous transformation on the click coordinates corresponding to the click area to obtain homogeneous transformed coordinates, wherein the homogeneous transformation is used to map the click coordinates to the two-dimensional plane where the facial video image is located; and determine the target position within the two-dimensional plane where the facial video image is located according to the homogeneous transformed coordinates.

[0196] According to one or more embodiments of the present disclosure, the configuration parameters include map texture information; when the drawing unit draws the makeup special effects at the target position of the facial video image according to the drawing gesture information, it is specifically used to: generate the makeup special effects according to the map texture information; superimpose the makeup special effects on the target facial model to generate the makeup special effects at the target position corresponding to the drawing gesture information in the facial video image.

[0197] According to one or more embodiments of the present disclosure, the standard facial model includes multiple facial areas. When the drawing unit generates makeup special effects based on the map texture information, it is specifically used to: determine the map texture based on the map texture information; draw the map texture in the facial area corresponding to the gesture information in the standard facial model to generate a makeup map; and draw the makeup map on the facial area corresponding to the target facial model based on the correspondence between the target facial model and the standard facial model to generate the makeup special effects.

[0198] According to one or more embodiments of the present disclosure, the display unit is further configured to display the facial video image after applying the makeup effects on the user interface in real time.

[0199] In a fifth aspect, according to one or more embodiments of the present disclosure, there is provided an electronic device, comprising: at least one processor and a memory;

[0200] Memory stores computer-executable instructions;

[0201] At least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the makeup special effects drawing method as described in the first aspect and various possible designs of the first aspect.

[0202] According to one or more embodiments of the present disclosure, the electronic device further includes:

[0203] A camera, used to obtain a user's facial video image;

[0204] A display screen is used to display a facial video image with makeup special effects drawn on it.

[0205] In a sixth aspect, according to one or more embodiments of the present disclosure, there is provided an electronic device, comprising: at least one processor and a memory;

[0206] Memory stores computer-executable instructions;

[0207] At least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the makeup special effects drawing method as described in the second aspect and various possible designs of the second aspect.

[0208] In the seventh aspect, an embodiment of the present disclosure provides a computer-readable storage medium, which stores computer-executable instructions. When the processor executes the computer-executable instructions, it implements the makeup special effects drawing method as described in the first aspect and various possible designs of the first aspect, or implements the makeup special effects drawing method as described in the second aspect and various possible designs of the second aspect.

[0209] In an eighth aspect, an embodiment of the present disclosure provides a computer program comprising a program code. When a computer runs the computer program, the program code executes the makeup special effects drawing method as described in the first aspect and various possible designs of the first aspect, or executes the makeup special effects drawing method as described in the second aspect and various possible designs of the second aspect.

[0210] The above description is merely a preferred embodiment of the present disclosure and an illustration of the technical principles employed. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by the specific combination of the above-mentioned technical features, but also includes other technical solutions formed by any combination of the above-mentioned technical features or their equivalents without departing from the above-mentioned disclosed concepts. For example, a technical solution formed by replacing the above-mentioned features with (but not limited to) technical features with similar functions disclosed in this disclosure.

[0211] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details have been included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.

[0212] Although the subject matter has been described in language specific to structural features and / or methodological logical acts, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are merely example forms of implementing the claims.

Claims

1. A makeup special effects rendering method, characterized in that: The method comprises: displaying facial video images; Acquiring drawing gesture information input by a user, wherein the drawing gesture information is used to indicate a facial area in the facial video image to which a makeup special effect is to be added; Drawing a makeup effect at a target position of the facial video image according to the drawing gesture information, wherein the target position corresponds to a fixed facial area as the facial video image is played; Displaying a facial video image after applying makeup effects; The method further comprises: determining a click area of ​​the drawing gesture information on a target facial model, wherein the target facial model is generated based on a facial video image; Determining the target position according to the click area; obtaining configuration parameters according to the target position, wherein the configuration parameters include the type of the makeup effect and the effect of the makeup effect; Drawing the makeup effect at a target position of the facial video image according to the drawing gesture information includes: Generate makeup effects according to the configuration parameters; The makeup special effect is superimposed on the target facial model to generate the makeup special effect at the target position corresponding to the drawing gesture information in the facial video image.

2. The method according to claim 1, characterized in that The method further comprises: Obtaining a preset standard facial model, wherein the standard facial model includes a plurality of vertices; According to a preset face detection model, a target face model corresponding to the facial video image is generated, wherein the target face model includes a plurality of vertices, and the number of vertices in the target face model is the same as the number of vertices in the standard face model.

3. The method according to claim 2, characterized in that The target facial model includes a plurality of facial regions, each of which is formed by connecting lines of the vertices. Determining a click region of the drawing gesture information on the target facial model includes: Obtaining the click coordinates of the drawing gesture information mapped on the screen; The facial area where the click coordinates are located is determined as the click area.

4. The method according to claim 2, characterized in that Determining the target position according to the click area includes: generating an artificial matrix according to the target facial model and the standard facial model, wherein the artificial matrix is ​​used to represent an artificial transformation between the target facial model and the standard facial model; A target position corresponding to the facial region is determined according to the simulated matrix.

5. The method according to claim 4, characterized in that Each vertex corresponds to an index identifier, and the index identifiers of the vertices in the target facial model correspond one-to-one with the index identifiers of the vertices in the standard facial model. Generating a simulated matrix based on the target facial model and the standard facial model includes: Obtaining a first vertex corresponding to the click area in the target facial model; Determining, according to the index identifier of the first vertex, a second vertex in the standard facial model corresponding to the first vertex; An artificial matrix is ​​generated according to the first vertex and the second vertex, wherein the artificial matrix is ​​used to represent a mapping relationship between the first vertex in the target facial model and the second vertex in the standard facial model.

6. The method according to claim 4, characterized in that Determining a target position corresponding to the click area according to the simulated matrix includes: Performing a homogeneous transformation on the click coordinates corresponding to the click area to obtain homogeneous transformed coordinates, wherein the homogeneous transformation is used to map the click coordinates to a two-dimensional plane where the facial video image is located; The target position is determined in the two-dimensional plane where the facial video image is located according to the homogeneous transformation coordinates.

7. The method according to claim 1, characterized in that The configuration parameters include map texture information, and the map texture information is used to generate the makeup special effect.

8. The method according to any one of claims 1 to 7, characterized in that The method further comprises: sending the facial video image and the drawing gesture information, and / or; Receive a facial video image after applying makeup effects.

9. A makeup special effects rendering device, characterized in that: include: a display unit, configured to display a facial video image; an acquiring unit, configured to acquire drawing gesture information input by a user, wherein the drawing gesture information is used to indicate a facial area in the facial video image to which a makeup special effect is to be added; a drawing unit, configured to draw a makeup effect at a target position of the facial video image according to the drawing gesture information, wherein the target position corresponds to a fixed facial area as the facial video image is played; The drawing unit is further configured to: determine a click area of ​​the drawing gesture information on a target facial model, wherein the target facial model is generated based on a facial video image; determine a target position based on the click area; and obtain configuration parameters based on the target position, wherein the configuration parameters include a type of the makeup effect and an effect of the makeup effect; When drawing the makeup special effect at the target position of the facial video image according to the drawing gesture information, the drawing unit is specifically used to: generate the makeup special effect according to the configuration parameters; and superimpose the makeup special effect on the target facial model to generate the makeup special effect at the target position corresponding to the drawing gesture information in the facial video image.

10. An electronic device, characterized in that: include: at least one processor and memory; The memory stores computer-executable instructions; The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the makeup special effect drawing method according to any one of claims 1 to 8.

11. The electronic device according to claim 10, characterized in that Also includes: A camera, used to obtain a user's facial video image; A display screen is used to display a facial video image with makeup special effects drawn on it.

12. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer-executable instructions. When the processor executes the computer-executable instructions, the makeup special effects drawing method according to any one of claims 1 to 8 is implemented.

Citation Information

Patent Citations

  • Method and system for pasting image to human face based on affine transformation

    CN104778712A

  • Video figure dressing method and device, computing device and computer memory medium

    CN107820027A

  • Special effect display method and device, storage medium and electronic equipment

    CN111242881A

  • Live broadcast interaction method and device, electronic equipment and storage medium

    CN111246232A