Method and device for acquiring facial expression coefficient
By drawing marker points, generating topological networks and non-rigid body registration algorithms in facial expression processing, the facial expression coefficients are directly calculated, which solves the problem of incompatible accuracy and speed in the existing technology and improves the accuracy of facial expression coefficients. Gain accuracy and efficiency, and reduce storage space usage.
Patent Information
- Application Number
- CN202410906117.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-08
- Publication Date
- 2024-10-29
AI Technical Summary
The accuracy of obtaining facial expression coefficients in the existing technology is not high and the efficiency is low. It takes up a lot of storage space and it is difficult to balance accuracy and speed.
By acquiring target videos with changing facial expressions, drawing facial marker points, tracking changes in marker point positions, determining neutral and polar expressions, generating a three-dimensional model, and using topological networks and non-rigid body registration algorithms to generate a private facial expression base Template, directly calculate facial expression coefficients, skipping the time-consuming three-dimensional reconstruction and non-rigid body registration steps.
It improves the accuracy and efficiency of facial expression coefficients, reduces storage space occupation, and solves the problem of incompatibility between accuracy and speed in the existing technology.
Smart Images

Figure CN118864673A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to a method and device for acquiring facial expression coefficients. Background Art
[0002] Deep learning-based voice-driven virtual facial expressions are one of the key technologies for virtual human visualization and interaction. Realistic driving effects rely on good training data in both quantity and quality. In order to reduce driving complexity, facial expressions are generally split into a series of facial expression bases and corresponding facial expression coefficients. It can be seen that the training data includes voice data, facial expression bases, and facial expression coefficients, among which the acquisition of facial expression coefficients is a difficult point.
[0003] Among the existing technologies, one is to obtain facial expression coefficients using real-time facial capture technology based on RGBD (Red, Green, Blue, Depth) cameras, such as the Live Link Face application of IPHONE, which can perform facial capture and generate facial expression coefficients. The facial expression coefficients obtained by this method have the problem of low accuracy, which affects the final effect of voice-driven facial expressions. The second is to perform multiple steps such as three-dimensional reconstruction, facial marker tracking, and non-rigid registration on each frame of the video based on a 4D array camera to obtain high-precision facial expression coefficients, such as the commercial software wrap4d. The data processing time involved in this method is too long, and the data occupies a large storage space. There are problems of low efficiency in obtaining facial expression coefficients and high storage occupancy. Summary of the invention
[0004] In view of this, the present application provides a method and device for obtaining facial expression coefficients, which optimizes the processing flow of obtaining facial expression coefficients, can improve the accuracy and efficiency of obtaining facial expression coefficients and can reduce storage space occupancy.
[0005] To solve the above problems, the technical solutions provided by this application are as follows:
[0006] In a first aspect, an embodiment of the present application provides a method for obtaining a facial expression coefficient, the method comprising:
[0007] Obtain a target video in which a person's facial expression changes, wherein facial markers are drawn on the face of the person;
[0008] Tracking the position changes of the facial landmarks in the target video to determine neutral expressions and polar expressions;
[0009] Acquire the three-dimensional model of the neutral expression, the three-dimensional model of the polar expression, and the three-dimensional spatial coordinates of the facial landmarks of the target image to be processed;
[0010] Using a preset standard topological network to wrap the three-dimensional model of the neutral expression to obtain a topological network of the neutral expression;
[0011] Based on a non-rigid registration algorithm, the topological network of the neutral expression is used to wrap the three-dimensional model of the polar expression to obtain a topological network of the polar expression;
[0012] Using the neutral expression topology network and the polar expression topology network to perform deformation migration on a preset standard facial expression base template to generate a private facial expression base template;
[0013] Based on the three-dimensional spatial coordinates of the facial markers of the target image to be processed and the private facial expression base template, a facial expression coefficient of the target image to be processed is generated.
[0014] In a possible implementation, the private facial expression base template includes a neutral expression base and a polar expression base;
[0015] The step of generating the facial expression coefficient of the target image to be processed based on the three-dimensional spatial coordinates of the facial markers of the target image to be processed and the private facial expression base template comprises:
[0016] The three-dimensional spatial coordinates of the facial markers of the target image to be processed, the neutral expression basis and the polar expression basis are solved by the least square method to obtain the facial expression coefficient of the target image to be processed.
[0017] In a possible implementation, before generating the facial expression coefficient of the target image to be processed based on the three-dimensional spatial coordinates of the facial landmarks of the target image to be processed and the private facial expression base template, the method further includes:
[0018] The three-dimensional space coordinates of the facial landmarks of the target image to be processed are corrected for the center of gravity coordinates.
[0019] In a possible implementation manner, obtaining the three-dimensional spatial coordinates of the facial landmarks of the target image to be processed includes:
[0020] Tracking the position changes of the facial markers of the target image to be processed in the long video to obtain the two-dimensional marker positions of the facial markers of the target image to be processed, wherein the specified segment in the long video is the target video;
[0021] The two-dimensional marker points are back-projected onto a grid corresponding to the three-dimensional model according to the camera parameters to obtain the three-dimensional spatial coordinates of the facial marker points of the target image to be processed.
[0022] In a possible implementation, the non-rigid registration algorithm is based on using the topological network of the neutral expression to wrap the three-dimensional model of the polar expression to obtain the topological network of the polar expression, including:
[0023] Determining facial landmarks associated with the neutral expression and the polar expression;
[0024] Based on a non-rigid registration algorithm, the topological network of the neutral expression is guided by the associated facial landmarks to wrap the three-dimensional model of the polar expression to obtain a topological network of the polar expression.
[0025] In a second aspect, an embodiment of the present application provides a device for acquiring a facial expression coefficient, the device comprising:
[0026] A first acquisition module is used to acquire a target video in which a facial expression of a person changes, wherein facial markers are drawn on the face of the person;
[0027] A tracking module, used for tracking the position change of the facial marker in the target video to determine the neutral expression and the polar expression;
[0028] A second acquisition module, used to acquire the three-dimensional model of the neutral expression, the three-dimensional model of the polar expression and the three-dimensional spatial coordinates of the facial landmarks of the target image to be processed;
[0029] A topological module, used to wrap the three-dimensional model of the neutral expression with a preset standard topological network to obtain a topological network of the neutral expression; based on a non-rigid registration algorithm, the three-dimensional model of the polar expression is wrapped with the topological network of the neutral expression to obtain a topological network of the polar expression;
[0030] A first generating module is used to use the topological network of the neutral expression and the topological network of the polar expression to perform deformation migration on a preset standard facial expression base template to generate a private facial expression base template;
[0031] The second generating module is used to generate the facial expression coefficient of the target image to be processed based on the three-dimensional space coordinates of the facial marker points of the target image to be processed and the private facial expression base template.
[0032] In a possible implementation, the private facial expression base template includes a neutral expression base and a polar expression base;
[0033] The second generating module is specifically used for:
[0034] The three-dimensional spatial coordinates of the facial markers of the target image to be processed, the neutral expression basis and the polar expression basis are solved by the least square method to obtain the facial expression coefficient of the target image to be processed.
[0035] In a possible implementation, the device further includes a barycenter coordinate correction module:
[0036] The barycentric coordinate correction module is used to perform barycentric coordinate correction on the three-dimensional space coordinates of the facial marker points of the target image to be processed.
[0037] In a possible implementation, the second acquisition module is used to acquire the three-dimensional spatial coordinates of the facial landmark points of the target image to be processed, including:
[0038] an acquisition submodule, used for tracking the position change of the facial markers of the target image to be processed in the long video, and obtaining the two-dimensional marker positions of the facial markers of the target image to be processed, wherein the specified segment in the long video is the target video;
[0039] The back-projection submodule is used to back-project the two-dimensional marker points onto a grid corresponding to the three-dimensional model according to the camera parameters to obtain the three-dimensional spatial coordinates of the facial marker points of the target image to be processed.
[0040] In a possible implementation, the topology module is used to wrap the three-dimensional model of the polar expression using the topological network of the neutral expression based on a non-rigid registration algorithm to obtain the topological network of the polar expression, including:
[0041] A determination submodule, used to determine the associated facial landmarks of the neutral expression and the polar expression;
[0042] The topology submodule is used to guide the topological network of the neutral expression to wrap the three-dimensional model of the polar expression based on the non-rigid registration algorithm with the associated facial landmarks to obtain the topological network of the polar expression.
[0043] In a third aspect, an embodiment of the present application provides a device for acquiring facial expression coefficients, the device comprising: a processor, a memory, and a system bus;
[0044] The processor and the memory are connected via the system bus;
[0045] The memory is used to store one or more programs, and the one or more programs include instructions. When the instructions are executed by the processor, the processor executes the method for obtaining facial expression coefficients described in the first aspect above.
[0046] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores instructions. When the instructions are executed on a device, the device executes the method for obtaining facial expression coefficients described in the first aspect above.
[0047] It can be seen that this application has the following beneficial effects:
[0048] The embodiment of the present application provides a method for obtaining facial expression coefficients, first obtaining a target video with changes in facial expressions, wherein facial markers are drawn on the face; tracking the position changes of the facial markers in the target video to determine the neutral expression and the polar expression; obtaining a three-dimensional model of the neutral expression, a three-dimensional model of the polar expression, and the three-dimensional spatial coordinates of the facial markers of the target image to be processed. Secondly, using a preset standard topological network to wrap the three-dimensional model of the neutral expression to obtain a topological network of the neutral expression; based on a non-rigid registration algorithm, using the topological network of the neutral expression to wrap the three-dimensional model of the polar expression to obtain a topological network of the polar expression; using the topological network of the neutral expression and the topological network of the polar expression to perform deformation migration on the preset standard facial expression base template to generate a private facial expression base template. Finally, based on the three-dimensional spatial coordinates of the facial markers of the target image to be processed and the private facial expression base template, the facial expression coefficients of the target image to be processed are generated. In this way, the processing flow of obtaining facial expression coefficients is optimized, and the facial markers are manually drawn to ensure the accuracy of the facial markers during the tracking process, thereby improving the accuracy of the generated facial expression coefficients; in the process of generating facial expression coefficients, the time-consuming three-dimensional reconstruction and non-rigid registration steps are skipped, and the facial markers and the private facial expression base template are directly used to regress the facial expression coefficients. The accuracy and efficiency of obtaining facial expression coefficients are improved and the storage space occupied is reduced, solving the problem that the accuracy and speed of obtaining facial phenotype coefficients in the prior art cannot be achieved at the same time.
[0049] The embodiment of the present application also provides a device for acquiring facial expression coefficients corresponding to the above method, which has the same beneficial effects as the above method. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] Figure 1 A flowchart of a method for obtaining a facial expression coefficient provided in an embodiment of the present application;
[0051] Figure 2 A flowchart of another method for obtaining facial expression coefficients provided in an embodiment of the present application;
[0052] Figure 3 A schematic diagram of drawing facial markers of a user is provided for an embodiment of the present application;
[0053] Figure 4 A schematic diagram of tracking facial landmarks shown in an embodiment of the present application;
[0054] Figure 5 A schematic diagram of a neutral expression provided in an embodiment of the present application;
[0055] Figure 6 A schematic diagram of a polar expression provided in an embodiment of the present application;
[0056] Figure 7 A schematic diagram of a three-dimensional model provided in an embodiment of the present application;
[0057] Figure 8 A schematic diagram of obtaining three-dimensional space coordinates provided in an embodiment of the present application;
[0058] Fig. 9 A schematic diagram of a preset standard topology grid provided in an embodiment of the present application;
[0059] Fig.10 A schematic diagram of a topological network of neutral expressions provided in an embodiment of the present application;
[0060] Fig.11 A schematic diagram of a topological network of polar expressions provided in an embodiment of the present application;
[0061] Fig.12 A schematic diagram of a standard facial expression base template disclosed in an embodiment of the present application;
[0062] Fig.13 A schematic diagram of a private facial expression base template disclosed in an embodiment of the present application;
[0063] Fig.14 A schematic diagram of a center of gravity coordinate provided in an embodiment of the present application;
[0064] Fig.15 A schematic diagram of the structure of a device for acquiring facial expression coefficients provided in an embodiment of the present application;
[0065] Fig.16 A schematic diagram of the structure of a facial expression coefficient acquisition device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0066] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0067] In this application, relational terms such as first and second, etc. are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. The terms "comprise", "comprising" or any other variants thereof are intended to cover non-exclusive inclusion, so that the process, method, article or equipment including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or equipment. In the absence of further restrictions, the elements defined by the statement "comprising a ..." do not exclude the presence of other identical elements in the process, method, article or equipment including the elements.
[0068] The training data for voice-driven virtual facial expressions may include voice data, facial expression bases, and facial expression coefficients. Among them, voice data can be directly recorded through a microphone, the facial expression bases can be preset according to standard templates, and obtaining facial expression coefficients is a difficult point.
[0069] In the prior art, one method is to detect dense facial feature points in real time based on RGBD cameras and real-time facial capture through deep learning methods, but there are errors in the detection results, which leads to low accuracy of the generated facial expression coefficients.
[0070] Second, the process of generating facial expression coefficients based on 4D array cameras requires 3D reconstruction and non-rigid registration for each frame of the video. 3D reconstruction and non-rigid registration are time-consuming, and the intermediate results generated by 3D reconstruction and non-rigid registration take up a lot of storage space, which leads to a long processing time, large storage space occupied by data, and high time and space costs for obtaining facial expression coefficients.
[0071] In order to solve the problem that accuracy and speed cannot be achieved at the same time in the prior art, the embodiment of the present application provides a method and device for obtaining facial expression coefficients. First, a target video with changes in facial expressions is obtained, wherein facial markers are drawn on the face; the position changes of the facial markers in the target video are tracked to determine the neutral expression and the polar expression; a three-dimensional model of the neutral expression, a three-dimensional model of the polar expression, and the three-dimensional spatial coordinates of the facial markers of the target image to be processed are obtained. Secondly, the three-dimensional model of the neutral expression is wrapped with a preset standard topological network to obtain a topological network of the neutral expression; based on the non-rigid registration algorithm, the three-dimensional model of the polar expression is wrapped with the topological network of the neutral expression to obtain a topological network of the polar expression; the topological network of the neutral expression and the topological network of the polar expression are used to deform and migrate the preset standard facial expression base template to generate a private facial expression base template. Finally, based on the three-dimensional spatial coordinates of the facial markers of the target image to be processed and the private facial expression base template, the facial expression coefficients of the target image to be processed are generated. In this way, the processing flow for obtaining facial expression coefficients is optimized. Compared with the real-time facial capture technology based on deep learning, the embodiment of the present application uses manually drawn facial markers to ensure the accuracy of facial markers during the tracking process, thereby improving the accuracy of the generated facial expression coefficients. Compared with the processing flow of the 4D array device, the embodiment of the present application skips the time-consuming three-dimensional reconstruction and non-rigid registration steps in the process of generating facial expression coefficients, and directly uses facial markers and private facial expression base templates to regress facial expression coefficients. The accuracy and efficiency of obtaining facial expression coefficients are improved and the storage space occupied is reduced, solving the problem that the accuracy and speed of obtaining facial phenotype coefficients in the prior art cannot be achieved at the same time.
[0072] It should be noted that the hardware applicable to the embodiments of the present application includes but is not limited to devices such as RGBD cameras or 4D array cameras. Any device that can obtain three-dimensional models and image data by outputting data can be used to execute the embodiments of the present application.
[0073] In order to facilitate understanding of the technical solution provided in the embodiment of the present application, a method and device for obtaining facial expression coefficients provided in the embodiment of the present application are described below in conjunction with the accompanying drawings.
[0074] The method for obtaining a facial expression coefficient provided in the embodiment of the present application can be applied to a server or a preset system, and the embodiment of the present application is not limited thereto. Figure 1 , Figure 1 A flowchart of a method for acquiring facial expression coefficients provided in an embodiment of the present application, the method specifically includes S101-S107.
[0075] The embodiment of the present application can be summarized into two parts. The first part is the process of generating a private facial expression base template, see S101-S106; the second part is the process of generating a facial expression coefficient, see S107.
[0076] S101: Acquire a target video in which a person's facial expression changes, wherein facial markers are drawn on the face of the person.
[0077] See also Figure 2 , Figure 2 A flowchart of another method for obtaining facial expression coefficients provided in an embodiment of the present application is provided. A private facial expression base template is generated, and a facial expression coefficient is generated based on the private facial expression base template and the three-dimensional spatial positions of facial landmarks of a target image to be processed in a long video.
[0078] Before executing the step of acquiring the target video, first manually draw facial landmarks on the user's face, see Figure 3 , Figure 3 A schematic diagram of drawing facial markers of a user is provided for the embodiment of the present application. The facial markers are drawn randomly, and the overall markers are sparsely but evenly distributed during drawing. When the expression changes, the markers drawn in places with drastic changes such as eyes and mouth are slightly denser.
[0079] The embodiment of the present application does not limit the number of facial markers, and there is no upper limit to the number of facial markers. To reduce resource waste, the number of facial markers is generally set to 100. The position where the facial markers are drawn has little effect on the recognition accuracy.
[0080] Use a camera to shoot the user and record the video information. The shot video is a long video, and the target video is a video clip in which the user's facial expression changes significantly in the long video. It should be noted that a video contains multiple frames of graphic files, and each frame of the image file contains multiple images. For example, an RGBD camera generally outputs a color image and a depth image at the same time, and a 4D array camera outputs a multi-view color image or grayscale image. Other devices are similar.
[0081] The target video is a segment in a long video in which a specified facial expression changes. The length of the target video is generally several dozen frames, and as an example, it can be 30 frames. The embodiment of the present application is not limited to this.
[0082] A video clip with obvious changes in facial expressions can be manually selected from a long video as the target video, where the long video is a video shot of the user's face, wherein facial markers are drawn on the face.
[0083] You can also shoot a video with obvious changes in facial expressions as the target video, and also shoot a long video for obtaining the facial expression coefficient.
[0084] It should be noted that the selection of facial landmarks generally only selects the landmarks of the front face. In one possible implementation method, if there is information such as a side view, the landmarks of the side face can also be selected from the side view. By acquiring and processing facial landmarks from multiple angles, the accuracy of generating facial expression coefficients can be improved.
[0085] S102: Tracking the position change of the facial marker in the target video to determine the neutral expression and the polar expression.
[0086] Track the position changes of facial markers in different frames of the target video to determine neutral expressions and polar expressions. That is, extract one frame of neutral expression and multiple frames of polar expressions in the target video, track the position of facial markers on the image sequence, and determine the accuracy of the tracking results. Figure 4 , Figure 4 This is a schematic diagram of tracking facial markers shown in an embodiment of the present application. Changes in facial expressions can be tracked through facial markers.
[0087] See also Figure 5 , Figure 5 A schematic diagram of a neutral expression provided in an embodiment of the present application. A neutral expression is an expression presented when a user is in a calm state and his / her facial organs are in a relaxed state. Figure 6 , Figure 6 A schematic diagram of a polar expression provided in an embodiment of the present application. A polar expression is an expression presented when a user is not calm and his facial organs are in a tense state. Some marking points in the polar expression have a large position deviation from the marking points of the corresponding neutral expression in the three-dimensional space coordinates.
[0088] S103: Acquire the three-dimensional model of the neutral expression, the three-dimensional model of the polar expression, and the three-dimensional spatial coordinates of the facial landmarks of the target image to be processed.
[0089] Since the number of extracted frames is small, the time spent on high-precision three-dimensional reconstruction of one frame of neutral expression and multiple frames of polar expressions is also less.
[0090] See also Figure 7 , Figure 7 A schematic diagram of a three-dimensional model provided in an embodiment of the present application. The three-dimensional model can be obtained by traditional multi-view geometry methods. It is not necessary to construct a three-dimensional model for each frame, but only the extracted neutral expression and several polar expressions need to be reconstructed in three dimensions.
[0091] In one possible implementation, obtaining the three-dimensional spatial coordinates of facial markers of a target image to be processed includes: tracking position changes of facial markers of the target image to be processed in a long video to obtain two-dimensional marker positions of the facial markers of the target image to be processed, wherein a specified segment in the long video is the target video; and back-projecting the two-dimensional markers onto a grid corresponding to a three-dimensional model according to camera parameters to obtain the three-dimensional spatial coordinates of the facial markers of the target image to be processed.
[0092] The camera parameters are pre-set data. The camera parameters include internal parameters and external parameters. The internal parameters refer to the camera focal length, distortion coefficient, etc., and the external parameters refer to the position information of the camera in the world coordinate system.
[0093] See also Figure 8 , Figure 8 A schematic diagram of obtaining three-dimensional spatial coordinates provided in an embodiment of the present application. According to the camera parameters, a line is drawn between the camera focus and the 2D pixel point (two-dimensional marker point), and the point where the extended line intersects with the three-dimensional model is the desired 3D point, and the coordinates of the 3D point are the three-dimensional spatial coordinates of the facial marker point of the target image to be processed.
[0094] The three-dimensional spatial coordinates of the facial landmarks of the target image to be processed are used in the non-rigid registration step of the facial expression coefficient generation process.
[0095] S104: Wrapping the three-dimensional model of the neutral expression with a preset standard topological network to obtain a topological network of the neutral expression.
[0096] According to the above information, a preset standard topological grid is used to perform topology on one frame of neutral expression and multiple frames of polar expressions to obtain a topological network of neutral expression and topological grids of multiple polar expressions.
[0097] See also Fig. 9 , Fig. 9 A schematic diagram of a preset standard topology grid provided in an embodiment of the present application. Fig.10 , Fig.10 A schematic diagram of a topological network of neutral expressions provided in an embodiment of the present application.
[0098] The standard topological mesh is used to wrap the three-dimensional model of the neutral expression, and the neutral expression texture is transferred to obtain a topological network of the neutral expression with the same topology as the standard topological mesh.
[0099] It should be noted that the topological network of the neutral expression and the topological grid of the polar expression are obtained by adjusting the standard topological network, and can also be considered as the same topological network as the standard topological network.
[0100] S105: Based on a non-rigid registration algorithm, the topological network of the neutral expression is used to wrap the three-dimensional model of the polar expression to obtain a topological network of the polar expression.
[0101] See also Fig.11 , Fig.11 A schematic diagram of a topological network of polar expressions provided in an embodiment of the present application. In a possible implementation, based on a non-rigid registration algorithm, the topological network of the neutral expression is used to wrap the three-dimensional model of the polar expression to obtain a topological network of the polar expression, including: determining the associated facial landmarks of the neutral expression and the polar expression; based on the non-rigid registration algorithm, the topological network of the neutral expression is guided by the associated facial landmarks to wrap the three-dimensional model of the polar expression to obtain a topological network of the polar expression.
[0102] Using a non-rigid registration algorithm, the topological network of the neutral expression with good topology is used to wrap the three-dimensional model of the polar expression to obtain the topological mesh of the polar expression. In the process of obtaining the topological network of the polar expression, the three-dimensional marker points with good association between the neutral expression and the polar expression are used as a guide to improve the accuracy of the registration.
[0103] Each 3D point is obtained by back-projecting the corresponding 2D marker point. The 2D marker points have been tracked in the foregoing, which is equivalent to knowing the correlation between the 2D marker points, and therefore also knowing the correlation between the 3D facial marker points.
[0104] S106: Using the neutral expression topology network and the polar expression topology network to perform deformation migration on a preset standard facial expression base template to generate a private facial expression base template.
[0105] See also Fig.12 and Fig.13 , Fig.12 A schematic diagram of a standard facial expression base template disclosed in an embodiment of the present application; Fig.13 A schematic diagram of a private facial expression base template disclosed in an embodiment of the present application.
[0106] According to the topological network of neutral expression and the topological network of polar expression with good topology, a set of standard facial expression base templates are deformed and migrated. Specifically, the standard facial expression base templates are migrated to the topological network of neutral expression, and the polar expression is used as a constraint to guide the deformation migration process to generate a set of private facial expression base templates that are closer to the private style.
[0107] S107: Generate a facial expression coefficient of the target image to be processed based on the three-dimensional spatial coordinates of the facial landmarks of the target image to be processed and the private facial expression base template.
[0108] The facial expression coefficients of multiple videos can be determined, and the same processing is performed on multiple videos. The following is an example of a video (a clip video in a long video is the target video) for explanation.
[0109] First, facial markers are selected on the first frame of the long video. Unlike traditional processes such as wrap4d, which require as many points as possible to be selected on multiple views, in this step, only some markers of the front face need to be selected. Multiple markers can be selected at the mouth and eyes to improve the accuracy of the facial expression coefficient. The number of facial markers is reduced from hundreds to dozens, and it will not affect the calculation accuracy of the facial expression coefficient.
[0110] Secondly, the facial landmarks are tracked on the image sequence, see Figure 4 , ensuring the accuracy of the tracking results. Since the selection of the aforementioned facial markers only involves some markers on the front face, the calculation time and error rate of marker tracking will be greatly reduced. The markers on the first frame image are tracked on other frames. The specific tracking can use the traditional optical flow method or the current point tracking method based on deep learning. The embodiment of the present application is not limited to this and can be selected according to actual needs.
[0111] After that, the 3D coordinates of the facial landmarks are obtained without the need to perform 3D reconstruction of the entire face. For example, in an RGBD camera, this can be obtained through a depth map, and in a 4D array camera, only the 3D coordinates of the facial landmarks can be calculated through multi-view geometry methods, saving the time of 3D reconstruction of each frame.
[0112] Finally, the facial landmarks on the private facial expression base template are associated with the facial landmarks of the target image to be processed, and the facial expression coefficients of each frame in the long video are directly solved, skipping the non-rigid registration process, which can save a lot of time.
[0113] In one possible implementation, the private facial expression base template includes a neutral expression base and a polar expression base; based on the three-dimensional spatial coordinates of the facial marker points of the target image to be processed and the private facial expression base template, the facial expression coefficient of the target image to be processed is generated, including: performing least squares solution on the three-dimensional spatial coordinates of the facial marker points of the target image to be processed, the neutral expression base and the polar expression base to obtain the facial expression coefficient of the target image to be processed.
[0114] By using the three-dimensional spatial coordinates of the associated facial landmarks and the private expression base template, the least squares constraint is established for the facial expression coefficient. By solving the equation, the facial expression coefficient of each frame can be obtained. The facial expression of each frame can be linearly combined by the generated private facial expression base template. The specific calculation can refer to formula (1).
[0115]
[0116] Wherein, B is the synthesized expression, and the coordinates of some of the markers in B are known, namely, the three-dimensional spatial coordinates of the facial markers of the target image to be processed obtained by video tracking; B0 represents the neutral expression base; B i represents the expression base other than the neutral expression base in the private facial expression base template, which can be a polar expression base, i represents the sequence number of the expression base; w j Represents the corresponding facial expression coefficient, which is a scalar and ranges from 0 to 1. For example, there are 52 expression bases, and accordingly, there are 52 w (i ranges from 1 to 52).
[0117] In practical applications, facial landmarks usually do not coincide with mesh vertices, so barycentric coordinate correction is needed to establish a relationship between the facial landmark positions and mesh vertex positions. Fig.14 , Fig.14 A schematic diagram of a center of gravity coordinate provided in an embodiment of the present application.
[0118] In one possible implementation, before generating the facial expression coefficient of the target image to be processed based on the three-dimensional spatial coordinates of the facial marker points of the target image to be processed and the private facial expression base template, the method further includes: performing centroid coordinate correction on the three-dimensional spatial coordinates of the facial marker points of the target image to be processed.
[0119] Assuming that the facial landmark point P falls within the triangular mesh composed of v1, v2, and v3, the coordinates of point P can be expressed by formula (2), where a, b, and c represent the weights of vertices v1, v2, and v3, respectively.
[0120] P=av1+bv2+cv3 (2)
[0121] Assuming that the 3D coordinate of a facial marker obtained by video tracking is L, its corresponding marker on the neutral expression in the private facial expression base is N, and the neutral expression marker falls within the triangular mesh with vertex numbers v1, v2, and v3, then formula (3) holds. In formula 3, only w i is an unknown number. The equations of formula (3) can be used to form a system of equations for all facial landmarks. Generally, the number of facial landmarks is greater than w. i The number of facial expressions can be obtained by the least square method. Since it is a linear system of equations, no iterative calculation is required. Compared with the traditional process that requires three-dimensional reconstruction, non-rigid registration and other steps to solve the facial expression coefficient, the embodiment of the present application directly regresses the expression coefficient through the three-dimensional spatial coordinates of the marker points, and the calculation time of a single frame can be reduced from minutes to milliseconds.
[0122]
[0123] Bi represents the blendshape basis, the subscript i represents the number of bases, B i is a (nx3) two-dimensional matrix. In formula (3), B i The subscripts n1, n2, n3 represent the n1th, n2th, n3th rows of the matrix, which are 1x3 vectors corresponding to the dimensions of L and N.
[0124] The embodiment of the present application directly regresses the facial expression coefficient through the three-dimensional spatial coordinates of the private facial expression base template and the facial marker points, which is mainly divided into two steps. First, a private facial expression base template is generated, and only a few frames need to be three-dimensionally reconstructed and non-rigidly aligned, which does not take up too much time; in the process of batch generating expression coefficients, compared with the traditional process, the number of facial marker points used can be reduced from hundreds to dozens, which can reduce the marker point tracking time and the error rate in the tracking process, and at the same time skip the time-consuming process of three-dimensional reconstruction and non-rigid alignment of each frame, so that 4D facial expression coefficients can be generated quickly and accurately, and the single-frame calculation time is reduced from minutes to milliseconds, and the amount of intermediate data generated is reduced. For a video with 3600 frames in 1 minute, the storage space can be reduced by about 100G.
[0125] Based on the contents of the above steps S101-S107, it can be known that first, a target video with changes in facial expressions is obtained, in which facial markers are drawn on the face; the position changes of the facial markers in the target video are tracked to determine the neutral expression and the polar expression; the three-dimensional model of the neutral expression, the three-dimensional model of the polar expression and the three-dimensional spatial coordinates of the facial markers of the target image to be processed are obtained. Secondly, the three-dimensional model of the neutral expression is wrapped with a preset standard topological network to obtain a topological network of the neutral expression; based on the non-rigid registration algorithm, the three-dimensional model of the polar expression is wrapped with the topological network of the neutral expression to obtain a topological network of the polar expression; the preset standard facial expression base template is deformed and migrated using the topological network of the neutral expression and the topological network of the polar expression to generate a private facial expression base template. Finally, based on the three-dimensional spatial coordinates of the facial markers of the target image to be processed and the private facial expression base template, the facial expression coefficients of the target image to be processed are generated. In this way, the processing flow of obtaining facial expression coefficients is optimized, and the facial markers are manually drawn to ensure the accuracy of the facial markers during the tracking process, thereby improving the accuracy of the generated facial expression coefficients; in the process of generating facial expression coefficients, the time-consuming three-dimensional reconstruction and non-rigid registration steps are skipped, and the facial markers and the private facial expression base template are directly used to regress the facial expression coefficients. The accuracy and efficiency of obtaining facial expression coefficients are improved and the storage space occupied is reduced, solving the problem that the accuracy and speed of obtaining facial phenotype coefficients in the prior art cannot be achieved at the same time.
[0126] The above embodiment of the present application provides a method for obtaining a facial expression coefficient based on the above. Next, a device for obtaining a facial expression coefficient also provided in the embodiment of the present application is described, which is used to perform the above Figure 1 Next, the function of the device for obtaining the facial expression coefficient is described. The structural diagram of the device for obtaining the facial expression coefficient is shown in FIG. Fig.15 As shown, it includes a first acquisition module 1501 , a tracking module 1502 , a second acquisition module 1503 , a topology module 1504 , a first generation module 1505 and a second generation module 1506 .
[0127] in,
[0128] The first acquisition module 1501 is used to acquire a target video in which a facial expression of a person changes, wherein facial markers are drawn on the face of the person;
[0129] A tracking module 1502, used to track the position change of the facial marker in the target video and determine the neutral expression and the polar expression;
[0130] A second acquisition module 1503 is used to acquire the three-dimensional model of the neutral expression, the three-dimensional model of the polar expression and the three-dimensional space coordinates of the facial landmarks of the target image to be processed;
[0131] The topology module 1504 is used to wrap the three-dimensional model of the neutral expression with a preset standard topology network to obtain a topology network of the neutral expression; based on a non-rigid registration algorithm, the three-dimensional model of the polar expression is wrapped with the topology network of the neutral expression to obtain a topology network of the polar expression;
[0132] A first generating module 1505 is used to use the topological network of the neutral expression and the topological network of the polar expression to perform deformation migration on the preset standard facial expression base template to generate a private facial expression base template;
[0133] The second generating module 1506 is used to generate the facial expression coefficient of the target image to be processed based on the three-dimensional space coordinates of the facial landmarks of the target image to be processed and the private facial expression base template.
[0134] In a possible implementation, the private facial expression base template includes a neutral expression base and a polar expression base;
[0135] The second generating module 1506 is specifically used for:
[0136] The three-dimensional spatial coordinates of the facial markers of the target image to be processed, the neutral expression basis and the polar expression basis are solved by the least square method to obtain the facial expression coefficient of the target image to be processed.
[0137] In a possible implementation, the device further includes a barycenter coordinate correction module:
[0138] The barycentric coordinate correction module is used to perform barycentric coordinate correction on the three-dimensional space coordinates of the facial marker points of the target image to be processed.
[0139] In a possible implementation, the second acquisition module 1503 is used to acquire the three-dimensional space coordinates of the facial landmark points of the target image to be processed, including:
[0140] an acquisition submodule, used for tracking the position change of the facial markers of the target image to be processed in the long video, and obtaining the two-dimensional marker positions of the facial markers of the target image to be processed, wherein the specified segment in the long video is the target video;
[0141] The back-projection submodule is used to back-project the two-dimensional marker points onto a grid corresponding to the three-dimensional model according to the camera parameters to obtain the three-dimensional spatial coordinates of the facial marker points of the target image to be processed.
[0142] In a possible implementation, the topology module 1504 is used to wrap the three-dimensional model of the polar expression using the topology network of the neutral expression based on a non-rigid registration algorithm to obtain the topology network of the polar expression, including:
[0143] A determination submodule, used to determine the associated facial landmarks of the neutral expression and the polar expression;
[0144] The topology submodule is used to guide the topological network of the neutral expression to wrap the three-dimensional model of the polar expression based on the non-rigid registration algorithm with the associated facial landmarks to obtain the topological network of the polar expression.
[0145] The embodiment of the present application provides a device for acquiring facial expression coefficients, which includes a first acquisition module, a tracking module, a second acquisition module, a topology module, a first generation module, and a second generation module. The first acquisition module is used to acquire a target video in which facial expressions change, wherein facial markers are drawn on the face. The tracking module is used to track the position changes of the facial markers in the target video to determine neutral expressions and polar expressions. The second acquisition module is used to acquire a three-dimensional model of the neutral expression, a three-dimensional model of the polar expression, and the three-dimensional spatial coordinates of the facial markers of the target image to be processed. The topology module is used to wrap the three-dimensional model of the neutral expression with a preset standard topology network to obtain a topology network of the neutral expression; based on a non-rigid registration algorithm, the topology network of the neutral expression is used to wrap the three-dimensional model of the polar expression to obtain a topology network of the polar expression. The first generation module is used to use the topology network of the neutral expression and the topology network of the polar expression to perform deformation migration on a preset standard facial expression base template to generate a private facial expression base template. The second generation module is used to generate the facial expression coefficient of the target image to be processed based on the three-dimensional spatial coordinates of the facial markers of the target image to be processed and the private facial expression base template. In this way, the processing flow of obtaining the facial expression coefficient is optimized, and the facial markers are manually drawn to ensure the accuracy of the facial markers in the tracking process, thereby improving the accuracy of the generated facial expression coefficient; in the process of generating the facial expression coefficient, the time-consuming three-dimensional reconstruction and non-rigid registration steps are skipped, and the facial markers and the private facial expression base template are directly used to regress the facial expression coefficient. The accuracy and efficiency of obtaining the facial expression coefficient are improved and the storage space occupancy is reduced, solving the problem that the accuracy and speed of obtaining the facial phenotype coefficient in the prior art cannot be achieved at the same time.
[0146] Based on the method for obtaining a facial expression coefficient provided in the above method embodiment, the present application embodiment provides a device for obtaining a facial expression coefficient, see Fig.16 , the device includes: a processor, a memory, and a system bus;
[0147] The processor and the memory are connected via the system bus;
[0148] The memory is used to store one or more programs, and the one or more programs include instructions. When the instructions are executed by the processor, the processor executes the method for obtaining facial expression coefficients described in any one of the above embodiments.
[0149] Based on the method for obtaining a facial expression coefficient provided in the above method embodiment, an embodiment of the present application provides a computer-readable storage medium, which stores instructions. When the instructions are executed on a device, the device executes the method for obtaining a facial expression coefficient described in any of the above embodiments.
[0150] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device or device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment. The device and device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0151] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0152] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for obtaining a facial expression coefficient, characterized in that: The method comprises: Obtain a target video in which a person's facial expression changes, wherein facial markers are drawn on the face of the person; Tracking the position changes of the facial landmarks in the target video to determine neutral expressions and polar expressions; Acquire the three-dimensional model of the neutral expression, the three-dimensional model of the polar expression, and the three-dimensional spatial coordinates of the facial landmarks of the target image to be processed; Using a preset standard topological network to wrap the three-dimensional model of the neutral expression to obtain a topological network of the neutral expression; Based on a non-rigid registration algorithm, the topological network of the neutral expression is used to wrap the three-dimensional model of the polar expression to obtain a topological network of the polar expression; Using the neutral expression topology network and the polar expression topology network to perform deformation migration on a preset standard facial expression base template to generate a private facial expression base template; Based on the three-dimensional spatial coordinates of the facial markers of the target image to be processed and the private facial expression base template, a facial expression coefficient of the target image to be processed is generated.
2. The method for obtaining facial expression coefficients according to claim 1, characterized in that: The private facial expression base template includes a neutral expression base and a polar expression base; The step of generating the facial expression coefficient of the target image to be processed based on the three-dimensional spatial coordinates of the facial markers of the target image to be processed and the private facial expression base template comprises: The three-dimensional spatial coordinates of the facial markers of the target image to be processed, the neutral expression basis and the polar expression basis are solved by the least square method to obtain the facial expression coefficient of the target image to be processed.
3. The method for obtaining facial expression coefficients according to claim 1, characterized in that: Before generating the facial expression coefficient of the target image to be processed based on the three-dimensional spatial coordinates of the facial landmarks of the target image to be processed and the private facial expression base template, the method further includes: The three-dimensional space coordinates of the facial landmarks of the target image to be processed are corrected for the center of gravity coordinates.
4. The method for obtaining facial expression coefficients according to claim 1, characterized in that: Acquiring the three-dimensional spatial coordinates of the facial landmarks of the target image to be processed, including: Tracking the position changes of the facial markers of the target image to be processed in the long video to obtain the two-dimensional marker positions of the facial markers of the target image to be processed, wherein the specified segment in the long video is the target video; The two-dimensional marker points are back-projected onto a grid corresponding to the three-dimensional model according to the camera parameters to obtain the three-dimensional spatial coordinates of the facial marker points of the target image to be processed.
5. The method for obtaining facial expression coefficients according to claim 1, characterized in that: The non-rigid body registration algorithm is based on using the topological network of the neutral expression to wrap the three-dimensional model of the polar expression to obtain the topological network of the polar expression, including: Determining facial landmarks associated with the neutral expression and the polar expression; Based on a non-rigid registration algorithm, the topological network of the neutral expression is guided by the associated facial landmarks to wrap the three-dimensional model of the polar expression to obtain a topological network of the polar expression.
6. A device for acquiring facial expression coefficients, characterized in that: The device comprises: A first acquisition module is used to acquire a target video in which a facial expression of a person changes, wherein facial markers are drawn on the face of the person; A tracking module, used for tracking the position change of the facial marker in the target video to determine the neutral expression and the polar expression; A second acquisition module, used to acquire the three-dimensional model of the neutral expression, the three-dimensional model of the polar expression and the three-dimensional spatial coordinates of the facial landmarks of the target image to be processed; A topological module, used to wrap the three-dimensional model of the neutral expression with a preset standard topological network to obtain a topological network of the neutral expression; based on a non-rigid registration algorithm, the three-dimensional model of the polar expression is wrapped with the topological network of the neutral expression to obtain a topological network of the polar expression; A first generating module is used to use the topological network of the neutral expression and the topological network of the polar expression to perform deformation migration on a preset standard facial expression base template to generate a private facial expression base template; The second generating module is used to generate the facial expression coefficient of the target image to be processed based on the three-dimensional space coordinates of the facial landmarks of the target image to be processed and the private facial expression base template.
7. The device for acquiring facial expression coefficients according to claim 6, characterized in that: The private facial expression base template includes a neutral expression base and a polar expression base; The second generating module is specifically used for: The three-dimensional spatial coordinates of the facial markers of the target image to be processed, the neutral expression basis and the polar expression basis are solved by the least square method to obtain the facial expression coefficient of the target image to be processed.
8. The device for acquiring facial expression coefficients according to claim 6, characterized in that: The device also includes a barycenter coordinate correction module: The barycentric coordinate correction module is used to perform barycentric coordinate correction on the three-dimensional space coordinates of the facial marker points of the target image to be processed.
9. The device for acquiring facial expression coefficients according to claim 6, characterized in that: The second acquisition module is used to acquire the three-dimensional spatial coordinates of the facial landmarks of the target image to be processed, including: an acquisition submodule, used for tracking the position change of the facial markers of the target image to be processed in the long video, and obtaining the two-dimensional marker positions of the facial markers of the target image to be processed, wherein the specified segment in the long video is the target video; The back-projection submodule is used to back-project the two-dimensional marker points onto a grid corresponding to the three-dimensional model according to the camera parameters to obtain the three-dimensional spatial coordinates of the facial marker points of the target image to be processed.
10. The device for acquiring facial expression coefficients according to claim 6, characterized in that: The topological module is used to wrap the three-dimensional model of the polar expression using the topological network of the neutral expression based on a non-rigid registration algorithm to obtain the topological network of the polar expression, including: A determination submodule, used to determine the associated facial landmarks of the neutral expression and the polar expression; The topology submodule is used to guide the topological network of the neutral expression to wrap the three-dimensional model of the polar expression based on the non-rigid registration algorithm with the associated facial landmarks to obtain the topological network of the polar expression.
