Data migration method and device, electronic device, and readable storage medium

Through the data migration method, the data of the first model is migrated to a second model with the same topological relationship, which solves the problem of low accuracy of virtual objects' actions and achieves the effect of closer virtual objects' actions and entity actions.

CN113379903BActive Publication Date: 2025-04-04BEIJING IQIYI TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110744454.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-06-30
Publication Date
2025-04-04
Estimated Expiration
2041-06-30

AI Technical Summary

Technical Problem

In the prior art, the movement accuracy of 3D virtual objects is low, especially due to the difference in body proportions between the model and the entity.

Method used

Through a data migration method, the data of the first model is migrated to a second model with the same topological relationship, the node sequence path length specificity of the first model is masked using the normalization method, and the normalization vector is reverse normalized to the second model to match the node sequence path length characteristics of the second model, thereby determining the migration position coordinates of the target node.

Benefits of technology

It improves the accuracy of the movement of the virtual object, makes the movement of the virtual object closer to the physical movement, and reduces the phenomenon of "model penetration".

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113379903B_ABST
    Figure CN113379903B_ABST
Patent Text Reader

Abstract

The data migration method and device, electronic device, and readable storage medium provided by the present application obtain the first vector pointing from the first reference point to the target node based on the position coordinates of the reference point in the first model and the position coordinates of the reference point, take the sum of the projection lengths of the vectors of the first model on the first vector as the first parameter, take the sum of the projection lengths of the vectors of the second model on the first vector as the second parameter, use the first parameter to normalize the first vector to obtain the normalized first vector, use the second parameter to denormalize the normalized first vector to the second model to obtain the pointing vector of the first reference point, and determine the migration position coordinates obtained after migrating the position coordinates of the target node to the corresponding target node based on the pointing displacement coordinates of the first reference point. The action presented by the virtual object driven by the second model based on the migration position coordinates can be close to the action of the entity, that is, it has high accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of electronic information, and in particular to a data migration method and device, an electronic device, and a readable storage medium. Background Art

[0002] The production of 3D virtual objects (usually including people and animals) is widely used in scenes such as animation production and movie special effects. Taking 3D virtual characters as an example of 3D virtual objects, the general process of producing 3D virtual characters is: using motion capture technology to capture various actions of entities such as actors, generate data indicating these actions, and then assign the data to a specified 3D model.

[0003] In practice, the proportions of the various parts of the model used to carry data may be different from the proportions of the various parts of the actual motion capture entity. Taking 3D virtual characters as an example: the 3D model used to carry data is different from the body proportions of the actor, so the produced virtual object may have inaccurate movements, such as "piercing the model" due to the difference in body proportions between the 3D model and the actor. "Piercing the model" means that the 3D model makes some movements that do not conform to the principles of physics, such as limbs extending into the body, such as Figure 1 As shown in the circled area, the right arm of the two-dimensional virtual idol has penetrated into the body.

[0004] It can be seen that how to improve the accuracy of virtual object movements has become an urgent problem to be solved in the field of virtual object production. Summary of the invention

[0005] The present application provides a data migration method and device, an electronic device, and a readable storage medium, the purpose of which is to solve the problem of how to improve the accuracy of the actions of virtual objects.

[0006] In order to achieve the above objectives, this application provides the following technical solutions:

[0007] A data migration method for migrating data of a first model to a second model with the same topological relationship, comprising:

[0008] Acquire the position coordinates of a reference point in the grid of the first model according to the rotation data of the node in the first model;

[0009] According to the position coordinates of the nodes in the first model and the position coordinates of the reference point, a vector from the first reference point to the target node is obtained as a first vector; the target node is any node to be migrated in the first model, and the first reference point is any reference point in the grid of the first model;

[0010] The sum of the projection lengths of each vector of the first model on the first vector is used as the first parameter; each vector of the first model is a vector in the first node sequence, in which the previous node of two adjacent nodes points to the next node; the first node sequence is a sequence of nodes passed in sequence in the process of moving from the first node to the target node on the first model, in the order in which they are passed; the first node is a node whose distance from the first reference point meets a preset condition in the initial state of the first model;

[0011] The sum of the projection lengths of each vector of the second model on the first vector is used as the second parameter; each vector of the second model is a vector in which the previous node of two adjacent nodes points to the next node in the second node sequence, and the second node sequence is a sequence of nodes passed in sequence in the process of moving from the corresponding first node to the corresponding target node on the second model in the order of being passed; the corresponding first node is: a node representing the same topological relationship as the first node, and the corresponding target node is: a node representing the same topological relationship as the target node;

[0012] Using the first parameter, normalizing the first vector to obtain a normalized first vector;

[0013] Denormalizing the normalized first vector to the second model using the second parameter to obtain the pointing vector of the first reference point;

[0014] Based on the pointing displacement coordinates of at least the first reference point, the migration position coordinates obtained after migrating the position coordinates of the target node to the corresponding target node are determined. The pointing displacement coordinates of the first reference point are the coordinates obtained after moving the first reference point along the direction of the pointing vector by the length of the pointing vector.

[0015] Optionally, acquiring, according to the position coordinates of the node in the first model and the position coordinates of the reference point, a vector pointing from the first reference point to the target node as the first vector includes:

[0016] Determine the initial displacement coordinates of the first reference point according to the position coordinates of the target node, where the initial displacement coordinates of the first reference point are coordinates obtained by moving the first reference point along the direction of the first vector by the length of the first vector;

[0017] The first vector is obtained according to the initial displacement coordinates of the first reference point and the position coordinates of the first reference point.

[0018] Optionally, the using the first parameter to normalize the first vector to obtain a normalized first vector includes:

[0019] Obtaining a normalized first vector of the first reference point according to a ratio of the first vector to the first parameter;

[0020] The step of using the second parameter to denormalize the normalized first vector to the second model to obtain the pointing vector of the first reference point includes:

[0021] The pointing vector of the first reference point is obtained according to the product of the normalized first vector and the second parameter.

[0022] Optionally, determining, based on at least the pointing displacement coordinates of the first reference point, the migration position coordinates obtained after migrating the position coordinates of the target node to the corresponding target node includes:

[0023] According to the pointing displacement coordinates of each reference point of the first model, the migration position coordinates obtained after the position coordinates of the target node are migrated to the corresponding target node are determined.

[0024] Optionally, also include:

[0025] The migration rotation data of the corresponding target node is determined based on the position coordinates of the corresponding target node and the initial position coordinates of the node in the second model, wherein the initial position coordinates are the preset position coordinates of the node in the second model before the position coordinates of the target node are migrated to the migration position data of the corresponding target node in the second model.

[0026] Optionally, both the first model and the second model are human body models;

[0027] The target node is any node in the first model to be migrated, including:

[0028] The target node is any node to be migrated except the trunk node in the first model.

[0029] A data migration device, used for migrating data of a first model to a second model with the same topological relationship, comprising:

[0030] A first acquisition module, configured to acquire position coordinates of a reference point in a grid of the first model according to rotation data of a node in the first model;

[0031] The second acquisition module is used to acquire a vector from the first reference point to the target node as a first vector according to the position coordinates of the node in the first model and the position coordinates of the reference point; the target node is any node to be migrated in the first model, and the first reference point is any reference point in the grid of the first model.

[0032] a first processing module, configured to use the sum of the projection lengths of each vector of the first model on the first vector as a first parameter; each vector of the first model is a vector in a first node sequence, in which the previous node of two adjacent nodes points to the next node; the first node sequence is a sequence of nodes passed in sequence in the process of moving from the first node to the target node on the first model, in the order in which they are passed; the first node is a node whose distance from the first reference point meets a preset condition in the initial state of the first model;

[0033] A second processing module is used to use the sum of the projection lengths of each vector of the second model on the first vector as a second parameter; each vector of the second model is a vector in which the previous node of two adjacent nodes points to the next node in the second node sequence, and the second node sequence is a sequence of nodes passed in sequence in the process of moving from the corresponding first node to the corresponding target node on the second model in the order of being passed; the corresponding first node is: a node representing the same topological relationship as the first node, and the corresponding target node is: a node representing the same topological relationship as the target node;

[0034] a normalization module, configured to use the first parameter to perform normalization processing on the first vector to obtain a normalized first vector;

[0035] a denormalization module, configured to denormalize the normalized first vector to the second model using the second parameter to obtain a pointing vector of the first reference point;

[0036] A migration module is used to determine the migration position coordinates obtained after migrating the position coordinates of the target node to the corresponding target node based on the pointing displacement coordinates of at least the first reference point, wherein the pointing displacement coordinates of the first reference point are the coordinates obtained after moving the first reference point along the direction of the pointing vector by the length of the pointing vector.

[0037] Optionally, the migration module is further used to:

[0038] The migration rotation data of the corresponding target node is determined based on the position coordinates of the corresponding target node and the initial position coordinates of the node in the second model, wherein the initial position coordinates are the preset position coordinates of the node in the second model before the position coordinates of the target node are migrated to the migration position data of the corresponding target node in the second model.

[0039] An electronic device, comprising:

[0040] Processor and memory;

[0041] The memory is used to store programs, and the processor is used to run the programs, using the above-mentioned data migration method.

[0042] A computer-readable storage medium stores a program, and when an electronic device runs the program, the above-mentioned data migration method is implemented.

[0043] The technical solution described in the present application, according to the position coordinates of the reference point in the first model and the position coordinates of the reference point, obtains the first vector pointing to the target node from the first reference point, takes the sum of the projection lengths of the vectors of the first model on the first vector as the first parameter, takes the sum of the projection lengths of the vectors of the second model on the first vector as the second parameter, uses the first parameter to normalize the first vector to obtain the normalized first vector, uses the second parameter to denormalize the normalized first vector to the second model, obtains the pointing vector of the first reference point, and determines the migration position coordinates obtained after migrating the position coordinates of the target node to the corresponding target node according to the pointing displacement coordinates of the first reference point. It can be seen that, by using the normalization method, the specificity of the length of the path composed of the first node sequence of the first model is shielded, and then the normalized first vector is denormalized to the second model, so that the pointing vector obtains the length characteristics of the path composed of the second node sequence, therefore, the position coordinates of the target node determined by the pointing vector are matched with the second model, so that the action presented by the virtual object driven by the second model according to the migration position coordinates can be close to the action of the entity, that is, it has a higher accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0045] Figure 1 An example diagram of a virtual animated character "wearing a model" as an example of a virtual object;

[0046] Figure 2a An example diagram of a 3D human body model corresponding to a part of the joint points of the human body;

[0047] Figure 2b for Figure 2a An example diagram of a mesh obtained by driving the model shown;

[0048] Figure 3 A flowchart of a data migration method disclosed in an embodiment of the present application;

[0049] Figure 4 A flowchart of another data migration method disclosed in an embodiment of the present application;

[0050] Figure 5 A schematic diagram of the structure of a data migration device disclosed in an embodiment of the present application. DETAILED DESCRIPTION

[0051] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0052] During the research process, the applicant discovered that because the actions performed by the entity need to be displayed, the driving skeleton nodes (hereinafter referred to as nodes) in the specified 3D model usually have the same topological relationship with the joint points in the entity, that is, the driving skeleton nodes in the specified 3D model correspond one-to-one to all or part of the joint points in the entity.

[0053] However, the ratio of node distances in a specified 3D model is not necessarily the same as the ratio of the lengths of the corresponding joint points in the entity. Therefore, the actions displayed by the specified 3D model may deviate greatly from the actions performed by the entity.

[0054] Therefore, the applicant proposes that:

[0055] In order to improve the accuracy of the virtual object's movements, a 3D model that matches the entity can be constructed first, hereinafter referred to as the first model. The captured data is assigned to the first model to obtain the data of the nodes in the first model (position coordinates and rotation data), and then the data of the nodes in the first model are migrated to the specified 3D model, hereinafter referred to as the second model, and the virtual object is driven by the second model.

[0056] In the following embodiments, a technical solution is proposed for migrating data of nodes in a first model to nodes in a second model, with the aim of shielding the difference in the distance ratio between nodes in the first model and the second model, so that the actions displayed by the second model according to the migrated data are closer to the actions of the entity, that is, the actions of the virtual objects are more accurate.

[0057] Here are some definitions and explanations:

[0058] Topological relationships refer to the types of nodes and the connections between them. The type of node is the type of joint point in the corresponding entity, for example Figure 2a It is understood that Figure 2aShown are nodes corresponding to joints of a portion of the human body.

[0059] The first model and the second model are both 3D models, wherein the node data included therein include position coordinates and rotation data. The definition of rotation data can refer to the prior art.

[0060] The ratio of node distances refers to the ratio of the distance S1 between the first node A and the second node B to the distance S2 between the other two nodes C and D, that is, S1 / S2. The distance can be calculated from the position coordinates of the nodes. Figure 2a For example, using the position coordinates of Hips and LeftHips Hips, we get the distance S1 between Hips and LeftHips. Using the position coordinates of Hips and RightHips, we get the distance S2 between Hips and RightHips. Dividing S1 by S2, we get the ratio of the node distances.

[0061] The ratio of the joint lengths in an entity refers to the ratio of the bone lengths between the joints. For example, the bone length between joint 1 and joint 2 is S3, and the bone length between joint 3 and joint 4 is S4. S3 / S4 is a joint length ratio.

[0062] The first model and the entity are adapted to each other by: the nodes in the first model correspond one-to-one with the joint points in the entity, and the ratio of the node distances in the first model is the same as the ratio of the lengths of the corresponding joint points in the entity, for example, Figure 2a The ratio of the distance between Hips and LeftHips divided by the distance between Hips and RightHips is equal to the ratio of the bone length between Hips and LeftHips in the human body divided by the bone length between Hips and RightHips in the human body.

[0063] The correspondence between the nodes in the model and the joint points in the entity means that if the data assigned to a node in the model is the data collected from the displacement or rotation of a joint point in the entity, then the node corresponds to the joint point.

[0064] The mesh of a model refers to a plane surrounding the 3D model obtained by driving the rotation data of the nodes in the 3D model. If the connected nodes in the 3D model are regarded as a skeleton, the mesh can be regarded as the "flesh" that wraps the skeleton.

[0065] Usually, 3D software such as Unity or Blender is used to drive the 3D model using the rotation data of the 3D model to obtain the mesh. The specific process will not be described here.

[0066] When driving the rotation data of a 3D model to obtain a mesh, the shape of the mesh can be set. The reference point is a point in the mesh, which can be specified before obtaining the mesh. For example, the mesh can be a rectangle, and the reference point can be the upper left vertex of the rectangle.

[0067] When the first model and the second model are constructed, each node is assigned a default position coordinate and selection data, and the motion data collected from the entity has not yet been assigned to the model. The state of the model at this time is called the initial state. Taking the human body model as an example, usually, the initial state of the model is the T-Pose state, that is, the connection lines of the nodes in the model are in a "T" shape.

[0068] Based on the above content, it can be known that the first model and the second model have the same topological relationship, and the nodes in the first model correspond one-to-one with the nodes in the second model, that is, the nodes in the first model have unique corresponding nodes in the second model.

[0069] Figure 2a The present invention is an example of a human 3D model used in an embodiment of the present application, Hips represents the hip node, Spine1 represents the first (closed) node of the spine, Spine2 represents the second (closed) node of the spine, Neck represents the neck (closed) node, Head represents the head (closed) node, LeftShoulder represents the left shoulder (closed) node, RightShoulder represents the right shoulder (closed) node, LeftElbow represents the left elbow (closed) node, RightElbow represents the right elbow (closed) node, LeftWrist represents the left wrist (closed) node, RightWrist represents the right wrist (closed) node, LeftHips represents the left hip (closed) node, RightHips represents the right hip (closed) node, LeftKnee represents the left knee (closed) node, RightKnee represents the right-left knee (closed) node, LeftAnkle represents the left ankle (closed) node, and RightAnkle represents the right ankle (closed) node.

[0070] Figure 2b Based on Figure 2a An example of a mesh of a generated model, where the mesh is represented by a triangle. The reference point is represented by the centroid of the triangle. The mesh includes a head mesh and a torso mesh.

[0071] Figure 2b The head mesh shown in is denoted as:

[0072] Figure 2b The torso mesh shown in

[0073] The reference points of each head mesh are The reference points for each torso mesh are Therefore, the reference point of the first model is ref A =ref A-H +ref A-B .

[0074] Where T represents the triangle in the mesh. 1 A-B Represents triangle T 1 A-B The center of gravity can be regarded as the position coordinates of a reference point.

[0075] Based on the above definition of mesh, it can be seen that the mesh is closer to the entity than the skeleton formed by node connections.

[0076] In the following embodiments, any node to be migrated in the first model is referred to as a target node, and the corresponding node of the target node in the second model is referred to as a corresponding target node. The topological relationship represented by any node (such as the target node) in the first model is the same as the topological relationship represented by the corresponding node (such as the corresponding target node) in the second model, that is, the corresponding node of any node is a node representing the same relationship in the topological relationship.

[0077] For example, Figure 2a As shown, the target node is LeftWrist in the first model, and LeftWrist in the second model is the corresponding target node. The topological relationship of LeftWrist in the first model is connected to LeftElbow, and the topological relationship of LeftWrist in the second model is also connected to LeftElbow.

[0078] The data migration process proposed in the embodiment of the present application will be described in detail below.

[0079] Figure 3 The process of a data migration method disclosed in an embodiment of the present application includes the following steps:

[0080] S31. Acquire the position coordinates of a reference point in the grid of the first model according to the rotation data of the node in the first model.

[0081] The specific implementation method of S31 is as described above and will not be repeated here.

[0082] S32. According to the position coordinates of the nodes in the first model and the position coordinates of the reference point, obtain a vector from the first reference point to the target node as a first vector.

[0083] The target node is any node in the first model to which data is to be migrated, and the first reference point is any reference point in the grid of the first model.

[0084] One implementation of S31 is: taking the direction of the first reference point pointing to the target node as the direction of the first vector, and taking the distance between the first reference point and the target node as the length of the first vector, the first vector can be determined. The distance between the first reference point and the target node is determined by the position coordinates of the first reference point and the target node.

[0085] In addition to the above implementation, the embodiment of the present application also proposes another implementation with higher accuracy, which will be described in detail in the following embodiments.

[0086] S33. Taking the sum of the projection lengths of the vectors of the first model on the first vector as the first parameter.

[0087] Each first model vector is a vector in the first node sequence, where the previous node of two adjacent nodes points to the next node. The first node sequence is a sequence of nodes passed in sequence in the process of moving from the first node to the target node on the first model in the order in which they are passed.

[0088] In this embodiment, the first node is a node whose distance from the first reference point meets a preset condition in the initial state of the first model. In this embodiment, the preset condition may be, but is not limited to, the closest distance. The distance between the node and the reference point may be determined based on the position coordinates of the node and the position coordinates of the reference point.

[0089] The initial state of the first model refers to a state in which nodes are assigned default values ​​when the first model is constructed, and data collected during the movement of the entity are not assigned.

[0090] S34. Taking the sum of the projection lengths of the vectors of the second model on the first vector as the second parameter.

[0091] Each vector of the second model is a vector in which the previous node of two adjacent nodes points to the next node in the second node sequence.

[0092] The second node sequence is a sequence of nodes passed in sequence in the process of moving from the corresponding first node to the corresponding target node on the second model, in the order in which they are passed.

[0093] The corresponding first node is: a node that represents the same topological relationship as the first node, and the corresponding target node is: a node that represents the same topological relationship as the target node.

[0094] It can be seen that the first parameter represents the length component of the path formed by the nodes in the first node sequence in the direction of the first vector.

[0095] S35. Use the first parameter to normalize the first vector to obtain a normalized first vector.

[0096] Because the first parameter represents the length component of the path formed by the nodes in the first node sequence in the direction of the first vector, the normalized first vector obtained by using the first parameter can be regarded as a vector that eliminates the specificity of the length. That is, in the path formed by the first node sequence in the first model, the influence of the distance between the nodes on the normalized first vector has been eliminated.

[0097] S36. Denormalize the normalized first vector to the second model using the second parameter to obtain the pointing vector of the first reference point.

[0098] The second parameter represents the length component of the path formed by the nodes in the second node sequence in the direction of the first vector, so the normalized first vector multiplied by the second parameter can be regarded as mapping the normalized first vector to the second model. That is, the pointing vector has the distance characteristics between the nodes in the path formed by the second node sequence.

[0099] S37. Determine, based on the pointing displacement coordinates of at least the first reference point, the migration position coordinates obtained after migrating the position coordinates of the target node to the corresponding target node.

[0100] The pointing displacement coordinates of the first reference point are coordinates obtained by moving the first reference point along the direction of the pointing vector by the length of the pointing vector.

[0101] It can be seen from the above process that in this embodiment, a normalization method is used to mask the specificity of the length of the path composed of the first node sequence of the first model, and then the normalized first vector is mapped to the second model, so that the pointing vector obtains the length characteristics of the path composed of the second node sequence. Therefore, the position coordinates of the target node determined by the pointing vector are matched with the second model, so that the action presented by the virtual object driven by the second model according to the position coordinates can be close to the action of the entity, that is, it has higher accuracy.

[0102] Furthermore, in this embodiment, reference points are used to obtain the position coordinates of the nodes. Since the reference points have more physical characteristics, the accuracy of the movements of the virtual objects can be further improved.

[0103] The following is an example of applying the above embodiment to Figure 2a as well as Figure 2b The process of the human body 3D model shown includes the following steps:

[0104] 1. According to the rotation data of the nodes in the first model, the position coordinates of the reference points in the grid of the first model are obtained.

[0105] 2. According to the position coordinates of the node in the first model and the position coordinates of the reference point, obtain the vector from the first reference point to the target node as the first vector.

[0106] As mentioned above, the target node is any node in the first model to which data is to be migrated. In this step and the following embodiments, an example of the target node is LeftWrist.

[0107] The first reference node is Figure 2b The center of any triangle shown.

[0108] Assume that the node closest to the first reference node is Figure 2a As shown in Hips, the first node is Hips.

[0109] 3. The sum of the projection lengths of the vectors of the first model on the first vector is taken as the first parameter.

[0110] Each vector of the first model is a vector from the previous node of two adjacent nodes to the next node in the first node sequence. The first node sequence is a sequence of nodes passed in sequence in the process of moving from the first node to the target node on the first model in the order in which they are passed.

[0111] The length of the vector from the previous node to the next node is obtained by the difference between the position coordinates of the previous node and the next node, and the direction is the direction from the previous node to the next node.

[0112] by Figure 2a For example, in the process of moving from Hips in the first model to LeftWrist, the nodes passed in sequence are: Hips->Spine1->Spine2->LeftShoulder->LeftElbow->LeftWrist. Therefore, the first node sequence is (Hips, Spine1, Spine2, LeftShoulder, LeftElbow, LeftWrist).

[0113] The first model vectors are:

[0114]

[0115]

[0116]

[0117]

[0118]

[0119] In the above formulas, P represents the position coordinates, and src represents the first model.

[0120] Any first model vector The length of the projection onto the first vector is expressed as:

[0121] In formula (1) represents the unit vector of the first vector, express is the unit vector, so Indicates v i and The cosine value of the angle between express In v i The projection length on .

[0122] The first parameter of the i-th node is Taking the first node sequence mentioned above as an example, m=5.

[0123] It can be seen from the calculation formula of the first parameter that the first parameter represents the length component of the path formed by the nodes in the first node sequence in the first vector direction.

[0124] 4. The sum of the projection lengths of each vector of the second model on the first vector is taken as the second parameter.

[0125] Each vector of the second model is a vector in the second node sequence, where the previous node of two adjacent nodes points to the next node. The second node sequence is a sequence of nodes passed in sequence in the process of moving from the corresponding first node to the corresponding target node on the second model in the order in which they are passed.

[0126] According to the above definition of corresponding nodes, an example of a second node sequence corresponding to an example of a first node sequence in the first model is the following sequence of nodes in the second model:

[0127] (Hips,Spine1,Spine2,LeftShoulder,LeftElbow,LeftWrist).

[0128] The second model vectors are:

[0129]

[0130]

[0131]

[0132]

[0133]

[0134] In the above formulas, P represents the position coordinates, and tar represents the second model.

[0135] The second parameter is It can be seen from the calculation formula of the second parameter that the second parameter represents the length component of the path formed by the nodes in the second node sequence in the direction of the first vector.

[0136] 5. Use the first parameter to normalize the first vector to obtain a normalized first vector.

[0137] Specifically, the normalized first vector is:

[0138] Because the first parameter represents the length component of the path formed by the nodes in the first node sequence in the direction of the first vector, the normalized first vector obtained by using the first parameter can be regarded as a vector that eliminates the specificity of the length. That is, in the path formed by the first node sequence in the first model, the influence of the distance between the nodes on the normalized first vector has been eliminated.

[0139] It can be understood that the above formula for calculating the normalized vector is only an example and may be in other forms, for example, multiplying the above formula by a coefficient.

[0140] 6. Use the second parameter to denormalize the normalized first vector to the second model to obtain the pointing vector of the first reference point.

[0141] In this step, an example of mapping operation is multiplication, that is, the pointing vector of the first node is:

[0142] The second parameter represents the length component of the path formed by the nodes in the second node sequence in the direction of the first vector, so the normalized first vector multiplied by the second parameter can be regarded as mapping the normalized first vector to the second model. That is, the pointing vector has the distance characteristics between the nodes in the path formed by the second node sequence.

[0143] 7. Determine the migration position coordinates obtained after migrating the position coordinates of the target node to the corresponding target node based on the pointing displacement coordinates of at least the first reference point.

[0144] The pointing displacement coordinates of the first reference point are the coordinates obtained by moving the first reference point along the direction of the pointing vector by the length of the pointing vector, that is,

[0145] It can be seen from the above process that in this embodiment, the data in the first model is normalized to remove the influence of the human body proportions, and then the data is allocated to the second model. The body proportions of the second model are taken into consideration when allocating the data to the second model, and a reference point that can reflect the "fatness" of the human body is introduced. Therefore, the movements of the virtual character driven by the second model can be closer to the movements of the entity, thereby having higher accuracy.

[0146] Figure 4 The process of a data migration method disclosed in the embodiment of the present application is Figure 3 The main difference compared to the process shown is that the steps that can further improve the accuracy and save resources are limited or added.

[0147] Figure 4 The following steps are included:

[0148] S41, collecting data of nodes of the first model.

[0149] The motion data of the first model includes position data and rotation data of nodes in the first model.

[0150] As mentioned above, motion capture technology can be used to collect data of each joint point of the entity during movement, and the collected data can be assigned to the nodes in the first model. The data of any node in the first model includes the position coordinates and rotation data of the node.

[0151] It can be understood that if the motion data is collected continuously, multiple frames of motion data can be formed. In this embodiment, any frame of motion data of the first model is recorded as:

[0152] Rotate data:

[0153]

[0154] Among them, src represents the first model, Hips represents the hip (off) node, Spine1 represents the first (off) node of the spine, Spine2 represents the second (off) node of the spine, Neck represents the neck (off) node, Head represents the head (off) node, LeftShoulder represents the left shoulder (off) node, RightShoulder represents the right shoulder (off) node, LeftElbow represents the left elbow (off) node, RightElbow represents the right elbow (off) node, LeftWrist represents the left wrist (off) node, RightWrist represents the right wrist (off) node, LeftHips represents the left hip (off) node, RightHips represents the right hip (off) node, LeftKnee represents the left knee (off) node, RightKnee represents the right left knee (off) node, LeftAnkle represents the left ankle (off) node, and RightAnkle represents the right ankle (off) node.

[0155] Location coordinates:

[0156]

[0157] S42. Obtain the position coordinates of the reference point in the grid of the first model according to the rotation data.

[0158] S43. Using the position coordinates of the trunk node in the first model as the migration position coordinates of the corresponding node in the second model.

[0159] The trunk node refers to a node located in the trunk part. That is, for the nodes on the trunk in the human body 3D model, the position coordinates assigned to the nodes in the first model by motion capture technology can be directly used as the position coordinates of the corresponding nodes in the second model without the need to migrate through the steps described in the above embodiment.

[0160] Because the trunk nodes of the human body do not participate in the movement or their contribution to the movement is limited, the position coordinates of the trunk nodes have little effect on the accuracy of the movement. Therefore, directly using the position coordinates of the trunk nodes of the first model as the migration position coordinates of the corresponding nodes in the second model can save computing power and reduce latency without significantly reducing the accuracy of the virtual object's movement.

[0161] S44. Determine the pointing vectors of all reference points in the first model.

[0162] For the sake of convenience, any reference point among the reference points of the first model is referred to as a first reference point.

[0163] Specifically, the position data of the LeftWrist node and the position data of the reference point are used as known data and substituted into: Get multiple vectors v i .

[0164] Among them, ref i A is the reference point, where i = 1, 2, ... n, and different values ​​of i represent different reference points. i It is a preset weight parameter and can be set in advance. In the following, the vector from the first reference point to the LeftWrist node is referred to as the first vector.

[0165] It can be understood that the meaning of formula (1) is: the position data of the LeftWrist node is the weighted sum of the second vectors of each reference point, wherein the second vector of the first reference point is the sum of the first vector of the first reference point and the position data of the first reference point in the first model.

[0166] In other words, the above process can also be expressed as: according to the position coordinates of the target node, the initial displacement coordinates of the first node are determined, and the initial displacement coordinates of the first reference point are the coordinates obtained by moving the first reference point along the direction of the first vector by the length of the first vector. According to the initial displacement coordinates of the first reference point and the position coordinates of the first reference point, the first vector is obtained.

[0167] It can be understood that, for each reference point, the corresponding first vector can be obtained according to the above process.

[0168] The method of obtaining the first vector described in this step determines the first vector by using multiple reference points, and therefore has higher accuracy than the method of determining the first vector using the position coordinates of the target node and the first reference point.

[0169] In getting v i Afterwards, the method for obtaining the first parameter, the second parameter and the pointing vector of each reference point can refer to the method for obtaining the pointing vector of the first reference point mentioned above, which will not be repeated here.

[0170] S45 . Determine the migration position coordinates obtained after migrating the position coordinates of the target node to the corresponding target node according to the pointing displacement coordinates of each reference point of the first model.

[0171] Specifically, the migration position coordinates of the LeftWrist node in the second model are:

[0172] in, is the pointing displacement coordinate of the first reference point. i is the weighting coefficient, which is an optional parameter.

[0173] Compared with the above embodiment in which only the first reference point is used to determine the migration position coordinates of the target node, the method of using multiple reference points to determine the migration position of the target node can obtain more accurate results.

[0174] Because the target node is any node except the trunk node, the above processing is performed on the nodes except the trunk node in sequence to obtain the migration position coordinates of all other nodes except the trunk node.

[0175] S46, determining the migration rotation data of the corresponding target node according to the migration position coordinates of the corresponding target node and the initial position coordinates of the nodes in the second model.

[0176] The initial position coordinates can be configured when constructing the second model and are known data for this step.

[0177] Specifically, the IK algorithm may be used to determine the migration rotation data based on the migration position coordinates and the initial position coordinates, which will not be described in detail here.

[0178] It can be understood that the method of determining the migration rotation data using the post-migration position coordinates and the initial position coordinates is easier to implement than the method of determining the migration position coordinates, so it can also save computing power and time resources.

[0179] Figure 4 The process shown has the following beneficial effects:

[0180] 1. Use the relationship between the vector and position data between each node in the human 3D skeleton model to determine the vector between each node, which can be closer to the actual topological relationship between the nodes.

[0181] 2. Length is the reason for the "penetration" of the isomorphic model. In this embodiment, the first parameter and the second parameter are determined based on the length vector, respectively. Therefore, the inaccurate movement of the virtual object driven by the second model, such as the "penetration" problem, can be fundamentally solved.

[0182] 3. Determine the migration rotation data based on the migration position coordinates, and use the pre-migration position coordinates of the trunk nodes directly as the migration position coordinates, which can save resources while obtaining migration data that meets accuracy requirements.

[0183] Figure 5 A data migration device disclosed in an embodiment of the present application includes: a first acquisition module, a second acquisition module, a first processing module, a second processing module, a normalization module, a denormalization module and a migration module.

[0184] The first acquisition module is used to acquire the position coordinates of the reference point in the grid of the first model according to the rotation data of the node in the first model.

[0185] The second acquisition module is used to obtain a vector pointing from the first reference point to the target node as a first vector based on the position coordinates of the node in the first model and the position coordinates of the reference point; the target node is any node in the first model to which data is to be migrated, and the first reference point is any reference point in the grid of the first model.

[0186] The first processing module is used to use the sum of the projection lengths of each vector of the first model on the first vector as the first parameter; each vector of the first model is a vector in the first node sequence, in which the previous node of two adjacent nodes points to the next node; the first node sequence is a sequence of nodes passed in sequence in the process of moving from the first node to the target node on the first model, in the order in which they are passed; the first node is a node whose distance from the first reference point in the initial state of the first model meets a preset condition.

[0187] The second processing module is used to use the sum of the projection lengths of each vector of the second model on the first vector as the second parameter; each vector of the second model is a vector in which the previous node of two adjacent nodes points to the next node in the second node sequence, and the second node sequence is a sequence of nodes passed in sequence in the process of moving from the corresponding first node to the corresponding target node on the second model in the order passed; the corresponding first node is: a node representing the same topological relationship as the first node, and the corresponding target node is: a node representing the same topological relationship as the target node.

[0188] The normalization module is used to use the first parameter to perform normalization processing on the first vector to obtain a normalized first vector.

[0189] The denormalization module is used to denormalize the normalized first vector to the second model using the second parameter to obtain the pointing vector of the first reference point.

[0190] The migration module is used to determine the migration position coordinates obtained after migrating the position coordinates of the target node to the corresponding target node based on the pointing displacement coordinates of at least the first reference point. The pointing displacement coordinates of the first reference point are the coordinates obtained after moving the first reference point along the direction of the pointing vector by the length of the pointing vector.

[0191] Optionally, the migration module is further used to:

[0192] The migration rotation data of the corresponding target node is determined based on the position coordinates of the corresponding target node and the initial position coordinates of the node in the second model, wherein the initial position coordinates are the preset position coordinates of the node in the second model before the position coordinates of the target node are migrated to the migration position data of the corresponding target node in the second model.

[0193] Optionally, the second acquisition module is used to acquire, according to the position coordinates of the node in the first model and the position coordinates of the reference point, a vector from the first reference point to the target node as the first vector, including:

[0194] The second acquisition module is specifically used to determine the initial displacement coordinates of the first reference point based on the position coordinates of the target node, where the initial displacement coordinates of the first reference point are the coordinates obtained by moving the first reference point along the direction of the first vector by the length of the first vector; and to acquire the first vector based on the initial displacement coordinates of the first reference point and the position coordinates of the first reference point.

[0195] Optionally, the normalization module is used to use the first parameter to perform normalization processing on the first vector, and obtaining the normalized first vector includes:

[0196] The normalization module is specifically configured to obtain a normalized first vector of the first reference point according to a ratio of the first vector to the first parameter.

[0197] Optionally, the denormalization module is used to denormalize the normalized first vector to the second model using the second parameter to obtain the pointing vector of the first node, including: the denormalization module is specifically used to obtain the pointing vector of the first node according to the product of the normalized first vector and the second parameter.

[0198] Optionally, the migration module is used to determine the migration position coordinates obtained after migrating the position coordinates of the target node to the corresponding target node according to the pointing displacement coordinates of at least the first reference point, including:

[0199] The migration module is specifically used to determine the migration position coordinates obtained after the position coordinates of the target node are migrated to the corresponding target node according to the pointing displacement coordinates of each reference point of the first model.

[0200] Optionally, the first model and the second model are human models. The target node is any node in the first model to be migrated, including: the target node is any node in the first model to be migrated except the torso node.

[0201] The device described in this embodiment is used to migrate data of a first model to a second model with the same topological relationship, so that the movement accuracy of a virtual object driven by the second model that obtains the migrated data is higher.

[0202] An embodiment of the present application further discloses an electronic device, including: a processor and a memory, wherein the memory is used to store a program, and the processor is used to run the program to implement the data migration method described in the above embodiment.

[0203] The embodiment of the present application further discloses a computer-readable storage medium on which a program is stored, characterized in that when the electronic device runs the program, the data migration method described in the above embodiment is implemented.

[0204] If the functions described in the method of the embodiment of the present application are implemented in the form of software functional units and sold or used as independent products, they can be stored in a storage medium readable by a computing device. Based on this understanding, the part of the embodiment of the present application that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions to enable a computing device (which can be a personal computer, server, mobile computing device or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program code.

[0205] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0206] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A data migration method for migrating data from a first model to a second model with the same topological relationship, characterized in that: include: Acquire the position coordinates of a reference point in the grid of the first model according to the rotation data of the node in the first model; According to the position coordinates of the nodes in the first model and the position coordinates of the reference point, a vector from the first reference point to the target node is obtained as a first vector; the target node is any node to be migrated in the first model, and the first reference point is any reference point in the grid of the first model; The sum of the projection lengths of each vector of the first model on the first vector is used as the first parameter; each vector of the first model is a vector in the first node sequence, in which the previous node of two adjacent nodes points to the next node; the first node sequence is a sequence of nodes passed in sequence in the process of moving from the first node to the target node on the first model, in the order in which they are passed; the first node is a node whose distance from the first reference point meets a preset condition in the initial state of the first model; The sum of the projection lengths of each vector of the second model on the first vector is used as the second parameter; each vector of the second model is a vector in which the previous node of two adjacent nodes points to the next node in the second node sequence, and the second node sequence is a sequence of nodes passed in sequence in the process of moving from the corresponding first node to the corresponding target node on the second model in the order of being passed; the corresponding first node is: a node representing the same topological relationship as the first node, and the corresponding target node is: a node representing the same topological relationship as the target node; Using the first parameter, normalizing the first vector to obtain a normalized first vector; Denormalizing the normalized first vector to the second model using the second parameter to obtain a pointing vector of the first reference point; Based on the pointing displacement coordinates of at least the first reference point, the migration position coordinates obtained after migrating the position coordinates of the target node to the corresponding target node are determined. The pointing displacement coordinates of the first reference point are the coordinates obtained after moving the first reference point along the direction of the pointing vector by the length of the pointing vector.

2. The method according to claim 1, characterized in that The step of obtaining, according to the position coordinates of the node in the first model and the position coordinates of the reference point, a vector from the first reference point to the target node as a first vector includes: Determine the initial displacement coordinates of the first reference point according to the position coordinates of the target node, where the initial displacement coordinates of the first reference point are coordinates obtained by moving the first reference point along the direction of the first vector by the length of the first vector; The first vector is obtained according to the initial displacement coordinates of the first reference point and the position coordinates of the first reference point.

3. The method according to claim 1, characterized in that The using the first parameter to normalize the first vector to obtain a normalized first vector includes: Obtaining a normalized first vector of the first reference point according to a ratio of the first vector to the first parameter; The step of using the second parameter to denormalize the normalized first vector to the second model to obtain the pointing vector of the first reference point includes: The pointing vector of the first reference point is obtained according to the product of the normalized first vector and the second parameter.

4. The method according to claim 1, characterized in that: The determining, based on at least the pointing displacement coordinates of the first reference point, the migration position coordinates obtained after migrating the position coordinates of the target node to the corresponding target node includes: According to the pointing displacement coordinates of each reference point of the first model, the migration position coordinates obtained after the position coordinates of the target node are migrated to the corresponding target node are determined.

5. The method according to any one of claims 1 to 4, characterized in that: Also includes: The migration rotation data of the corresponding target node is determined based on the position coordinates of the corresponding target node and the initial position coordinates of the node in the second model, wherein the initial position coordinates are the preset position coordinates of the node in the second model before the position coordinates of the target node are migrated to the migration position data of the corresponding target node in the second model.

6. The method according to any one of claims 1 to 4, characterized in that: The first model and the second model are both human models; The target node is any node in the first model to be migrated, including: The target node is any node to be migrated except the trunk node in the first model.

7. A data migration device, used to migrate data of a first model to a second model with the same topological relationship, characterized in that: include: A first acquisition module, configured to acquire position coordinates of a reference point in a grid of the first model according to rotation data of a node in the first model; A second acquisition module is used to acquire a vector from the first reference point to the target node as a first vector according to the position coordinates of the node in the first model and the position coordinates of the reference point; the target node is any node to be migrated in the first model, and the first reference point is any reference point in the grid of the first model; a first processing module, configured to use the sum of the projection lengths of each vector of the first model on the first vector as a first parameter; each vector of the first model is a vector in a first node sequence, in which the previous node of two adjacent nodes points to the next node; the first node sequence is a sequence of nodes passed in sequence in the process of moving from the first node to the target node on the first model, in the order in which they are passed; the first node is a node whose distance from the first reference point meets a preset condition in the initial state of the first model; A second processing module is used to use the sum of the projection lengths of each vector of the second model on the first vector as a second parameter; each vector of the second model is a vector in which the previous node of two adjacent nodes points to the next node in the second node sequence, and the second node sequence is a sequence of nodes passed in sequence in the process of moving from the corresponding first node to the corresponding target node on the second model in the order of being passed; the corresponding first node is: a node representing the same topological relationship as the first node, and the corresponding target node is: a node representing the same topological relationship as the target node; a normalization module, configured to use the first parameter to perform normalization processing on the first vector to obtain a normalized first vector; a denormalization module, configured to denormalize the normalized first vector to the second model using the second parameter to obtain a pointing vector of the first reference point; A migration module is used to determine the migration position coordinates obtained after migrating the position coordinates of the target node to the corresponding target node based on the pointing displacement coordinates of at least the first reference point, wherein the pointing displacement coordinates of the first reference point are the coordinates obtained after moving the first reference point along the direction of the pointing vector by the length of the pointing vector.

8. The device according to claim 7, characterized in that The migration module is also used to: The migration rotation data of the corresponding target node is determined based on the position coordinates of the corresponding target node and the initial position coordinates of the node in the second model, wherein the initial position coordinates are the preset position coordinates of the node in the second model before the position coordinates of the target node are migrated to the migration position data of the corresponding target node in the second model.

9. An electronic device, characterized in that: include: Processor and memory; The memory is used to store a program, and the processor is used to run the program to implement the data migration method described in any one of claims 1 to 6.

10. A computer-readable storage medium having a program stored thereon, characterized in that: When the electronic device runs the program, the data migration method described in any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Method and system for vision measure for digital human models

    CN106485748A

  • Data verification method based on multi-source transfer learning

    CN108549907A