Facial customization method and apparatus, electronic device, and readable medium

By merging the vertex information and texture maps of the facial contour model and the facial feature model to generate a facial model, the problem of limited facial customization range in the existing technology is solved, and higher degrees of freedom and better customization effects are achieved.

CN113920236BActive Publication Date: 2025-10-17NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111177134.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-09
Publication Date
2025-10-17
Estimated Expiration
2041-10-09

AI Technical Summary

Technical Problem

The facial customization function in the existing technology cannot achieve significant differences, resulting in a limited range of user facial customization.

Method used

By obtaining the facial contour model and facial feature model, merging their vertex information and texture maps, a facial model is generated, providing a wider range of customization and higher degrees of freedom.

Benefits of technology

This expands the range of facial customization and improves the degree of freedom, reduces the computing resource requirements of the rendering process, and provides better customization effects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113920236B_ABST
    Figure CN113920236B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a face customization method and device, electronic equipment and readable medium, the method comprises: obtaining a face contour model and at least one facial feature model; merging contour vertex information of the face contour model with facial feature vertex information of the facial feature model to obtain face vertex information of a face model; merging contour texture maps corresponding to the face contour model with facial feature texture maps corresponding to the facial feature model to obtain a face texture map corresponding to the face model; and rendering the face model using the face vertex information of the face model and the corresponding face texture map. The face customization function with greater customization range and higher degree of freedom can be provided for the user, and the face customization effect can be better.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of three-dimensional technology, and in particular, to a face customization method, a face customization device, an electronic device, and a computer readable medium. BACKGROUND

[0002] In the prior art, a face customization function can be provided for a user in a three-dimensional model to meet the user's personalized needs. Generally, in the process of customizing a face, the user usually adjusts the skeletal information in the face model or the texture map of the face model to change the features of the face model, thereby realizing the face customization function.

[0003] However, the face customization function usually needs to be adjusted based on an existing face model, in which case the face customization function usually cannot make the adjusted face significantly different from the original face, resulting in a limited range of face customization for the user. SUMMARY

[0004] Embodiments of the present application provide a face customization method, device, electronic device, and computer readable storage medium to solve the problem of a limited range of face customization.

[0005] Embodiments of the present application disclose a face customization method, comprising:

[0006] obtaining a face contour model and at least one feature model;

[0007] merging contour vertex information of the face contour model and feature vertex information of the feature model to obtain face vertex information of a face model;

[0008] merging a contour texture map corresponding to the face contour model and a feature texture map corresponding to the feature model to obtain a face texture map corresponding to the face model;

[0009] rendering the face model using the face vertex information of the face model and the corresponding face texture map.

[0010] Optionally, the contour vertex information includes contour skeletal information and contour position information, the feature vertex information includes feature skeletal information and feature position information, and the face vertex information includes face skeletal information.

[0011] The step of merging the contour vertex information of the face contour model and the feature vertex information of the feature model to obtain the face vertex information of the face model comprises:

[0012] determining the face skeletal information in the face vertex information based on the contour skeletal information and the feature skeletal information.

[0013] determine index information corresponding to the face vertex information based on the contour position information and the facial feature position information.

[0014] Optionally, the step of merging the contour skeleton information and the facial feature skeleton information to obtain the face skeleton information comprises:

[0015] merging facial feature skeleton information different from the contour skeleton information with the contour skeleton information to determine skeleton order information;

[0016] updating face skeleton information in the face vertex information based on the skeleton order information.

[0017] Optionally, the step of determining index information corresponding to the face vertex information based on the contour position information and the facial feature position information comprises:

[0018] identifying whether a distance between the face position information and the facial feature position information is less than a preset threshold value;

[0019] if the distance between the face position information and the facial feature position information is less than the preset threshold value, merging face vertex information corresponding to the face contour model and facial feature vertex information of the facial feature model into the same index.

[0020] Optionally, the method further comprises:

[0021] merging the face vertex information of the face contour model and the facial feature vertex information of the facial feature model into the same vertex buffer to obtain a vertex buffer of the face model; and / or,

[0022] merging contour normal information of the face contour model and facial feature normal information of the facial feature model to obtain face normal information of the face model.

[0023] Optionally, the step of merging contour texture maps corresponding to the face contour model and facial feature texture maps corresponding to the facial feature model to obtain face texture maps corresponding to the face model comprises:

[0024] merging the contour texture maps corresponding to the face contour model and the facial feature texture maps corresponding to the facial feature model into face texture maps, and recording a face type corresponding to a pixel point in the face texture maps by using a color value; the face type comprises a face contour and / or a facial feature.

[0025] Optionally, the method further comprises:

[0026] adjusting texture mapping information in the face vertex information according to the face type corresponding to the pixel point in the face texture maps.

[0027] Optionally, the method further comprises:

[0028] In the face vertex information of the face model, the facial feature vertex information corresponding to the facial feature model is deleted;

[0029] In the face texture map of the face model, the facial feature texture map corresponding to the facial feature model is deleted.

[0030] The embodiment of the present application further discloses a face customization device, comprising:

[0031] The face contour model and the at least one facial feature model are acquired by the acquiring module;

[0032] The contour vertex information of the face contour model and the facial feature vertex information of the facial feature model are merged by the vertex merging module to obtain the face vertex information of the face model;

[0033] The contour texture map corresponding to the face contour model and the facial feature texture map corresponding to the facial feature model are merged by the texture map merging module to obtain the face texture map corresponding to the face model;

[0034] The face model is rendered by the rendering module by using the face vertex information of the face model and the face texture map corresponding thereto.

[0035] Optionally, the contour vertex information comprises contour skeleton information and contour position information, the facial feature vertex information comprises facial feature skeleton information and facial feature position information, and the face vertex information comprises face skeleton information;

[0036] The vertex merging module comprises:

[0037] The face skeleton determining submodule is configured to determine the face skeleton information in the face vertex information based on the contour skeleton information and the facial feature skeleton information;

[0038] The index determining submodule is configured to determine the index information corresponding to the face vertex information based on the contour position information and the facial feature position information.

[0039] Optionally, the face skeleton determining submodule comprises:

[0040] The order determining unit is configured to merge the facial feature skeleton information different from the contour skeleton information with the contour skeleton information to determine skeleton order information;

[0041] The updating unit is configured to update the face skeleton information in the face vertex information based on the skeleton order information.

[0042] Optionally, the index determining submodule comprises:

[0043] A distance identifying unit is configured to identify whether a distance between the face position information and the facial feature position information is less than a preset threshold value.

[0044] An index merging unit is configured to merge the face vertex information corresponding to the face contour model and the facial feature vertex information of the facial feature model into the same index if the distance between the face position information and the facial feature position information is less than the preset threshold value.

[0045] Optionally, the device further comprises:

[0046] A buffer merging module is configured to merge the face vertex information of the face contour model and the facial feature vertex information of the facial feature model into the same vertex buffer to obtain the vertex buffer of the face model; and / or,

[0047] A normal merging module is configured to merge the contour normal information of the face contour model and the facial feature normal information of the facial feature model to obtain the face normal information of the face model.

[0048] Optionally, the texture map merging module comprises:

[0049] A texture map merging submodule is configured to merge the contour texture map corresponding to the face contour model and the facial feature texture map corresponding to the facial feature model into a face texture map, and record the face type corresponding to a pixel point in the face texture map by using a color value; the face type comprises a face contour and / or a facial feature.

[0050] Optionally, the device further comprises:

[0051] A texture mapping adjusting module is configured to adjust the texture mapping information in the face vertex information according to the face type corresponding to a pixel point in the face texture map.

[0052] Optionally, the device further comprises:

[0053] A vertex deleting module is configured to delete at least one facial feature vertex information corresponding to the facial feature model in the face vertex information of the face model.

[0054] A texture map deleting module is configured to delete the facial feature texture map corresponding to the facial feature model in the face texture map of the face model.

[0055] The embodiment of the present application further discloses an electronic device comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory complete communication with each other through the communication bus.

[0056] The memory is used for storing a computer program.

[0057] The processor is used for executing the program stored on the memory to realize the method as described in the embodiments of the present application.

[0058] The embodiments of the present application also disclose one or more computer readable media having instructions stored thereon, which, when executed by one or more processors, cause the processors to perform the method as described in the embodiments of the present application.

[0059] The embodiments of the present application have the following advantages:

[0060] By the face customization method, the face contour model and the at least one facial feature model are acquired; the contour vertex information of the face contour model and the facial feature vertex information of the facial feature model are merged to obtain face vertex information of a face model, and the vertices of the face contour model and the vertices of the facial feature model are fused into an entirety; the contour texture map corresponding to the face contour model and the facial feature texture map corresponding to the facial feature model are merged to obtain a face texture map corresponding to the face model, so that the computing resources required in a subsequent rendering process are reduced; and the face model is rendered by using the face vertex information of the face model and the corresponding face texture map. The face customization method can provide a face customization function with a large customizable range and high freedom for a user, and can have a good face customization effect. BRIEF DESCRIPTION OF DRAWINGS

[0061] Figure 1 is a step flowchart of a face customization method provided in the embodiments of the present application;

[0062] Figure 2 is a schematic diagram of a face contour model provided in the embodiments of the present application;

[0063] Figure 3 is a step flowchart of another face customization method provided in the embodiments of the present application;

[0064] Figure 4 is a structural block diagram of a face customization device provided in the embodiments of the present application;

[0065] Figure 5 is a block diagram of an electronic device provided in the embodiments of the present application;

[0066] Figure 6 is a schematic diagram of a computer readable medium provided in the embodiments of the present application. DETAILED DESCRIPTION

[0067] In order to make the above objectives, features and advantages of the present application more apparent, further specific embodiments of the present application will be described in detail below with reference to the drawings and specific embodiments.

[0068] In the case that the face customization function is limited, the face model is decomposed into a face contour model and a facial feature model in the embodiment of the present application. The user can freely select different face contour models and facial feature models to customize the face. The face customization method does not need to be adjusted based on the existing face model, and the face customization can have a wider range and higher degree of freedom, and the user can more easily customize the preferred face model.

[0069] Referring to Figure 1 , a step flowchart of a face customization method provided in the embodiment of the present application is shown, and can specifically include the following steps:

[0070] Step 101, obtaining a face contour model and at least one facial feature model;

[0071] In the embodiment of the present application, the face customization function can be customized based on the face contour model and the facial feature model. A plurality of different styles of face contour models and facial feature models can be prepared, so that the user can select the preferred face contour model and at least one facial feature model from the prepared face contour models and facial feature models. Thus, the user-selected face contour model and at least one facial feature model can be obtained.

[0072] Specifically, as Figure 2 shown, the face contour model can be a model that forms the face contour part in the face model, which can not include the facial feature part in the face model. The facial feature model can be a model that forms the facial feature part in the face model. The facial feature model can include an eye model, a nose model, an ear model, a mouth model, a brow model, etc., which are not limited by the present application.

[0073] In a specific implementation, in order to ensure that the face contour model and the facial feature model can obtain a more natural effect after being combined, the face contour model and the facial feature model can be generated based on the same skeleton. Generally, the skeletons of the face contour models can be different, and the facial feature model can be generated based on the same skeleton information as a face contour model, so that the facial feature model can be used on the face contour model generated based on the same skeleton.

[0074] Step 102, combining contour vertex information of the face contour model with facial feature vertex information of the facial feature model to obtain face vertex information of the face model;

[0075] In an embodiment of the present invention, after a user determines their preferred facial contour model and at least one facial feature model, the facial contour model and the facial feature model can be merged to obtain a facial model that includes the facial features. Thus, the contour vertex information of the facial contour model can be first merged with the facial feature vertex information of the facial feature model to obtain the facial vertex information of the facial model. This allows the vertex information forming the model surface to be combined into a single entity, allowing the subsequent generation of a facial model that integrates the facial features and the facial contour.

[0076] Specifically, because the facial contour model and the facial feature model are based on the same skeleton, the positions of the vertices of the facial feature model require no or only minor adjustments, effectively matching the facial contour model. Consequently, the contour vertex information of the facial contour model and the facial feature vertex information of the facial feature model can be stored in the same vertex buffer, and the index information corresponding to the contour vertex information of the facial contour model and the facial feature vertex information of the facial feature model can be merged to obtain the facial vertex information of the facial model.

[0077] Step 103, merging the contour texture map corresponding to the facial contour model and the facial feature texture map corresponding to the facial feature model to obtain a facial texture map corresponding to the facial model;

[0078] In this embodiment of the present invention, while merging the contour vertex information of the facial contour model with the facial feature vertex information of the facial feature model, the contour texture map corresponding to the facial contour model and the facial feature texture maps corresponding to the facial feature model can also be merged to obtain a facial texture map corresponding to the facial model. Consequently, when subsequently rendering the facial model, the facial model can be rendered based on a single facial texture map, rather than multiple rendering maps, thereby reducing computational resources required for the subsequent rendering process.

[0079] Step 104 : Render and generate the facial model using the facial vertex information of the facial model and its corresponding facial texture map.

[0080] In an embodiment of the present invention, after the facial vertex information and facial texture map of the facial model are merged, the facial contour model and the facial feature model are considered to have been merged, resulting in a facial model comprising the facial contour portion and the facial features. The facial vertex information of the facial model and its corresponding facial texture map can then be used to render and generate the facial model. This allows the customized facial model to be displayed to the user in three-dimensional space, thereby providing users with a higher degree of freedom in facial customization.

[0081] In a specific implementation, after merging the facial model's facial vertex information and facial texture map, the facial vertex information can be stored in a vertex stream, and the facial texture map is a single image. As a result, the computing resources required to render the facial model are similar to those of existing facial customization methods, without adding additional computing resource overhead. Simultaneously, facial feature customization using a facial contour model and at least one facial feature model effectively expands the scope of facial customization, providing greater flexibility.

[0082] The facial customization method of the embodiment of the present invention obtains a facial contour model and at least one facial feature model; merges the contour vertex information of the facial contour model with the facial feature vertex information of the facial feature model to obtain facial vertex information of the facial model; and fuses the vertices of the facial contour model and the facial feature model into a whole; merges the contour texture map corresponding to the facial contour model with the facial feature texture map corresponding to the facial feature model to obtain a facial texture map corresponding to the facial model, thereby reducing the computing resources required for subsequent rendering; and uses the facial vertex information of the facial model and its corresponding facial texture map to render and generate the facial model. This method provides users with a facial customization function with a wide customizable range, high degree of freedom, and excellent facial customization results.

[0083] Reference Figure 3 , shows a flowchart of another facial customization method provided in an embodiment of the present invention, which may specifically include the following steps:

[0084] Step 301, obtaining a facial contour model and at least one facial feature model;

[0085] In an embodiment of the present invention, facial customization can be achieved based on a facial contour model and facial feature models. A variety of facial contour models and facial feature models of varying styles can be prepared, allowing the user to select a preferred facial contour model and at least one facial feature model from the prepared facial contour models and facial feature models. The user's selected facial contour model and at least one facial feature model can then be obtained.

[0086] Specifically, the facial contour model may be the model that forms the facial contour portion of the facial model and may not include the facial features of the facial model. The facial features model may be the model that forms the facial features of the facial model. The facial features model may include an eye model, a nose module, an ear model, a mouth model, an eyebrow model, etc., and the present invention does not limit this.

[0087] In a specific implementation, in order to ensure that the facial contour model and the facial feature model can be combined to obtain a relatively natural effect, the facial contour model and the facial feature model can be generated based on the same skeleton. Generally, the skeletons of the facial contour models can be different, and the facial feature model can be generated based on the same skeleton information as a facial contour model, so that the facial feature model can be used on the facial contour model generated based on the same skeleton.

[0088] In step 302, the facial skeleton information in the facial vertex information is determined based on the contour skeleton information and the facial feature skeleton information.

[0089] In the embodiment of the present application, in order to combine the contour vertex information of the facial contour model and the facial feature vertex information of the facial feature model to obtain the facial vertex information, the skeleton information and index information recorded in the contour vertex information and the facial feature vertex information need to be adjusted, so that the contour vertex information and the facial feature vertex information can be combined into unified facial vertex information, so as to generate the facial model in subsequent rendering.

[0090] In the embodiment of the present application, in order to combine the contour vertex information of the facial contour model and the facial feature vertex information of the facial feature model to obtain the facial vertex information, the skeleton information and index information recorded in the contour vertex information and the facial feature vertex information need to be adjusted, so that the contour vertex information and the facial feature vertex information can be combined into unified facial vertex information, so as to generate the facial model in subsequent rendering.

[0091] Specifically, the facial contour model and the facial feature model can have a skeleton, and the vertices on the facial contour model and the facial feature model can follow the movement of the skeleton when moving, so that the contour skeleton information can record the skeleton corresponding to each vertex in the facial contour model, and the facial feature skeleton information can record the skeleton corresponding to each vertex in the facial feature model. The facial vertex information can record the skeleton corresponding to each vertex in the facial model.

[0092] The facial contour model and the facial feature model are generated based on the same skeleton, and the facial contour model and the facial feature model can contain part of the skeleton in the skeleton, so that the contour skeleton information contained in the contour vertex information can be the same as part of the facial feature skeleton information contained in the facial feature vertex information. For example, the contour skeleton information contained in the contour vertex information can be skeleton A, skeleton B, skeleton C, and skeleton D, and the facial feature skeleton information contained in the facial feature vertex information can be skeleton A, skeleton B, skeleton C, skeleton D, skeleton E, and skeleton F, so that the contour skeleton information and the facial feature skeleton information can both contain skeleton A, skeleton B, skeleton C, and skeleton D, and there is part of the different skeleton information.

[0093] In this case, in the process of combining the facial contour model and the at least one facial feature model, the facial skeleton information corresponding to each facial vertex information can be determined based on the contour skeleton information and the facial feature skeleton information, so that the facial vertex information can be correctly corresponding to the skeleton information.

[0094] In an embodiment of the present application, the step of merging the contour skeleton information and the facial feature skeleton information to obtain the face skeleton information comprises:

[0095] S11, merging the facial feature skeleton information different from the contour skeleton information with the contour skeleton information to determine skeleton sequence information;

[0096] In an embodiment of the present application, the skeletons in the model can be arranged in a preset sequence, and each skeleton can be assigned with identification information associated with the arrangement sequence, so that the contour skeleton information and the facial feature skeleton information can contain the identification information. In the process of merging the face contour model and the at least one facial feature model, the identification information recorded in the contour skeleton information can conflict with the identification information recorded in the facial feature skeleton information. For example, the same identification is used to mark different skeletons, or different identifications are used to mark the same skeleton. Therefore, in order to avoid the conflict between the contour skeleton information of the face contour model and the facial feature skeleton information of the facial feature model, which leads to the failure of subsequent model merging, the facial feature skeleton information different from the contour skeleton information can be merged with the contour skeleton information to determine the skeleton sequence information.

[0097] Specifically, the identification information of the skeleton in the contour skeleton information can be taken as the skeleton sequence information, and then the contour skeleton information and the facial feature skeleton information are compared to determine whether the skeleton corresponding to the facial feature skeleton information is the same as the skeleton corresponding to the contour skeleton information. If the skeleton corresponding to the facial feature skeleton information is the same as the skeleton corresponding to the contour skeleton information, it can be considered that the identification corresponding to the facial feature skeleton information has been determined, and the skeleton sequence information does not need to be adjusted. If the skeleton corresponding to the facial feature skeleton information is different from the skeleton corresponding to the contour skeleton information, the identification information of the skeleton needs to be added in the skeleton sequence information. Therefore, the contour skeleton information and the facial feature skeleton information can be merged, and the skeleton sequence information corresponding to the contour skeleton information and the facial feature skeleton information can be determined, so as to further determine the identification information in the face skeleton information.

[0098] In a specific implementation, the skeleton sequence information can first be arranged for the contour skeleton information, and then the facial feature skeleton information is arranged on the basis of the contour skeleton information. Therefore, on the basis of the original identification information of the facial feature skeleton information, the value corresponding to the number of the contour skeleton information can be offset to obtain the new identification information of the facial feature skeleton information. For example, if the contour skeleton information has a total of 100, which occupies 1-100 in the skeleton sequence information, in the case of needing to assign new identification information to the facial feature skeleton information, the original identification information "1" of the facial feature skeleton information can be offset by 100, the number of the contour skeleton information, to obtain new identification information "101", so as to realize the merging of the contour skeleton information and the facial feature skeleton information.

[0099] S12, update the face skeleton information in the face vertex information based on the skeleton identification and sequence information.

[0100] In the embodiment of the present application, the contour vertex information of the face contour model and the facial feature vertex information of the facial feature model are combined to obtain the face skeleton information of the face model. Then, the face skeleton information in the face vertex information is updated based on the skeleton identification and sequence information, so that the identification information of the skeleton corresponding to the face skeleton information is the same as the identification of the skeleton in the skeleton sequence information, to ensure that the face skeleton information can correctly record the related information of the corresponding skeleton, and the combination of the contour vertex information of the face contour model and the facial feature vertex information of the facial feature model is completed.

[0101] In the specific implementation, the contour vertex information is taken as the face vertex information, and then in the process of sequentially adding the facial feature vertex information as the face vertex information, it is determined whether the identification information of the skeleton recorded in the facial feature vertex information is the same as the identification of the skeleton in the skeleton sequence information. If not, the identification information of the skeleton recorded in the facial feature vertex information is adjusted, and then the facial feature vertex information is taken as the face vertex information, so that the combination of the contour vertex information of the face contour model and the facial feature vertex information of the facial feature model is completed.

[0102] Step 303, determining the index information corresponding to the face vertex information based on the contour position information and the facial feature position information;

[0103] In the embodiment of the present application, in the process of generating the face model based on the vertex, the index information needs to be used to determine the vertex that constitutes the face. For example, if the vertex A, the vertex B and the vertex C are recorded in an index information, it can be determined that the vertex A, the vertex B and the vertex C constitute a face.

[0104] In order to fuse the face contour model and the facial feature model into the face model, it is necessary to re-determine the index information of each point, record the vertices with similar positions in the same index, so that the vertices with similar positions can be connected to form a face, and the face contour model and the facial feature model can be fused. Therefore, the index information corresponding to the face vertex information can be determined based on the contour position information and the facial feature position information.

[0105] In an embodiment of the present application, the determination of the index information corresponding to the face vertex information based on the contour position information and the facial feature position information comprises:

[0106] S21, identifying whether the distance between the face position information and the facial feature position information is less than a preset threshold;

[0107] In the embodiment of the present application, whether the distance between the facial position information and the facial feature position information is less than a preset threshold value can be identified first to determine whether the distance between the contour vertex information and the facial feature vertex information is similar.

[0108] Specifically, the contour vertex information can include contour position information, and the facial feature vertex information can include facial feature position information. Thus, the distance between the vertices can be determined directly based on the contour position information of the contour vertex information and the facial feature position information of the facial feature vertex information.

[0109] In S22, if the distance between the facial position information and the facial feature position information is less than a preset threshold value, the facial vertex information corresponding to the facial contour model and the facial feature vertex information of the facial feature model are merged into the same index.

[0110] In the embodiment of the present application, if the distance between the facial position information and the facial feature position information is less than a preset threshold value, it can be considered that the distance between the facial vertex information corresponding to the facial position information and the facial feature vertex information corresponding to the facial feature position information is similar. At this time, the facial vertex information corresponding to the facial contour model and the facial feature vertex information of the facial feature model can be merged into the same index to make the facial contour model and the facial feature model be fused.

[0111] Specifically, the facial vertex information corresponding to the facial contour model and the facial feature vertex information of the facial feature model are merged into the same index. After that, in the process of rendering the model, the vertices in the same index can be connected to each other to form a face, so that the facial contour model and the facial feature model can be fused.

[0112] In an embodiment of the present application, the method further comprises:

[0113] In S31, the facial vertex information of the facial contour model and the facial feature vertex information of the facial feature model are merged into the same vertex buffer to obtain a vertex buffer of the facial model; and / or,

[0114] In the embodiment of the present application, the vertex buffer can be used to store the vertex information. When the facial vertex information corresponding to the facial contour model and the facial feature vertex information of the facial feature model need to be merged, the facial vertex information of the facial contour model and the facial feature vertex information of the facial feature model can be merged into the same vertex buffer to obtain a vertex buffer of the facial model, so that the vertices in the same vertex buffer can be rendered subsequently to obtain the facial model.

[0115] In S32, the contour normal information of the facial contour model and the facial feature normal information of the facial feature model are merged to obtain facial normal information of the facial model.

[0116] In the embodiment of the present application, the model can have normal information which can be used to determine the light reflection direction of the model. The face contour model can also record contour normal information. The facial feature model can record facial feature normal information. After the contour vertex information of the face contour model is combined with the facial feature vertex information of the facial feature model, the contour normal information and the facial feature normal information can also be combined to obtain the face normal information of the face model to determine the light reflection direction of the face model, so that the light direction of the face model can be unified to present the face model with a whole sense.

[0117] In step 304, the contour texture map corresponding to the face contour model is combined with the facial feature texture map corresponding to the facial feature model to obtain the face texture map corresponding to the face model.

[0118] In the embodiment of the present application, while the contour vertex information of the face contour model is combined with the facial feature vertex information of the facial feature model, the contour texture map corresponding to the face contour model can also be combined with the facial feature texture map corresponding to the facial feature model to obtain the face texture map corresponding to the face model. Thus, when the face model is rendered subsequently, the face model can be rendered based on a single face texture map instead of multiple rendering maps, reducing the calculation resources of the subsequent rendering process.

[0119] In an embodiment of the present application, the step of combining the contour texture map corresponding to the face contour model with the facial feature texture map corresponding to the facial feature model to obtain the face texture map corresponding to the face model comprises:

[0120] In step S41, the contour texture map corresponding to the face contour model is combined with the facial feature texture map corresponding to the facial feature model into a face texture map, and the face type corresponding to a pixel point is recorded in the face texture map by using a color value; the face type includes the face contour and / or the facial feature.

[0121] In the embodiment of the present application, the contour texture map corresponding to the face contour model can be combined with the facial feature texture map corresponding to the facial feature model into a face texture map, and the face type corresponding to a pixel point can be recorded in the face texture map by using a color value, so that the texture map corresponding to different face types of the face model can be determined based on the color value of the pixel.

[0122] In a specific implementation, the color value of a pixel point can be represented by an RGBA value. Generally, an RGBA value includes a red (Red), green (Green), blue (Blue), and an opacity parameter channel (Alpha). The color of a pixel point can be represented by an RGB value, and the face type corresponding to the pixel point can be represented by an Alpha channel value. Thus, the five features or contours corresponding to each part in the face texture map can be quickly determined based on the Alpha channel value in the face texture map.

[0123] In an embodiment of the present application, the method further comprises:

[0124] S51, adjusting the texture mapping information in the face vertex information according to the face type corresponding to a pixel point in the face texture map.

[0125] In an embodiment of the present application, after the face texture map is obtained by merging, the texture mapping information in the face vertex information can be adjusted according to the face type corresponding to a pixel point in the face texture map, so that each vertex in the face vertex information can correctly correspond to the face texture map.

[0126] In a specific implementation, the region of different face types in the face texture map can be determined based on the color value of a pixel point in the face texture map, and then the texture mapping relationship between the pixel coordinates in the face texture map and the corresponding vertices in the face vertex information can be determined based on the texture mapping relationship between the pixel coordinates and the vertices in the original contour texture map and the five feature texture map, so as to adjust the texture mapping information.

[0127] S305, generating the face model by rendering using the face vertex information of the face model and the corresponding face texture map.

[0128] In an embodiment of the present application, after the face vertex information and the face texture map of the face model are obtained by merging, it can be considered that the face contour model and the five feature model are completed by merging, and the face model containing the face contour part and the five feature part is obtained. At this time, the face model can be generated by rendering using the face vertex information of the face model and the corresponding face texture map, so that the face model customized by the user can be displayed in the three-dimensional space, thereby providing the user with a face customization function with high degree of freedom.

[0129] In a specific implementation, after the face vertex information and the face texture map of the face model are obtained by merging, the face vertex information can be stored in a vertex stream, and the face texture map is a single one, so that the required computing resources for rendering the face model are similar to those of the original face customization method, and no additional computing resource overhead is added. Meanwhile, the customization of the five organs by the face contour model and the at least one five-organ model can effectively expand the customizable range of face customization and provide a face customization function with higher degrees of freedom.

[0130] In an embodiment of the present application, the method further comprises:

[0131] S61, in the face vertex information of the face model, deleting the five-organ vertex information corresponding to the at least one five-organ model;

[0132] In an embodiment of the present application, the user can also delete at least one unnecessary five-organ model in the already merged face model when the user needs to adjust the face. Thus, in the case that the user needs to delete the five-organ model, the five-organ vertex information corresponding to the at least one five-organ model can be deleted in the face vertex information of the face model.

[0133] Specifically, when the bone information and the index information corresponding to the vertex information are adjusted, how the bone information and the index information are offset can be recorded. Based on the offset value related to the vertex information, the five-organ vertex information corresponding to the five-organ model can be quickly determined in the face vertex information, and the five-organ vertex information can be deleted.

[0134] For example, if the identification information in the five-organ bone information of a certain five organ is obtained by offsetting the original identification information by 100, the identification range of the five-organ bone information of the five organ in the current face bone information can be quickly determined, so that the five-organ vertex information corresponding to the five-organ model can be quickly determined in the face vertex information.

[0135] S62, in the face texture map of the face model, deleting the five-organ texture map corresponding to the five-organ model.

[0136] In an embodiment of the present application, after the five-organ vertex information is deleted, the five-organ texture map corresponding to the five-organ model can also be deleted in the face texture map of the face model.

[0137] In a specific implementation, based on the color value of the pixel point in the face texture map, the region where the five-organ texture map corresponding to the five-organ model is located in the face texture map can be determined, and the texture map information in the region can be deleted.

[0138] The face customization method provided by the embodiment of the present application comprises the following steps: obtaining a face contour model and at least one facial feature model; merging contour vertex information of the face contour model and facial feature vertex information of the facial feature model to obtain face vertex information of a face model, and fusing vertices of the face contour model and vertices of the facial feature model into one whole; merging contour texture maps corresponding to the face contour model and facial feature texture maps corresponding to the facial feature model to obtain face texture maps corresponding to the face model, so as to reduce the calculation resources required in the subsequent rendering process; and rendering the face model by using the face vertex information of the face model and the face texture maps corresponding to the face model. The face customization method can provide a face customization function with a large customizable range and high freedom for a user, and can have a good face customization effect.

[0139] It should be noted that, for the method embodiments, in order to simply describe, they are all described as a series of action combinations, but those skilled in the art should know that the embodiments of the present application are not limited by the action sequence described, because according to the embodiments of the present application, some steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should know that the embodiments described in the specification all belong to preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present application.

[0140] Referring to Figure 4 , a structure block diagram of a face customization device provided by an embodiment of the present application is shown, which can specifically comprise the following modules:

[0141] The obtaining module 401 is configured to obtain a face contour model and at least one facial feature model.

[0142] The vertex merging module 402 is configured to merge contour vertex information of the face contour model and facial feature vertex information of the facial feature model to obtain face vertex information of a face model.

[0143] The map merging module 403 is configured to merge contour texture maps corresponding to the face contour model and facial feature texture maps corresponding to the facial feature model to obtain face texture maps corresponding to the face model.

[0144] The rendering module 304 is configured to render the face model by using the face vertex information of the face model and the face texture maps corresponding to the face model.

[0145] Optionally, the contour vertex information comprises contour skeleton information and contour position information, the facial feature vertex information comprises facial feature skeleton information and facial feature position information, and the face vertex information comprises face skeleton information.

[0146] The vertex merging module comprises:

[0147] The face skeleton determining sub-module is configured to determine the face skeleton information in the face vertex information based on the contour skeleton information and the facial feature skeleton information.

[0148] The index determining sub-module is configured to determine index information corresponding to the face vertex information based on the contour position information and the facial feature position information.

[0149] Optionally, the face skeleton determining sub-module comprises:

[0150] The order determining unit is configured to merge the facial feature skeleton information different from the contour skeleton information with the contour skeleton information to determine skeleton order information.

[0151] The updating unit is configured to update the face skeleton information in the face vertex information based on the skeleton identification order information.

[0152] Optionally, the index determining sub-module comprises:

[0153] The distance identifying unit is configured to identify whether the distance between the face position information and the facial feature position information is less than a preset threshold.

[0154] The index merging unit is configured to merge the face vertex information corresponding to the face contour model and the facial feature vertex information of the facial feature model into the same index if the distance between the face position information and the facial feature position information is less than the preset threshold.

[0155] Optionally, the device further comprises:

[0156] The buffer merging module is configured to merge the face vertex information of the face contour model and the facial feature vertex information of the facial feature model into the same vertex buffer to obtain a vertex buffer of the face model; and / or,

[0157] The normal merging module is configured to merge the contour normal information of the face contour model and the facial feature normal information of the facial feature model to obtain face normal information of the face model.

[0158] Optionally, the texture merging module comprises:

[0159] The texture merging sub-module is configured to merge the contour texture map corresponding to the face contour model and the facial feature texture map corresponding to the facial feature model into a face texture map, and record the pixel points corresponding to the face types in the face texture map by using color values; the face types comprise the face contour and / or the facial features.

[0160] Optionally, the device further comprises:

[0161] The texture mapping adjustment module is configured to adjust texture mapping information in the face vertex information according to a face type corresponding to a pixel point in the face texture map.

[0162] Optionally, the device further comprises:

[0163] The vertex deletion module is configured to delete, in face vertex information of the face model, five-wu vertex information corresponding to the five-wu model.

[0164] The map deletion module is configured to delete, in a face texture map of the face model, five-wu texture map corresponding to the five-wu model.

[0165] For the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the related parts are referred to the part of the method embodiment.

[0166] In addition, the embodiment of the present application also provides an electronic device, such as Figure 5 As shown in the figure, it comprises a processor 501, a communication interface 502, a memory 503 and a communication bus 504, wherein the processor 501, the communication interface 502 and the memory 503 complete mutual communication through the communication bus 504,

[0167] The memory 503 is used for storing a computer program.

[0168] The processor 501 is used for executing the program stored in the memory 503, and realizes the following steps:

[0169] Obtaining a face contour model and at least one five-wu model;

[0170] Merging contour vertex information of the face contour model and five-wu vertex information of the five-wu model to obtain face vertex information of a face model;

[0171] Merging contour texture map corresponding to the face contour model and five-wu texture map corresponding to the five-wu model to obtain face texture map corresponding to the face model;

[0172] Using the face vertex information of the face model and the corresponding face texture map to render and generate the face model.

[0173] Optionally, the contour vertex information comprises contour skeleton information and contour position information, the five-wu vertex information comprises five-wu skeleton information and five-wu position information, and the face vertex information comprises face skeleton information.

[0174] The step of merging the contour vertex information of the face contour model and the five-wu vertex information of the five-wu model to obtain the face vertex information of the face model comprises:

[0175] determining the facial skeleton information in the facial vertex information based on the contour skeleton information and the facial feature skeleton information;

[0176] determining index information corresponding to the facial vertex information based on the contour position information and the facial feature position information.

[0177] Optionally, the step of merging the contour skeleton information and the facial feature skeleton information to obtain facial skeleton information comprises:

[0178] merging facial feature skeleton information different from the contour skeleton information with the contour skeleton information to determine skeleton order information;

[0179] updating facial skeleton information in the facial vertex information based on the skeleton order information.

[0180] Optionally, the step of determining index information corresponding to the facial vertex information based on the contour position information and the facial feature position information comprises:

[0181] identifying whether a distance between the facial position information and the facial feature position information is less than a preset threshold value;

[0182] if the distance between the facial position information and the facial feature position information is less than the preset threshold value, merging facial vertex information corresponding to the facial contour model and facial feature vertex information of the facial feature model into the same index.

[0183] Optionally, the method further comprises:

[0184] merging facial vertex information of the facial contour model and facial feature vertex information of the facial feature model into the same vertex buffer to obtain a vertex buffer of the facial model; and / or,

[0185] merging contour normal information of the facial contour model and facial feature normal information of the facial feature model to obtain facial normal information of the facial model.

[0186] Optionally, the step of merging contour texture mapping corresponding to the facial contour model and facial feature texture mapping corresponding to the facial feature model to obtain facial texture mapping corresponding to the facial model comprises:

[0187] merging contour texture mapping corresponding to the facial contour model and facial feature texture mapping corresponding to the facial feature model into facial texture mapping, and recording a pixel point corresponding facial type in the facial texture mapping by using a color value; the facial type comprises a facial contour and / or a facial feature.

[0188] Optionally, the method further comprises:

[0189] According to the face type corresponding to the pixel point in the face texture map, the texture mapping information in the face vertex information is adjusted.

[0190] Optionally, the method further comprises:

[0191] In the face vertex information of the face model, the facial feature vertex information corresponding to the facial feature model is deleted;

[0192] In the face texture map of the face model, the facial feature texture map corresponding to the facial feature model is deleted.

[0193] The communication bus mentioned above can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For the convenience of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or only one type of bus.

[0194] The communication interface is used for communication between the terminal and other devices.

[0195] The memory can include a Random Access Memory (RAM) and can also include a non-volatile memory, such as at least one disk memory. Optionally, the memory can also be at least one storage device located away from the aforementioned processor.

[0196] The processor mentioned above can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; can also be a Digital Signal Processing (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component.

[0197] As Figure 6It should be noted that, in the present disclosure, the terms "first", "second", etc. are used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or sequence between these entities or operations. In addition, the terms "comprise", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such a process, method, article or device. Without more limitations, the element defined by the statement "comprises a" does not exclude the presence of additional identical elements in the process, method, article or device comprising the element.

[0198] In another embodiment provided by the present disclosure, a computer program product including instructions is also provided, which, when executed on a computer, causes the computer to perform the face customization method described in the above embodiments.

[0199] In the above embodiments, all or part of the embodiments can be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments can be implemented in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present disclosure are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network or other programmable device. The computer instructions can be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another computer readable storage medium, for example, the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center through wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) mode. The computer readable storage medium can be any available medium accessible by a computer or a data storage device such as a server, data center, etc. integrated with one or more available media. The available media can be magnetic media (such as floppy disk, hard disk, magnetic tape), optical media (such as DVD), or semiconductor media (such as solid state disk (SSD)) and the like.

[0200] It should be noted that, in the present disclosure, the terms "first", "second", etc. are used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or sequence between these entities or operations. In addition, the terms "comprise", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such a process, method, article or device. Without more limitations, the element defined by the statement "comprises a" does not exclude the presence of additional identical elements in the process, method, article or device comprising the element.

[0201] The various embodiments in the specification are described in a related manner, and the same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on the difference from other embodiments. In particular, for the system embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the part of the method embodiments.

[0202] The above only describes the preferred embodiments of the present application, and is not used to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A facial customization method, characterized in that: include: Obtaining a facial contour model and at least one facial feature model; Merging the contour vertex information of the facial contour model with the facial feature vertex information of the facial feature model to obtain facial vertex information of the facial model; Merging the contour texture map corresponding to the facial contour model with the facial feature texture maps corresponding to the facial feature model to obtain a facial texture map corresponding to the facial model; Using facial vertex information of the facial model and its corresponding facial texture map, rendering and generating the facial model; The contour vertex information includes contour skeleton information and contour position information, the facial feature vertex information includes facial feature skeleton information and facial feature position information, and the facial vertex information includes facial skeleton information; The step of merging the contour vertex information of the facial contour model with the facial feature vertex information of the facial feature model to obtain facial vertex information of the facial model comprises: Determining the facial bone information in the facial vertex information based on the contour bone information and the facial feature bone information; Determining index information corresponding to the facial vertex information based on the contour position information and the facial feature position information; The step of combining the outline skeleton information and the facial features skeleton information to obtain facial skeleton information includes: Merging facial feature skeleton information different from the outline skeleton information with the outline skeleton information to determine skeleton sorting information; Based on the bone sorting information, facial bone information in the facial vertex information is updated.

2. The method according to claim 1, characterized in that The determining, based on the contour position information and the facial feature position information, index information corresponding to the facial vertex information includes: Identify whether the distance between the facial position information and the facial features position information is less than a preset threshold; If the distance between the facial position information and the facial feature position information is less than a preset threshold, the facial vertex information corresponding to the facial contour model and the facial feature vertex information of the facial feature model are merged into the same index.

3. The method according to claim 1, characterized in that The method further comprises: Merging the facial vertex information of the facial contour model and the facial feature vertex information of the facial feature model into the same vertex buffer to obtain the vertex buffer of the facial model; and / or, The contour normal information of the facial contour model and the facial feature normal information of the facial feature model are combined to obtain facial normal information of the facial model.

4. The method according to claim 1, wherein The step of merging the contour texture map corresponding to the facial contour model with the facial feature texture maps corresponding to the facial feature model to obtain the facial texture map corresponding to the facial model comprises: The contour texture map corresponding to the facial contour model and the facial feature texture map corresponding to the facial feature model are merged into a facial texture map, and the facial type corresponding to the pixel point is recorded using a color value in the facial texture map; the facial type includes facial contour and / or facial features.

5. The method according to claim 4, characterized in that The method further comprises: Adjusting texture mapping information in the facial vertex information according to the facial type corresponding to the pixel points in the facial texture map.

6. The method according to claim 1, characterized in that The method further comprises: Deleting at least one facial feature vertex information corresponding to the facial feature model from the facial vertex information of the facial model; In the facial texture map of the facial model, the facial feature texture map corresponding to the facial feature model is deleted.

7. A facial customization device, characterized in that include: An acquisition module, configured to acquire a facial contour model and at least one facial feature model; a vertex merging module, configured to merge the contour vertex information of the facial contour model with the facial feature vertex information of the facial feature model to obtain facial vertex information of the facial model; a texture merging module, configured to merge the contour texture map corresponding to the facial contour model with the facial feature texture maps corresponding to the facial feature model to obtain a facial texture map corresponding to the facial model; A rendering module, configured to generate the facial model by rendering using facial vertex information of the facial model and its corresponding facial texture map; The contour vertex information includes contour skeleton information and contour position information, the facial feature vertex information includes facial feature skeleton information and facial feature position information, and the facial vertex information includes facial skeleton information; The vertex merging module includes: A facial skeleton determination submodule, configured to determine the facial skeleton information in the facial vertex information based on the contour skeleton information and the facial feature skeleton information; An index determination submodule, configured to determine index information corresponding to the facial vertex information based on the contour position information and the facial feature position information; The facial skeleton determination submodule includes: a ranking determining unit, configured to combine facial feature skeleton information different from the outline skeleton information with the outline skeleton information to determine skeleton ranking information; An updating unit is configured to update the facial bone information in the facial vertex information based on the bone sorting information.

8. An electronic device, characterized in that: comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus; The memory is used to store computer programs; The processor is configured to implement the method according to any one of claims 1 to 6 when executing a program stored in the memory.

9. One or more computer-readable media having instructions stored thereon, which, when executed by one or more processors, cause the processors to perform the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Hairstyle DESIGN METHOD, device, READABLE STORAGE MEDIUM, AND INTELLIGENT TERMINAL

    CN109410315A