Method, apparatus, device, and storage medium for obtaining an avatar

By automatically obtaining and applying target adjustment parameters, the benchmark virtual image is adjusted, which solves the problems of low efficiency and poor quality of virtual image acquisition in the existing technology, and achieves efficient and reliable virtual image matching and adjustment.

CN113694525BActive Publication Date: 2025-06-27TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202110309711.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-03-23
Publication Date
2025-06-27
Estimated Expiration
2041-03-23

AI Technical Summary

Technical Problem

In the prior art, the efficiency of obtaining new virtual images with specific attributes and matching the original virtual images is low and the quality is poor, mainly due to the low efficiency and poor reliability of manually setting adjustment parameters.

Method used

By obtaining the first virtual image and the benchmark virtual image, the template virtual image matching the benchmark virtual image is obtained, and the target adjustment parameters are automatically obtained based on the difference information between the reference part in the first virtual image and the reference part in the template virtual image, and the benchmark virtual image is adjusted based on these parameters to obtain a new virtual image matching the first virtual image.

Benefits of technology

It improves the efficiency of obtaining new virtual images, ensures the quality of new virtual images acquired, and reduces human resources and time costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113694525B_ABST
    Figure CN113694525B_ABST
Patent Text Reader

Abstract

The present application discloses a method, apparatus, device and storage medium for obtaining a virtual avatar, belonging to the field of artificial intelligence technology. The method includes: obtaining a first virtual avatar and a reference virtual avatar, where the first virtual avatar has a first attribute and the reference virtual avatar has a second attribute; obtaining a template virtual avatar with the first attribute that matches the reference virtual avatar; obtaining a target adjustment parameter based on the difference information between the reference part in the first virtual avatar and the reference part in the template virtual avatar; and adjusting the reference part in the reference virtual avatar based on the target adjustment parameter to obtain a second virtual avatar. Based on this, the process of obtaining the adjustment parameter does not need to rely on manual work and can be automatically executed, and the efficiency of obtaining the adjustment parameter is relatively high, which is beneficial to improving the efficiency of obtaining a new virtual avatar. In addition, the reliability of the obtained adjustment parameter is relatively high, and the quality of the new virtual avatar obtained by using the obtained adjustment parameter is relatively good.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of artificial intelligence technology, and particularly to a method, device, equipment and storage medium for obtaining a virtual image. Background Technique

[0002] With the continuous development of artificial intelligence technology, there are more and more ways to generate virtual images (such as facial virtual images, body virtual images, etc.). In actual application scenarios (such as games, movies, etc.), the attributes of the original virtual image generated may be quite different from the specific attributes required by the application scenario, making it difficult for the original virtual image to be directly used in the actual application scenario. In such a case, it is often necessary to obtain a new virtual image with specific attributes and matching the original virtual image to better adapt to the actual application scenario.

[0003] In the related art, the staff analyzes the original virtual image to manually set adjustment parameters, and then adjusts the reference virtual image with specific attributes based on the manually set adjustment parameters, and uses the new virtual image obtained after adjustment as the new virtual image with specific attributes and matching the original virtual image.

[0004] In the process of obtaining such a virtual image, the adjustment parameters are manually set by the staff through analyzing the original virtual image. The acquisition efficiency of the adjustment parameters is low, and a large amount of human resources and time costs are required, resulting in a low acquisition efficiency of the new virtual image. In addition, the reliability of the manually set adjustment parameters is poor, and the quality of the new virtual image obtained based on the manually set adjustment parameters is not good. Summary of the Invention

[0005] The embodiments of the present application provide a method, device, equipment and storage medium for obtaining a virtual image, which can be used to improve the acquisition efficiency of the new virtual image and the quality of the obtained new virtual image. The technical solutions are as follows:

[0006] On the one hand, the embodiments of the present application provide a method for obtaining a virtual image, the method includes:

[0007] Obtain a first virtual image and a reference virtual image, the first virtual image has a first attribute, the reference virtual image has a second attribute, and the first attribute is different from the second attribute;

[0008] Obtain a template virtual image with the first attribute that matches the reference virtual image;

[0009] Obtain a target adjustment parameter based on the difference information between the reference part in the first virtual image and the reference part in the template virtual image, where the target adjustment parameter is used to provide an adjustment direction for adjusting the reference virtual image to match the first virtual image;

[0010] Based on the target adjustment parameter, adjust the reference part in the reference virtual image to obtain a second virtual image, where the second virtual image has the second attribute and matches the first virtual image.

[0011] On the other hand, a device for obtaining a virtual image is provided, and the device includes:

[0012] A first acquisition unit, configured to acquire a first virtual image and a reference virtual image, where the first virtual image has a first attribute, the reference virtual image has a second attribute, and the first attribute is different from the second attribute;

[0013] A second acquisition unit, configured to acquire a template virtual image with the first attribute that matches the reference virtual image;

[0014] A third acquisition unit, configured to obtain a target adjustment parameter based on the difference information between the reference part in the first virtual image and the reference part in the template virtual image, where the target adjustment parameter is used to provide an adjustment direction for adjusting the reference virtual image to match the first virtual image;

[0015] An adjustment unit, configured to adjust the reference part in the reference virtual image based on the target adjustment parameter to obtain a second virtual image, where the second virtual image has the second attribute and matches the first virtual image.

[0016] In a possible implementation manner, the third acquisition unit includes:

[0017] A first acquisition subunit, configured to acquire a first ratio and a second ratio, where the first ratio is used to indicate the proportional feature of the reference part in the first virtual image in the first virtual image, and the second ratio is used to indicate the proportional feature of the reference part in the template virtual image in the template virtual image;

[0018] A second acquisition subunit, configured to obtain the difference information between the reference part in the first virtual image and the reference part in the template virtual image based on the first ratio and the second ratio;

[0019] A processing subunit, configured to perform a conversion process on the difference information based on the reference virtual image to obtain the target adjustment parameter.

[0020] In a possible implementation manner, the first acquisition subunit is configured to acquire a first reference distance and a second reference distance, where the first reference distance is used to provide a measurement benchmark for a reference part in the first virtual avatar, and the second reference distance is used to provide a measurement benchmark for the reference part in the template virtual avatar; determine the distance between a first reference part key point and a second reference part key point in the first virtual avatar as a first measurement distance, where the first reference part key point and the second reference part key point in the first virtual avatar are both one of the reference part key points in the respective reference part key points in the first virtual avatar, and the respective reference part key points in the first virtual avatar are used to indicate the reference part in the first virtual avatar; determine the distance between a first reference part key point and a second reference part key point in the template virtual avatar as a second measurement distance, where the first reference part key point and the second reference part key point in the template virtual avatar respectively match the first reference part key point and the second reference part key point in the first virtual avatar; use the ratio of the first measurement distance to the first reference distance as the first ratio; and use the ratio of the second measurement distance to the second reference distance as the second ratio.

[0021] In a possible implementation manner, the processing subunit is configured to acquire a third reference distance, where the third reference distance is used to provide a measurement benchmark for the reference part in the reference virtual avatar; obtain a unit change distance that matches the difference information based on a reference position adjustment index corresponding to the reference part in the reference virtual avatar; and perform conversion processing on the difference information based on the third reference distance and the unit change distance to obtain the target adjustment parameter.

[0022] In a possible implementation manner, the reference position adjustment index includes sub-reference position adjustment indexes respectively corresponding to the respective reference part key points in the reference virtual avatar; the processing subunit is further configured to extract, from the sub-reference position adjustment indexes respectively corresponding to the respective reference part key points in the reference virtual avatar, the sub-reference position adjustment indexes respectively corresponding to the first reference part key point and the second reference part key point in the reference virtual avatar, where the first reference part key point and the second reference part key point in the reference virtual avatar respectively match the first reference part key point and the second reference part key point in the first virtual avatar; and determine the unit change distance that matches the difference information based on an index difference between the sub-reference position adjustment index corresponding to the first reference part key point in the reference virtual avatar and the sub-reference position adjustment index corresponding to the second reference part key point in the reference virtual avatar.

[0023] In a possible implementation manner, the difference information is the difference in proportion between the first proportion and the second proportion; the processing subunit is further configured to use the product of the third reference distance and the difference in proportion as the target change distance matching the difference information; and obtain the target adjustment parameter based on the ratio of the target change distance to the unit change distance.

[0024] In a possible implementation manner, the processing subunit is further configured to, in response to the ratio of the target change distance to the unit change distance being less than a first value, use the first value as the target adjustment parameter; in response to the ratio of the target change distance to the unit change distance being greater than a second value, use the second value as the target adjustment parameter, where the second value is greater than the first value; and in response to the ratio of the target change distance to the unit change distance being not less than the first value and not greater than the second value, use the ratio of the target change distance to the unit change distance as the target adjustment parameter.

[0025] In a possible implementation manner, the adjustment unit is configured to obtain the target position adjustment index corresponding to the reference part in the reference virtual image based on the target adjustment parameter and the reference position adjustment index corresponding to the reference part in the reference virtual image, where the target position adjustment index includes sub-target position adjustment indexes corresponding to key points of each reference part in the reference virtual image; and use the sub-target position adjustment indexes corresponding to key points of each reference part in the reference virtual image to adjust the position of the reference part in the reference virtual image to obtain the second virtual image.

[0026] In a possible implementation manner, the second obtaining unit is configured to obtain at least one candidate virtual image having the first attribute; obtain the matching degree of each of the at least one candidate virtual image with the reference virtual image; and obtain the template virtual image based on the candidate virtual images whose matching degree with the reference virtual image meets the selection condition.

[0027] In a possible implementation manner, the reference virtual image is provided by a virtual image adjustment system, and the adjustment unit is configured to call the virtual image adjustment system and adjust the reference part in the reference virtual image based on the target adjustment parameter to obtain the second virtual image.

[0028] On the other hand, a computer device is provided, where the computer device includes a processor and a memory, and at least one computer program is stored in the memory, and the at least one computer program is loaded and executed by the processor to implement the method for obtaining a virtual image as described in any one of the above.

[0029] On the other hand, a computer-readable storage medium is also provided. At least one computer program is stored in the computer-readable storage medium and is loaded and executed by a processor to implement the method for obtaining a virtual image as described in any one of the above.

[0030] On the other hand, a computer program product or a computer program is also provided. The computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the method for obtaining a virtual image as described in any one of the above.

[0031] The technical solutions provided in the embodiments of the present application at least bring the following beneficial effects:

[0032] In the embodiments of the present application, the process of obtaining the adjustment parameters for adjusting the reference virtual image does not need to rely on manual operation and can be automatically executed, and the efficiency of obtaining the adjustment parameters is relatively high, which is beneficial to improving the efficiency of obtaining a new virtual image. In addition, the adjustment parameters for adjusting the reference virtual image are obtained based on the difference information between the reference parts in the first virtual image and the same reference parts in the template virtual image that matches the reference virtual image, which can provide strong reference for adjusting the reference virtual image into a new virtual image that matches the first virtual image. The reliability of the obtained adjustment parameters is relatively high, and the quality of the new virtual image obtained by using the obtained adjustment parameters is relatively good. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0034] Figure 1 is a schematic diagram of the implementation environment of a method for obtaining a virtual image provided by an embodiment of the present application;

[0035] Figure 2 is a flowchart of a method for obtaining a virtual image provided by an embodiment of the present application;

[0036] Figure 3 is a schematic diagram of key points in a three-dimensional human face virtual image provided by an embodiment of the present application;

[0037] Figure 4It is a flowchart of a process for obtaining a target adjustment parameter based on the difference information between a reference part in a first virtual image and a reference part in a template virtual image provided by an embodiment of the present application;

[0038] Figure 5 It is a schematic diagram of a first reference distance and a second reference distance provided by an embodiment of the present application;

[0039] Figure 6 It is a schematic diagram of a first measurement distance and a second measurement distance provided by an embodiment of the present application;

[0040] Figure 7 It is a schematic diagram of a third reference distance provided by an embodiment of the present application;

[0041] Figure 8 It is a schematic diagram of a process for adjusting a reference part in a reference virtual image based on a target adjustment parameter to obtain a second virtual image provided by an embodiment of the present application;

[0042] Figure 9 It is a schematic diagram of a process for obtaining a second virtual image provided by an embodiment of the present application;

[0043] Figure 10 It is a schematic diagram of a device for obtaining a virtual image provided by an embodiment of the present application;

[0044] Figure 11 It is a schematic diagram of the structure of a third acquisition unit provided by an embodiment of the present application;

[0045] Figure 12 It is a schematic diagram of the structure of a terminal provided by an embodiment of the present application;

[0046] Figure 13 It is a schematic diagram of the structure of a server provided by an embodiment of the present application. Detailed implementation manners

[0047] To make the objectives, technical solutions, and advantages of the present application clearer, the following will further describe the embodiments of the present application in detail with reference to the accompanying drawings.

[0048] To facilitate understanding of the technical process of the embodiments of the present application, some terms involved in the embodiments of the present application are explained below.

[0049] 3DMM (Three Dimensional Morphable Model): It is a general three-dimensional face parameterization model that represents a face with a fixed number of points. The core idea of 3DMM is that a face can be uniquely matched in three-dimensional space and can be linearly added by weighted summation of many other orthogonal bases of faces.

[0050] Exemplarily, a three-dimensional face can be represented by two feature vectors, namely a shape vector S and a texture vector W:

[0051] S = (X1, Y1, Z1, X2, Y2, Z2,..., X n , Y n , Z n ) T , S ∈ R 3n

[0052] W = (R1, G1, B1, R2, G2, B2,..., R n , G n , B n ) T , W ∈ R 3n

[0053] where X1, Y1, Z1, X2, Y2, Z2,..., X n , Y n , Z n represent the respective elements that make up the shape vector S; S ∈ R 3n indicates that S is in three-dimensional space; R1, G1, B1, R2, G2, B2,..., R n , G n , B n represent the respective elements that make up the texture vector W; W ∈ R 3n indicates that W is in three-dimensional space; T represents the transpose of a vector; n is an integer not less than 1.

[0054] The core idea of 3DMM is that any new face can be generated by a linear combination of the feature vectors of the base faces. Based on this core idea, the shape vector S' and texture vector W' of any new face are obtained according to the following formula 1:

[0055]

[0056] where, represents the average vector of the shape vectors of the base faces; S l represents the shape vector of the l-th (l is an integer not less than 1) base face; a l represents the weight corresponding to the shape vector of the l-th base face; m (m is an integer not less than 1) represents the number of base faces; represents the average vector of the texture vectors of the base faces; W l represents the texture vector of the l-th base face; b l represents the weight corresponding to the texture vector of the l-th base face.

[0057] Blend shape: A technique in which a single mesh deforms to achieve combinations between many predefined shapes and any quantity, known as deformation targets in Maya / 3ds Max (3D modeling and animation software). For example, a single mesh is the basic shape of the default shape (e.g., a faceless expression), and other shapes of the basic shape are used for blending / deforming to achieve different expressions (laughing, frowning, closing eyelids, etc.), which are collectively referred to as blend shapes or deformation targets.

[0058] In an exemplary embodiment, the method for obtaining a virtual avatar provided in the embodiments of the present application can be applied to the field of artificial intelligence technology. Next, an introduction to artificial intelligence technology will be given.

[0059] Artificial Intelligence (AI) is a theory, method, technology, and application system that uses digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology in computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can react in a way similar to human intelligence. Artificial intelligence also studies the design principles and implementation methods of various intelligent machines to enable the machines to have the functions of perception, reasoning, and decision-making.

[0060] Artificial intelligence technology is an interdisciplinary subject that involves a wide range of fields, including both hardware-level technologies and software-level technologies. The basic technologies of artificial intelligence generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technologies, operation / interaction systems, and mechatronics. The software technologies of artificial intelligence mainly include several major directions such as computer vision technology, speech processing technology, natural language processing technology, and machine learning / deep learning.

[0061] Among them, computer vision (CV) technology is a science that studies how to enable machines to "see". Further speaking, it refers to using cameras and computers to replace the human eye for tasks such as object recognition and measurement in machine vision, and further performing graphic processing to make the computer-processed images more suitable for human eye observation or transmission to instrument detection. As a scientific discipline, computer vision researches related theories and technologies, and attempts to establish artificial intelligence systems that can obtain information from images or multi-dimensional data. Computer vision technology usually includes image processing, image recognition, image semantic understanding, image retrieval, OCR (Optical Character Recognition), video processing, video semantic understanding, video content / behavior recognition, three-dimensional object reconstruction, obtaining virtual avatars, 3D (Three Dimensional) technology, virtual reality, augmented reality, simultaneous localization and mapping, etc. It also includes common biometric recognition technologies such as face recognition and fingerprint recognition.

[0062] With the research and progress of artificial intelligence technology, artificial intelligence technology has been studied and applied in multiple fields. For example, common ones include smart home, smart wearable devices, virtual assistants, smart speakers, smart marketing, driverless, autonomous driving, drones, robots, smart healthcare, smart customer service, etc. It is believed that with the development of technology, artificial intelligence technology will be applied in more fields and play an increasingly important role.

[0063] Figure 1 The figure shows a schematic diagram of the implementation environment of the method for obtaining a virtual avatar provided by an embodiment of the present application. The implementation environment may include: a terminal 11 and a server 12.

[0064] The method for obtaining a virtual avatar provided by an embodiment of the present application can be executed by the terminal 11, or by the server 12, or jointly by the terminal 11 and the server 12. The embodiments of the present application do not limit this. For the case where the method for obtaining a virtual avatar provided by the embodiments of the present application is jointly executed by the terminal 11 and the server 12, the server 12 undertakes the main computing work and the terminal 11 undertakes the secondary computing work; or, the server 12 undertakes the secondary computing work and the terminal 11 undertakes the main computing work; or, a distributed computing architecture is adopted between the server 12 and the terminal 11 for collaborative computing.

[0065] In a possible implementation, the terminal 11 can be any electronic product that can interact with a user through one or more means such as a keyboard, a touchpad, a touch screen, a remote control, voice interaction, or a handwriting device. For example, a PC (Personal Computer), a mobile phone, a smart phone, a PDA (Personal Digital Assistant), a wearable device, a PPC (Pocket PC), a tablet computer, a smart in-vehicle device, a smart TV, a smart speaker, etc. The server 12 can be a single server, a server cluster composed of multiple servers, or a cloud computing service center. The terminal 11 and the server 12 establish a communication connection through a wired or wireless network.

[0066] Those skilled in the art should understand that the above-mentioned terminal 11 and server 12 are only examples. Other existing or future terminal or server that can be applied to this application should also be included within the protection scope of this application and are hereby incorporated by reference.

[0067] Based on the above Figure 1 shown implementation environment, an embodiment of this application provides a method for obtaining a virtual image. Taking this method applied to a computer device as an example, the computer device can refer to a terminal or a server. As Figure 2 shown, the method for obtaining a virtual image provided by the embodiment of this application includes the following steps 201 to step 204:

[0068] In step 201, a first virtual image and a reference virtual image are obtained. The first virtual image has a first attribute, and the reference virtual image has a second attribute, and the first attribute is different from the second attribute.

[0069] The first virtual image is used to constrain the overall characteristics of the finally obtained new virtual image, so that the finally obtained new virtual image matches the first virtual image. Exemplarily, the overall characteristics of the virtual image are represented by the appearance form of the virtual image. Virtual images with similar overall characteristics are similar in appearance form. In the relevant application scenarios of virtual images, in addition to considering the overall characteristics of the virtual image, the attributes of the virtual image also need to be considered. The overall characteristics and attributes are characteristics of different angles of the virtual image. The embodiment of this application does not limit the specific type of the attribute, and can be flexibly set according to actual needs. Exemplarily, the type of the attribute is style, or the type of the attribute is color. In the embodiment of this application, the attribute possessed by the first virtual image is called the first attribute.

[0070] The embodiments of the present application do not limit the type of the first virtual image. Exemplarily, the type of the first virtual image is a facial virtual image or a body virtual image. Exemplarily, the facial virtual image can be further divided into a human face virtual image, an animal face virtual image, etc. Exemplarily, the first virtual image can refer to a three-dimensional virtual image or a two-dimensional virtual image, etc. The embodiments of the present application will take the first virtual image as a three-dimensional virtual image as an example for illustration.

[0071] The embodiments of the present application do not limit the acquisition method of the first virtual image. Exemplarily, the acquisition methods of the first virtual image include but are not limited to the following two:

[0072] Method 1: Invoke a virtual image generation model to generate the first virtual image.

[0073] The virtual image generation model refers to a model used to generate virtual images. Depending on the type of the virtual image to be generated, the type of the virtual image generation model may be different. The embodiments of the present application do not limit the type of the virtual image generation model, as long as it can generate virtual images. Exemplarily, for the case where the type of the first virtual image is a three-dimensional human face virtual image, the virtual image generation model is 3DMM, and 3DMM can generate a three-dimensional human face virtual image with a realistic style similar to the appearance of a human face photo based on the human face photo.

[0074] Method 2: Obtain the first virtual image from a virtual image library.

[0075] The virtual image library stores pre-generated and stored virtual images. The first virtual image can refer to any virtual image in the virtual image library. It should be noted that the embodiments of the present application do not limit the source of the virtual images in the virtual image library. Exemplarily, the virtual images in the virtual image library can be virtual images generated by invoking a virtual image generation model, or virtual images edited by art staff using editing software.

[0076] In an actual application scenario, the first attribute of the first virtual image may not be the same as the attribute required by the actual application scenario, resulting in the first virtual image being unable to be directly applied in the actual application scenario. Exemplarily, taking the attribute of style as an example, the style of the first virtual image is a realistic style, but the actual application scenario is a game scenario, and the style required by the game scenario is a cartoon style. In this case, the first virtual image cannot be directly applied in the game scenario. The implementation goal of the embodiments of the present application is to obtain a new virtual image that matches the first virtual image and has the attributes required by the actual application scenario. Exemplarily, matching the first virtual image means that the overall features are similar to the first virtual image. For example, for the case where the type of the first virtual image is a human face virtual image, matching the first virtual image means having a similar appearance to the first virtual image.

[0077] In the embodiments of the present application, the attributes required by the actual application scenario are referred to as the second attributes. The first attributes are different from the second attributes. It should be noted that the first attributes and the second attributes are different attributes of the same type. Exemplarily, the types of the first attributes and the second attributes are both styles, the first attribute is a realistic style, and the second attribute is a cartoon style.

[0078] The reference virtual image is a virtual image to be adjusted with the second attribute, and the process of obtaining the new virtual image is achieved by adjusting the reference virtual image. The type of the reference virtual image is the same as the type of the first virtual image. Exemplarily, the types of the reference virtual image and the first virtual image are both human face virtual images. The reference virtual image has the second attribute, but may not match the first virtual image. Based on this, it is necessary to adjust the reference virtual image so as to obtain a new virtual image with the second attribute and matching the first virtual image. In an exemplary embodiment, during the process of adjusting the reference virtual image, what is changed is the overall feature of the reference virtual image, and the second attribute possessed by the reference virtual image will not be changed.

[0079] In an exemplary embodiment, the reference virtual image is provided by a virtual image adjustment system. The virtual image adjustment system includes the reference virtual image and adjustment resources for adjusting the reference virtual image. In this case, the process of obtaining the reference virtual image is: determining a virtual image adjustment system that matches the second attribute, and obtaining the reference virtual image provided by the virtual image adjustment system.

[0080] The adjustment resources for adjusting the reference virtual image can be preset by professionals, and the embodiments of the present application do not limit this. Exemplarily, the adjustment resources for adjusting the reference virtual image refer to blend shape resources. The blend shape resources include sub-resources for respectively adjusting each adjustable part in the reference virtual image. Exemplarily, the sub-resource for adjusting any part refers to the reference position adjustment index corresponding to the any part. Exemplarily, the reference position adjustment index refers to the position residual between the any part in the reference virtual image and the any part in the boundary virtual image. The boundary virtual image is used to indicate the maximum adjustable range of the any part in the reference virtual image. Exemplarily, for the case where the reference virtual image is a three-dimensional virtual image, the position residual includes sub-residuals respectively possessed by the position coordinates on the three coordinate axes.

[0081] In an exemplary embodiment, when the type of the first virtual avatar is a human face virtual avatar, the virtual avatar adjustment system is a face sculpting system. The face sculpting system is used to allow players or staff to adjust a reference human face virtual avatar to create a new human face virtual avatar. Exemplarily, assuming the actual application scenario is to obtain a character virtual avatar in a game, in this case, the second attribute is the style required by the game, and the virtual avatar adjustment system is the face sculpting system provided by the game. This face sculpting system is used to allow players to create a character virtual avatar with the style required by the game. Assuming the actual application scenario is to obtain an actor virtual avatar in a film or television work, in this case, the second attribute is the style required by the film or television work, and the virtual avatar adjustment system is the face sculpting system provided by the film or television work. This face sculpting system is used to allow staff to create an actor virtual avatar with the style required by the film or television work.

[0082] In an exemplary embodiment, the reference virtual avatar can also be obtained from a virtual avatar library with the second attribute, and the embodiments of the present application do not limit this.

[0083] In step 202, a template virtual avatar with the first attribute that matches the reference virtual avatar is obtained.

[0084] The reference virtual avatar has the second attribute, and the first virtual avatar has the first attribute. To obtain a new virtual avatar that has the second attribute and matches the first virtual avatar by adjusting the reference virtual avatar, it is necessary to obtain a template virtual avatar with the first attribute that matches the reference virtual avatar, so as to obtain adjustment parameters for adjusting the reference virtual avatar by comparing the template virtual avatar and the first virtual avatar, both of which have the first attribute. Exemplarily, matching the reference virtual avatar means being similar to the overall features of the reference virtual avatar.

[0085] The template virtual avatar is a virtual avatar that matches the reference virtual avatar and has the first attribute. Since both the template virtual avatar and the first virtual avatar have the first attribute, the template virtual avatar and the first virtual avatar are comparable, and the differences between the template virtual avatar and the first virtual avatar can be found through comparison. Since the template virtual avatar matches the reference virtual avatar and the first virtual avatar matches the new virtual avatar that needs to be obtained finally, the differences between the template virtual avatar and the first virtual avatar can reflect the differences between the new virtual avatar that needs to be obtained finally and the reference virtual avatar. Therefore, the adjustment parameters obtained based on the differences between the template virtual avatar and the first virtual avatar can provide an adjustment direction for adjusting the reference virtual avatar to match the first virtual avatar, so that the reference virtual avatar can be adjusted by using the obtained adjustment parameters to obtain a new virtual avatar that has the second attribute and matches the first virtual avatar.

[0086] In a possible implementation, the method for obtaining a template virtual image with a first attribute that matches a reference virtual image is as follows: obtain at least one candidate virtual image with the first attribute; obtain the matching degree between each of the at least one candidate virtual image and the reference virtual image; and obtain the template virtual image based on the candidate virtual images whose matching degree with the reference virtual image meets the selection criteria.

[0087] Based on the first virtual image, the first attribute can be determined, and thus at least one candidate virtual image with the first attribute can be obtained. In an exemplary embodiment, the at least one candidate virtual image with the first attribute is obtained from a virtual image library with the first attribute. The number of candidate virtual images in the embodiments of the present application is not limited, and the number of candidate virtual images can be one or more. After obtaining at least one candidate virtual image with the first attribute, obtain the matching degree between each of the at least one candidate virtual image and the reference virtual image.

[0088] The embodiments of the present application do not limit the method for obtaining the matching degree between two virtual images. Exemplarily, the method for obtaining the matching degree between any candidate virtual image and the reference virtual image is as follows: calculate the distance between the position coordinates of the key points in any candidate virtual image and the position coordinates of the corresponding key points in the reference virtual image, and determine the matching degree between the any candidate virtual image and the reference virtual image based on the distance.

[0089] The type and number of key points in the virtual image are set according to experience or flexibly adjusted according to the type of the virtual image. The embodiments of the present application do not limit this. Exemplarily, for the case where the type of the virtual image is a three-dimensional face virtual image, the key points in the virtual image refer to the key points on the face, including but not limited to the key points for indicating the eyes, the key points for indicating the nose, the key points for indicating the mouth, the key points for indicating the chin, etc. The number of key points for indicating a certain part (such as eyes, nose, mouth, etc.) is one or more, which is determined according to the actual situation. For example, for the case where the type of the virtual image is a three-dimensional face virtual image, the key points in the three-dimensional face virtual image are as Figure 3 shown. Figure 3 The number of key points in the three-dimensional face virtual image shown is 86. Exemplarily, each key point is marked with an index, and the index of each key point is used to point to the position coordinates of the key point.

[0090] The key points in any candidate virtual image correspond one by one to the key points in the reference virtual image. Exemplarily, the way to calculate the distance between the position coordinates of the key points in any candidate virtual image and the position coordinates of the corresponding key points in the reference virtual image can be to calculate the Euclidean distance or Manhattan distance, etc. between the position coordinates of the key points in any candidate virtual image and the position coordinates of the corresponding key points in the reference virtual image. The embodiments of the present application do not limit this.

[0091] In an exemplary embodiment, the greater the distance between the position coordinates of the key points in any candidate virtual image and the position coordinates of the corresponding key points in the reference virtual image, the smaller the matching degree between the any candidate virtual image and the reference virtual image. The embodiments of the present application do not limit the way to determine the matching degree between the any candidate virtual image and the reference virtual image based on the distance, as long as the relationship between the distance and the matching degree is negatively correlated. Exemplarily, the reciprocal of the distance is used as the matching degree between the any candidate virtual image and the reference virtual image.

[0092] In an exemplary embodiment, another way to obtain the matching degree between any candidate virtual image and the reference virtual image can be: calculate the similarity between the position coordinates of the key points in any candidate virtual image and the position coordinates of the corresponding key points in the reference virtual image, and use the similarity as the matching degree between the any candidate virtual image and the reference virtual image. The embodiments of the present application do not limit the calculation method of the similarity. Exemplarily, the similarity refers to the cosine similarity.

[0093] Regardless of which method, the matching degree between at least one candidate virtual image and the reference virtual image can be obtained respectively. After obtaining the matching degree between at least one virtual image and the reference virtual image respectively, a template virtual image is obtained based on the candidate virtual image whose matching degree with the reference virtual image meets the selection condition. The selection condition for the matching degree with the reference virtual image is set according to experience or flexibly adjusted according to the application scenario. The embodiments of the present application do not limit this. Exemplarily, the matching degree with the reference virtual image meeting the selection condition means that the matching degree with the reference virtual image is the top K (K is an integer not less than 1) largest matching degrees.

[0094] The number of candidate virtual avatars whose matching degree with the reference virtual avatar meets the selection criteria may be one or multiple, which is related to the setting of the selection criteria and the actual matching degrees of the candidate virtual avatars with the reference virtual avatar. Exemplarily, for the case where the number of candidate virtual avatars whose matching degree with the reference virtual avatar meets the selection criteria is one, the method for obtaining the template virtual avatar based on the candidate virtual avatar whose matching degree with the reference virtual avatar meets the selection criteria is: directly using the one candidate virtual avatar whose matching degree with the reference virtual avatar meets the selection criteria as the template virtual avatar.

[0095] In an exemplary embodiment, for the case where the number of candidate virtual avatars whose matching degree with the reference virtual avatar meets the selection criteria is multiple, the method for obtaining the template virtual avatar based on the candidate virtual avatars whose matching degree with the reference virtual avatar meets the selection criteria is: randomly selecting one candidate virtual avatar from the multiple candidate virtual avatars whose matching degree with the reference virtual avatar meets the selection criteria as the template virtual avatar; or, using the average virtual avatar of the multiple candidate virtual avatars whose matching degree with the reference virtual avatar meets the selection criteria as the template virtual avatar.

[0096] It should be noted that the above-described method for obtaining the template virtual avatar based on at least one candidate virtual avatar is only an exemplary description of an implementation method for obtaining the template virtual avatar, and the embodiments of the present application are not limited thereto. Exemplarily, the method for obtaining the template virtual avatar that matches the reference virtual avatar and has the first attribute may also be: an art staff member manually creates a template virtual avatar that matches the reference virtual avatar and has the first attribute with reference to the reference virtual avatar.

[0097] In step 203, based on the difference information between the reference part in the first virtual avatar and the reference part in the template virtual avatar, a target adjustment parameter is obtained, and the target adjustment parameter is used to provide an adjustment direction for adjusting the reference virtual avatar into a virtual avatar that matches the first virtual avatar.

[0098] After obtaining the template virtual avatar, based on the difference information between the reference part in the first virtual avatar and the reference part in the template virtual avatar, a target adjustment parameter is obtained. Both the first virtual avatar and the template virtual avatar have the first attribute, and each part corresponds one by one. It should be noted that the first virtual avatar, the template virtual avatar, and the reference virtual avatar are all virtual avatars of the same type, and the first virtual avatar, the template virtual avatar, and the reference virtual avatar all have the same component parts. Exemplarily, the types of the first virtual avatar, the template virtual avatar, and the reference virtual avatar are all human face virtual avatars, and the first virtual avatar, the template virtual avatar, and the reference virtual avatar all have parts such as eyes, nose, mouth, and chin.

[0099] The reference part refers to the part in the reference virtual image that needs to be adjusted. Exemplarily, the part that needs to be adjusted refers to some or all of the adjustable parts, and the embodiments of the present application do not limit this. The reference part is set according to experience or flexibly adjusted according to application requirements, and the embodiments of the present application do not limit this. The reference part in the first virtual image and the reference part in the template virtual image are the same part. For example, if the types of the first virtual image and the template virtual image are both human face virtual images, the reference parts in the first virtual image and the template virtual image are both the nose. It should be noted that the number of reference parts may be one or multiple. The embodiments of the present application are described by taking the number of reference parts as one as an example.

[0100] The target adjustment parameter is used to provide an adjustment direction for adjusting the reference virtual image to match the first virtual image. That is to say, based on the target adjustment parameter, it can be known how to adjust the reference virtual image to obtain a virtual image that matches the first virtual image. In a possible implementation manner, referring to Figure 4 , the process of obtaining the target adjustment parameter based on the difference information between the reference part in the first virtual image and the reference part in the template virtual image includes the following steps 2031 to 2033:

[0101] Step 2031: Obtain a first ratio and a second ratio. The first ratio is used to indicate the proportional feature of the reference part in the first virtual image in the first virtual image, and the second ratio is used to indicate the proportional feature of the reference part in the template virtual image in the template virtual image.

[0102] The first ratio is used to indicate the proportional feature of the reference part in the first virtual image in the first virtual image. According to the first ratio, it can be known the proportion of the reference part in the first virtual image in the first virtual image; the second ratio is used to indicate the proportional feature of the reference part in the template virtual image in the template virtual image. According to the second ratio, it can be known the proportion of the reference part in the template virtual image in the template virtual image. In a possible implementation manner, the process of obtaining the first ratio and the second ratio includes the following steps 1 to 4:

[0103] Step 1: Obtain a first reference distance and a second reference distance. The first reference distance is used to provide a measurement benchmark for the reference part in the first virtual image, and the second reference distance is used to provide a measurement benchmark for the reference part in the template virtual image.

[0104] The first reference distance is the reference distance required to obtain the first proportion, and can provide a measurement reference for the reference part in the first virtual image; the second reference distance is the reference distance required to obtain the second proportion, and can provide a measurement reference for the reference part in the template virtual image. Exemplarily, the obtaining method of the first reference distance is the same as that of the second reference distance. In the embodiments of the present application, the process of obtaining the first reference distance is taken as an example for illustration.

[0105] The obtaining method of the first reference distance is set according to experience or flexibly adjusted according to the type of the first virtual image, the type of the reference part, etc., and the embodiments of the present application do not limit this. Exemplarily, the process of obtaining the first reference distance is: obtaining the distance between the first reference point and the second reference point in the first virtual image, and taking the distance between the first reference point and the second reference point as the first reference distance. Both the first reference point and the second reference point in the first virtual image are one key point among the respective key points in the first virtual image. Which key point among the respective key points in the first virtual image is the first reference point and which key point is the second reference point are set according to experience or flexibly adjusted according to the type of the first virtual image, the type of the reference part, etc.

[0106] Exemplarily, for the case where the type of the first virtual image is a human face virtual image, the first reference point in the first virtual image is the left temple key point in the first virtual image, and the second reference point in the first virtual image is the right temple key point in the first virtual image. In this case, the first reference distance is the distance between the left temple key point and the right temple key point in the first virtual image. After obtaining the first virtual image, the position information of each key point in the first virtual image can be known. The position information of each key point is used to indicate the position coordinates of each key point. Then, the position coordinates of the left temple key point and the position coordinates of the right temple key point in the first virtual image can be obtained. Furthermore, based on the position coordinates of the left temple key point and the position coordinates of the right temple key point in the first virtual image, the distance between the left temple key point and the right temple key point in the first virtual image is determined.

[0107] In an exemplary embodiment, after obtaining the first virtual avatar, the topological relationship of the first virtual avatar can be known. Then, by analyzing the topological relationship of the first virtual avatar, the position information of each key point in the first virtual avatar can be obtained. The embodiment of the present application does not limit the representation form of the position information of any key point in the first virtual avatar. Exemplarily, the position information of any key point in the first virtual avatar directly refers to the position coordinates of the any key point in the first virtual avatar; or, the position information of any key point in the first virtual avatar includes the index of the any key point in the first virtual avatar and the position coordinates pointed to by the index of the any key point. The position coordinates pointed to by the index of any key point are the position coordinates of the any key point. It should be noted that when the first virtual avatar is a three-dimensional virtual avatar, the position coordinates of the key points in the first virtual avatar are three-dimensional coordinates (x, y, z); when the first virtual avatar is a two-dimensional virtual avatar, the position coordinates of the key points in the first virtual avatar are two-dimensional coordinates (x, y). Regardless of which representation form, the position coordinates of any key point in the first virtual avatar can be obtained according to the position information of any key point in the first virtual avatar.

[0108] The embodiment of the present application does not limit the method for determining the distance between the left temple key point and the right temple key point in the first virtual avatar based on the position coordinates of the left temple key point and the position coordinates of the right temple key point in the first virtual avatar. Exemplarily, based on the position coordinates of the left temple key point and the position coordinates of the right temple key point in the first virtual avatar, the straight-line distance between the left temple key point and the right temple key point in the first virtual avatar is determined; or, based on the position coordinates of the left temple key point and the position coordinates of the right temple key point in the first virtual avatar, the horizontal distance between the left temple key point and the right temple key point in the first virtual avatar is determined.

[0109] Exemplarily, for the case where the type of the first virtual avatar is a human face virtual avatar, the first reference point in the first virtual avatar is the forehead center key point, and the second reference point in the first virtual avatar is the chin center key point. In this case, the first reference distance is the distance between the forehead center key point and the chin center key point in the first virtual avatar.

[0110] In an exemplary embodiment, for the case where the obtained first reference distance is independent of the reference part, the first reference distances obtained for different reference parts are the same; for the case where the obtained first reference distance is related to the reference part, the first reference distances obtained for different reference parts may be different.

[0111] It should be noted that the above-described implementation method for obtaining the first reference distance is only an example, and the embodiments of the present application are not limited thereto. In an exemplary embodiment, the process of obtaining the first reference distance may also be: obtaining a first reference distance between a first reference point and a second reference point in the first virtual image; obtaining a second reference distance between a third reference point and a fourth reference point in the first virtual image; taking the average distance between the first reference distance and the second reference distance as the first reference distance corresponding to the first virtual image. The first reference point, the second reference point, the third reference point, and the fourth reference point are all one key point among the key points in the first virtual image, and which key point among the key points in the first virtual image is the first reference point, which key point is the second reference point, which key point is the third reference point, and which key point is the fourth reference point are set according to experience.

[0112] The above describes the implementation process of obtaining the first reference distance. For the implementation process of obtaining the second reference distance, refer to the implementation process of obtaining the first reference distance, which will not be elaborated here. It should be noted that the specific method for obtaining the second reference distance is the same as the specific method for obtaining the first reference distance to ensure comparability between the first ratio and the second ratio obtained subsequently. Exemplarily, if the first reference distance is the distance between a first reference point and a second reference point in the first virtual image, then the second reference distance is the distance between the first reference point and the second reference point in the template virtual image.

[0113] The first reference point and the second reference point in the template virtual image respectively match the first reference point and the second reference point in the first virtual image. Exemplarily, the matching of two reference points means that the semantics corresponding to the two reference points are the same. Exemplarily, assume that the first reference point and the second reference point in the first virtual image respectively refer to the left temple key point and the right temple key point in the first virtual image, then the first reference point and the second reference point in the template virtual image respectively refer to the left temple key point and the right temple key point in the template virtual image.

[0114] Exemplarily, taking the types of the first virtual image and the template virtual image as three-dimensional face virtual images, the first reference point as the left temple key point, and the second reference point as the right temple key point as an example, the first reference distance and the second reference distance are as Figure 5 shown. In Figure 5 , the first virtual image is the three-dimensional face virtual image shown in (1) in Figure 5 , and the first reference distance is D1; the template virtual image is the three-dimensional face virtual image shown in (2) in Figure 5 , and the second reference distance is D2.

[0115] Step 2: Determine the first measurement distance as the distance between the first reference part key point and the second reference part key point in the first virtual image. Both the first reference part key point and the second reference part key point in the first virtual image are one of the reference part key points among all the reference part key points in the first virtual image, and all the reference part key points in the first virtual image are used to indicate the reference parts in the first virtual image.

[0116] The first measurement distance is used to measure the characteristics of the reference parts in the first virtual image in terms of distance. The first measurement distance refers to the distance between the first reference part key point and the second reference part key point in the first virtual image. Both the first reference part key point and the second reference part key point in the first virtual image are one of the reference part key points among all the reference part key points in the first virtual image, and all the reference part key points in the first virtual image are used to indicate the reference parts in the first virtual image. Which reference part key point among all the reference part key points in the first virtual image is the first reference part key point and which is the second reference part key point are set according to experience or flexibly adjusted according to the type of the reference part. The embodiments of the present application do not limit this.

[0117] Exemplarily, for the case where the type of the first virtual image is a human face virtual image and the reference part is the nose, the first reference part key point in the first virtual image is the reference part key point at the leftmost position among all the reference part key points in the first virtual image (which can be called the left nose key point), and the second reference part key point in the first virtual image is the reference part key point at the rightmost position among all the reference part key points in the first virtual image (which can be called the right nose key point). The distance between the left nose key point and the right nose key point in the first virtual image can be regarded as the width of the nose in the first virtual image.

[0118] Exemplarily, the distance between the first reference part key point and the second reference part key point in the first virtual image can refer to the straight-line distance determined based on the position coordinates of the first reference part key point and the position coordinates of the second reference part key point in the first virtual image, or can refer to the horizontal distance determined based on the position coordinates of the first reference part key point and the position coordinates of the second reference part key point in the first virtual image, etc. The embodiments of the present application do not limit this.

[0119] Step 3: Determine the second measurement distance as the distance between the first reference part key point and the second reference part key point in the template virtual image. The first reference part key point and the second reference part key point in the template virtual image respectively match the first reference part key point and the second reference part key point in the first virtual image.

[0120] The second measurement distance is used to measure the characteristics of the reference part in the template virtual image in terms of distance. The second measurement distance is the distance between the key point of the first reference part and the key point of the second reference part in the template virtual image. Among them, the key point of the first reference part and the key point of the second reference part in the template virtual image respectively match the key point of the first reference part and the key point of the second reference part in the first virtual image. That is to say, the semantics corresponding to the key point of the first reference part in the template virtual image is the same as the semantics corresponding to the key point of the first reference part in the first virtual image, and the semantics corresponding to the key point of the second reference part in the template virtual image is the same as the semantics corresponding to the key point of the second reference part in the first virtual image.

[0121] For example, assume that the types of the first virtual image and the template virtual image are both three-dimensional face virtual images, and the reference part is the nose. If the key point of the first reference part and the key point of the second reference part in the first virtual image are respectively the left key point of the nose and the right key point of the nose in the first virtual image, then the key point of the first reference part and the key point of the second reference part in the template virtual image are respectively the left key point of the nose and the right key point of the nose in the template virtual image.

[0122] For the implementation process of determining the second measurement distance, refer to the implementation process of determining the first measurement distance in step 2, which will not be elaborated here. It should be noted that the specific method of determining the second measurement distance is the same as the specific method of determining the first measurement distance to ensure the comparability between the subsequent obtained first ratio and the second ratio.

[0123] Exemplarily, taking the types of the first virtual image and the template virtual image as three-dimensional face virtual images, the reference part as the nose, the key point of the first reference part as the left key point of the nose, and the key point of the second reference part as the right key point of the nose as an example, the first measurement distance and the second measurement distance are as Figure 6 shown. In Figure 6 , the first virtual image is the three-dimensional face virtual image shown in (1) in Figure 6 , and the first measurement distance is d1; the template virtual image is the three-dimensional face virtual image shown in (2) in Figure 6 , and the second measurement distance is d2.

[0124] Step 4: Take the ratio of the first measurement distance to the first reference distance as the first ratio; take the ratio of the second measurement distance to the second reference distance as the second ratio.

[0125] After obtaining the first reference distance and the second reference distance based on Step 1, and obtaining the first measurement distance and the second measurement distance based on Step 2 and Step 3, perform this Step 4. During the execution of this Step 4, use the ratio of the first measurement distance to the first reference distance as the first proportion, and use the ratio of the second measurement distance to the second reference distance as the second proportion.

[0126] Exemplarily, assume that the first reference distance is D1 and the first measurement distance is d1, then the first proportion is Assume that the second reference distance is D2 and the second measurement distance is d2, then the second proportion is

[0127] Step 2032: Based on the first proportion and the second proportion, obtain the difference information between the reference part in the first virtual image and the reference part in the template virtual image.

[0128] The first proportion is used to indicate the proportional characteristics of the reference part in the first virtual image in the first virtual image, and the second proportion is used to indicate the proportional characteristics of the reference part in the template virtual image in the template virtual image. In a possible implementation manner, the method for obtaining the difference information between the reference part in the first virtual image and the reference part in the template virtual image based on the first proportion and the second proportion is: use the difference between the first proportion and the second proportion as the difference information between the reference part in the first virtual image and the reference part in the template virtual image. In this case, assume that the first proportion is The second proportion is Then the difference information between the reference part in the first virtual image and the reference part in the template virtual image is

[0129] Of course, in the exemplary embodiment, the method for obtaining the difference information between the reference part in the first virtual image and the reference part in the template virtual image based on the first proportion and the second proportion can also be: calculate the difference between the first proportion and the second proportion, and use the product of the difference and the reference weight as the difference information between the reference part in the first virtual image and the reference part in the template virtual image. The reference weight is set according to experience or flexibly adjusted according to the application scenario, and the embodiments of the present application do not limit this.

[0130] In this Step 2032, use the difference between the proportions to reflect the difference between the reference part in the first virtual image and the reference part in the template virtual image.

[0131] Step 2033: Based on the reference virtual image, perform conversion processing on the difference information to obtain the target adjustment parameter.

[0132] After obtaining the difference information between the reference part in the first virtual avatar and the reference part in the template virtual avatar, perform a conversion process on the difference information based on the reference virtual avatar to obtain the target adjustment parameter for the reference part. Since the target adjustment parameter is used to adjust the reference part in the reference virtual avatar, during the process of obtaining the target adjustment parameter, it is necessary to perform a conversion process on the difference information based on the reference virtual avatar so that the obtained target adjustment parameter can achieve a relatively reliable adjustment effect.

[0133] In a possible implementation manner, the process of performing a conversion process on the difference information based on the reference virtual avatar to obtain the target adjustment parameter includes the following steps A to C:

[0134] Step A: Obtain a third reference distance, where the third reference distance is used to provide a measurement reference for the reference part in the reference virtual avatar.

[0135] For the process of obtaining the third reference distance, refer to the process of obtaining the first reference distance in step 2031, which will not be elaborated here. It should be noted that the specific method of obtaining the third reference distance is the same as the specific method of obtaining the first reference distance to ensure the reliability of the subsequent obtained conversion process. Exemplarily, if the first reference distance is the distance between the first reference point and the second reference point in the first virtual avatar, then the third reference distance is the distance between the first reference point and the second reference point in the reference virtual avatar. Among them, the first reference point and the second reference point in the reference virtual avatar respectively match the first reference point and the second reference point in the first virtual avatar.

[0136] Exemplarily, taking the type of the reference virtual avatar as a three-dimensional face virtual avatar, the first reference point as the left temple key point, and the second reference point as the right temple key point as an example, the third reference distance D3 is as Figure 7 shown.

[0137] Step B: Based on the reference position adjustment index corresponding to the reference part in the reference virtual avatar, obtain the unit change distance that matches the difference information.

[0138] The reference position adjustment index corresponding to the reference part in the reference virtual avatar is used to constrain the maximum movable distance of the position of the reference part in the reference virtual avatar. Exemplarily, the reference adjustment index corresponding to the reference part in the reference virtual avatar includes the sub-reference position adjustment indexes respectively corresponding to the key points of each reference part in the reference virtual avatar. Exemplarily, the sub-reference position adjustment index corresponding to any one of the key points of each reference part in the reference virtual avatar is used to indicate the maximum movable distance of the position of this any one of the key points of the reference part in the reference virtual avatar.

[0139] Exemplarily, the distance that the position can move includes the distances that the position can move in the directions of each coordinate axis respectively. Exemplarily, the distance that the position can move in the direction of any coordinate axis can be a positive value or a negative value. A positive value indicates moving in the positive direction of the any coordinate axis, and a negative value indicates moving in the negative direction of the any coordinate axis. The positive direction and the negative direction of any coordinate axis are set according to experience or flexibly adjusted according to the application scenario, and the embodiments of the present application do not limit this. Exemplarily, the positive direction of the horizontal coordinate axis is the direction horizontally to the right, and the negative direction is the direction horizontally to the left.

[0140] The embodiments of the present application do not limit the determination method of the reference position adjustment index corresponding to the reference part in the reference virtual image. Exemplarily, the process of obtaining the reference position adjustment index corresponding to the reference part in the reference virtual image is the process of obtaining the sub-reference position adjustment indexes corresponding to the key points of each reference part in the reference virtual image. In a possible implementation manner, the process of obtaining the sub-reference position adjustment index corresponding to any key point of each reference part in the reference virtual image is: obtaining the boundary virtual image corresponding to the reference virtual image, and using the residual between the position coordinates of the any reference part key point in the boundary virtual image and the position coordinates of the any reference part key point in the reference virtual image as the sub-reference position adjustment index corresponding to the any reference part key point.

[0141] Exemplarily, the residual between two position coordinates includes the sub-residuals of the two position coordinates on each coordinate axis. Exemplarily, if the virtual image is a three-dimensional virtual image, the residual between two position coordinates includes the sub-residuals of the two position coordinates on the three coordinate axes of X, Y, and Z. Exemplarily, the sub-residual of two position coordinates on any coordinate axis refers to the difference between the coordinate values of the two position coordinates on the any coordinate axis.

[0142] In an exemplary embodiment, the reference virtual image is provided by a virtual image adjustment system, and the virtual image adjustment system includes the blend shape resources corresponding to each adjustable part in the reference virtual image. In this case, the reference position adjustment index corresponding to the reference part in the reference virtual image refers to the blend shape resource corresponding to the reference part in the reference virtual image. Exemplarily, taking the type of the reference virtual image as a face virtual image and the reference part as the nose in the face virtual image as an example, the reference position adjustment index corresponding to the reference part in the reference virtual image refers to the blend shape resource corresponding to the nose in the face virtual image, which can be denoted as Nose blend shape (nose blend shape).

[0143] After obtaining the reference position adjustment indicators corresponding to the reference parts in the reference virtual image, based on the reference position adjustment indicators corresponding to the reference parts in the reference virtual image, obtain the unit change distance matching the difference information. The unit change distance matching the difference information is used to normalize the difference information.

[0144] In a possible implementation manner, the reference position adjustment indicators include sub-reference position adjustment indicators corresponding to the key points of each reference part in the reference virtual image. In this case, the process of obtaining the unit change distance matching the difference information based on the reference position adjustment indicators corresponding to the reference parts in the reference virtual image is as follows: among the sub-reference position adjustment indicators corresponding to the key points of each reference part in the reference virtual image, extract the sub-reference position adjustment indicators corresponding to the first reference part key point and the second reference part key point in the reference virtual image, and the first reference part key point and the second reference part key point in the reference virtual image respectively match the first reference part key point and the second reference part key point in the first virtual image; based on the indicator difference between the sub-reference position adjustment indicator corresponding to the first reference part key point in the reference virtual image and the sub-reference position adjustment indicator corresponding to the second reference part key point in the reference virtual image, determine the unit change distance matching the difference information.

[0145] Among the key points of each reference part in the reference virtual image, there are the first reference part key point and the second reference part key point, so the sub-reference position adjustment indicators corresponding to the first reference part key point and the second reference part key point in the reference virtual image can be directly extracted from the sub-reference position adjustment indicators corresponding to the key points of each reference part in the reference virtual image.

[0146] After extracting the sub-reference position adjustment indicators corresponding to the first reference part key point and the second reference part key point in the reference virtual image, based on the indicator difference between the sub-reference position adjustment indicator corresponding to the first reference part key point in the reference virtual image and the sub-reference position adjustment indicator corresponding to the second reference part key point in the reference virtual image, determine the unit change distance matching the difference information.

[0147] In a possible implementation manner, the sub-reference position adjustment indicator corresponding to any key point of a reference part in the reference virtual image includes the sub-residuals corresponding to the any key point on each coordinate axis respectively, and the coordinate formed by the sub-residuals corresponding to the any key point on each coordinate axis respectively is called the residual coordinate corresponding to the any key point. That is to say, based on the sub-reference position adjustment indicator corresponding to any key point of a reference part in the reference virtual image, the residual coordinate corresponding to the any key point in the reference virtual image can be obtained.

[0148] In an exemplary embodiment, the method for determining the unit change distance matching the difference information based on the index difference between the sub-reference position adjustment index corresponding to the first reference part key point in the reference virtual image and the sub-reference position adjustment index corresponding to the second reference part key point in the reference virtual image is as follows: based on the sub-reference position adjustment index corresponding to the first reference part key point in the reference virtual image, determine the residual coordinates corresponding to the first reference part key point in the reference virtual image; based on the sub-reference position adjustment index corresponding to the second reference part key point in the reference virtual image, determine the residual coordinates corresponding to the second reference part key point in the reference virtual image; use the target difference between the residual coordinates corresponding to the first reference part key point in the reference virtual image and the residual coordinates corresponding to the second reference part key point in the reference virtual image as the index difference, and determine the unit change distance matching the difference information based on the target difference.

[0149] In an exemplary embodiment, the form of the target difference is coordinates. The method for determining the unit change distance matching the difference information based on the target difference is as follows: use the distance between the position indicated by the target difference and the coordinate origin as the unit change distance matching the difference information.

[0150] In an exemplary embodiment, the form of the target difference is a distance. That is to say, the target difference between the residual coordinates corresponding to the first reference part key point in the reference virtual image and the residual coordinates corresponding to the second reference part key point in the reference virtual image is the distance between the position indicated by the residual coordinates corresponding to the first reference part key point in the reference virtual image and the position indicated by the residual coordinates corresponding to the second reference part key point in the reference virtual image. In this case, the method for determining the unit change distance matching the difference information based on the target difference is as follows: directly use the target difference as the unit change distance matching the difference information.

[0151] Exemplarily, the distance between the position indicated by the residual coordinates corresponding to the first reference part key point in the reference virtual image and the position indicated by the residual coordinates corresponding to the second reference part key point in the reference virtual image may refer to the straight-line distance between the position indicated by the residual coordinates corresponding to the first reference part key point in the reference virtual image and the position indicated by the residual coordinates corresponding to the second reference part key point in the reference virtual image, or may refer to the horizontal distance between the position indicated by the residual coordinates corresponding to the first reference part key point in the reference virtual image and the position indicated by the residual coordinates corresponding to the second reference part key point in the reference virtual image, etc. The embodiments of the present application do not limit this.

[0152] The key points based on which the unit change distance is obtained are matched with those based on which the first measurement distance is obtained. That is to say, the unit change distance matching the difference information is obtained by referring to the way of obtaining the first measurement distance. The reliability of the unit change distance obtained in this way is relatively high.

[0153] Step C: Based on the third reference distance and the unit change distance, perform a conversion process on the difference information to obtain a target adjustment parameter.

[0154] After obtaining the third reference distance based on Step A and the unit change distance based on Step B, perform a conversion process on the difference information based on the third reference distance and the unit change distance, and use the parameter obtained after the conversion process as the target adjustment parameter.

[0155] In a possible implementation manner, the difference information is the ratio difference between the first ratio and the second ratio. In this case, the process of performing a conversion process on the difference information based on the third reference distance and the unit change distance to obtain the target adjustment parameter is as follows: Multiply the third reference distance by the ratio difference to obtain the target change distance matching the difference information; Based on the ratio of the target change distance to the unit change distance, obtain the target adjustment parameter. Exemplarily, the ratio difference between the first ratio and the second ratio is Assume that the third reference distance is D3, then the target change distance is expressed as The ratio of the target change distance to the unit change distance is calculated based on Formula 2:

[0156]

[0157] Where s represents the ratio of the target change distance to the unit change distance; d0 represents the unit change distance.

[0158] The ratio difference is used to reflect the difference between the reference part in the first virtual image and the reference part in the template virtual image from the perspective of the ratio of the measurement distance to the reference distance. The third reference distance is the reference distance in the reference virtual image. Multiply the third reference distance by the ratio difference to obtain the target change distance matching the difference information. The target change distance can reflect the difference between the reference part in the finally obtained new virtual image and the reference part in the reference virtual image.

[0159] Exemplarily, the target adjustment parameter is an adjustment coefficient of a reference position adjustment index corresponding to a reference part in the reference virtual image. The process of obtaining the target adjustment parameter based on the ratio of the target change distance to the unit change distance is as follows: in response to the ratio of the target change distance to the unit change distance being less than the first value, taking the first value as the target adjustment parameter; in response to the ratio of the target change distance to the unit change distance being greater than the second value, taking the second value as the target adjustment parameter; in response to the ratio of the target change distance to the unit change distance being not less than the first value and not greater than the second value, taking the ratio of the target change distance to the unit change distance as the target adjustment parameter. Herein, the second value is greater than the first value.

[0160] The first value and the second value are set according to experience or flexibly adjusted according to the application scenario. The embodiments of the present application do not limit this. Exemplarily, the first value is -1 and the second value is 1. Based on the above method of obtaining the target adjustment parameter, the value of the target adjustment parameter can be restricted within the interval formed by the first value and the second value (e.g., [-1, 1]) to avoid too large a difference between the finally obtained new virtual image and the reference virtual image.

[0161] It should be noted that the above is only described by taking the number of reference parts as one example. For the case where the number of reference parts is multiple, for each reference part, a target adjustment parameter can be obtained by referring to the above method. One target adjustment parameter is used to adjust one reference part. That is to say, the number of target adjustment parameters is the same as the number of reference parts. Exemplarily, for the case where the number of reference parts is multiple, the target adjustment parameters obtained for different reference parts may be the same or different. The embodiments of the present application do not limit this.

[0162] In step 204, based on the target adjustment parameter, the reference part in the reference virtual image is adjusted to obtain a second virtual image. The second virtual image has a second attribute and matches the first virtual image.

[0163] After obtaining the target adjustment parameters, the reference parts in the reference virtual image are adjusted, and the virtual image obtained after the adjustment is used as the second virtual image. The second virtual image is the newly obtained virtual image finally obtained. Since the second virtual image is obtained by adjusting the reference virtual image, the second virtual image has the same attributes as the reference virtual image, that is, the second virtual image has a second attribute. In addition, since the second virtual image is obtained by adjusting the reference virtual image based on the target adjustment parameters, and the target adjustment parameters are used to provide an adjustment direction for adjusting the reference virtual image to match the first virtual image, the second virtual image obtained by adjusting according to the target adjustment parameters is a virtual image that matches the first virtual image. Therefore, the second virtual image has a second attribute and matches the first virtual image.

[0164] In a possible implementation manner, the number of target adjustment parameters is the same as the number of reference parts. For each reference part, a target adjustment parameter can be obtained. For the case where the number of target adjustment parameters is multiple, in step 204, based on each target adjustment parameter, a corresponding reference part in the reference virtual image is adjusted, and the virtual image obtained after being adjusted based on all the target adjustment parameters is used as the second virtual image. In the embodiments of the present application, an example where the number of reference parts is one is used for illustration.

[0165] In a possible implementation manner, the process of adjusting the reference part in the reference virtual image based on the target adjustment parameter to obtain the second virtual image is as follows: based on the target adjustment parameter and the reference position adjustment index corresponding to the reference part in the reference virtual image, the target position adjustment index corresponding to the reference part in the reference virtual image is obtained. The target position adjustment index includes sub-target position adjustment indexes corresponding to the key points of each reference part in the reference virtual image; the position of the reference part in the reference virtual image is adjusted by using the sub-target position adjustment indexes corresponding to the key points of each reference part in the reference virtual image to obtain the second virtual image.

[0166] In a possible implementation manner, the method for obtaining the target position adjustment index corresponding to the reference part in the reference virtual image based on the target adjustment parameter and the reference position adjustment index corresponding to the reference part in the reference virtual image is: multiplying the target adjustment parameter by the reference position adjustment index corresponding to the reference part in the reference virtual image as the target position adjustment index corresponding to the reference part in the reference virtual image.

[0167] Exemplarily, the reference position adjustment index corresponding to the reference part in the reference virtual avatar includes the sub-reference position adjustment indexes corresponding to the key points of each reference part in the reference virtual avatar. The process of calculating the product of the target adjustment parameter and the reference position adjustment index corresponding to the reference part in the reference virtual avatar is to calculate the product of the target adjustment parameter and the sub-reference position adjustment indexes corresponding to the key points of each reference part in the reference virtual avatar respectively. The product of the target adjustment parameter and the sub-reference position adjustment index corresponding to any key point of the reference part in the reference virtual avatar is the sub-target position adjustment index corresponding to the any key point of the reference part in the reference virtual avatar.

[0168] Exemplarily, the sub-target position adjustment index corresponding to any key point of the reference part in the reference virtual avatar includes the coordinate adjustment indexes corresponding to the any key point of the reference part in the reference virtual avatar on each coordinate axis. In a possible implementation manner, the process of using the sub-target position adjustment indexes corresponding to the key points of each reference part in the reference virtual avatar to adjust the position of the reference part in the reference virtual avatar to obtain the second virtual avatar is as follows: using the sub-target position adjustment indexes corresponding to the key points of each reference part in the reference virtual avatar, adjusting the position coordinates of the key points of each reference part in the reference virtual avatar, taking the key points corresponding to the adjusted position coordinates as the adjusted key points of the reference part, and taking the virtual avatar composed of the adjusted key points of the reference part and the unadjusted key points in the reference virtual avatar as the second virtual avatar.

[0169] In an exemplary embodiment, assuming that the target adjustment parameter is 1.0, the type of the reference virtual avatar is a face virtual avatar, and the reference part is the nose, the process of adjusting the reference part in the reference virtual avatar based on the target adjustment parameter to obtain the second virtual avatar is as Figure 8 shown. In Figure 8 , first calculate the product between the target adjustment parameter 1.0 and the reference position adjustment index (Nose blend shape) corresponding to the nose in the reference virtual avatar, and then use the calculated product to adjust the nose in the reference virtual avatar to obtain the second virtual avatar. According to Figure 8 , it can be known that the width of the nose in the second virtual avatar is basically twice the width of the nose in the reference virtual avatar.

[0170] In a possible implementation, the reference virtual avatar is provided by the virtual avatar adjustment system. The process of adjusting the reference part in the reference virtual avatar based on the target adjustment parameter to obtain the second virtual avatar is implemented by calling the virtual avatar adjustment system. That is to say, call the virtual avatar adjustment system to adjust the reference part in the reference virtual avatar based on the target adjustment parameter to obtain the second virtual avatar. The type of the virtual avatar adjustment system is related to the actual application scenario. Exemplarily, for the actual application scenario of obtaining a human face virtual avatar, the virtual avatar adjustment system refers to a face sculpting system.

[0171] Exemplarily, the process of obtaining the second virtual avatar is as Figure 9 shown. Obtain the first virtual avatar and the reference virtual avatar, where the first virtual avatar has a first attribute and the reference virtual avatar has a second attribute. Obtain a template virtual avatar with the first attribute that matches the reference virtual avatar. Based on the difference information between the reference part in the first virtual avatar and the reference part in the template virtual avatar, obtain the target adjustment parameter; call the virtual avatar adjustment system and adjust the reference part in the reference virtual avatar based on the target adjustment parameter to obtain the second virtual avatar that has the second attribute and matches the first virtual avatar.

[0172] In an exemplary embodiment, the method for obtaining a virtual avatar provided in this application embodiment can be regarded as an attribute transfer scheme. Exemplarily, for the case where the type of the attribute is style, the method for obtaining a virtual avatar provided in this application embodiment can achieve the style transfer of the virtual avatar. In the actual application scenario, the type of the virtual avatar is a 3D human face virtual avatar, and the type of the attribute is style. The virtual avatar adjustment system called in this application embodiment can refer to a game / film and television face sculpting system. In this case, the solution provided in this application embodiment is a 3D human face virtual avatar style transfer scheme based on the game / film and television face sculpting system, which can achieve the transfer from a realistic style to a specific game / film and television style.

[0173] Exemplarily, when obtaining a 3D human face virtual avatar (i.e., the first virtual avatar) in the realistic style of a player / actor, if there is a complete game / film and television face sculpting system for a certain work, it can be converted for use in a specific game / film and television style. First, establish a corresponding neutral face template (i.e., the template virtual avatar) in the realistic style for the neutral face of the face sculpting system (i.e., the reference virtual avatar), then calculate the difference between the 3D human face virtual avatar in the realistic style and this neutral face template, and convert the difference into the coefficient of the blend shape resource in the face sculpting system, so that a character with a unified style and similar appearance to the player / actor can be sculpted using the native game / film and television face sculpting system. The solution provided in this application embodiment can effectively reduce the cumbersome face sculpting time of players and improve the game experience; if used for film and television purposes, it can effectively reduce the art labor cost.

[0174] In the embodiments of the present application, the process of obtaining the adjustment parameters for adjusting the reference virtual image does not rely on manual operation and can be automatically executed. The efficiency of obtaining the adjustment parameters is relatively high, which is beneficial to improving the efficiency of obtaining a new virtual image. In addition, the adjustment parameters for adjusting the reference virtual image are obtained based on the difference information between the reference part in the first virtual image and the same reference part in the template virtual image that matches the reference virtual image. This can provide strong reference for adjusting the reference virtual image into a new virtual image that matches the first virtual image, and the reliability of the obtained adjustment parameters is relatively high. The quality of the new virtual image obtained by using the obtained adjustment parameters is relatively good.

[0175] See Figure 10 , the embodiments of the present application provide a device for obtaining a virtual image, and the device includes:

[0176] The first obtaining unit 1001 is configured to obtain a first virtual image and a reference virtual image. The first virtual image has a first attribute, and the reference virtual image has a second attribute, and the first attribute is different from the second attribute;

[0177] The second obtaining unit 1002 is configured to obtain a template virtual image with the first attribute that matches the reference virtual image;

[0178] The third obtaining unit 1003 is configured to obtain a target adjustment parameter based on the difference information between the reference part in the first virtual image and the reference part in the template virtual image. The target adjustment parameter is used to provide an adjustment direction for adjusting the reference virtual image into a virtual image that matches the first virtual image;

[0179] The adjustment unit 1004 is configured to adjust the reference part in the reference virtual image based on the target adjustment parameter to obtain a second virtual image. The second virtual image has the second attribute and matches the first virtual image.

[0180] In a possible implementation manner, see Figure 11 , the third obtaining unit 1003 includes:

[0181] The first obtaining subunit 10031 is configured to obtain a first ratio and a second ratio. The first ratio is used to indicate the proportional feature of the reference part in the first virtual image in the first virtual image, and the second ratio is used to indicate the proportional feature of the reference part in the template virtual image in the template virtual image;

[0182] The second obtaining subunit 10032 is configured to obtain the difference information between the reference part in the first virtual image and the reference part in the template virtual image based on the first ratio and the second ratio;

[0183] The processing subunit 10033 is configured to perform conversion processing on the difference information based on the reference virtual image to obtain the target adjustment parameter.

[0184] In a possible implementation manner, the first acquisition subunit 10031 is configured to acquire a first reference distance and a second reference distance. The first reference distance is used to provide a measurement reference for a reference part in the first virtual image, and the second reference distance is used to provide a measurement reference for a reference part in the template virtual image. The distance between the first reference part key point and the second reference part key point in the first virtual image is determined as the first measurement distance. Both the first reference part key point and the second reference part key point in the first virtual image are one of the reference part key points in the respective reference parts of the first virtual image, and the respective reference part key points in the first virtual image are used to indicate the reference parts in the first virtual image. The distance between the first reference part key point and the second reference part key point in the template virtual image is determined as the second measurement distance. The first reference part key point and the second reference part key point in the template virtual image respectively match the first reference part key point and the second reference part key point in the first virtual image. The ratio of the first measurement distance to the first reference distance is used as the first ratio. The ratio of the second measurement distance to the second reference distance is used as the second ratio.

[0185] In a possible implementation manner, the processing subunit 10033 is configured to acquire a third reference distance, where the third reference distance is used to provide a measurement reference for a reference part in the reference virtual image. Based on the reference position adjustment index corresponding to the reference part in the reference virtual image, a unit change distance matching the difference information is acquired. The difference information is subjected to conversion processing based on the third reference distance and the unit change distance to obtain the target adjustment parameter.

[0186] In a possible implementation manner, the reference position adjustment index includes sub-reference position adjustment indexes respectively corresponding to the respective reference part key points in the reference virtual image. The processing subunit 10033 is further configured to extract, from the sub-reference position adjustment indexes respectively corresponding to the respective reference part key points in the reference virtual image, the sub-reference position adjustment indexes respectively corresponding to the first reference part key point and the second reference part key point in the reference virtual image. The first reference part key point and the second reference part key point in the reference virtual image respectively match the first reference part key point and the second reference part key point in the first virtual image. Based on the index difference between the sub-reference position adjustment index corresponding to the first reference part key point in the reference virtual image and the sub-reference position adjustment index corresponding to the second reference part key point in the reference virtual image, a unit change distance matching the difference information is determined.

[0187] In a possible implementation, the difference information is the difference in ratios between the first ratio and the second ratio; the processing subunit 10033 is further configured to use the product of the third reference distance and the difference in ratios as the target change distance matching the difference information; and obtain a target adjustment parameter based on the ratio of the target change distance to the unit change distance.

[0188] In a possible implementation, the processing subunit 10033 is further configured to, in response to the ratio of the target change distance to the unit change distance being less than a first value, use the first value as the target adjustment parameter; in response to the ratio of the target change distance to the unit change distance being greater than a second value, use the second value as the target adjustment parameter, where the second value is greater than the first value; and in response to the ratio of the target change distance to the unit change distance being not less than the first value and not greater than the second value, use the ratio of the target change distance to the unit change distance as the target adjustment parameter.

[0189] In a possible implementation, the adjustment unit 1004 is configured to obtain a target position adjustment index corresponding to a reference part in the reference virtual image based on the target adjustment parameter and the reference position adjustment index corresponding to the reference part in the reference virtual image, where the target position adjustment index includes sub-target position adjustment indexes corresponding to respective key points of each reference part in the reference virtual image; and use the sub-target position adjustment indexes corresponding to respective key points of each reference part in the reference virtual image to adjust the position of the reference part in the reference virtual image to obtain a second virtual image.

[0190] In a possible implementation, the second acquisition unit 1002 is configured to acquire at least one candidate virtual image having a first attribute; acquire the matching degree between each of the at least one candidate virtual image and the reference virtual image; and acquire a template virtual image based on the candidate virtual images whose matching degree with the reference virtual image meets the selection condition.

[0191] In a possible implementation, the reference virtual image is provided by a virtual image adjustment system, and the adjustment unit 1004 is configured to call the virtual image adjustment system and adjust the reference part in the reference virtual image based on the target adjustment parameter to obtain a second virtual image.

[0192] In the embodiments of the present application, the process of obtaining the adjustment parameters for adjusting the reference virtual image does not rely on manual operation and can be automatically executed, with a relatively high efficiency of obtaining the adjustment parameters, which is beneficial to improving the efficiency of obtaining new virtual images. In addition, the adjustment parameters for adjusting the reference virtual image are obtained based on the difference information between the reference parts in the first virtual image and the same reference parts in the template virtual image matching the reference virtual image, which can provide strong reference for adjusting the reference virtual image into a new virtual image matching the first virtual image. The reliability of the obtained adjustment parameters is relatively high, and the quality of the new virtual image obtained by using the obtained adjustment parameters is good.

[0193] It should be noted that when the device provided in the above embodiments realizes its functions, only the division of the above function modules is used for illustration. In actual applications, the above functions can be allocated to different function modules according to needs, that is, the internal structure of the device is divided into different function modules to complete all or part of the functions described above. In addition, the device provided in the above embodiments and the method embodiments belong to the same concept, and the specific implementation process can be found in the method embodiments and will not be repeated here.

[0194] In an exemplary embodiment, a computer device is further provided. The computer device includes a processor and a memory, and at least one computer program is stored in the memory. The at least one computer program is loaded and executed by one or more processors to implement any one of the above methods for obtaining a virtual image. The computer device may refer to a terminal or a server. Next, the structures of the terminal and the server will be introduced separately.

[0195] Figure 12 It is a schematic structural diagram of a terminal provided in the embodiments of the present application. The terminal may be: a smart phone, a tablet computer, a notebook computer or a desktop computer. The terminal may also be referred to by other names such as user equipment, portable terminal, laptop terminal, desktop terminal, etc.

[0196] Generally, the terminal includes: a processor 1201 and a memory 1202.

[0197] The processor 1201 may include one or more processing cores, such as a quad-core processor, an octa-core processor, etc. The processor 1201 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), or PLA (Programmable Logic Array). The processor 1201 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the wake state, also known as the CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 1201 may be integrated with a GPU (Graphics Processing Unit), and the GPU is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 1201 may further include an AI (Artificial Intelligence) processor, and the AI processor is used to process computational operations related to machine learning.

[0198] The memory 1202 may include one or more computer-readable storage media, and the computer-readable storage media may be non-transitory. The memory 1202 may further include high-speed random access memory and non-volatile memory, such as one or more disk storage devices and flash storage devices. In some embodiments, the non-transitory computer-readable storage media in the memory 1202 is used to store at least one instruction, and the at least one instruction is used to be executed by the processor 1201 to implement the method for obtaining a virtual image provided in the method embodiments of the present application.

[0199] In some embodiments, the terminal may optionally further include: a peripheral device interface 1203 and at least one peripheral device. The processor 1201, the memory 1202, and the peripheral device interface 1203 may be connected through a bus or signal lines. Each peripheral device may be connected to the peripheral device interface 1203 through a bus, signal lines, or a circuit board. Specifically, the peripheral devices include at least one of a radio frequency circuit 1204, a display screen 1205, a camera assembly 1206, an audio circuit 1207, and a power supply 1209.

[0200] The peripheral device interface 1203 can be used to connect at least one I / O (Input / Output) related peripheral device to the processor 1201 and the memory 1202. The radio frequency circuit 1204 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The radio frequency circuit 1204 communicates with the communication network and other communication devices through electromagnetic signals. The display screen 1205 is used to display the UI (User Interface). The UI may include graphics, text, icons, videos, and any combination thereof. The camera component 1206 is used to collect images or videos.

[0201] The audio circuit 1207 may include a microphone and a speaker. The microphone is used to collect sound waves of the user and the environment, and convert the sound waves into electrical signals for input to the processor 1201 for processing, or input to the radio frequency circuit 1204 to achieve voice communication. The speaker is used to convert the electrical signals from the processor 1201 or the radio frequency circuit 1204 into sound waves. The power supply 1209 is used to supply power to each component in the terminal. The power supply 1209 can be alternating current, direct current, a disposable battery, or a rechargeable battery.

[0202] In some embodiments, the terminal further includes one or more sensors 1210. The one or more sensors 1210 include but are not limited to: an acceleration sensor 1211, a gyroscope sensor 1212, a pressure sensor 1213, an optical sensor 1215, and a proximity sensor 1216.

[0203] The acceleration sensor 1211 can detect the magnitude of acceleration on the three coordinate axes of the coordinate system established by the terminal. The gyroscope sensor 1212 can detect the body direction and rotation angle of the terminal. The gyroscope sensor 1212 can cooperate with the acceleration sensor 1211 to collect the 3D actions of the user on the terminal. The pressure sensor 1213 can be disposed on the side frame of the terminal and / or the lower layer of the display screen 1205. When the pressure sensor 1213 is disposed on the side frame of the terminal, it can detect the holding signal of the user on the terminal, and the processor 1201 can perform left / right hand recognition or quick operation according to the holding signal collected by the pressure sensor 1213. When the pressure sensor 1213 is disposed on the lower layer of the display screen 1205, the processor 1201 can control the operable controls on the UI interface according to the pressure operation of the user on the display screen 1205.

[0204] The optical sensor 1215 is used to collect the ambient light intensity. The proximity sensor 1216, also known as a distance sensor, is usually disposed on the front panel of the terminal. The proximity sensor 1216 is used to collect the distance between the user and the front of the terminal.

[0205] Those skilled in the art can understand,Figure 12 The structure shown does not constitute a limitation on the terminal, and may include more or fewer components than shown, or combine certain components, or adopt a different component arrangement.

[0206] Figure 13 FIG. 5 is a schematic structural diagram of a server provided by an embodiment of the present application. The server may vary greatly due to different configurations or performances, and may include one or more processors (Central Processing Units, CPUs) 1301 and one or more memories 1302. Among them, at least one computer program is stored in the one or more memories 1302, and the at least one computer program is loaded and executed by the one or more processors 1301 to implement the method for obtaining a virtual image provided by each of the above method embodiments. Of course, the server may also have components such as a wired or wireless network interface, a keyboard, and an input / output interface for input / output. The server may also include other components for implementing the functions of the device, which will not be elaborated here.

[0207] In an exemplary embodiment, there is also provided a computer-readable storage medium storing at least one computer program, and the at least one computer program is loaded and executed by a processor of a computer device to implement any one of the above methods for obtaining a virtual image.

[0208] In a possible implementation manner, the above computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a compact disc read-only memory (CD-ROM), a magnetic tape, a floppy disk, an optical data storage device, etc.

[0209] In an exemplary embodiment, there is also provided a computer program product or a computer program. The computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes any one of the above methods for obtaining a virtual image.

[0210] It should be noted that the terms "first", "second", etc. in the description and claims of this application are used to distinguish similar objects and do not necessarily describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances so that the embodiments of this application described here can be implemented in an order other than those illustrated or described here. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. On the contrary, they are merely examples of devices and methods consistent with some aspects of this application as detailed in the appended claims.

[0211] It should be understood that the "plurality" mentioned herein refers to two or more. "And / or" describes the association relationship of associated objects and indicates that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone. The character " / " generally represents an "or" relationship between the associated objects before and after.

[0212] The above are only exemplary embodiments of this application and are not intended to limit this application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of this application shall be included within the protection scope of this application.

Claims

1. A method for obtaining an avatar, characterized in that, The method includes: Obtain a first virtual image and a reference virtual image, where the first virtual image has a first attribute, the reference virtual image has a second attribute, and the first attribute is different from the second attribute; Obtain a template virtual image with the first attribute that matches the reference virtual image, where the match with the reference virtual image means being similar to the overall features of the reference virtual image, and the overall features are represented by the appearance form; Based on the difference information between the reference part in the first virtual image and the reference part in the template virtual image, obtain a target adjustment parameter, where the target adjustment parameter is used to provide an adjustment direction for adjusting the reference virtual image to match the first virtual image, and the match with the first virtual image means being similar to the overall features of the first virtual image; Based on the target adjustment parameter, adjust the reference part in the reference virtual image to obtain a second virtual image, where the second virtual image has the second attribute and matches the first virtual image, and the adjustment changes the overall features of the reference virtual image without changing the second attribute that the reference virtual image has.

2. The method according to claim 1, characterized in that, The obtaining of the target adjustment parameter based on the difference information between the reference part in the first virtual image and the reference part in the template virtual image includes: Obtain a first ratio and a second ratio, where the first ratio is used to indicate the proportional feature of the reference part in the first virtual image in the first virtual image, and the second ratio is used to indicate the proportional feature of the reference part in the template virtual image in the template virtual image; Based on the first ratio and the second ratio, obtain the difference information between the reference part in the first virtual image and the reference part in the template virtual image; Based on the reference virtual image, perform a conversion process on the difference information to obtain the target adjustment parameter.

3. The method according to claim 2, wherein The obtaining of the first ratio and the second ratio includes: Obtain a first reference distance and a second reference distance, where the first reference distance is used to provide a measurement benchmark for the reference part in the first virtual image, and the second reference distance is used to provide a measurement benchmark for the reference part in the template virtual image; Determine the distance between a first reference part key point and a second reference part key point in the first virtual image as a first measurement distance, where the first reference part key point and the second reference part key point in the first virtual image are both one of the reference part key points in the first virtual image, and the reference part key points in the first virtual image are used to indicate the reference part in the first virtual image; Determine the distance between a first reference part key point and a second reference part key point in the template virtual image as a second measurement distance, where the first reference part key point and the second reference part key point in the template virtual image respectively match the first reference part key point and the second reference part key point in the first virtual image; Use the ratio of the first measurement distance to the first reference distance as the first proportion; use the ratio of the second measurement distance to the second reference distance as the second proportion.

4. The method according to claim 3, wherein The converting and processing the difference information based on the reference virtual image to obtain the target adjustment parameter includes: Obtain a third reference distance, where the third reference distance is used to provide a measurement reference for the reference part in the reference virtual image; Based on the reference position adjustment index corresponding to the reference part in the reference virtual image, obtain a unit change distance that matches the difference information; Convert and process the difference information based on the third reference distance and the unit change distance to obtain the target adjustment parameter.

5. The method according to claim 4, wherein The reference position adjustment index includes sub-reference position adjustment indexes corresponding to key points of each reference part in the reference virtual image; the obtaining a unit change distance that matches the difference information based on the reference position adjustment index corresponding to the reference part in the reference virtual image includes: Among the sub-reference position adjustment indexes corresponding to key points of each reference part in the reference virtual image, extract the sub-reference position adjustment indexes corresponding to the first reference part key point and the second reference part key point in the reference virtual image, where the first reference part key point and the second reference part key point in the reference virtual image respectively match the first reference part key point and the second reference part key point in the first virtual image; Based on the index difference between the sub-reference position adjustment index corresponding to the first reference part key point in the reference virtual image and the sub-reference position adjustment index corresponding to the second reference part key point in the reference virtual image, determine the unit change distance that matches the difference information.

6. The method according to claim 4, characterized in that, The difference information is the proportion difference between the first proportion and the second proportion; the converting and processing the difference information based on the third reference distance and the unit change distance to obtain the target adjustment parameter includes: Use the product of the third reference distance and the proportion difference as the target change distance that matches the difference information; Based on the ratio of the target change distance to the unit change distance, obtain the target adjustment parameter.

7. The method according to claim 6, characterized in that The obtaining the target adjustment parameter based on the ratio of the target change distance to the unit change distance includes: In response to the ratio of the target change distance to the unit change distance being less than a first value, use the first value as the target adjustment parameter; In response to the ratio of the target change distance to the unit change distance being greater than a second value, use the second value as the target adjustment parameter, where the second value is greater than the first value; In response to the ratio of the target change distance to the unit change distance being not less than the first value and not greater than the second value, use the ratio of the target change distance to the unit change distance as the target adjustment parameter.

8. The method according to any one of claims 1-7, characterized in that, The adjusting the reference part in the reference virtual image based on the target adjustment parameter to obtain a second virtual image includes: Based on the target adjustment parameter and the reference position adjustment index corresponding to the reference part in the reference virtual image, obtain the target position adjustment index corresponding to the reference part in the reference virtual image, where the target position adjustment index includes sub-target position adjustment indexes corresponding to each reference part key point in the reference virtual image; Use the sub-target position adjustment indexes corresponding to each reference part key point in the reference virtual image to adjust the position of the reference part in the reference virtual image to obtain the second virtual image.

9. The method according to any one of claims 1-7, characterized in that, The obtaining of the template virtual image having the first attribute and matching the reference virtual image includes: Obtain at least one candidate virtual image having the first attribute; Obtain the matching degree of each of the at least one candidate virtual image with the reference virtual image; Based on the candidate virtual image whose matching degree with the reference virtual image meets the selection condition, obtain the template virtual image.

10. The method according to any one of claims 1-7, characterized in that The reference virtual image is provided by a virtual image adjustment system. The adjusting the reference part in the reference virtual image based on the target adjustment parameter to obtain a second virtual image includes: Invoke the virtual image adjustment system, and based on the target adjustment parameter, adjust the reference part in the reference virtual image to obtain the second virtual image.

11. An apparatus for obtaining an avatar, characterized in that, The device includes: A first obtaining unit, configured to obtain a first virtual image and a reference virtual image, where the first virtual image has a first attribute, the reference virtual image has a second attribute, and the first attribute is different from the second attribute; A second obtaining unit, configured to obtain a template virtual image having the first attribute and matching the reference virtual image, where being matched with the reference virtual image means being similar to the overall features of the reference virtual image, and the overall features are represented by the appearance form; A third obtaining unit, configured to obtain a target adjustment parameter based on the difference information between the reference part in the first virtual image and the reference part in the template virtual image, where the target adjustment parameter is used to provide an adjustment direction for adjusting the reference virtual image to be a virtual image matching the first virtual image, and being matched with the first virtual image means being similar to the overall features of the first virtual image; An adjustment unit, configured to adjust the reference part in the reference virtual image based on the target adjustment parameter to obtain a second virtual image, where the second virtual image has the second attribute and is matched with the first virtual image, and the adjustment changes the overall features of the reference virtual image without changing the second attribute possessed by the reference virtual image.

12. The device according to claim 11, wherein The third obtaining unit includes: A first obtaining subunit, configured to obtain a first ratio and a second ratio, where the first ratio is used to indicate the proportional feature of the reference part in the first virtual image in the first virtual image, and the second ratio is used to indicate the proportional feature of the reference part in the template virtual image in the template virtual image; A second acquisition subunit, configured to acquire difference information between the reference part in the first virtual image and the reference part in the template virtual image based on the first ratio and the second ratio; A processing subunit, configured to perform conversion processing on the difference information based on the reference virtual image to obtain the target adjustment parameter.

13. The device according to claim 12, characterized in that, The first acquisition subunit is configured to acquire a first reference distance and a second reference distance, where the first reference distance is used to provide a measurement benchmark for the reference part in the first virtual image, and the second reference distance is used to provide a measurement benchmark for the reference part in the template virtual image; determine the distance between the first reference part key point and the second reference part key point in the first virtual image as the first measurement distance, where the first reference part key point and the second reference part key point in the first virtual image are both one of the reference part key points in the respective reference part key points in the first virtual image, and the respective reference part key points in the first virtual image are used to indicate the reference part in the first virtual image; Determine the distance between the first reference part key point and the second reference part key point in the template virtual image as the second measurement distance, where the first reference part key point and the second reference part key point in the template virtual image respectively match the first reference part key point and the second reference part key point in the first virtual image; use the ratio of the first measurement distance to the first reference distance as the first ratio; Use the ratio of the second measurement distance to the second reference distance as the second ratio.

14. The device according to claim 13, characterized in that, The processing subunit is configured to acquire a third reference distance, where the third reference distance is used to provide a measurement benchmark for the reference part in the reference virtual image; acquire a unit change distance matching the difference information based on the reference position adjustment index corresponding to the reference part in the reference virtual image; perform conversion processing on the difference information based on the third reference distance and the unit change distance to obtain the target adjustment parameter.

15. The device according to claim 14, characterized in that, The reference position adjustment index includes sub-reference position adjustment indexes respectively corresponding to the respective reference part key points in the reference virtual image; the processing subunit is configured to extract the sub-reference position adjustment indexes respectively corresponding to the first reference part key point and the second reference part key point in the reference virtual image from the sub-reference position adjustment indexes respectively corresponding to the respective reference part key points in the reference virtual image, where the first reference part key point and the second reference part key point in the reference virtual image respectively match the first reference part key point and the second reference part key point in the first virtual image; determine the unit change distance matching the difference information based on the index difference between the sub-reference position adjustment index corresponding to the first reference part key point in the reference virtual image and the sub-reference position adjustment index corresponding to the second reference part key point in the reference virtual image.

16. The device according to claim 14, characterized in that, The difference information is the ratio difference between the first ratio and the second ratio; the processing subunit is configured to use the product of the third reference distance and the ratio difference as the target change distance matching the difference information; and obtain the target adjustment parameter based on the ratio of the target change distance to the unit change distance.

17. The device according to claim 16, characterized in that, The processing subunit is configured to, in response to the ratio of the target change distance to the unit change distance being less than a first value, use the first value as the target adjustment parameter; in response to the ratio of the target change distance to the unit change distance being greater than a second value, use the second value as the target adjustment parameter, where the second value is greater than the first value; in response to the ratio of the target change distance to the unit change distance being not less than the first value and not greater than the second value, use the ratio of the target change distance to the unit change distance as the target adjustment parameter.

18. The device according to any one of claims 11-17, characterized in that, The adjustment unit is configured to obtain the target position adjustment index corresponding to the reference part in the reference virtual image based on the target adjustment parameter and the reference position adjustment index corresponding to the reference part in the reference virtual image, where the target position adjustment index includes sub-target position adjustment indexes corresponding to respective key points of each reference part in the reference virtual image; and use the sub-target position adjustment indexes corresponding to respective key points of each reference part in the reference virtual image to adjust the position of the reference part in the reference virtual image to obtain the second virtual image.

19. The device according to any one of claims 11-17, characterized in that The second obtaining unit is configured to obtain at least one candidate virtual image having the first attribute; and obtain the matching degree of each of the at least one candidate virtual image with the reference virtual image; Based on the candidate virtual images whose matching degree with the reference virtual image meets the selection condition, obtain the template virtual image.

20. The device according to any one of claims 11-17, characterized in that, The reference virtual image is provided by a virtual image adjustment system, and the adjustment unit is configured to call the virtual image adjustment system and adjust the reference part in the reference virtual image based on the target adjustment parameter to obtain the second virtual image.

21. A computer device, characterized in that, The computer device includes a processor and a memory, and at least one computer program is stored in the memory, and the at least one computer program is loaded and executed by the processor to implement the method for obtaining a virtual image according to any one of claims 1 to 10.

22. A computer-readable storage medium, characterized in that, At least one computer program is stored in the computer-readable storage medium, and the at least one computer program is loaded and executed by a processor to implement the method for obtaining a virtual image according to any one of claims 1 to 10.

23. A computer program product, characterized in that, The computer program product includes computer instructions, the computer instructions are stored in a computer-readable storage medium, a processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the method for obtaining a virtual image according to any one of claims 1 to 10.

Citation Information

Patent Citations

  • Face reconstruction method and device, computer device and storage medium

    CN112419454A