CN113362431A - Data migration method and device, electronic equipment and readable storage medium - Google Patents
Data migration method and device, electronic equipment and readable storage medium Download PDFInfo
- Publication number
- CN113362431A CN113362431A CN202110741541.XA CN202110741541A CN113362431A CN 113362431 A CN113362431 A CN 113362431A CN 202110741541 A CN202110741541 A CN 202110741541A CN 113362431 A CN113362431 A CN 113362431A
- Authority
- CN
- China
- Prior art keywords
- node
- model
- vector
- nodes
- pointing
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000013508 migration Methods 0.000 title claims abstract description 92
- 230000005012 migration Effects 0.000 title claims abstract description 91
- 238000000034 method Methods 0.000 title claims abstract description 53
- 239000013598 vector Substances 0.000 claims abstract description 227
- 238000006073 displacement reaction Methods 0.000 claims abstract description 43
- 238000010606 normalization Methods 0.000 claims abstract description 25
- 238000012545 processing Methods 0.000 claims abstract description 19
- 230000008569 process Effects 0.000 claims description 17
- 230000009471 action Effects 0.000 abstract description 16
- 230000033001 locomotion Effects 0.000 description 19
- 210000000988 bone and bone Anatomy 0.000 description 7
- 210000003423 ankle Anatomy 0.000 description 4
- 238000004364 calculation method Methods 0.000 description 4
- 210000003127 knee Anatomy 0.000 description 4
- 210000000707 wrist Anatomy 0.000 description 4
- 238000010586 diagram Methods 0.000 description 3
- 238000004519 manufacturing process Methods 0.000 description 3
- 238000013507 mapping Methods 0.000 description 3
- 238000006243 chemical reaction Methods 0.000 description 2
- 241001465754 Metazoa Species 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 210000003414 extremity Anatomy 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 230000008570 general process Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
- 238000011160 research Methods 0.000 description 1
- 230000009466 transformation Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T13/00—Animation
- G06T13/20—3D [Three Dimensional] animation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T15/00—3D [Three Dimensional] image rendering
- G06T15/005—General purpose rendering architectures
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T19/00—Manipulating 3D models or images for computer graphics
- G06T19/20—Editing of 3D images, e.g. changing shapes or colours, aligning objects or positioning parts
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Computer Graphics (AREA)
- Architecture (AREA)
- Computer Hardware Design (AREA)
- General Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Processing Or Creating Images (AREA)
Abstract
According to the data migration method and device, the electronic device and the computer readable storage medium, vectors of first nodes pointing to target nodes are obtained according to position coordinates of the nodes in a first model and are used as first vectors, the sum of projection lengths of the vectors of the first model on the first vectors is used as a first parameter, the sum of projection lengths of the vectors of a second model on the first vectors is used as a second parameter, the first parameters are used for carrying out normalization processing on the first vectors to obtain normalized first vectors, the second parameters are used for carrying out reverse normalization on the normalized first vectors to the second model to obtain pointing vectors of the first nodes, and migration position coordinates are determined according to pointing displacement coordinates of the first nodes. By using the normalization method, the specificity of the length of the first model is shielded, and the normalized first vector is reversely normalized into the second model to obtain the length characteristic of the second model, so that the action of the virtual object driven by the second model has higher accuracy.
Description
Technical Field
The present application relates to the field of electronic information, and in particular, to a data migration method and apparatus, an electronic device, and a readable storage medium.
Background
The production of 3D virtual objects (including characters and animals in general) is widely used in scenes such as animation production and movie special effects. Taking a 3D avatar as an example of a 3D virtual object, a general process for creating the 3D avatar is as follows: various motions of an entity, such as an actor, are captured through motion capture techniques, data indicative of the motions is generated, and the data is distributed onto a specified 3D model.
In practice, the proportions of the parts of the model used to carry the data may differ from the proportions of the parts of the actual motion capture entity, also exemplified by a 3D avatar: the 3D model for carrying data is different from the actor in size ratio, so the manufactured virtual object may have the problem of inaccurate movement, such as: the 'die-threading' is caused by the difference between the figure proportion of the 3D model and the figure proportion of the actor. "mold through" means that the 3D model does some actions that do not conform to the physical principle, such as the limb extending into the body, as shown by the enclosed area in fig. 1, and the right arm of the two-dimensional virtual couple passes into the body.
Therefore, how to improve the precision of the action of the virtual object becomes a problem to be solved urgently in the field of virtual object production at present.
Disclosure of Invention
The application provides a data migration method and device, an electronic device and a readable storage medium, and aims to solve the problem of how to improve the accuracy of actions of virtual objects.
In order to achieve the above object, the present application provides the following technical solutions:
a data migration method is used for migrating data of a first model to a second model with the same topological relation, and comprises the following steps:
acquiring a vector of a first node pointing to a target node according to the position coordinates of the nodes in the first model, and taking the vector as a first vector; the target node is any node to be subjected to data migration in the first model, and the first node is any node except the target node in the first model;
taking the sum of the projection lengths of the vectors of the first model on the first vector as a first parameter; each vector of the first model is a vector of a node before two adjacent nodes pointing to a node after the node before the node in the first node sequence, and the first node sequence is a sequence formed by nodes passing through in sequence according to the sequence of the nodes passing through in the process of moving from the first node to the target node on the first model;
taking the sum of the projection lengths of the vectors of the second model on the first vector as a second parameter; each vector of the second model is a vector of a node before two adjacent nodes pointing to a node after the node in a second node sequence, and the second node sequence is a sequence formed by nodes passing through in sequence according to the sequence of the nodes passing through in the process of moving from the corresponding first node to the corresponding target node on the second model; the corresponding first node is: the node which represents the same topological relation with the first node, and the corresponding target node is: a node representing the same topological relation as the target node;
using the first parameter to carry out normalization processing on the first vector to obtain a normalized first vector;
using the second parameter to inversely normalize the normalized first vector to the second model to obtain a pointing vector of the first node;
and determining a migration position coordinate obtained after the position coordinate of the target node is migrated to the corresponding target node according to at least the pointing displacement coordinate of the first node, wherein the pointing displacement coordinate of the first node is obtained after the first node is moved by the length of the pointing vector along the direction of the pointing vector.
Optionally, obtaining a vector of the first node pointing to the target node according to the position coordinates of the nodes in the first model, as the first vector, includes:
determining an initial displacement coordinate of the first node according to the position coordinate of the target node, wherein the initial displacement coordinate of the first node is a coordinate obtained by moving the first node along the direction of the first vector by the length of the first vector;
and acquiring the first vector according to the initial displacement coordinate of the first node and the position coordinate of the first node.
Optionally, the using the first parameter to perform normalization processing on the first vector to obtain a normalized first vector includes:
obtaining a normalized first vector of the first node according to the ratio of the first vector to the first parameter;
the inverse normalizing the normalized first vector to the second model using the second parameter to obtain the direction vector of the first node includes:
and acquiring the pointing vector of the first node according to the product of the normalized first vector and the second parameter.
Optionally, the determining, according to the pointing displacement coordinate of at least the first node, a migration position coordinate obtained after the position coordinate of the target node is migrated to the corresponding target node includes:
and determining a migration position coordinate obtained after the position coordinate of the target node is migrated to the corresponding target node according to the pointing displacement coordinates of other nodes except the target node.
Optionally, the method further includes:
determining 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, wherein the initial position coordinates are preset position coordinates of the nodes in the second model before the position coordinates of the target node are migrated to the migration position coordinates of the corresponding target node in the second model.
Optionally, the first model and the second model are human body models;
the target node is any node to be subjected to data migration in the first model, and the method comprises the following steps:
the target node is any node to be subjected to data migration except for the trunk node in the first model.
A data migration device for migrating data of a first model to a second model with the same topological relation, comprising:
the acquisition module is used for acquiring a vector of the first node pointing to the target node as a first vector according to the position coordinates of the nodes in the first model; the target node is any node to be subjected to data migration in the first model, and the first node is any node except the target node in the first model;
the first processing module is used for taking the sum of the projection lengths of the vectors of the first model on the first vector as a first parameter; each vector of the first model is a vector of a node before two adjacent nodes pointing to a node after the node before the node in the first node sequence, and the first node sequence is a sequence formed by nodes passing through in sequence according to the sequence of the nodes passing through in the process of moving from the first node to the target node on the first model;
the second processing module is used for taking the sum of the projection lengths of the vectors of the second model on the first vector as a second parameter; each vector of the second model is a vector of a node before two adjacent nodes pointing to a node after the node in a second node sequence, and the second node sequence is a sequence formed by nodes passing through in sequence according to the sequence of the nodes passing through in the process of moving from the corresponding first node to the corresponding target node on the second model; the corresponding first node is: the node which represents the same topological relation with the first node, and the corresponding target node is: a node representing the same topological relation as the target node;
the normalization module is used for performing normalization processing on the first vector by using the first parameter to obtain a normalized first vector;
the inverse normalization module is used for inverse normalizing the normalized first vector to the second model by using the second parameter to obtain a pointing vector of the first node;
and the migration module is used for determining a migration position coordinate obtained after the position coordinate of the target node is migrated to the corresponding target node according to at least the pointing displacement coordinate of the first node, wherein the pointing displacement coordinate of the first node is a coordinate obtained after the first node is moved by the length of the pointing vector along the direction of the pointing vector.
Optionally, the migration module is further configured to:
determining migration rotation data of the 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, wherein the initial position coordinates are preset position coordinates of the nodes in the second model before the position coordinates of the target node are migrated to the migration position coordinates of the corresponding target node in the second model.
An electronic device, comprising:
a processor and a memory;
the memory is used for storing programs, and the processor is used for operating the programs so as to realize the data migration method.
A computer-readable storage medium having a program stored thereon, the program, when executed by an electronic device, implementing the above-described data migration method.
According to the technical scheme, vectors of first nodes pointing to target nodes are obtained according to position coordinates of the nodes in a first model and are used as first vectors, the sum of projection lengths of the vectors of the first model on the first vectors is used as a first parameter, the sum of projection lengths of the vectors of a second model on the first vectors is used as a second parameter, the first parameters are used for carrying out normalization processing on the first vectors to obtain normalized first vectors, the normalized first vectors are subjected to reverse normalization to the second model by using the second parameter to obtain pointing vectors of the first nodes, and migration position coordinates obtained after the position coordinates of the target nodes are migrated to the corresponding target nodes are determined according to pointing displacement coordinates of at least the first nodes. 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 second model according to the virtual object driven by the migration position coordinates can be close to the action of the entity, namely, the action has higher accuracy.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is an exemplary diagram of a virtual animated character "die-cut" as an example of a virtual object;
FIG. 2 is an exemplary diagram of a 3D model of a human body corresponding to a portion of a joint point of the human body;
FIG. 3 is a flow chart of a data migration method disclosed in an embodiment of the present application;
FIG. 4 is a flowchart of another data migration method disclosed in an embodiment of the present application;
fig. 5 is a schematic structural diagram of a data migration apparatus according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
In the research process, the applicant finds that driving bone nodes (hereinafter referred to as nodes) in the specified 3D model and joint points in the entity generally have the same topological relation because the actions made by the entity are to be shown, that is, the driving bone nodes in the specified 3D model correspond to all or part of the joint points in the entity in a one-to-one manner.
However, the ratio of the node distance in the specified 3D model is not necessarily the same as the ratio of the corresponding joint length in the entity, so the motion exhibited by the specified 3D model may have a large deviation from the motion made by the entity.
Therefore, the applicant proposed:
in order to improve the accuracy of the motion of the virtual object, a 3D model adapted to the entity, hereinafter referred to as a first model, may be constructed first. The captured data is assigned to the first model to obtain data (position coordinates and rotation data) of nodes in the first model, and then the data of the nodes in the first model is migrated to a specified 3D model, hereinafter referred to as a second model, and the virtual object is driven using the second model.
In the following embodiments, a technical scheme for migrating data of nodes in a first model to nodes in a second model is provided, which aims to shield a difference in a ratio of distances between the nodes in the first model and the second model, so that the second model is closer to an action of an entity according to an action shown by migrated data, that is, an action of a virtual object is more accurate.
Some definitions are explained and illustrated below:
the topological relation refers to the type of the nodes and the connection relation among the nodes. The type of a node is the type of the node in the corresponding entity, such as the various nodes shown in FIG. 2. It is to be understood that fig. 2 shows a node corresponding to a part of a joint point of a human body.
The first model and the second model are both 3D models, wherein the data of the included nodes comprise position coordinates and rotation data. The definition of rotation data can be found in the prior art.
The proportion of the node distances is as follows: 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, S1/S2. Wherein, the distance can be calculated by the position coordinates of the nodes. Taking fig. 2 as an example, the position coordinates of Hips and LeftHips are used to obtain the distance S1 between Hips and LeftHips, the position coordinates of Hips and RightHips are used to obtain the distance S2 between Hips and RightHips, and S1 is divided by S2 to obtain the ratio of the node distance.
The ratio of the lengths of the joint points in the entity refers to the ratio of the lengths of bones between the joint points, for example, the length of a bone between the joint point 1 and the joint point 2 is S3, the length of a bone between the joint point 3 and the joint point 4 is S4, and S3/S4 is a joint point length ratio.
The first model is adapted to the entity: the nodes in the first model are in one-to-one correspondence with the joints in the entity, and the ratio of the distances between the nodes in the first model is the same as the ratio of the lengths of the corresponding joints in the entity, for example, the ratio of the distance between Hips and LeftHips divided by the distance between Hips and RightHips in fig. 2 is equal to the ratio of the length of bone between Hips and LeftHips divided by the length of bone between Hips and RightHips in the human body.
The nodes in the model correspond to the joint points in the entity, and the method comprises the following steps: the data distributed to a certain node in the model is data acquired by displacement or rotation of a certain joint point in the entity, and the node corresponds to the joint point.
Based on the above, the first model and the second model have the same topological relationship, and the nodes in the first model correspond to the nodes in the second model one to one, that is, the nodes in the first model all have unique corresponding nodes in the second model.
Fig. 2 is an example of a human body 3D model used in an embodiment of the present application, Hips represents a hip node, Spine1 represents a first (off) node of a Spine, Spine2 represents a second (off) node of the Spine, Neck (off) node, Head represents a Head (off) node, LeftShoulder represents a left shoulder (off) node, RightShoulder represents a right shoulder (off) node, LeftElbow represents a left elbow (off) node, RightElbow represents a right elbow (off) node, leftwright represents a left wrist (off) node, rightwright represents a right wrist (off) node, LeftHips represents a left hip (off) node, RightHips represents a right hip (off) node, LeftKnee represents a left knee (off) node, RightKnee represents a right left knee (off) node, leftanklebetle represents a left ankle (off) node, and rightankles represents a right ankle (off) node.
In the following embodiments, any node to be migrated in the first model is referred to as a target node, and a corresponding node of the target node in the second model is referred to as a corresponding target node. The topological relation of any node (such as a target node) represented in the first model is the same as the topological relation of a corresponding node (such as a corresponding target node) represented in the second model, namely the corresponding node of any node is the node representing the same relation in the topological relation.
For example, as shown in fig. 2, the target node is LeftWrist in the first model, and then LeftWrist in the second model is the corresponding target node. The topological relation of the leftWrist in the first model is connected with the leftElbow, and the topological relation of the leftWrist in the second model is also connected with the leftElbow.
The migration flow of data proposed in the embodiment of the present application will be described in detail below.
Fig. 3 is a flowchart of a data migration method disclosed in an embodiment of the present application, including the following steps:
and S31, acquiring a vector of the first node pointing to the target node according to the position coordinates of the nodes in the first model, and taking the vector as a first vector.
The target node is any node to be subjected to data migration in the first model, and the first node is any node except the target node in the first model.
One implementation of S31 is: and taking the direction of the first node pointing to the target node as the direction of the first vector, and taking the distance between the first node and the target node as the length of the first vector, so as to determine the first vector. The distance between the first node and the target node is determined by the position coordinates of the first node and the target node.
In addition to the above implementation, the present application provides another implementation with higher precision, which will be described in detail in the following embodiments.
And S32, taking the sum of the projection lengths of the vectors of the first model on the first vector as a first parameter.
Each first model vector is a vector of a node before and a node after two adjacent nodes in the first node sequence. The first node sequence is a sequence formed by nodes passing through in sequence according to the passing sequence in the process of moving from the first node to the target node on the first model.
The length of the vector of the previous node pointing to the next node is obtained through the difference of the position coordinates of the previous node and the next node, and the direction is the direction of the previous node pointing to the next node.
It can be seen that the first parameter represents a length component in the direction of the first vector of a path formed by nodes in the first sequence of nodes.
And S33, taking the sum of the projection lengths of the vectors of the second model on the first vector as a second parameter.
Each vector of the second model is a vector of a previous node pointing to a next node in the second node sequence. The second node sequence is a sequence formed by nodes passing through in sequence according to the passing sequence in the process of moving from the corresponding first node to the corresponding target node on the second model.
And S34, normalizing the first vector according to the first parameter to obtain a normalized first vector.
Since the first parameter represents a length component in the direction of the first vector of a path formed by nodes in the first node sequence, the normalized first vector obtained by the first vector using the first parameter can be regarded as a vector in which the specificity of the length is eliminated. I.e. the first sequence of nodes in the first model, the influence of the distance between the nodes on the normalized first vector has been eliminated.
And S35, using the second parameter to reversely normalize the normalized first vector to the second model to obtain the direction vector of the first node.
The second parameter represents a length component in the direction of the first vector of a path formed by nodes in the second sequence of nodes, so that multiplying the normalized first vector by the second parameter can be seen as mapping the normalized first vector to the second model. I.e. the pointing vector has the characteristics of the distance between the nodes in the path formed by the second sequence of nodes.
And S36, determining a migration position coordinate obtained after the position coordinate of the target node is migrated to the corresponding target node according to the pointing displacement coordinate of at least the first node.
As can be seen from the above flow, in this embodiment, the normalization method is used to mask the specificity of the length of the path formed by the first node sequence of the first model, and then the normalized first vector is mapped into the second model, so that the pointing vector obtains the length feature of the path formed by the second node sequence, and therefore, the position coordinates of the target node determined by using 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, the accuracy is high.
The following is a process of applying the above embodiment to the human body 3D model shown in fig. 2, including the following steps:
1. and acquiring a vector of the first node pointing to the target node as a first vector according to the position coordinates of the nodes in the first model.
As mentioned above, the target node is any node to be migrated in the first model, and in this step and the following embodiments, the target node is exemplified by LeftWrist. The first node is any node except the destination node, and in this step and the following embodiments, an example of the first node is Hips.
2. And taking the sum of the projection lengths of the vectors of the first model on the first vector as a first parameter.
Each vector of the first model is a vector of a previous node pointing to a next node in the first node sequence. The first node sequence is a sequence formed by nodes passing through in sequence according to the passing sequence in the process of moving from the first node to the target node on the first model.
The length of the vector of the previous node pointing to the next node is obtained through the difference of the position coordinates of the previous node and the next node, and the direction is the direction of the previous node pointing to the next node.
Taking fig. 2 as an example, in the process of moving from Hips to LeftWrist in the first model, the nodes that are passed through in sequence are: hips- > spin 1- > spin 2- > leftshot- > leftelbowr- > leftwhite, so the first node sequence is (Hips, spin 1, spin 2, leftshot, leftelbowr, leftwhite).
Each first model vector is:
in the above equations, P represents the position coordinates, and src represents the first model.
in the formula (1)A unit vector representing a first vector is provided,to representThe unit vector of (a), and therefore,denotes viAndcos value of the angle of (a) to (b), therebyTo representAt viThe projected length of (c).
As can be seen from the above calculation formula of the first parameter, the first parameter represents a length component of a path formed by nodes in the first node sequence in the direction of the first vector.
3. And taking the sum of the projection lengths of the vectors of the second model on the first vector as a second parameter.
Each vector of the second model is a vector of a previous node pointing to a next node in the second node sequence. The second node sequence is a sequence formed by nodes passing through in sequence according to the passing sequence in the process of moving from the corresponding first node to the corresponding target node on the second model.
In accordance with the above definition of the corresponding nodes, an example of the second node sequence corresponding to an example of the first node sequence in the first model is the following sequence of nodes in the second model:
(Hips,Spine1,Spine2,LeftShoulder,LeftElbow,LeftWrist)。
each second model vector is:
in the above equations, P represents the position coordinates, and tar represents the second model.
The second parameter isAs can be seen from the calculation formula of the second parameter, the second parameter represents a length component of a path formed by nodes in the second node sequence in the direction of the first vector.
4. And carrying out normalization processing on the first vector by using the first parameter to obtain a normalized first vector.
5. And using the second parameter to reversely normalize the normalized first vector to the second model to obtain the direction vector of the first node.
In this step, one example of the mapping operation is multiplication, that is, the direction vector of the first node is:
the second parameter represents a length component in the direction of the first vector of a path formed by nodes in the second sequence of nodes, so that multiplying the normalized first vector by the second parameter can be seen as mapping the normalized first vector to the second model. I.e. the pointing vector has the characteristics of the distance between the nodes in the path formed by the second sequence of nodes.
6. And determining a migration position coordinate obtained after the position coordinate of the target node is migrated to the corresponding target node at least according to the pointing displacement coordinate of the first node.
The pointing displacement coordinate of the first node is obtained by moving the first node along the direction of the pointing vector by the length of the pointing vector, that is, the pointing displacement coordinate is
It can be seen from the above flow that, in this embodiment, after the data in the first model is subjected to the influence of the figure proportion of the human body by using the normalization method, the data is allocated to the second model, and the figure proportion of the second model is considered when the data is allocated to the second model, so that the action of the virtual character driven by the second model is closer to the action of the entity, and the accuracy is higher.
Fig. 4 is a flowchart of a method for migrating motion data, which is disclosed in an embodiment of the present application, and compared with the flowchart shown in fig. 3, the main difference is that steps capable of further improving precision and saving resources are defined or added.
Fig. 4 includes the following steps:
and S41, collecting data of the nodes of the first model.
As previously described, motion capture techniques may be used to capture data for various joint points of an entity during motion and assign the captured data to nodes in the first model. The data of any one node in the first model includes position coordinates of the node and rotation data.
It can be understood that if motion data is continuously collected, multiple frames of data may be formed, and in this embodiment, any one frame of motion data of the first model is recorded as:
rotation data:
where src represents the first model, Hips represents a hip node, Spine1 represents a Spine first node, Spine2 represents a Spine second node, tack represents a Neck (off) node, Head represents a Head (off) node, leftShoulder represents a left shoulder (off) node, rightShoulder represents a right shoulder (off) node, LeftElbow represents a left elbow (off) node, rightElbow represents a right elbow (off) node, leftWrist represents a left wrist (off) node, rightWrist represents a right wrist (off) node, LeftHips represents a left hip (off) node, rightHips represents a right hip (off) node, LeftKnee represents a left knee (off) node, rightKnee represents a right knee (off) node, LeftAnkle represents a left ankle (off) node, and RightAnkle represents a right ankle (off) node.
Position coordinates:
and S42, taking the position coordinates of the trunk node in the first model as the migration position coordinates of the corresponding node in the second model.
Torso node refers to a node located in the torso portion. That is, for a node on the torso in the human 3D model, the position coordinates assigned to the node in the first model by the motion capture technique may be directly used as the position coordinates of the corresponding node in the second model without being migrated through the steps described in the above embodiments.
Because the trunk node of the human body does not participate in the movement or has limited contribution to the movement, the position coordinates of the trunk node have little influence on the accuracy of the movement, and therefore, the position coordinates of the trunk node of the first model are directly used as the migration position coordinates of the corresponding node in the second model, on the premise that the accuracy of the movement of the virtual object is not obviously reduced, the calculation power can be saved, and the time delay is reduced.
And S43, determining the orientation vectors of all nodes except the trunk node and the target node in the first model.
In this step, the target node is defined as any one node except the trunk node, that is, the direction vectors of all nodes except the trunk node and the target node are obtained. In this embodiment, the target node takes LeftWrist as an example.
Taking any one of the nodes other than the trunk node and the target node, which is called the first node, as an example, the difference between the present embodiment and the above embodiment in acquiring the pointing vector is that: the manner of obtaining the first vector.
In this step, the first vector is obtained in the following manner:
and acquiring a first vector according to the position coordinates of the target node, the position coordinates of other nodes except the trunk node and the target node in the first model and the conversion relation.
Wherein, the conversion relation comprises: and determining the position coordinates of the target node according to the initial displacement coordinates of other nodes, wherein the initial displacement coordinates of the first node are obtained by moving the first node along the direction of the first vector by the length of the first vector.
wherein, Pi srcIs the position coordinates of any one node except the torso node and the LeftWrist node. v. ofiA vector pointing to LeftWrist for any one node except the torso node and the LeftWrist node. It will be understood that v isiI.e. a first vector pointing to the target node for the first node.
λiThe preset weight parameter can be preset. It can be understood that λiThe average value can be obtained directly without setting the parameter.
vi+Pi srcThe meaning of (A) is: coordinate P of positioni srcAlong vector viFor the purpose of distinguishing from the displacement coordinates in the above-described embodiments, the position coordinates obtained after the displacement are referred to as initial displacement coordinates.
Thus, it is understood that formula (2) has the meaning: the position coordinates of leftwhite are a weighted sum of initial displacement coordinates of respective nodes except for the torso node and the leftwhite node.
Because of the fact thatPi srcAnd λiIt is known that v can be obtained by substituting formula (2)i。
That is, the above flow can also be expressed as: and determining an initial displacement coordinate of the first node according to the position coordinate of the target node, wherein the initial displacement coordinate of the first node is a coordinate obtained by moving the first node along the direction of the first vector by the length of the first vector. And acquiring a first vector according to the initial displacement coordinate of the first node and the position coordinate of the first node.
At the acquisition of viThen, the first parameter, the second parameter, and the direction vector of the other nodes except the trunk node and the target node may be obtained by the above method for obtaining the direction vector of the first node, which is not described herein again.
The manner of obtaining the first vector in this step determines the first vector from the plurality of nodes, and therefore, has higher accuracy than the manner of determining using the position coordinates of the target node and the first node.
And S44, determining the migration position coordinates obtained after the position coordinates of the target nodes are migrated to the corresponding target nodes according to the pointing displacement coordinates of other nodes except the trunk nodes and the target nodes.
Specifically, the migration position coordinates of the LeftWrist node in the second model are as follows:wherein,is the pointing displacement coordinate of the first node. Lambda [ alpha ]iIs a weighting coefficient and is an optional parameter.
Compared with the embodiment that only the first node is used for determining the migration position coordinate of the target node, the method that the migration positions of the target node are determined by using a plurality of nodes obtains more accurate results.
Since the target node is any one node except the trunk node, the migration position coordinates of all the other nodes except the trunk node can be obtained by sequentially performing the above processing on the nodes except the trunk node.
And S45, determining migration rotation data of the nodes in the second model according to the migration position coordinates of the corresponding target nodes and the initial position coordinates of the nodes in the second model.
Where the initial position coordinates may be set at the time of construction of the second model, which is known data for this step.
Specifically, the migration rotation data may be determined by using an IK algorithm according to the migration position coordinates and the initial position coordinates, and a specific implementation manner of the IK algorithm may refer to the prior art and is not described herein again.
It is 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, and therefore, the calculation power and time resources can be saved.
The flow shown in fig. 4 has the following beneficial effects:
1. the vector between the nodes is determined by using the relationship between the vector between the nodes in the human body 3D skeleton model and the position data, so that the real topological relationship between the nodes can be more closely attached.
2. The length is a cause of 'die-through' of the isomorphic model, and in the embodiment, the first parameter and the second parameter are respectively determined based on the length vector, so that the problem of inaccurate motion of the virtual object driven by the second model, such as 'die-through', can be fundamentally solved.
3. The migration rotation data is determined according to the migration position coordinates, and the position coordinates of the trunk nodes before migration are directly used as the migration position coordinates, so that resources can be saved on the premise that the migration data meeting the accuracy requirement are obtained.
Fig. 5 is a data migration apparatus according to an embodiment of the present application, including: the device comprises an acquisition module, a first processing module, a second processing module, a normalization module, an inverse normalization module and a migration module.
The acquisition module is used for acquiring a vector of the first node pointing to the target node according to the position coordinates of the nodes in the first model, and the vector is used as a first vector; the target node is any node to be subjected to data migration in the first model, and the first node is any node except the target node in the first model.
The first processing module is used for taking the sum of the projection lengths of the vectors of the first model on the first vector as a first parameter; each vector of the first model is a vector of a node before two adjacent nodes pointing to a node after the node before the node in the first node sequence, and the first node sequence is a sequence formed by nodes passing through in sequence according to the sequence of the nodes passing through in the process of moving from the first node to the target node on the first model.
The second processing module is used for taking the sum of the projection lengths of the vectors of the second model on the first vector as a second parameter; each vector of the second model is a vector of a node before two adjacent nodes pointing to a node after the node in a second node sequence, and the second node sequence is a sequence formed by nodes passing through in sequence according to the sequence of the nodes passing through in the process of moving from the corresponding first node to the corresponding target node on the second model; the corresponding first node is: the node which represents the same topological relation with the first node, and the corresponding target node is: and the nodes with the same topological relation with the target node. The normalization module is used for performing normalization processing on the first vector by using the first parameter to obtain a normalized first vector. The denormalization module is used for denormalizing the normalized first vector to the second model by using the second parameter to obtain a pointing vector of the first node.
The migration module is configured to determine, according to at least a pointing displacement coordinate of the first node, a migration position coordinate obtained after the position coordinate of the target node is migrated to the corresponding target node, where the pointing displacement coordinate of the first node is a coordinate obtained after the first node is moved by the length of the pointing vector along the direction of the pointing vector.
Optionally, the migration module is further configured to: determining migration rotation data of the 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, wherein the initial position coordinates are preset position coordinates of the nodes in the second model before the position coordinates of the target node are migrated to the migration position coordinates of the corresponding target node in the second model.
Optionally, the obtaining module is configured to obtain, as the first vector, a vector of the first node pointing to the target node according to the position coordinates of the nodes in the first model, and includes:
the obtaining module is specifically configured to determine an initial displacement coordinate of the first node according to the position coordinate of the target node, where the initial displacement coordinate of the first node is a coordinate obtained by moving the first node along the direction of the first vector by the length of the first vector; and acquiring the first vector according to the initial displacement coordinate of the first node and the position coordinate of the first node.
Optionally, the normalizing module is configured to perform normalization processing on the first vector by using the first parameter, and obtaining a normalized first vector includes: the normalization module is specifically configured to obtain a normalized first vector of the first node according to a ratio of the first vector to the first parameter.
Optionally, the inverse normalization module is configured to inverse-normalize the normalized first vector to the second model using the second parameter, and obtaining the direction vector of the first node includes: the inverse normalization module is specifically configured to obtain a pointing vector of the first node according to a product of the normalized first vector and the second parameter.
Optionally, the migration module is configured to determine, according to the pointing displacement coordinate of at least the first node, a migration position coordinate obtained after the position coordinate of the target node is migrated to the corresponding target node, and includes:
the migration module is specifically configured to determine, according to the pointing displacement coordinates of other nodes except the target node, a migration position coordinate obtained after the position coordinate of the target node is migrated to the corresponding target node.
Optionally, the first model and the second model are human models. The target node is any node to be subjected to data migration in the first model, and the method comprises the following steps: the target node is any node to be subjected to data migration except for the trunk node in the first model.
The device of this embodiment is configured to migrate data of the first model to the second model with the same topological relation, so that the action accuracy of the virtual object driven by the second model for obtaining the migrated data is higher.
The embodiment of the application also discloses an electronic device, which comprises: the processor is used for executing the program to realize the data migration method of the embodiment.
The embodiment of the application also discloses a computer-readable storage medium, wherein a program is stored on the computer-readable storage medium, and the computer-readable storage medium is characterized in that when the electronic device runs the program, the data migration method of the embodiment is realized.
The functions described in the method of the embodiment of the present application, if implemented in the form of software functional units and sold or used as independent products, may be stored in a storage medium readable by a computing device. Based on such understanding, part of the contribution to the prior art of the embodiments of the present application or part of the technical solution may be embodied in the form of a software product stored in a storage medium and including several instructions for causing a computing device (which may be a personal computer, a server, a mobile computing device or a network device) to execute all or part of the steps of the method described in the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The embodiments are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same or similar parts among the embodiments are referred to each other.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims (10)
1. A data migration method is used for migrating data of a first model to a second model with the same topological relation, and is characterized by comprising the following steps:
acquiring a vector of a first node pointing to a target node according to the position coordinates of the nodes in the first model, and taking the vector as a first vector; the target node is any node to be subjected to data migration in the first model, and the first node is any node except the target node in the first model;
taking the sum of the projection lengths of the vectors of the first model on the first vector as a first parameter; each vector of the first model is a vector of a node before two adjacent nodes pointing to a node after the node before the node in the first node sequence, and the first node sequence is a sequence formed by nodes passing through in sequence according to the sequence of the nodes passing through in the process of moving from the first node to the target node on the first model;
taking the sum of the projection lengths of the vectors of the second model on the first vector as a second parameter; each vector of the second model is a vector of a node before two adjacent nodes pointing to a node after the node in a second node sequence, and the second node sequence is a sequence formed by nodes passing through in sequence according to the sequence of the nodes passing through in the process of moving from the corresponding first node to the corresponding target node on the second model; the corresponding first node is: the node which represents the same topological relation with the first node, and the corresponding target node is: a node representing the same topological relation as the target node;
using the first parameter to carry out normalization processing on the first vector to obtain a normalized first vector;
using the second parameter to inversely normalize the normalized first vector to the second model to obtain a pointing vector of the first node;
and determining a migration position coordinate obtained after the position coordinate of the target node is migrated to the corresponding target node according to at least the pointing displacement coordinate of the first node, wherein the pointing displacement coordinate of the first node is obtained after the first node is moved by the length of the pointing vector along the direction of the pointing vector.
2. The method of claim 1, wherein obtaining a vector of a first node pointing to a target node as a first vector according to the position coordinates of the nodes in the first model comprises:
determining an initial displacement coordinate of the first node according to the position coordinate of the target node, wherein the initial displacement coordinate of the first node is a coordinate obtained by moving the first node along the direction of the first vector by the length of the first vector;
and acquiring the first vector according to the initial displacement coordinate of the first node and the position coordinate of the first node.
3. The method of claim 1, wherein the normalizing the first vector using the first parameter comprises:
obtaining a normalized first vector of the first node according to the ratio of the first vector to the first parameter;
the inverse normalizing the normalized first vector to the second model using the second parameter to obtain the direction vector of the first node includes:
and acquiring the pointing vector of the first node according to the product of the normalized first vector and the second parameter.
4. The method according to claim 1, wherein determining a migration position coordinate obtained after migrating the position coordinate of the target node to the corresponding target node according to the pointing displacement coordinate of at least the first node comprises:
and determining a migration position coordinate obtained after the position coordinate of the target node is migrated to the corresponding target node according to the pointing displacement coordinates of other nodes except the target node.
5. The method according to any one of claims 1-4, further comprising:
determining 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, wherein the initial position coordinates are preset position coordinates of the nodes in the second model before the position coordinates of the target node are migrated to the migration position coordinates of the corresponding target node in the second model.
6. The method of any of claims 1-4, wherein the first model and the second model are human models;
the target node is any node to be subjected to data migration in the first model, and the method comprises the following steps:
the target node is any node to be subjected to data migration except for the trunk node in the first model.
7. A data migration apparatus for migrating data of a first model to a second model with the same topological relation, comprising:
the acquisition module is used for acquiring a vector of the first node pointing to the target node as a first vector according to the position coordinates of the nodes in the first model; the target node is any node to be subjected to data migration in the first model, and the first node is any node except the target node in the first model;
the first processing module is used for taking the sum of the projection lengths of the vectors of the first model on the first vector as a first parameter; each vector of the first model is a vector of a node before two adjacent nodes pointing to a node after the node before the node in the first node sequence, and the first node sequence is a sequence formed by nodes passing through in sequence according to the sequence of the nodes passing through in the process of moving from the first node to the target node on the first model;
the second processing module is used for taking the sum of the projection lengths of the vectors of the second model on the first vector as a second parameter; each vector of the second model is a vector of a node before two adjacent nodes pointing to a node after the node in a second node sequence, and the second node sequence is a sequence formed by nodes passing through in sequence according to the sequence of the nodes passing through in the process of moving from the corresponding first node to the corresponding target node on the second model; the corresponding first node is: the node which represents the same topological relation with the first node, and the corresponding target node is: a node representing the same topological relation as the target node;
the normalization module is used for performing normalization processing on the first vector by using the first parameter to obtain a normalized first vector;
the inverse normalization module is used for inverse normalizing the normalized first vector to the second model by using the second parameter to obtain a pointing vector of the first node;
and the migration module is used for determining a migration position coordinate obtained after the position coordinate of the target node is migrated to the corresponding target node according to at least the pointing displacement coordinate of the first node, wherein the pointing displacement coordinate of the first node is a coordinate obtained after the first node is moved by the length of the pointing vector along the direction of the pointing vector.
8. The apparatus of claim 7, wherein the migration module is further configured to:
determining migration rotation data of the 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, wherein the initial position coordinates are preset position coordinates of the nodes in the second model before the position coordinates of the target node are migrated to the migration position coordinates of the corresponding target node in the second model.
9. An electronic device, comprising:
a processor and a memory;
the memory is used for storing a program, and the processor is used for operating the program to realize the data migration method of any one of claims 1 to 6.
10. A computer-readable storage medium on which a program is stored, characterized in that, when the program is executed by an electronic device, the migration method of data according to any one of claims 1 to 6 is implemented.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110741541.XA CN113362431A (en) | 2021-06-30 | 2021-06-30 | Data migration method and device, electronic equipment and readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110741541.XA CN113362431A (en) | 2021-06-30 | 2021-06-30 | Data migration method and device, electronic equipment and readable storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN113362431A true CN113362431A (en) | 2021-09-07 |
Family
ID=77537729
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110741541.XA Pending CN113362431A (en) | 2021-06-30 | 2021-06-30 | Data migration method and device, electronic equipment and readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113362431A (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113724363A (en) * | 2021-09-10 | 2021-11-30 | 北京爱奇艺科技有限公司 | Data migration method and device, electronic equipment and readable storage medium |
CN113744375A (en) * | 2021-09-10 | 2021-12-03 | 北京爱奇艺科技有限公司 | Data migration method and device, electronic equipment and readable storage medium |
CN113744376A (en) * | 2021-09-16 | 2021-12-03 | 北京爱奇艺科技有限公司 | Data correction method and device, electronic equipment and readable storage medium |
CN114140573A (en) * | 2021-09-16 | 2022-03-04 | 北京爱奇艺科技有限公司 | Method and device for optimizing root node data in model |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP1406215A1 (en) * | 2002-10-02 | 2004-04-07 | Université Libre de Bruxelles | Method for the modeling of skeletal kinematics |
CN110533752A (en) * | 2019-07-23 | 2019-12-03 | 深圳大学 | A kind of generation method, storage medium and the electronic equipment of human action edit model |
CN110852449A (en) * | 2019-11-25 | 2020-02-28 | 北京百度网讯科技有限公司 | Model migration method and electronic device |
CN112330824A (en) * | 2018-05-31 | 2021-02-05 | Oppo广东移动通信有限公司 | Image processing method, image processing device, electronic equipment and storage medium |
-
2021
- 2021-06-30 CN CN202110741541.XA patent/CN113362431A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP1406215A1 (en) * | 2002-10-02 | 2004-04-07 | Université Libre de Bruxelles | Method for the modeling of skeletal kinematics |
CN112330824A (en) * | 2018-05-31 | 2021-02-05 | Oppo广东移动通信有限公司 | Image processing method, image processing device, electronic equipment and storage medium |
CN110533752A (en) * | 2019-07-23 | 2019-12-03 | 深圳大学 | A kind of generation method, storage medium and the electronic equipment of human action edit model |
CN110852449A (en) * | 2019-11-25 | 2020-02-28 | 北京百度网讯科技有限公司 | Model migration method and electronic device |
Non-Patent Citations (1)
Title |
---|
黄元忠;宋卫;卢庆华;: "基于机器学习的三维骨架模型动作合成", 电脑与信息技术, no. 04, 10 August 2020 (2020-08-10) * |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113724363A (en) * | 2021-09-10 | 2021-11-30 | 北京爱奇艺科技有限公司 | Data migration method and device, electronic equipment and readable storage medium |
CN113744375A (en) * | 2021-09-10 | 2021-12-03 | 北京爱奇艺科技有限公司 | Data migration method and device, electronic equipment and readable storage medium |
CN113744376A (en) * | 2021-09-16 | 2021-12-03 | 北京爱奇艺科技有限公司 | Data correction method and device, electronic equipment and readable storage medium |
CN114140573A (en) * | 2021-09-16 | 2022-03-04 | 北京爱奇艺科技有限公司 | Method and device for optimizing root node data in model |
CN113744376B (en) * | 2021-09-16 | 2024-03-08 | 北京爱奇艺科技有限公司 | Data correction method and device, electronic equipment and readable storage medium |
CN114140573B (en) * | 2021-09-16 | 2024-09-13 | 北京爱奇艺科技有限公司 | Optimization method and device for root node data in model |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Tiwari et al. | Neural-gif: Neural generalized implicit functions for animating people in clothing | |
CN113362431A (en) | Data migration method and device, electronic equipment and readable storage medium | |
WO2021169839A1 (en) | Action restoration method and device based on skeleton key points | |
Mori et al. | Estimating human body configurations using shape context matching | |
US11948376B2 (en) | Method, system, and device of generating a reduced-size volumetric dataset | |
US9159134B2 (en) | Method and apparatus for estimating a pose | |
CN101894278B (en) | Human motion tracing method based on variable structure multi-model | |
CN111950412A (en) | Hierarchical dance action attitude estimation method with sequence multi-scale depth feature fusion | |
Villegas et al. | Contact-aware retargeting of skinned motion | |
US20230230305A1 (en) | Online streamer avatar generation method and apparatus | |
JP2019096113A (en) | Processing device, method and program relating to keypoint data | |
WO2007102537A1 (en) | Posture estimating device and method | |
Hong et al. | Garment4d: Garment reconstruction from point cloud sequences | |
CN108073855A (en) | A kind of recognition methods of human face expression and system | |
CN113379903A (en) | Data migration method and device, electronic equipment and readable storage medium | |
CN115205737B (en) | Motion real-time counting method and system based on transducer model | |
CN115223240B (en) | Motion real-time counting method and system based on dynamic time warping algorithm | |
JP6839116B2 (en) | Learning device, estimation device, learning method, estimation method and computer program | |
CN113569775B (en) | Mobile terminal real-time 3D human motion capturing method and system based on monocular RGB input, electronic equipment and storage medium | |
KR20200057572A (en) | Hand recognition augmented reality-intraction apparatus and method | |
KR20230009676A (en) | 3d human pose estimation apparatus and method thereof | |
JP7464512B2 (en) | 3D human posture estimation device, method and program | |
CN110175629B (en) | Human body action similarity calculation method and device | |
CN113744375A (en) | Data migration method and device, electronic equipment and readable storage medium | |
CN113724363A (en) | Data migration method and device, electronic equipment and readable storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |