Material generation, image processing method, device, electronic device and storage medium

The three-dimensional deformation processing of the face model through the target three-dimensional deformation parameters is solved, and the problem of poor deformation effect in the existing technology is achieved, and the consistent deformation and natural deformation effect of multi-frame face images is achieved.

CN114742951BActive Publication Date: 2025-08-22BEIJING SWEET SUGARSOFT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210417761.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-20
Publication Date
2025-08-22
Estimated Expiration
2042-04-20

AI Technical Summary

Technical Problem

In the prior art, in the face deformation processing, the deformation effect is poor, especially in multi-frame face images, there are problems of unnatural deformation and differences.

Method used

The target three-dimensional deformation parameters are used to perform three-dimensional deformation processing on the face three-dimensional model, including deformation position, deformation mode and deformation amplitude, to generate target materials to match the deformation effect of the image to be processed, and to reduce unnatural deformation through depth-related information.

Benefits of technology

The consistent deformation effect in multi-frame face images is achieved, reducing the unnatural deformation of facial features of human faces and improving the naturalness and authenticity of the deformation effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114742951B_ABST
    Figure CN114742951B_ABST
Patent Text Reader

Abstract

The present disclosure provides a material generation and image processing method, device, electronic device and storage medium, wherein the method includes: displaying a first three-dimensional face model in a first area of ​​a graphical user interface; in response to obtaining target three-dimensional deformation parameters, performing a first three-dimensional deformation process on the first three-dimensional face model based on the target three-dimensional deformation parameters to obtain a second three-dimensional face model; wherein the target three-dimensional deformation parameters are used to characterize at least one of the following: a deformation position, a deformation method, and a deformation amplitude of a target facial part; in response to a face deformation material generation instruction, generating a target material containing the target three-dimensional deformation parameters based on the target three-dimensional deformation parameters, wherein the target material is used to deform the target facial part of a to-be-processed image, and the deformation effect of the to-be-processed image matches the deformation effect of the second three-dimensional face model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer vision technology, and more specifically, to a material generation and image processing method, device, electronic device, and storage medium. Background Art

[0002] Facial feature beautification typically uses facial keypoint recognition technology to identify key points in an image, determine their locations, and then adjust these locations to alter the shape of the facial features. However, this beautification method suffers from poor deformation effects. Summary of the Invention

[0003] The embodiments of the present disclosure at least provide a material generation and image processing method, device, electronic device and storage medium.

[0004] In a first aspect, an embodiment of the present disclosure provides a material generation method, comprising:

[0005] Displaying a first human face three-dimensional model in a first area of ​​the graphical user interface;

[0006] In response to obtaining target three-dimensional deformation parameters, performing a first three-dimensional deformation process on the first three-dimensional face model based on the target three-dimensional deformation parameters to obtain a second three-dimensional face model; wherein the target three-dimensional deformation parameters are used to represent at least one of the following: a deformation position, a deformation method, and a deformation amplitude of the target facial part;

[0007] In response to a face deformation material generation instruction, a target material including the target three-dimensional deformation parameters is generated based on the target three-dimensional deformation parameters. The target material is used to deform the target face part of the image to be processed, and the deformation effect of the image to be processed matches the deformation effect of the second three-dimensional face model.

[0008] In this way, when the target material generated by the target three-dimensional deformation parameters is used to process the image to be processed, the deformation effect of the image to be processed is matched with the deformation effect of the second face three-dimensional model. Furthermore, when the same face in multiple frames of face images is deformed, even if the face has different postures in different face images, the deformation effect is consistent. In addition, the target three-dimensional deformation parameters also include depth-related information. By deforming the face with the target three-dimensional deformation parameters, the degree of unnatural deformation of the facial features can be reduced, thereby improving the deformation effect of the face.

[0009] In an optional embodiment, the first three-dimensional face model includes: a plurality of vertices, and position information of the plurality of vertices in a model coordinate system;

[0010] The step of performing a first three-dimensional deformation process on the first human face three-dimensional model based on the target three-dimensional deformation parameters to obtain a second human face three-dimensional model includes:

[0011] Determining, from a plurality of vertices included in the first three-dimensional face model, a target vertex corresponding to a deformation position indicated by the target three-dimensional model parameter;

[0012] Performing position adjustment on the target vertex according to the deformation mode and deformation amplitude indicated by the target three-dimensional deformation parameter to obtain the second three-dimensional face model.

[0013] In this way, by adjusting the position of the target vertex using the target three-dimensional deformation parameters, the first three-dimensional face model can be deformed to obtain a second three-dimensional face model that conforms to the deformation method and deformation amplitude corresponding to the target three-dimensional deformation parameters. Different parts of the face are corresponded to different vertices, thereby achieving targeted deformation processing of different parts of the face.

[0014] In an optional implementation manner, obtaining the target three-dimensional deformation parameter includes:

[0015] A parameter setting panel is displayed in the third area of ​​the graphical user interface; the parameter setting panel includes: a first parameter setting control for setting three-dimensional deformation parameters corresponding to multiple facial parts respectively;

[0016] In response to a setting operation performed on the first parameter setting control corresponding to any target facial part, a target three-dimensional deformation parameter corresponding to the target facial part is determined.

[0017] In an optional embodiment, the parameter setting panel further includes: a second parameter setting control for setting display parameters, wherein the display parameters include at least one of the following: camera angle, background color, and three-dimensional model display size;

[0018] The method further includes: setting a control based on the second parameter to obtain target display parameters; and displaying the second three-dimensional face model based on the target display parameters.

[0019] In this way, the deformation amplitude of the three-dimensional face model can be set through the parameter setting panel to display the deformation effect corresponding to the change amplitude of the three-dimensional face model; the parameter setting panel can also be used to set parameters such as camera angle, background color, display size, etc., thereby optimizing the display effect of the three-dimensional face model.

[0020] In an optional implementation, the first three-dimensional face model includes: a standard three-dimensional face model, or a three-dimensional model obtained by deforming the standard three-dimensional face model using a preset parameter configuration file.

[0021] In this way, the materials that have been generated in the past for face deformation can be adjusted a second time to facilitate the use of the materials.

[0022] In an optional embodiment, the first three-dimensional face model includes a three-dimensional model obtained by performing three-dimensional deformation processing on the standard three-dimensional face model using a preset parameter configuration file;

[0023] Before displaying the first human face 3D model in the first area of ​​the graphical user interface, the method further includes:

[0024] In response to importing the parameter configuration file, parsing the parameter configuration file to obtain the three-dimensional deformation parameters carried in the parameter configuration file;

[0025] The standard three-dimensional face model is subjected to a first three-dimensional deformation process using the three-dimensional deformation parameters to obtain the first three-dimensional face model and a first preview image corresponding to the first three-dimensional face model.

[0026] In this way, by parsing the parameter configuration file to obtain the three-dimensional deformation parameters, the standard human face three-dimensional model is subjected to the first three-dimensional deformation processing to obtain the first human face three-dimensional model and the first preview image, which are used for display in the graphical user interface, and the target three-dimensional deformation parameters are configured for the first human face three-dimensional model to obtain the second human face three-dimensional model, and the target material is generated to obtain the second preview image matching the second human face three-dimensional model.

[0027] In an optional embodiment, the parameter configuration file includes a first parameter configuration file generated using preset three-dimensional design software;

[0028] After parsing the parameter configuration file to obtain the original three-dimensional deformation parameters carried in the parameter configuration file, the method further includes at least one of the following:

[0029] Based on the deformation mode represented by the original three-dimensional deformation parameters, loading a software module corresponding to the deformation mode; the software module is used to perform a first three-dimensional deformation process on the standard human face three-dimensional model;

[0030] Initializing a parameter setting panel based on the deformation position and deformation amplitude represented by the original three-dimensional deformation parameters;

[0031] Initialize and configure a target character string; wherein the target character string is used to store adjustment information of the original three-dimensional deformation parameters adjusted by the user.

[0032] In this way, when configuring the parameter file, when the first parameter configuration file is generated by the preset three-dimensional design software, the original three-dimensional deformation parameters are obtained by parsing the first parameter configuration file. After loading the software module corresponding to the deformation method based on the deformation method represented by the original three-dimensional deformation parameters, the loaded software module can be conveniently used to deform the first face three-dimensional model, thereby speeding up the processing speed; after initializing the parameter setting panel, the parameter setting panel is used to provide the user with an entry for adjusting the corresponding parameters, and can intuitively display the specific deformation status of the current first face three-dimensional model to the user; after initializing the target character string, the target character string can be used to save the adjustment information, so that the original three-dimensional deformation parameters and the adjustment information are stored separately, which is convenient for the user to make secondary adjustments to the adjustment information based on the original three-dimensional deformation parameters.

[0033] In an optional embodiment, the parameter configuration file includes a second parameter configuration file obtained by adjusting original three-dimensional deformation parameters in the first parameter configuration file;

[0034] After parsing the parameter configuration file to obtain the original three-dimensional deformation parameters carried in the parameter configuration file, the method further includes:

[0035] The target character string is parsed to obtain adjustment information for adjusting the three-dimensional deformation parameters in the first parameter configuration file; and the parameter setting panel is updated based on the adjustment information obtained by the parsing.

[0036] In this way, when parsing the second parameter configuration file, since the second parameter configuration file is obtained after adjusting the original three-dimensional deformation parameters in the first parameter configuration file before parsing, when the first parameter configuration file cannot meet the user's needs, the user can make a secondary adjustment to some of the three-dimensional deformation parameters in the first parameter configuration file; when making a secondary adjustment to the three-dimensional deformation parameters, the target character string in the first parameter configuration file can be directly parsed to obtain the corresponding adjustment information, and the obtained adjustment information is used to update the current parameter setting panel, thereby simplifying the processing steps and realizing repeated calling of the template.

[0037] In an optional embodiment, performing a first three-dimensional deformation process on the standard three-dimensional face model using the three-dimensional deformation parameters to obtain the first three-dimensional face model includes:

[0038] Obtaining adjusted three-dimensional deformation parameters using the adjustment information and the three-dimensional deformation parameters;

[0039] The first three-dimensional deformation process is performed on the standard three-dimensional face model using the adjusted three-dimensional deformation parameters to obtain the first three-dimensional face model.

[0040] In an optional embodiment, the method further includes:

[0041] Displaying a first preview image corresponding to the first three-dimensional face model in a second area of ​​the graphical user interface;

[0042] In response to acquiring the target three-dimensional deformation parameters, performing a second three-dimensional deformation process on the first preview image based on the target three-dimensional deformation parameters to obtain a second preview image;

[0043] The second preview image is displayed.

[0044] In this way, the first preview image can be deformed according to the target material containing the target three-dimensional deformation parameters to obtain the second preview image. Since the second facial three-dimensional model is obtained by the first deformation of the first facial three-dimensional model according to the target three-dimensional deformation parameters, and the target material contains the target three-dimensional deformation parameters, the second preview image can be obtained according to the first preview image and the target material, so that the second preview image and the second facial three-dimensional model have the same deformation effect.

[0045] In an optional embodiment, performing a second 3D deformation process on the first preview image based on the target 3D deformation parameter to obtain the second preview image includes:

[0046] Performing three-dimensional face reconstruction on the first preview image to obtain a third three-dimensional face model of the template face in the first preview image;

[0047] performing a first three-dimensional deformation process on the third three-dimensional face model based on the target deformation coefficient to obtain a fourth three-dimensional face model;

[0048] Perform position transformation processing on the pixels in the image to be processed based on the fourth three-dimensional face model to obtain the second preview image.

[0049] In this way, by performing three-dimensional face reconstruction on the first preview image, a third face three-dimensional model is obtained. Compared with the standard face three-dimensional model, the third face three-dimensional model can be directly reconstructed based on the image provided by the user or the image in the video. Then, the user can obtain the third face three-dimensional model that conforms to the facial feature information in the image based on the provided image, so that the user can more intuitively obtain the deformation effect of the fourth face three-dimensional model after deformation processing based on the third face three-dimensional model.

[0050] In an optional implementation, the first preview image includes an original preview image; or an image obtained by performing a first three-dimensional deformation process on the original preview image using a parameter configuration file.

[0051] In this way, it is ensured that the first preview image and the first three-dimensional face model have the same deformation effect, so that the user can compare the first preview image and the first three-dimensional face model to more intuitively see the impact of the same face deformation parameters on the face in the image and the face in the three-dimensional model.

[0052] In a second aspect, the present disclosure further provides an image processing method, including:

[0053] Displaying an image to be processed on a graphical user interface; the image to be processed includes a target face;

[0054] In response to a target material loading operation, deforming the image to be processed based on the target material to obtain a first target image; wherein the target material is generated according to the material generation method described in any one of the above embodiments;

[0055] The first target image is displayed.

[0056] In this way, by loading the target material, the target three-dimensional deformation parameters corresponding to the facial parts in the target material can be used to process the image to be processed, and then the first target image can be directly generated through the target material, thereby realizing the deformation processing of the face in the first target image using the three-dimensional deformation parameters, and ensuring that when there are multiple frames of the first target image, the same face in multiple frames of the first target image can have the same three-dimensional deformation effect. In addition, the target three-dimensional deformation parameters also include depth information. By deforming the face with the target three-dimensional deformation parameters, the degree of unnatural deformation of the facial features can be reduced, thereby improving the deformation effect of the face.

[0057] In an optional embodiment, the target material includes target three-dimensional deformation parameters, and performing three-dimensional deformation processing on the image to be processed based on the target material to obtain the first target image includes:

[0058] Performing three-dimensional face reconstruction on the image to be processed to obtain a three-dimensional face model of a target face in the image to be processed;

[0059] performing a first three-dimensional deformation process on the three-dimensional face model based on the target deformation coefficient to obtain a target three-dimensional face model;

[0060] The pixel points in the image to be processed are subjected to position transformation processing based on the target face three-dimensional model to obtain the first target image.

[0061] In this way, the three-dimensional facial model of the target face obtained by performing three-dimensional facial reconstruction on the image to be processed makes the feature information of the three-dimensional facial model match the feature information of the image to be processed, so that the user can intuitively obtain the deformation effect; the first target image obtained according to the three-dimensional facial model directly performs position transformation according to the pixel points in the image to be processed, which can make the deformation effect of the image more realistic.

[0062] In a third aspect, an embodiment of the present disclosure provides a material generation device, the device comprising:

[0063] A display module, configured to display a first human face three-dimensional model in a first area of ​​a graphical user interface;

[0064] a processing module configured to, in response to acquiring target three-dimensional deformation parameters, perform a first three-dimensional deformation process on the first three-dimensional facial model based on the target three-dimensional deformation parameters to obtain a second three-dimensional facial model; wherein the target three-dimensional deformation parameters are used to represent at least one of the following: a deformation position, a deformation method, and a deformation amplitude of the target facial part;

[0065] The generating module is configured to generate a target material including the three-dimensional deformation parameters based on the target three-dimensional deformation parameters in response to a face deformation material generating instruction.

[0066] In a fourth aspect, an embodiment of the present disclosure further provides an image processing device, the device comprising:

[0067] A display module, configured to display an image to be processed on a graphical user interface; the image to be processed includes a target face;

[0068] a response module, configured to, in response to a target material loading operation, perform three-dimensional deformation processing on the image to be processed based on the target material to obtain a first target image; wherein the target material is generated using the material generation method according to any one of the first aspects;

[0069] The display module is further configured to display the first target image.

[0070] In a fifth aspect, an optional implementation of the present disclosure further provides an electronic device, a processor, and a memory, wherein the memory stores machine-readable instructions executable by the processor, and the processor is used to execute the machine-readable instructions stored in the memory. When the machine-readable instructions are executed by the processor, the machine-readable instructions perform the steps in any possible implementation of the above-mentioned first aspect or second aspect.

[0071] In a sixth aspect, an optional implementation of the present disclosure further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed, the steps of any possible implementation of the first aspect or the second aspect are executed.

[0072] For a description of the effects of the above-mentioned material generation, image processing device, electronic device, and computer-readable storage medium, please refer to the description of the above-mentioned material generation and image processing method, which will not be repeated here.

[0073] In order to make the above-mentioned objectives, features and advantages of the present disclosure more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0074] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the following briefly introduces the drawings required for use in the embodiments. The drawings herein are incorporated into and constitute a part of the specification. These drawings illustrate embodiments consistent with the present disclosure and, together with the specification, are used to illustrate the technical solutions of the present disclosure. It should be understood that the following drawings only illustrate certain embodiments of the present disclosure and should not be regarded as limiting the scope. For those of ordinary skill in the art, other relevant drawings can be obtained based on these drawings without inventive effort.

[0075] Figure 1 A flow chart of a material generation method provided by an embodiment of the present disclosure is shown;

[0076] Figure 2 A schematic diagram showing a deformation effect in a material generation method provided by an embodiment of the present disclosure is shown;

[0077] Figure 3a A schematic diagram of a graphical user interface in a material generation method provided by an embodiment of the present disclosure is shown;

[0078] Figure 3b FIG1 shows an enlarged schematic diagram of a third area of ​​a graphical user interface in a material generation method provided by an embodiment of the present disclosure;

[0079] Figure 4 A schematic diagram of the operation of a mobile terminal in an image processing method provided by an embodiment of the present disclosure is shown;

[0080] Figure 5 A flowchart of an image processing method provided by an embodiment of the present disclosure is shown;

[0081] Figure 6 A schematic diagram of a material generation device provided by an embodiment of the present disclosure is shown;

[0082] Figure 7 A schematic diagram of an image processing device provided by an embodiment of the present disclosure is shown;

[0083] Figure 8 A schematic diagram of an electronic device provided by an embodiment of the present disclosure is shown. DETAILED DESCRIPTION

[0084] In order to make the purpose, technical solutions and advantages of the embodiments of the present disclosure clearer, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, rather than all of the embodiments. The components of the embodiments of the present disclosure generally described and shown here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present disclosure is not intended to limit the scope of the present disclosure for protection, but merely represents the selected embodiments of the present disclosure. Based on the embodiments of the present disclosure, all other embodiments obtained by those skilled in the art without making creative work are within the scope of protection of the present disclosure.

[0085] Research has found that in the current method of deforming faces, the deformation process first uses the image input by the user. The software obtains the facial key points that determine the deformation effect based on the 2D information on the image. Secondly, the software adjusts the positions of the key points and, based on the adjusted key points, adjusts the positions of other pixels in the facial image to obtain the deformed facial image. On the one hand, this adjustment method can only be used to understand the beautification effect through the beautified image, resulting in poor user perception of the facial deformation effect. On the other hand, image-based adjustments can only adjust the deformation effect for planar structures, that is, adjustments are made on a 2D basis. When it is necessary to adjust multiple facial images in a video stream, since the facial postures in different facial images may be different, this adjustment method will result in significant differences in facial adjustments in different facial images and unnatural deformation of facial features, resulting in poor facial deformation effects.

[0086] Based on the above research, the present disclosure provides a material generation, image processing method, device, electronic device and storage medium. When the target material generated by the target three-dimensional deformation parameters is used to process the image to be processed, the deformation effect of the image to be processed is matched with the deformation effect of the second face three-dimensional model. Therefore, when the same face in multiple frames of face images is deformed, even if the posture of the face in different face images is different, the deformation effect is consistent. In addition, the target three-dimensional deformation parameters also include depth-related information. By deforming the face using the target three-dimensional deformation parameters, the degree of unnatural deformation of the facial features can be reduced, thereby improving the deformation effect of the face.

[0087] In addition, since the target three-dimensional deformation parameters are used to perform three-dimensional deformation processing on the first face three-dimensional model and the first preview image in the 3D dimension, through the three-dimensional deformation processing of the face three-dimensional model, not only the planar information of the face image can be adjusted, but also the depth information of the face can be adjusted, such as the depth of the eye sockets, the degree of facial convexity, etc., thereby improving the fineness of the adjustment, making the adjusted face image more natural and realistic, and thus meeting the user's usage needs.

[0088] In the face deformation process provided by the embodiment of the present disclosure, the facial parts are divided into multiple deformation parts. When adjusting a certain facial part, the deformation method and deformation amplitude corresponding to each deformation position can be adjusted for different deformation positions of the facial part, thereby achieving refined adjustment of the facial features and fine-tuning of local facial features to improve the face deformation effect.

[0089] The defects in the above solutions are the results obtained by the inventors after practice and careful research. Therefore, the process of discovering the above problems and the solutions proposed by this disclosure for the above problems below should be the contributions made by the inventors to this disclosure during the disclosure process.

[0090] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, it does not need to be further defined or explained in subsequent drawings.

[0091] To facilitate understanding of this embodiment, a material generation method and an image processing method disclosed in an embodiment of the present disclosure are first described in detail. The execution subject of the material generation method and the image processing method provided in the embodiment of the present disclosure is generally an electronic device with certain computing capabilities, such as a terminal device, a server, or other processing device. The terminal device can be a user equipment (UE), a mobile device, a user terminal, a cellular phone, a cordless phone, a handheld device, a computer device, an in-vehicle device, etc. In some possible implementations, the material generation method and the image processing method can be implemented by a processor calling computer-readable instructions stored in a memory.

[0092] The material generation method provided by the embodiment of the present disclosure is described below.

[0093] See also Figure 1 FIG. 1 is a flow chart of a material generation method provided by an embodiment of the present disclosure, wherein the method includes steps S101 to S103, wherein:

[0094] S101: Displaying a first human face three-dimensional model in a first area of ​​a graphical user interface.

[0095] S102: In response to obtaining target three-dimensional deformation parameters, performing a first three-dimensional deformation process on the first facial three-dimensional model based on the target three-dimensional deformation parameters to obtain a second facial three-dimensional model; wherein the target three-dimensional deformation parameters are used to characterize at least one of the following: a deformation position, a deformation method, and a deformation amplitude of the target facial part.

[0096] S103: In response to a face deformation material generation instruction, a target material including the target three-dimensional deformation parameters is generated based on the target three-dimensional deformation parameters, wherein the target material is used to deform the target face part of the image to be processed, and the deformation effect of the image to be processed matches the deformation effect of the second three-dimensional face model.

[0097] The above S101 to S103 are described in detail below.

[0098] With respect to the above S101, the first three-dimensional face model includes, for example: a standard three-dimensional face model, or a three-dimensional model obtained by deforming the standard three-dimensional face model using a preset parameter configuration file.

[0099] Here, the standard human face 3D model is represented as a 3D model that has not undergone secondary adjustment, in which all parameters are original. If the designer wants to adjust the parameters in the standard human face 3D model, the standard human face 3D model can be deformed through a preset parameter configuration file to obtain a processed 3D model. The designer can be the user who will use the model later or the designer of the model.

[0100] The standard three-dimensional face model is a three-dimensional face model obtained by performing standard modeling on the face. The standard three-dimensional face model includes, for example, a 3D mesh model.

[0101] The mesh model generally includes a plurality of vertices and the three-dimensional coordinates of the vertices in the model coordinate system. The vertices are connected to each other to form a plurality of meshes for constituting the surface of the three-dimensional face model.

[0102] In addition, different meshes may have a certain linkage relationship. This linkage relationship is used to represent the magnitude of the position change of other meshes adjacent to a mesh when the position of a vertex in the mesh changes.

[0103] The parameter configuration file is, for example, a configuration file generated by using preset three-dimensional design software for deforming a standard face model. The configuration file includes three-dimensional deformation parameters for performing row processing on the standard face model.

[0104] In one possible implementation, the preset three-dimensional design software may be, for example, software that generates target materials based on the material generation method provided in the embodiments of the present disclosure; in another possible implementation, the preset three-dimensional design software may also be software that deforms a standard three-dimensional face model based on other three-dimensional model deformation methods, and other deformation methods may be, for example, methods of deforming the three-dimensional model based on bone transformation coefficients.

[0105] In addition, the parameter configuration file can also be a set of three-dimensional deformation parameters that are manually or randomly generated, and the generated three-dimensional deformation parameters are carried in the parameter configuration file to use the parameter configuration file to deform the standard human face three-dimensional model to generate a first human face three-dimensional model.

[0106] In another embodiment of the present disclosure, the method further includes: displaying a first preview image corresponding to the first three-dimensional face model in the second area of ​​the graphical user interface. The first preview image is, for example, a frame of a face image.

[0107] The first preview image displayed corresponds to the deformation effect of the first 3D face model. That is, when the first 3D face model is a standard 3D face model, the first preview image is, for example, an original face image obtained by photographing the face.

[0108] If the first 3D facial model is a 3D model obtained by deforming the standard 3D facial model using a preset parameter configuration file, the first preview image is, for example, an image obtained by deforming the original face using the preset parameter configuration file. In this case, the deformation effect of the face in the first preview image is the same as the deformation effect of the first 3D facial model compared to the standard 3D facial model.

[0109] In this case, before displaying the first three-dimensional face model in the first area of ​​the graphical user interface, the method further includes: importing a parameter configuration file, and using the parameter configuration file to perform a first three-dimensional deformation process on the standard face model to obtain the first three-dimensional face model.

[0110] In addition, when the first preview image corresponding to the first three-dimensional facial model is displayed in the second area, the imported parameter configuration file can also be used to perform a second three-dimensional deformation process on the original facial image to obtain the first preview image.

[0111] Specifically, after importing the parameter configuration file, in response to importing the parameter configuration file, the parameter configuration file is parsed to obtain the three-dimensional deformation parameters carried in the parameter configuration file; the three-dimensional deformation parameters are used to perform a first three-dimensional deformation processing on the standard human face three-dimensional model to obtain the first human face three-dimensional model and a first preview image corresponding to the first human face three-dimensional model.

[0112] A: The parameter configuration file includes: a first parameter configuration file generated using a preset 3D design software. The 3D deformation parameters carried in the parameter configuration file are the original 3D deformation parameters corresponding to when the first parameter configuration file was generated.

[0113] For example, the first parameter configuration file can be in fbx format. This fbx format is a general 3D model file that supports key 3D data elements, such as 3D image information. By parsing the parameter configuration file, the original 3D deformation parameters are obtained, each of which corresponds to a deformation item.

[0114] In this case, after parsing the parameter configuration file to obtain the original three-dimensional deformation parameters carried in the parameter configuration file, at least one of the following a1 to a3 is also included:

[0115] a1: Based on the deformation mode represented by the original three-dimensional deformation parameters, load a software module corresponding to the deformation mode; the software module is used to perform a first three-dimensional deformation process on the standard human face three-dimensional model.

[0116] a2: Initializing the parameter setting panel based on the deformation position and deformation amplitude represented by the original three-dimensional deformation parameters.

[0117] For example, taking a computer as an execution subject, a software module is displayed on the computer's monitor. The software module displays a first area, a second area, and a third area. The first area displays a three-dimensional face model, the second area displays a preview image corresponding to the three-dimensional face model, and the third area displays a parameter setting panel. The parameter setting panel displays parameter setting information for a first deformation process for a standard face model. For example, the three-dimensional face model includes multiple facial parts, each facial part corresponds to a deformation item, and each deformation item is provided with a slider. Each slider corresponds to an original three-dimensional deformation parameter with an adjustment range of 0-100. The first deformation process sets a corresponding deformation effect within the range of 0-100, where 0 indicates that the deformation position and deformation amplitude have the smallest deformation effect relative to the original three-dimensional face model, and 100 indicates that the deformation position and deformation amplitude have the largest deformation effect relative to the original three-dimensional face model. After setting the deformation effect, the parameter setting panel is initialized so that the parameter setting panel is displayed in the third area.

[0118] a3: Initialize the configuration target character string; wherein the target character string is used to store the adjustment information of the original three-dimensional deformation parameters adjusted by the user.

[0119] Exemplarily, the purpose of initializing the configuration of the target string is to generate the target string so as to facilitate the subsequent adjustment of the original three-dimensional deformation parameters, and use the generated target string to save the corresponding adjustment information. The adjustment information includes at least one of the three-dimensional deformation parameters. When the original three-dimensional deformation parameters are subsequently adjusted, the target string can be directly called to generate the target three-dimensional deformation parameters and configured on the parameter setting panel. The corresponding three-dimensional deformation parameters can be intuitively seen through the parameter panel, and the three-dimensional deformation parameters can be conveniently adjusted using the parameter setting panel.

[0120] The target character string can be stored in a preset storage unit, and when it needs to be called, the target character string is called from the preset storage unit according to the statement.

[0121] B: The parameter configuration file includes a second parameter configuration file obtained by adjusting the original three-dimensional deformation parameters in the first parameter configuration file.

[0122] In this case, after parsing the parameter configuration file to obtain the original three-dimensional deformation parameters carried in the parameter configuration file, the method further includes:

[0123] Parse the target character string to obtain adjustment information for adjusting the three-dimensional deformation parameters in the first parameter configuration file; and update the parameter setting panel based on the adjustment information obtained by the analysis, and use the adjusted three-dimensional deformation parameters to perform a first three-dimensional deformation processing on the standard human face three-dimensional model to obtain the first human face three-dimensional model.

[0124] Exemplarily, for the second parameter configuration file, adjustment information for adjusting the three-dimensional deformation parameters in the first parameter configuration file is first obtained by parsing the target character string in the first parameter configuration file. The adjustment information represents the deformation effects corresponding to different parts of the original facial three-dimensional model, and the deformation effects are represented by three-dimensional deformation parameters. For example, in a first parameter configuration file, adjustments are made to all key points in the original three-dimensional facial model to obtain the original three-dimensional deformation parameters and generate a target character string. If it is necessary to adjust a certain part, it is only necessary to read the target character string corresponding to the part in the first parameter configuration file, and then adjust it according to the adjustment information and the original three-dimensional deformation parameters of the part to obtain the adjusted three-dimensional deformation parameters corresponding to the part, and update the target character string to obtain the first facial three-dimensional model.

[0125] Taking the device for executing the material generation method as a computer as an example, a 3D micro-plastic surgery layer can be added to the graphical user interface of the 3D model creation software. A parameter control panel is displayed in the third area of ​​the graphical user interface. The parameter control panel includes an import model option. The format of the model file is displayed below the imported model. For example, you can use the mouse to click the "Import Model" tab. At this time, the software loads the original 3D face model file by default. Clicking the "Import" tab can support importing fbx files with blendshape (bs) information and read the bs information. If you click the "Delete" tab, the read fbx will be deleted and restored to the default original 3D face model. Click the "Import Parameter Template" tab to pop up the resource template library. Select a 3D model in the resource template library. After selection, the software can load at least 25 deformation projects. Among them, for some deformation projects, please refer to the specific Figure 2 shown.

[0126] For S102: the target three-dimensional deformation parameter is used to represent at least one of the following: a deformation position, a deformation method, and a deformation amplitude of the target facial part.

[0127] The human face can be divided into multiple deformation parts, and each deformation part can be further divided into multiple deformation positions.

[0128] When dividing a face into multiple deformed parts, the face can be divided, for example, according to the positions of the facial features. Examples include: eye parts, eyebrow parts, nose parts, mouth parts, head parts, and face parts. For the eye parts, the multiple deformed parts obtained by division include, for example, the whole eye, outer canthus, inner canthus, eyeball, and under-eye bags. For the eyebrow parts, the multiple deformed parts obtained by division include, for example, the whole eyebrow, the beginning of the eyebrow, the middle of the eyebrow, the eyebrow arch, and the end of the eyebrow. For the nose part, the multiple deformed parts obtained by division include, for example, the whole nose, the beginning of the nose, the wings of the nose, the bridge of the nose, and the root of the nose. For the mouth part, the multiple deformed parts obtained by division include, for example, the whole mouth, the corners of the mouth, the upper lip, the lower lip, and the middle of the lip. For the forehead part, the multiple deformed parts obtained by division include, for example, the forehead, the upper forehead, the lower forehead, and both sides of the forehead. For the face parts, the multiple deformed parts obtained by division include, for example, the cheek, the lower jaw, and the chin.

[0129] The deformation modes corresponding to different deformation positions also vary according to the characteristics of the deformation positions.

[0130] For example, if the entire eye is deformed, deformation methods may include adjusting the overall eye proportions, eye angle, and distance between the eyes. For the outer canthus, deformation methods may include adjusting the outer canthus extension position, the outer canthus tilt angle, and the opening and closing ratio between the upper and lower eyelids corresponding to the outer canthus. For the inner canthus, deformation methods may include adjusting the inner canthus depth, the inner canthus tilt angle, and the opening and closing ratio between the upper and lower eyelids corresponding to the inner canthus. For the undereye bags, deformation methods may include adjusting their position, width, and length. For the eyeball, deformation methods may include adjusting its size, degree of depression, position, and color.

[0131] Each deformation method can also correspond to a deformation amplitude. For example, if the deformation location is the under-eye bag, and the deformation method is to adjust the width of the under-eye bag, the corresponding deformation amplitude can be any value within a certain deformation amplitude range. The deformation amplitude range is, for example, 70% to 150%. If the corresponding deformation amplitude is 90%, the width of the under-eye bag is adjusted to 90% of the original width.

[0132] When obtaining the target three-dimensional deformation parameters, for example, the following method can be used:

[0133] Through the first parameter setting control, you can input the target three-dimensional deformation parameters.

[0134] A parameter setting panel is displayed in the third area of ​​the graphical user interface; the parameter setting panel includes: a first parameter setting control for setting three-dimensional deformation parameters corresponding to multiple facial parts respectively;

[0135] In response to a setting operation performed on the first parameter setting control corresponding to any target facial part, a target three-dimensional deformation parameter corresponding to the target facial part is determined.

[0136] See also Figure 3a and Figure 3b As shown, the embodiments of the present disclosure provide a specific example of displaying a first 3D face model in a first area of ​​a graphical user interface and a first preview image in a second area. In this example, 31 represents the first area, 32 represents the first 3D face model, 33 represents the second area, and 34 represents the first preview image.

[0137] like Figure 3a and Figure 3b In the example shown, a specific example of displaying the parameter setting panel in the third area is shown. Figure 3a and Figure 3b In the figure, 35 represents the third area, and 36 represents the parameter setting panel. The parameter setting panel displays the first parameter setting control, which includes all deformation items. Each deformation item corresponds to a corresponding background information (BS) information, and each BS information corresponds to a target 3D deformation parameter. The target 3D deformation parameter ranges from 0 to 100. The user can change the deformation effect value by dragging the slider with the mouse or entering the value via keyboard input. The deformation effect corresponding to the parameter 0-100 is dynamically controllable. The deformation item input window supports modifying the deformation effect parameter. The minimum parameter value is 0. If the parameter is set to 0, it indicates that the deformation item corresponding to the first 3D facial model has no deformation effect or has a minimum deformation effect. At this time, the facial part corresponding to the deformation item is the same as the facial part before deformation, or the difference is minimal. The maximum parameter value can be set to 100. If the parameter is set to 100, it indicates that the deformation effect set for the deformation item corresponding to the first 3D facial model has reached its maximum effect. At this time, the difference between the facial part corresponding to the deformation item and the facial part before deformation has reached its maximum.

[0138] In addition, at least two deformation items can be grouped together, wherein, according to the selection order of different deformation items, the deformation items that are prioritized in the group can be selected as the "negative interval" for the adjustment of the combination parameters, and the deformation items that are subsequently grouped can be selected as the "positive interval" for the adjustment of the combination parameters. The parameter interval of the combined deformation items is [-100, 100], the parameter interval corresponding to the deformation items of the advanced group is [-100, 0], and the parameter interval corresponding to the deformation items of the subsequent group is [0, 100]. The adjustment method is the same as the adjustment method of the above-mentioned individual deformation items. The selection method of the positive and negative intervals can also be to select the deformation items that are prioritized in the group as the "positive interval" of the combination, and to select the deformation items that are subsequently grouped as the "negative interval" of the combination. The specific setting is made by yourself according to the actual application situation and is not limited here. It is worth noting that at this time, a parameter value of 0 indicates that the deformation item corresponding to the first facial three-dimensional model has not changed.

[0139] After creating a new group, the group is displayed below the first parameter setting control. The default group name is group1, 2, 3... and so on. Click the "Ungroup" tab to disband the group and restore the deformed items in the group to their original positions before the group was created.

[0140] In another embodiment of the present disclosure, the parameter setting panel also includes: a second parameter setting control for setting display parameters, and the display parameters include at least one of the following: camera angle, background color, and three-dimensional model display size; the method also includes: based on the second parameter setting control, obtaining target display parameters; based on the target display parameters, displaying the second human face three-dimensional model.

[0141] like Figure 3a and Figure 3b In the example shown, a second parameter setting control is displayed, which includes: "Position", "Rotation", and "Scale" adjustment windows. Use the mouse to click to select the corresponding window, and use the keyboard to enter the corresponding parameters to adjust the position of the first face three-dimensional model relative to the camera, the rotation angle, and the scale ratio, etc.

[0142] Through the second parameter setting control, the user can adjust the posture of the first face three-dimensional model and / or the second face three-dimensional model in the model coordinate system, so that the user can view the specific deformation effect from multiple angles when the first face three-dimensional model is subjected to the first three-dimensional deformation processing using the target three-dimensional deformation parameters, which is conducive to the user selecting the target three-dimensional deformation parameters that meet the usage requirements.

[0143] With respect to the above S102, after the target three-dimensional deformation parameters are set, a first three-dimensional deformation process is performed on the first three-dimensional face model according to the target three-dimensional deformation parameters to obtain a second three-dimensional face model.

[0144] When performing the first 3D deformation process on the first 3D face model using the target 3D deformation parameters, for example, the following method may be used:

[0145] A target vertex corresponding to the deformation position indicated by the target three-dimensional model parameters is determined from a plurality of vertices included in the first three-dimensional face model.

[0146] A position adjustment is performed on the target vertex according to the deformation mode and deformation amplitude indicated by the target three-dimensional deformation parameter.

[0147] Exemplarily, multiple target vertices of the first human face 3D model are traversed, and according to the positions of the traversed target vertices corresponding to the first human face 3D model in the coordinate system, the face deformation position containing the multiple target vertices is divided, and according to the obtained target 3D deformation parameters, the deformation mode and deformation amplitude of the face deformation position indicated by the target 3D deformation parameters are adjusted. For example, in the first deformation process of the nose part of the first human face 3D model, see Figure 3a and Figure 3b As shown, in the first parameter setting control, there is a detailed division for the nose part, including adjustments to the size and width of the nose part. After selecting this tab, you can enter the target three-dimensional deformation parameter. The range corresponding to the adjustment target three-dimensional deformation parameter is 0-100. Here, the target three-dimensional deformation parameter 40 corresponding to the nose size in the nose part is taken as an example. After setting the target three-dimensional deformation parameter, the software will adjust the target vertex corresponding to the nose part according to the adjustment ratio corresponding to the target three-dimensional deformation parameter, and then obtain the second target face model.

[0148] For the above S103, target material is generated according to the target three-dimensional parameters, and the target material is used to deform the target facial part of the image to be processed, and a first preview image corresponding to the first three-dimensional facial model is displayed in the second area of ​​the graphical user interface; the pixel points in the first preview image are positionally transformed based on the second three-dimensional facial model to obtain a second preview image; and the second preview image is displayed.

[0149] The first preview image includes an original preview image; or an image obtained by performing a first three-dimensional deformation process on the original preview image using a parameter configuration file.

[0150] See also Figure 5 FIG. 5 is a flowchart of an image processing method provided by an embodiment of the present disclosure, wherein the method includes steps S501 to S503.

[0151] S501: Displaying an image to be processed on a graphical user interface; the image to be processed includes a target face;

[0152] S502: In response to a target material loading operation, deform the image to be processed based on the target material to obtain a first target image;

[0153] S503: Display the first target image.

[0154] For example, when the image processing method is applied to a terminal device such as a mobile phone, an image including the user's face can be captured by the camera of the terminal device, or an image including the user's face can be selected from the photo album of the terminal device, or an image including the user's face can be received from other applications installed in the terminal device.

[0155] For another example, when applying the image processing method to a live broadcast scenario, a video frame containing a human face can be identified from multiple video frames included in a video stream acquired by a live broadcast device, and the video frame containing the human face can be used as the target image. Here, the target image can, for example, consist of multiple frames, and the multiple target images can, for example, be obtained by sampling the video stream.

[0156] Among them, three-dimensional face reconstruction is performed on the image to be processed to obtain a three-dimensional facial model of the target face in the image to be processed; three-dimensional deformation processing is performed on the three-dimensional facial model based on the target deformation coefficient to obtain a target three-dimensional facial model; and position transformation processing is performed on the pixel points in the image to be processed based on the target three-dimensional facial model to obtain the first target image.

[0157] For example, taking a mobile phone as an example, by parsing the target material generated by the target software on the desktop, the number of deformation items and the corresponding effects can be customized on the mobile terminal; wherein, the target software can deform the face in the face image using the image processing method provided by the embodiment of the present disclosure. For example, see Figure 7 As shown, you can customize 1-200 deformation items according to actual needs. Specifically, the number of deformation items is defined according to the number of corresponding bs information in the fbs file, and each bs information corresponds to a deformation item. After importing to the mobile terminal, the mobile terminal can retain or delete the deformation items. Each deformation item corresponds to the "3D Micro-Plastic Surgery" tab of the mobile terminal software. Users can deform different parts of the face in the photo or video taken in real time or in the photo or video library by clicking or sliding their fingers, and save it as a photo or video in real time.

[0158] The disclosed embodiment also provides another image processing method, which comprises displaying a parameter setting panel on the graphical user interface, and displaying image data to be processed on the graphical user interface; the image data includes a target face; the parameter setting panel includes: parameter setting controls for setting three-dimensional deformation parameters corresponding to multiple facial parts; in response to an adjustment operation on the parameter controls, obtaining target three-dimensional deformation parameters corresponding to the adjustment operation; the target three-dimensional deformation parameters are used to characterize at least one of the following: a deformation position, a deformation method, and a deformation amplitude of the target facial part; performing three-dimensional deformation processing on the image data to be processed based on the target three-dimensional deformation parameters to obtain a target image; and displaying the target image.

[0159] For example, taking the execution subject as a mobile phone, see Figure 4 As shown, the embodiment of the present disclosure also provides a set of standardized solutions. The mobile terminal accesses the 3D micro plastic surgery tab of the target software to preview the 3D micro plastic surgery projects and effects, and can preview the shooting effects in real time. The standardized solution has at least 25 deformation projects, and the adjustment range of the target 3D deformation parameters corresponding to each deformation project is [-100, 100]. Figure 2 As shown, taking the mouth width in the mouth area as an example, when the user adjusts the amplitude to -100, the user can feel the minimum deformation effect corresponding to the mouth width becoming 100 smaller. When the user adjusts the amplitude to 100, the user can feel the maximum deformation effect corresponding to the mouth width becoming 100 larger.

[0160] Those skilled in the art will understand that in the above-mentioned method of the specific implementation method, the writing order of each step does not mean a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of each step should be determined by its function and possible internal logic.

[0161] Based on the same inventive concept, the embodiment of the present disclosure also provides a material generation device corresponding to the material generation method. Since the principle of solving the problem by the device in the embodiment of the present disclosure is similar to the above-mentioned material generation method in the embodiment of the present disclosure, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.

[0162] Reference Figure 6 FIG. 1 is a schematic diagram of a material generation device provided by an embodiment of the present disclosure, wherein the device includes: a display module 61, a processing module 62, and a generation module 63; wherein,

[0163] a display module 61, configured to display a first human face three-dimensional model in a first area of ​​a graphical user interface;

[0164] a processing module 62 configured to, in response to obtaining target three-dimensional deformation parameters, perform a first three-dimensional deformation process on the first three-dimensional facial model based on the target three-dimensional deformation parameters to obtain a second three-dimensional facial model; wherein the target three-dimensional deformation parameters are used to represent at least one of the following: a deformation position, a deformation method, and a deformation amplitude of the target facial part;

[0165] The display module 61 is further configured to display the second three-dimensional face model;

[0166] Generating module 63: In response to the face deformation material generating instruction, generating target material including the three-dimensional deformation parameters based on the target three-dimensional deformation parameters.

[0167] In an optional embodiment, the first three-dimensional face model includes: a plurality of vertices, and position information of the plurality of vertices in a model coordinate system;

[0168] The processing module 62 is further configured to:

[0169] Determining, from a plurality of vertices included in the first three-dimensional face model, a target vertex corresponding to a deformation position indicated by the target three-dimensional model parameter;

[0170] Performing position adjustment on the target vertex according to the deformation mode and deformation amplitude indicated by the target three-dimensional deformation parameter to obtain the second three-dimensional face model.

[0171] In an optional embodiment, the display module 61 is further used to:

[0172] A parameter setting panel is displayed in the third area of ​​the graphical user interface; the parameter setting panel includes: a first parameter setting control for setting three-dimensional deformation parameters corresponding to multiple facial parts respectively;

[0173] In response to a setting operation performed on the first parameter setting control corresponding to any target facial part, a target three-dimensional deformation parameter corresponding to the target facial part is determined.

[0174] In an optional embodiment, the parameter setting panel further includes: a second parameter setting control for setting display parameters, wherein the display parameters include at least one of the following: camera angle, background color, and three-dimensional model display size;

[0175] The display module is also used for:

[0176] A control is set based on the second parameter to obtain target display parameters; and the second three-dimensional face model is displayed based on the target display parameters.

[0177] In an optional implementation, the first three-dimensional face model includes: a standard three-dimensional face model, or a three-dimensional model obtained by deforming the standard three-dimensional face model using a preset parameter configuration file.

[0178] In an optional embodiment, the first three-dimensional face model includes a three-dimensional model obtained by performing three-dimensional deformation processing on the standard three-dimensional face model using a preset parameter configuration file;

[0179] The processing module 62 is further configured to:

[0180] In response to importing the parameter configuration file, parsing the parameter configuration file to obtain the three-dimensional deformation parameters carried in the parameter configuration file;

[0181] The standard three-dimensional face model is subjected to a first three-dimensional deformation process using the three-dimensional deformation parameters to obtain the first three-dimensional face model and a first preview image corresponding to the first three-dimensional face model.

[0182] In an optional embodiment, the parameter configuration file includes a first parameter configuration file generated using preset three-dimensional design software;

[0183] The processing module 62 is further configured to:

[0184] Based on the deformation mode represented by the original three-dimensional deformation parameters, loading a software module corresponding to the deformation mode; the software module is used to perform a first three-dimensional deformation process on the standard human face three-dimensional model;

[0185] Initializing a parameter setting panel based on the deformation position and deformation amplitude represented by the original three-dimensional deformation parameters;

[0186] Initialize and configure a target character string; wherein the target character string is used to store adjustment information of the original three-dimensional deformation parameters adjusted by the user.

[0187] In an optional embodiment, the parameter configuration file includes a second parameter configuration file obtained by adjusting original three-dimensional deformation parameters in the first parameter configuration file;

[0188] The processing module 62 is further configured to:

[0189] The target character string is parsed to obtain adjustment information for adjusting the three-dimensional deformation parameters in the first parameter configuration file; and the parameter setting panel is updated based on the adjustment information obtained by the parsing.

[0190] In an optional implementation, the processing module 62 is further configured to:

[0191] Obtaining adjusted three-dimensional deformation parameters using the adjustment information and the three-dimensional deformation parameters;

[0192] The first three-dimensional deformation process is performed on the standard three-dimensional face model using the adjusted three-dimensional deformation parameters to obtain the first three-dimensional face model.

[0193] In an optional embodiment, the display module 61 is further used to:

[0194] Displaying a first preview image corresponding to the first three-dimensional face model in a second area of ​​the graphical user interface;

[0195] In response to acquiring the target three-dimensional deformation parameters, performing a second three-dimensional deformation process on the first preview image based on the target three-dimensional deformation parameters to obtain a second preview image;

[0196] The second preview image is displayed.

[0197] In an optional implementation, the processing module 62 is further configured to:

[0198] Performing three-dimensional face reconstruction on the first preview image to obtain a third three-dimensional face model of the template face in the first preview image;

[0199] performing a first three-dimensional deformation process on the third three-dimensional face model based on the target deformation coefficient to obtain a fourth three-dimensional face model;

[0200] Perform position transformation processing on the pixels in the image to be processed based on the fourth three-dimensional face model to obtain the second preview image.

[0201] In an optional implementation, the first preview image includes an original preview image; or an image obtained by performing a first three-dimensional deformation process on the original preview image using a parameter configuration file.

[0202] Based on the same inventive concept, an image processing device corresponding to the image processing method is also provided in the embodiment of the present disclosure. Figure 7 FIG. 1 is a schematic diagram of a material generation device provided by an embodiment of the present disclosure, wherein the device includes: a display module 71 and a response module 72, wherein:

[0203] A display module 71 is used to display the image to be processed on a graphical user interface; the image to be processed includes a target face;

[0204] a response module 72 configured to, in response to a target material loading operation, perform a three-dimensional deformation process on the image to be processed based on the target material to obtain a first target image; wherein the target material is generated using the material generation method described in the above embodiment;

[0205] The display module 71 is further configured to display the first target image.

[0206] Based on the same inventive concept, another image processing device corresponding to the image processing method is provided in an embodiment of the present disclosure. The device includes: a display module 71, a response module 72, and a processing module 73, wherein:

[0207] a display module 71 for displaying a parameter setting panel on the graphical user interface and displaying image data to be processed on the graphical user interface; the image data including a target face; the parameter setting panel including parameter setting controls for setting three-dimensional deformation parameters corresponding to a plurality of facial parts;

[0208] a response module 72 for, in response to an adjustment operation on the parameter control, obtaining target three-dimensional deformation parameters corresponding to the adjustment operation; the target three-dimensional deformation parameters are used to represent at least one of the following: a deformation position, a deformation method, and a deformation amplitude of the target facial part;

[0209] A processing module 73 is configured to perform three-dimensional deformation processing on the image data to be processed based on the target three-dimensional deformation parameters to obtain a target image;

[0210] The display module 71 is further configured to display the target image.

[0211] For descriptions of the processing flow of each module in the device and the interaction flow between each module, reference can be made to the relevant descriptions in the above method embodiment, which will not be described in detail here.

[0212] The present disclosure also provides an electronic device, such as Figure 8 FIG. 1 is a schematic diagram of the electronic device structure provided by an embodiment of the present disclosure, including:

[0213] Processor 81 and memory 82; the memory 82 stores machine-readable instructions executable by the processor 81, and the processor 81 is configured to execute the machine-readable instructions stored in the memory 82. When the machine-readable instructions are executed by the processor 81, the processor 81 performs the following steps:

[0214] Displaying a first human face three-dimensional model in a first area of ​​the graphical user interface;

[0215] In response to obtaining target three-dimensional deformation parameters, performing a first three-dimensional deformation process on the first three-dimensional face model based on the target three-dimensional deformation parameters to obtain a second three-dimensional face model; wherein the target three-dimensional deformation parameters are used to represent at least one of the following: a deformation position, a deformation method, and a deformation amplitude of the target facial part;

[0216] In response to a face deformation material generation instruction, a target material including the target three-dimensional deformation parameters is generated based on the target three-dimensional deformation parameters. The target material is used to deform the target face part of the image to be processed, and the deformation effect of the image to be processed matches the deformation effect of the second three-dimensional face model.

[0217] Or follow these steps:

[0218] Displaying an image to be processed on a graphical user interface; the image to be processed includes a target face;

[0219] In response to a target material loading operation, deforming the image to be processed based on the target material to obtain a first target image; wherein the target material is generated using the material generation method according to any one of claims 1 to 10;

[0220] The first target image is displayed.

[0221] The above-mentioned memory 82 includes internal memory 821 and external memory 822; the memory 821 here is also called internal memory, which is used to temporarily store the calculation data in the processor 81 and the data exchanged with the external memory 822 such as the hard disk. The processor 81 exchanges data with the external memory 822 through the internal memory 821.

[0222] The specific execution process of the above instructions can refer to the steps of the material generation method and the image processing method described in the embodiments of the present disclosure, and will not be repeated here.

[0223] The present disclosure also provides a computer-readable storage medium having a computer program stored thereon. When executed by a processor, the computer program executes the steps of the material generation method and image processing method described in the above method embodiments. The storage medium may be a volatile or non-volatile computer-readable storage medium.

[0224] The embodiments of the present disclosure also provide a computer program product, which carries program code. The instructions included in the program code can be used to execute the steps of the material generation method and the image processing method described in the above method embodiments. For details, please refer to the above method embodiments and will not be repeated here.

[0225] The computer program product may be implemented in hardware, software, or a combination thereof. In one embodiment, the computer program product is implemented as a computer storage medium. In another embodiment, the computer program product is implemented as a software product, such as a software development kit (SDK).

[0226] The present disclosure relates to the field of augmented reality. By acquiring image information of a target object in a real-world environment, the relevant features, states, and attributes of the target object are detected or identified using various vision-related algorithms, thereby achieving an AR effect that combines virtual and real life and matches the specific application. For example, the target object may be a face, limbs, gestures, movements, etc. related to the human body, or an identifier or marker related to an object, or a sandbox, display area, or display items related to a venue or location. Vision-related algorithms may involve visual positioning, SLAM, 3D reconstruction, image registration, background segmentation, key point extraction and tracking of objects, and object pose or depth detection. Specific applications can involve not only interactive scenarios such as guided tours, navigation, explanations, reconstruction, and virtual effect overlay displays related to real scenes or objects, but also special effects processing related to people, such as makeup beautification, body beautification, special effects display, and virtual model display. Detection or identification of the relevant features, states, and attributes of the target object can be achieved using a convolutional neural network. The above-mentioned convolutional neural network is a network model obtained by model training based on a deep learning framework.

[0227] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems and devices described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. In the several embodiments provided in the present disclosure, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

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

[0229] In addition, each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

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

[0231] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present disclosure, which are used to illustrate the technical solutions of the present disclosure, rather than to limit them. The scope of protection of the present disclosure is not limited thereto. Although the present disclosure has been described in detail with reference to the above-described embodiments, those skilled in the art should understand that any person skilled in the art can modify or easily conceive of changes to the technical solutions described in the above-described embodiments within the technical scope disclosed in the present disclosure, or replace some of the technical features therein with equivalents. Such modifications, changes, or replacements do not deviate from the spirit and scope of the technical solutions of the embodiments of the present disclosure, and should be included in the scope of protection of the present disclosure. Therefore, the scope of protection of the present disclosure shall be subject to the scope of protection of the claims.

Claims

1. A material generation method, characterized in that: include: Displaying a first human face three-dimensional model in a first area of ​​the graphical user interface; In response to obtaining target three-dimensional deformation parameters, performing a first three-dimensional deformation process on the first three-dimensional face model based on the target three-dimensional deformation parameters to obtain a second three-dimensional face model; wherein the target three-dimensional deformation parameters are used to represent at least one of the following: a deformation position, a deformation method, and a deformation amplitude of the target facial part; In response to the face deformation material generation instruction, generating a target material including the target three-dimensional deformation parameters based on the target three-dimensional deformation parameters, the target material being used to deform a target facial portion of the image to be processed, such that the deformation effect of the image to be processed matches the deformation effect of the second three-dimensional face model; Acquiring the target three-dimensional deformation parameters includes: displaying a parameter setting panel in a third area of ​​the graphical user interface; the parameter setting panel including: first parameter setting controls for setting three-dimensional deformation parameters corresponding to a plurality of facial parts; and determining the target three-dimensional deformation parameters corresponding to any target facial part in response to a setting operation performed on the first parameter setting control corresponding to the target facial part; A first preview image corresponding to the first three-dimensional facial model is displayed in a second area of ​​the graphical user interface; in response to obtaining the target three-dimensional deformation parameters, a second three-dimensional deformation processing is performed on the first preview image based on the target three-dimensional deformation parameters to obtain a second preview image; and the second preview image is displayed.

2. The method according to claim 1, characterized in that The first three-dimensional face model includes: a plurality of vertices and position information of the plurality of vertices in a model coordinate system; The step of performing a first three-dimensional deformation process on the first human face three-dimensional model based on the target three-dimensional deformation parameters to obtain a second human face three-dimensional model includes: Determining, from a plurality of vertices included in the first three-dimensional face model, a target vertex corresponding to a deformation position indicated by the target three-dimensional model parameter; The target vertex is subjected to position adjustment corresponding to the deformation mode and deformation amplitude indicated by the target three-dimensional deformation parameter to obtain the second three-dimensional face model.

3. The method according to claim 1, characterized in that The parameter setting panel further includes: a second parameter setting control for setting display parameters, wherein the display parameters include at least one of the following: camera angle, background color, and three-dimensional model display size; The method further includes: setting a control based on the second parameter to obtain target display parameters; and displaying the second three-dimensional face model based on the target display parameters.

4. The method according to claim 3, characterized in that The first three-dimensional face model includes: a standard three-dimensional face model, or a three-dimensional model obtained by deforming the standard three-dimensional face model using a preset parameter configuration file.

5. The method according to claim 4, characterized in that The first three-dimensional face model includes a three-dimensional model obtained by performing three-dimensional deformation processing on the standard three-dimensional face model using a preset parameter configuration file; Before displaying the first human face 3D model in the first area of ​​the graphical user interface, the method further includes: In response to importing the parameter configuration file, parsing the parameter configuration file to obtain the three-dimensional deformation parameters carried in the parameter configuration file; The standard three-dimensional face model is subjected to a first three-dimensional deformation process using the three-dimensional deformation parameters to obtain the first three-dimensional face model and a first preview image corresponding to the first three-dimensional face model.

6. The method according to claim 5, characterized in that The parameter configuration file includes a first parameter configuration file generated by using preset three-dimensional design software; After parsing the parameter configuration file to obtain the original three-dimensional deformation parameters carried in the parameter configuration file, the method further includes at least one of the following: Based on the deformation mode represented by the original three-dimensional deformation parameters, loading a software module corresponding to the deformation mode; The software module is used to perform a first three-dimensional deformation process on the standard three-dimensional face model; Initializing a parameter setting panel based on the deformation position and deformation amplitude represented by the original three-dimensional deformation parameters; Initialize and configure a target character string; wherein the target character string is used to store adjustment information of the original three-dimensional deformation parameters adjusted by the user.

7. The method according to claim 6, characterized in that The parameter configuration file includes a second parameter configuration file obtained by adjusting the original three-dimensional deformation parameters in the first parameter configuration file; After parsing the parameter configuration file to obtain the original three-dimensional deformation parameters carried in the parameter configuration file, the method further includes: parsing the target character string to obtain adjustment information for adjusting the three-dimensional deformation parameters in the first parameter configuration file; The parameter setting panel is updated based on the adjustment information obtained through analysis.

8. The method according to claim 7, characterized in that The step of performing a first three-dimensional deformation process on the standard three-dimensional face model by using the three-dimensional deformation parameters to obtain the first three-dimensional face model includes: Obtaining adjusted three-dimensional deformation parameters using the adjustment information and the three-dimensional deformation parameters; The first three-dimensional deformation process is performed on the standard three-dimensional face model using the adjusted three-dimensional deformation parameters to obtain the first three-dimensional face model.

9. The method according to claim 1, characterized in that The performing a second three-dimensional deformation process on the first preview image based on the target three-dimensional deformation parameter to obtain the second preview image includes: Performing three-dimensional face reconstruction on the first preview image to obtain a third three-dimensional face model of the template face in the first preview image; performing a first three-dimensional deformation process on the third three-dimensional face model based on the target deformation coefficient to obtain a fourth three-dimensional face model; Perform position transformation processing on the pixels in the image to be processed based on the fourth three-dimensional face model to obtain the second preview image.

10. The method according to claim 1, characterized in that The first preview image includes an original preview image; or an image obtained by performing a first three-dimensional deformation process on the original preview image using a parameter configuration file.

11. An image processing method, characterized in that: include: Display the image to be processed in the graphical user interface; The image to be processed includes a target face; In response to a target material loading operation, deforming the image to be processed based on the target material to obtain a first target image; wherein the target material is generated using the material generation method according to any one of claims 1 to 8; The first target image is displayed.

12. The method according to claim 11, characterized in that The target material includes target three-dimensional deformation parameters, and performing three-dimensional deformation processing on the image to be processed based on the target material to obtain a first target image includes: Performing three-dimensional face reconstruction on the image to be processed to obtain a three-dimensional face model of a target face in the image to be processed; performing a first three-dimensional deformation process on the three-dimensional face model based on the target deformation coefficient to obtain a target three-dimensional face model; The pixel points in the image to be processed are subjected to position transformation processing based on the target face three-dimensional model to obtain the first target image.

13. A material generating device, characterized in that: The device comprises: A first display module, configured to display a first human face three-dimensional model in a first area of ​​a graphical user interface; a processing module configured to, in response to acquiring target three-dimensional deformation parameters, perform a first three-dimensional deformation process on the first three-dimensional facial model based on the target three-dimensional deformation parameters to obtain a second three-dimensional facial model; wherein the target three-dimensional deformation parameters are used to represent at least one of the following: a deformation position, a deformation method, and a deformation amplitude of the target facial part; a generating module, configured to generate, in response to a face deformation material generating instruction, a target material including the target three-dimensional deformation parameters based on the target three-dimensional deformation parameters, the target material being used to deform a target facial portion of the image to be processed, such that the deformation effect of the image to be processed matches the deformation effect of the second three-dimensional face model; The first display module is further configured to: display a parameter setting panel in a third area of ​​the graphical user interface; the parameter setting panel including: first parameter setting controls for setting three-dimensional deformation parameters corresponding to a plurality of facial parts; and in response to a setting operation performed on the first parameter setting control corresponding to any target facial part, determining a target three-dimensional deformation parameter corresponding to the target facial part; The first display module is also used to: display a first preview image corresponding to the first three-dimensional facial model in the second area of ​​the graphical user interface; in response to obtaining the target three-dimensional deformation parameters, perform a second three-dimensional deformation processing on the first preview image based on the target three-dimensional deformation parameters to obtain a second preview image; and display the second preview image.

14. An image processing device, characterized in that: include: A second display module is used to display the image to be processed on the graphical user interface; The image to be processed includes a target face; a response module, configured to, in response to a target material loading operation, perform three-dimensional deformation processing on the image to be processed based on the target material to obtain a first target image; wherein the target material is generated using the material generation method according to any one of claims 1 to 10; The second display module is further configured to display the first target image.

15. An electronic device, characterized in that: include: A processor and a memory, wherein the memory stores machine-readable instructions executable by the processor, and the processor is used to execute the machine-readable instructions stored in the memory. When the machine-readable instructions are executed by the processor, the processor executes the steps of the material generation method according to any one of claims 1 to 10, or executes the steps of the image processing method according to any one of claims 11 to 12.

16. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program. When the computer program is executed by an electronic device, the electronic device executes the steps of the material generation method according to any one of claims 1 to 10, or executes the steps of the image processing method according to any one of claims 11-12.

Citation Information

Patent Citations

  • Image processing method and device, electronic equipment and storage medium

    CN108765351A

  • Face image processing method and device, electronic equipment and storage medium

    CN113409454A