CN113129414B - Hand motion restoration method, device, equipment and storage medium - Google Patents

Hand motion restoration method, device, equipment and storage medium Download PDF

Info

Publication number
CN113129414B
CN113129414B CN202110391111.XA CN202110391111A CN113129414B CN 113129414 B CN113129414 B CN 113129414B CN 202110391111 A CN202110391111 A CN 202110391111A CN 113129414 B CN113129414 B CN 113129414B
Authority
CN
China
Prior art keywords
hand
target
original
wrist
tail end
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.)
Active
Application number
CN202110391111.XA
Other languages
Chinese (zh)
Other versions
CN113129414A (en
Inventor
刘思阳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing IQIYI Science and Technology Co Ltd
Original Assignee
Beijing IQIYI Science and Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Beijing IQIYI Science and Technology Co Ltd filed Critical Beijing IQIYI Science and Technology Co Ltd
Priority to CN202110391111.XA priority Critical patent/CN113129414B/en
Publication of CN113129414A publication Critical patent/CN113129414A/en
Application granted granted Critical
Publication of CN113129414B publication Critical patent/CN113129414B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T13/00Animation
    • G06T13/203D [Three Dimensional] animation
    • G06T13/403D [Three Dimensional] animation of characters, e.g. humans, animals or virtual beings
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T19/00Manipulating 3D models or images for computer graphics
    • G06T19/20Editing 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)
  • Architecture (AREA)
  • Computer Graphics (AREA)
  • Computer Hardware Design (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Manipulator (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The application relates to a hand action repairing method, device, equipment and storage medium, wherein the method comprises the following steps: acquiring original hand parameters in original actions of an original object, wherein the original hand parameters comprise original positions of a left hand tail end and a right hand tail end; acquiring target wrist parameters in target actions of a target object, wherein the target wrist parameters comprise respective target positions of left and right wrists, and the target actions are obtained by redirecting original actions to the target object; determining respective target positions of the left hand end and the right hand end required for repairing the hand motion in the target motion, so that the respective target positions of the left hand end and the right hand end, the original hand parameters and the target wrist parameters meet constraint conditions; and repairing the hand motion in the target motion according to the target positions of the left hand tail end and the right hand tail end and the target wrist parameters. The hand movement repairing device is used for repairing hand movements when the movement is redirected, and serious deviation of hand mold penetration or hand movements is avoided.

Description

Hand motion restoration method, device, equipment and storage medium
Technical Field
The present disclosure relates to the field of virtual reality technologies, and in particular, to a method, an apparatus, a device, and a storage medium for repairing hand motions.
Background
Motion redirection (Motion Retargeting) is one of the important methods for motion editing and composition in three-dimensional animation. Motion redirection refers to redirecting motion from one character to another to achieve the goal of having multiple characters share motion. For example, the arm bending motion of character a is redirected to character B, so that character B performs the same arm bending motion as character a.
In motion redirection, two redirection strategies are typically used, one rotation priority and the other position priority. By rotational priority, it is meant that the rotational information of each joint is kept unchanged during the course of the motion redirection. Position priority is to maintain the position of the end joint unchanged during the motion redirection process and adjust the position of each node from the root node to the end node.
In the virtual reality scene, when the motion redirection is carried out on the human body model, the action of the hand is not considered, and the original rotation information of the hand and the forearm is kept unchanged.
When the motion redirection is performed by using the position-first strategy, the position of the end articulation point needs to be kept unchanged, which may cause the rotation information of the end articulation point and the father articulation point to change, that is, the wrist articulation point rotates relatively to the elbow articulation point, and when the rotation information of the forearm changes, if the rotation information of the hand remains unchanged from the rotation information of the forearm, the hand motion may be subjected to die penetration or serious deviation.
Disclosure of Invention
The application provides a hand motion restoration method, device, equipment and storage medium, which are used for restoring hand motion during motion redirection and avoiding hand mold penetration or serious deviation of hand motion.
In a first aspect, a method for repairing hand movements is provided, including:
acquiring original hand parameters in original actions of an original object, wherein the original hand parameters comprise original positions of a left hand tail end and a right hand tail end;
obtaining target wrist parameters in target actions of a target object, wherein the target wrist parameters comprise respective target positions of a left wrist and a right wrist, and the target actions are obtained by redirecting the original actions to the target object;
determining respective target positions of a left hand end and a right hand end required for repairing hand motions in the target motions, so that the respective target positions of the left hand end and the right hand end, the original hand parameters and the target wrist parameters meet constraint conditions; repairing the hand motion in the target motion according to the target positions of the left hand tail end and the right hand tail end and the target wrist parameters;
The constraint conditions include: a first distance value determined by the target positions of the left hand end and the right hand end respectively, and is close to a second distance value determined by the original positions of the left hand end and the right hand end respectively; and the length of a connecting line between the target position of the tail end of the left hand and the target position of the left wrist is equal to a first set value; and the length of the connecting line between the target position of the tail end of the right hand and the target position of the right wrist is equal to a second set value.
Optionally, the first distance value determined by the target positions of the left hand end and the right hand end is close to the second distance value determined by the original positions of the left hand end and the right hand end, including:
the first distance value is equal to the second distance value.
Optionally, the determining the target positions of the left hand end and the right hand end required for repairing the hand motion in the target motion so that the target positions of the left hand end and the right hand end, the original hand parameters and the target wrist parameters meet constraint conditions includes:
connecting the left hand tail end and the right hand tail end according to the original positions of the left hand tail end and the right hand tail end, and obtaining a first connecting line segment;
Connecting the left wrist and the right wrist according to the target positions of the left wrist and the right wrist to obtain a second connecting line segment;
taking the midpoint of the first connecting line segment as a first midpoint, taking the midpoint of the second connecting line segment as a second midpoint, and obtaining a first vector pointing to the first midpoint from the second midpoint, wherein the first vector is a third distance value from the second midpoint to the first midpoint;
drawing a first straight line parallel to the first vector through the original position of the left hand end, and drawing a second straight line parallel to the first vector through the original position of the right hand end;
and determining the target position of the left hand tail end on the first straight line, and determining the target position of the right hand tail end on the second straight line, so that the length of a connecting line from the target position of the left hand tail end to the target position of the left wrist is equal to the first set value, and the length of a connecting line from the target position of the right hand tail end to the target position of the right wrist is equal to the second set value.
Optionally, the target position of the left-hand end is further satisfied, and the ratio of the second vector, in which the target position of the left-hand end points to the original position of the left-hand end, to the first vector is greater than or equal to-1; the size of the second vector is equal to a fourth distance value between the target position of the left hand tail end and the original position of the left hand tail end;
The target position of the right hand tail end also meets the requirement that the ratio of a third vector, which points to the original position of the right hand tail end, of the target position of the right hand tail end to the first vector is greater than or equal to-1; the third vector has a size equal to a fifth distance value between the target position of the right-hand end and the original position of the right-hand end.
Optionally, before determining the target positions of the left hand end and the right hand end required for repairing the hand motion in the target motion so that the target positions of the left hand end and the right hand end, the original hand parameters and the target wrist parameters meet constraint conditions, the method further includes:
acquiring original wrist parameters in the original action, wherein the original wrist parameters comprise original positions of a left wrist and a right wrist respectively;
calculating a sixth distance value between the original position of the left wrist and the original position of the tail end of the left hand, and taking the sixth distance value as the first set value;
and calculating a seventh distance value between the original position of the right wrist and the original position of the right hand tail end, and taking the seventh distance value as the second set value.
Optionally, before determining the target positions of each of the left-hand end and the right-hand end required for repairing the hand motion in the target motion, the method further includes:
and determining the first distance value according to the original position of the left hand tail end and the original position of the right hand tail end, and determining that the first distance value is not larger than a preset distance value.
Optionally, the acquiring the original hand parameters in the original action of the original object includes:
acquiring the original positions of the fingers of the left hand and the original positions of the fingers of the right hand in the original action;
for any one target finger in the fingers of the left hand, executing a calculation process: calculating the original positions of the target fingers, and respectively obtaining eighth distance values between the original positions of the fingers of the right hand;
and selecting a minimum distance value from the calculated eighth distance values, taking the original position of the left finger corresponding to the minimum distance value as the original position of the tail end of the left hand, and taking the original position of the right finger corresponding to the minimum distance value as the original position of the tail end of the right hand.
In a second aspect, the present application provides a hand motion restoration device comprising:
The first acquisition module is used for acquiring original hand parameters in original actions of an original object, wherein the original hand parameters comprise original positions of the left hand tail end and the right hand tail end;
a second acquisition module, configured to acquire a target wrist parameter in a target motion of a target object, where the target wrist parameter includes a target position of each of a left wrist and a right wrist, where the target motion is obtained by redirecting the original motion to the target object;
the processing module is used for determining the target positions of the left hand tail end and the right hand tail end, which are required for repairing the hand motion in the target motion, so that the target positions of the left hand tail end and the right hand tail end, the original hand parameters and the target wrist parameters meet constraint conditions; repairing the hand motion in the target motion according to the target positions of the left hand tail end and the right hand tail end and the target wrist parameters;
the constraint conditions include: a first distance value determined by the target positions of the left hand end and the right hand end respectively, and is close to a second distance value determined by the original positions of the left hand end and the right hand end respectively; and the length of a connecting line between the target position of the tail end of the left hand and the target position of the left wrist is equal to a first set value; and the length of the connecting line between the target position of the tail end of the right hand and the target position of the right wrist is equal to a second set value.
In a third aspect, an embodiment of the present application provides an electronic device, including: the device comprises a processor, a memory and a communication bus, wherein the processor and the memory are communicated with each other through the communication bus; the memory is used for storing a computer program; the processor is configured to execute the program stored in the memory, and implement the hand motion repair method according to the first aspect.
In a fourth aspect, embodiments of the present application provide a computer readable storage medium storing a computer program, where the computer program when executed by a processor implements the hand motion restoration method according to the first aspect.
Compared with the prior art, the technical scheme provided by the embodiment of the application has the following advantages: according to the method provided by the embodiment of the application, the second distance value between the left-hand tail end and the right-hand tail end in the redirected target action is limited to be close to the first distance value between the left-hand tail end and the right-hand tail end in the original action, so that the proper distance between the two hands after redirection can be kept, and the die penetration phenomenon is avoided. At the same time, by defining the length of the redirected left-hand end to left wrist wire and the length of the redirected right-hand end to right wrist wire, the original hand motion can be substantially maintained without serious deviation.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention.
FIG. 1 is a schematic diagram of a kinematic redirection of a chain structure ABC;
FIG. 2 is a schematic diagram showing the effect of the problem of mold penetration by hand motion;
FIG. 3 is a schematic illustration of the effect of large deviations in hand motion;
FIG. 4A is a schematic diagram of the original actions of a human model;
FIG. 4B is a schematic diagram illustrating the effect of redirecting the original actions of FIG. 4A;
FIG. 5 is a schematic flow chart of hand motion repair in an embodiment of the present application;
FIG. 6 is a schematic flow chart of determining respective target positions of a left-hand end and a right-hand end in an embodiment of the present application;
fig. 7 is a schematic flow chart of acquiring original hand parameters in the embodiment of the present application;
fig. 8 is a schematic diagram of a positional relationship among nodes in an embodiment of the present application;
FIG. 9 is a schematic diagram of a hand motion repair device according to an embodiment of the present disclosure;
fig. 10 is a schematic structural diagram of an electronic device in an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application more clear, the technical solutions of 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.
The term "and/or" is herein merely an association relationship describing an associated object, meaning that there may be three relationships, e.g., a and/or B, may represent: a exists alone, A and B exist together, and B exists alone. In addition, the character "/" herein generally indicates that the front and rear associated objects are an "or" relationship.
It should be noted that, in the motion redirection process, the original object and the target object are described under the same world coordinate system, and the positions in the same world coordinate system are generally overlapped, for example, if the two objects are characters and only the arm lengths are different, the rest parts of the two objects except the front part of the arm are overlapped, and only the coordinates of the arm in the world coordinate system are different.
In the motion redirection process, there are a position-first redirection strategy and a rotation-first redirection strategy, and any one strategy can be selected for motion redirection.
For example, suppose that the chain structure ABC shown in fig. 1, which represents a person's arm, a is a shoulder node, B is an elbow node, and C is a wrist node, is subjected to motion redirection. AB is the big arm and BC is the small arm. The task of motion redirection is to migrate from a person with a short arm to a person with a long arm, assuming original skeleton ab=2 centimeters (cm), bc=2 cm; target bone ab=3cm, bc=3cm. If rotation priority is used, i.e. rotation information of each node is kept unchanged, AB 'C' is obtained after redirection to the target bone. If position priority is used, namely the position of the end joint point is kept unchanged, the node between the root joint point and the end joint point is adjusted, and the AB 'C' is obtained after the node is redirected to the target skeleton. B 'is the position of the point B after the rotation priority redirection, and C' is the position of the point C after the rotation priority redirection. B 'is the position of the point B after the position priority redirection, and C' is the position of the point C after the position priority redirection.
The inventors found by analyzing the prior art that:
because the joint points above the wrist are redirected during the motion redirection, the hand is not considered, and the original rotation information of the hand and the forearm is kept unchanged.
When the position-first redirection strategy is used, the position of the end articulation point needs to be kept unchanged, which may cause the rotation information of the end articulation point and the father articulation point to change, that is, the wrist articulation point rotates relatively to the elbow articulation point, when the rotation information of the forearm changes, if the hand keeps unchanged the original rotation information of the forearm, the hand motion cannot be kept, and thus hand through-mold occurs, or serious deviation occurs in the hand motion.
For example, as shown in fig. 2, which is a schematic diagram of the action of the arm and the hand, the long and thin line segments represent the arm, and the short line segments represent the hand. The first action in the figure is the original action, in which the hand is the palm closing action. In the process of redirecting the arm action by adopting the position priority, because the positions of the shoulder joint and the wrist joint are kept unchanged, the rotation information of the elbow joint is changed, and if the rotation information of the hand is kept unchanged, the repositioning effect is the effect of the second row in the graph, and the penetration of the hand is obvious. The third row in the figure is the correct motion, i.e. the hand should remain in proper motion even if the forearm is rotated.
For another example, as shown in fig. 3, which is a schematic diagram of the arm and hand movements, the long and thin line segments represent the arm and the short line segments represent the hand. The first action in the figure is the original action, in which the hand is the palm closing action. The first action in the figure is the original action, in which the hand is the palm closing action. In the process of redirecting the arm action by adopting the position priority, because the positions of the shoulder joint point and the wrist joint point are kept unchanged, the rotation information of the elbow joint point is changed, if the rotation information of the hand is kept unchanged, the repositioning effect is the effect of the second row in the figure, the hand action is obviously changed, and the palm closing action cannot be kept. The third row in the figure is the correct motion, i.e. the hand should remain in proper motion even if the forearm is rotated.
As shown in FIG. 4A, the original motion of an original character model in a 3D game scene is illustrated in the top half of FIG. 4A, and in the bottom half of FIG. 4A, the original motion of an agent of the original character model is illustrated. FIG. 4B illustrates the effect of redirecting the original motion of the character model illustrated in FIG. 4A to the target character model illustrated in FIG. 4B, with the top half of FIG. 4B illustrating the motion of the target character model after being redirected and the bottom half of FIG. 4B illustrating the motion of the target character model after being redirected. The hand of the target character model can be seen to be through-molded. The arms and legs of the target character model are lengthened compared to the original character model.
It should be noted that, in the agent model of fig. 4A and fig. 4B, the agent of the limb is composed of a plurality of triangular meshes, and the cylinder shown in the figure is only a visual effect that is presented when the triangular meshes are enough, which does not represent the agent of the limb or the cylinder. The black and white grid pattern in fig. 4A and 4B is a pattern of a floor on which a person stands.
Based on the above analysis, the inventor proposes a hand motion repairing method for repairing hand motion during motion redirection, and keeping the hand motion unchanged. The method can be applied to any type of electronic equipment, for example, a terminal or a server, wherein the terminal can be any type of mobile phone, tablet computer, computer and the like.
Specifically, as shown in fig. 5, the process of performing the hand action repair mainly includes:
step 501, obtaining original hand parameters in an original motion of an original object, where the original hand parameters include original positions of a left hand end and a right hand end.
The original object is a three-dimensional model of a virtual object, which may be a three-dimensional model of a virtual character, or may be a three-dimensional model of an animal with a wrist structure and a hand structure similar to those of a human, such as a monkey, an gorilla, etc.
Wherein the original action is a reference action referring to the original object with respect to the redirection procedure, which is directed to the target object by redirection.
The original position of the left hand end and the original position of the right hand end refer to positions in a three-dimensional model of an original object, and may be positions determined based on a virtual coordinate system where the three-dimensional model of the original object is located, where the virtual coordinate system may be constructed with a reference point of the three-dimensional model of the original object, and the reference point is used as a coordinate origin of the virtual coordinate system. Of course, points other than the three-dimensional model may be used as reference points. The construction mode of the virtual coordinate system is not limited, and the positions of the joint points above the wrist of the original object and the wrist of the target object can be matched in the redirection process.
Step 502, obtaining target wrist parameters in a target motion of a target object, wherein the target wrist parameters comprise respective target positions of a left wrist and a right wrist, and wherein the target motion is obtained by redirecting an original motion to the target object.
The target object is a three-dimensional model of a virtual object, and the virtual object can be a three-dimensional model of a virtual character, and also can be a three-dimensional model of animals with wrist structures and hand structures similar to those of a human, such as a monkey, an gorilla and the like, compared with the original object type.
The original object and the target object are not exactly identical, e.g. the two object arms are not identical in length.
Wherein, like the original action, the target action is also an action formed in the target object after redirection with respect to the redirection procedure.
It should be noted that, the method for repairing hand motions provided by the embodiments of the present application may be used for repairing hand motions after the joint points other than hand motions are oriented, regardless of the motion redirection technology specifically used.
Step 503, determining respective target positions of the left hand end and the right hand end required for repairing the hand motion in the target motion, so that the respective target positions of the left hand end and the right hand end, the original hand parameters and the target wrist parameters meet constraint conditions;
step 504, repairing the hand motion in the target motion according to the target positions of the left hand end and the right hand end and the target wrist parameters.
After repair the left hand action is defined as: the right hand action is defined in the range defined by the target position of the tail end of the left hand and the target position of the left wrist after modification: the target position of the right hand end is within a range defined by the target position of the right wrist.
Wherein the constraint conditions include: a first distance value determined by the target positions of the left hand end and the right hand end respectively is close to a second distance value determined by the original positions of the left hand end and the right hand end respectively; and the length of the connecting line between the target position of the tail end of the left hand and the target position of the left wrist is equal to a first set value; and the length of the connecting line between the target position of the right hand tail end and the target position of the right wrist is equal to the second set value.
According to the method provided by the embodiment of the application, the second distance value between the left-hand tail end and the right-hand tail end in the redirected target action is limited to be close to the first distance value between the left-hand tail end and the right-hand tail end in the original action, so that the proper distance between the two hands after redirection can be kept, and the die penetration phenomenon is avoided. Meanwhile, the restored hand motion can be kept substantially without serious deviation by limiting the length of the connecting line from the redirected left hand tail end to the left wrist and the length of the connecting line from the redirected right hand tail end to the right wrist. The target positions of the left hand tail end and the right hand tail end are determined through a simple set relation, and further the rotation information of the wrist joint is reversely pushed, so that the modified hand motion is obtained, the operation amount is small, the hand motion can be ensured not to have die penetration and verification deviation, and the effect is good.
It should be noted that, as defined in the constraint condition, the first distance value is close to the second distance value, that means, the absolute value of the difference between the first distance value and the second distance value is not greater than a preset value, and the preset value is smaller than the second distance value.
In a specific embodiment, the first distance value is equal to the second distance value, that is, the distance value of the two ends of the hands is redirected, which is equal to the distance value of the two ends of the hands in the original action, so as to achieve the purpose of keeping the distance between the two ends of the hands unchanged, and reduce the variation of the hand action before and after redirection to the greatest extent.
It should be noted that, in the embodiment of the present application, the specific manner of determining the target positions of the left-hand end and the right-hand end according to the above constraint conditions is not limited, and no matter what the process is, the determined target positions of the left-hand end and the right-hand end may be made so long as the above constraint conditions are satisfied. For ease of understanding, the process of determining the target positions of the left-hand end and the right-hand end is described below by way of one specific process.
As shown in fig. 6, determining the target positions of the left hand end and the right hand end required for repairing the hand motion in the target motion so that the target positions of the left hand end and the right hand end, the original hand parameters and the target wrist parameters meet constraint conditions mainly comprises the following steps:
Step 601, connecting the left hand tail end and the right hand tail end according to the original positions of the left hand tail end and the right hand tail end, and obtaining a first connecting line segment;
step 602, connecting the left wrist and the right wrist according to the target positions of the left wrist and the right wrist to obtain a second connecting line segment;
step 603, taking the midpoint of the first connecting line segment as a first midpoint, taking the midpoint of the second connecting line segment as a second midpoint, and obtaining a first vector pointing from the second midpoint to the first midpoint, wherein the first vector is a third distance value from the second midpoint to the first midpoint;
step 604, drawing a first straight line parallel to the first vector through the original position of the left-hand end, and drawing a second straight line parallel to the first vector through the original position of the right-hand end;
step 605, determining the target position of the left hand end on the first straight line, and determining the target position of the right hand end on the second straight line, so that the length of the connecting line from the target position of the left hand end to the target position of the left wrist is equal to the first set value, and the length of the connecting line from the target position of the right hand end to the target position of the right wrist is equal to the second set value.
In the embodiment, the target position of the left hand tail end and the target position of the right hand tail end are determined through simple geometric relations, so that the method is simple in calculation, small in operation amount and good in repairing effect.
In one embodiment, the target position of the left-hand end is also satisfied, and the ratio of the second vector, in which the target position of the left-hand end points to the original position of the left-hand end, to the first vector is greater than or equal to-1; the size of the second vector is equal to a fourth distance value between the target position of the tail end of the left hand and the original position of the tail end of the left hand;
the target position of the right hand end also meets the requirement that the target position of the right hand end points to a third vector of the original position of the right hand end, and the ratio of the third vector to the first vector is greater than or equal to-1; the third vector has a size equal to a fifth distance value between the target position at the right hand end and the original position at the right hand end.
That is, when the ratio of the second vector to the first vector is greater than or equal to-1, it means that by adopting the method provided in the above embodiment, a more suitable target position of the left-hand end can be determined, and if the constraint condition that is greater than or equal to-1 is not satisfied, it means that a reasonable target position of the left-hand end cannot be given, and it is possible to prompt the manual repair of the target position of the left-hand end.
Similarly, when the ratio of the third vector to the first vector is greater than or equal to-1, it indicates that the method provided by the above embodiment can determine the more suitable target position of the right-hand end, and if the limiting condition greater than or equal to-1 is not satisfied, it indicates that the reasonable target position of the right-hand end cannot be given, and the manual repair of the target position of the right-hand end can be prompted.
In one embodiment, before determining the target positions of the left hand end and the right hand end required for repairing the hand motion in the target motion so that the target positions of the left hand end and the right hand end, the original hand parameters and the target wrist parameters meet the constraint conditions, the method further comprises:
acquiring original wrist parameters in an original action, wherein the original wrist parameters comprise original positions of a left wrist and a right wrist respectively;
calculating a sixth distance value between the original position of the left wrist and the original position of the tail end of the left hand, and taking the sixth distance value as a first set value;
and calculating a seventh distance value between the original position of the right wrist and the original position of the tail end of the right hand, and taking the seventh distance value as a second set value.
That is, the distance from the left fingertip to the left wrist is kept unchanged before and after redirection, and the distance from the right fingertip to the right wrist is kept unchanged before and after redirection, so that the parameter requirements of the hand action in the redirection scene can be met. Of course, the first setting value and the second setting value may take other values, which are not limited herein.
In a specific embodiment, during the redirection process, the hand motion is repaired, mainly to avoid the hand mold penetration or serious deviation of the hand motion, and not every redirection needs to repair the hand motion. For the hand threading problem, specific conditions for enabling hand action repair can be set as follows:
Before determining the target positions of the left hand tail end and the right hand tail end required for repairing the hand motion in the target motion, determining a first distance value according to the original positions of the left hand tail end and the right hand tail end, and determining that the first distance value is not larger than a preset distance value.
That is, when the first distance is greater than the preset distance value, the hand is in the safe area, the hand mold penetration problem does not occur, the hand motion is basically not required to be repaired, and the hand motion repairing process can be selected not to be executed. Of course, this is not an absolute limitation, but is just an alternative setting condition of whether or not to execute.
The preset distance value belongs to an empirical value, namely, a critical distance value which is obtained through statistics and can define whether hand mold penetration occurs or not according to whether hand mold penetration occurs in a multi-time redirection process.
In one embodiment, as shown in fig. 7, obtaining the original hand parameters in the original motion of the original object includes:
step 701, acquiring the original positions of the fingers of the left hand and the original positions of the fingers of the right hand in the original action;
step 702, for any one target finger of the fingers of the left hand, executing a calculation process: calculating the original positions of the target fingers, and respectively obtaining eighth distance values between the original positions of the target fingers and the original positions of the fingers of the right hand;
In step 703, a minimum distance value is selected from the eighth distance values obtained by calculation, the original position of the left finger corresponding to the minimum distance value is used as the original position of the left hand end, and the original position of the right hand finger corresponding to the minimum distance value is used as the original position of the right hand end.
The following exemplifies a process of repairing a hand using a virtual character model of a virtual scene.
First, for the first question, "when hand movements need to be repaired? ", the solution idea is given as follows:
since the main purpose of hand repair is to prevent hand from penetrating through the mold, judgment can be made by the distance between the hands, if the distance between the hands is close, repair is required, and if the distance between the hands is far, repair is not required.
Because the joint points of the wrist are calculated through a redirection algorithm, the problem of mold penetration does not occur by default, and the hand mold penetration can exist in the middle of the palm or at the positions of fingertips. In the original motion before redirection, the shortest distance between the five fingertips of the left hand and the five fingertips of the right hand is calculated as follows:
hypothesis set P L Spatial coordinates of the five left fingertips are included:
Hypothesis set P R Spatial coordinates containing five right fingertips:
assume thatRepresenting left finger tip->And right finger tip->Distance value of fingertip>
The minimum distance value selected from among the distance values of all possible combinations of the left and right fingertips is represented.
If the minimum distance value satisfies: d > d set The hand is proved to be in a safe area without requiring the hand to be in the opposite handAnd repairing. d, d set Is an empirical value set manually.
Then, for the second question, "how to repair? ", the solution idea is given as follows:
analysis shows that the rotation of the forearm after redirection changes, but the wrist joint point is optimized by a redirection algorithm, and the position of the wrist joint point needs to be kept unchanged in the hand action repair process, and the position of the finger tip of the hand needs to be adjusted only in the hand action repair process. In addition, during the manual action repair process, the actions of the fingers and the palm are kept unchanged, and only the rotation of the whole hand is changed. Thus, the hand can be repaired by calculating the position of the fingertip after repair. Thus, the problem translates into calculating the positions of the nearest left and right fingertips.
The following node data are acquired:
the original position of the left hand end in the original motion is the position of the left finger tip a, and the space coordinate is expressed as p a
The original position of the right hand end is the position of the right finger tip b, and the spatial coordinate is expressed as p b
The original position c of the left wrist in the original motion is expressed as p by the space coordinate c
The original position d of the left wrist in the original motion is expressed as p by the space coordinate d
The target position c' of the redirected left wrist is represented by the spatial coordinate p c’
The target position d' of the right wrist after redirection, the spatial coordinate is denoted as p d’
Let the target position of the left hand end to be solved be denoted as a 'and the target position of the right hand end be denoted as b'. The positional relationship between the nodes is shown in fig. 8.
The following calculation process is performed:
calculating the midpoint e of the ab connecting line segment, i.eCalculation ofThe midpoint f of the c'd' connecting line segment, denoted asThe vector pointing from e to f is expressed as: />
Making a parallel vector through the point aA' is located on the straight line; making a parallel vector through point b +.>B' is located on the straight line.
During hand motion restoration, the distance from the fingertip to the wrist is kept unchanged, and the target position p of the left fingertip a' is calculated a’ Is a simultaneous equation of (2):
|p a’ -p c’ |=|p a -p c |;
From the simultaneous equation, p is obtained a’ And alpha, if alpha is not less than-1, indicating that p a’ If not, p obtained by the simultaneous equation a’ Is unreasonable, and p is required to be determined manually a’ Is a position of (c).
Similarly, the target position p of the right fingertip b' is calculated b’ Is a simultaneous equation of (2):
|p b’ -p d’ |=|p b -P d |;
from the simultaneous equation, p is obtained b’ And beta, if beta is not less than-1,then indicate the p b’ If not, p obtained by the simultaneous equation b’ Is unreasonable, and p is required to be determined manually b’ Is a position of (c).
At alpha and beta are both greater than or equal to-1, indicating that p is obtained a’ And p b’ The position of the hand is reasonable, and the hand motion is repaired based on the position.
Based on the same concept, the embodiment of the present application provides a hand action repair device, and the specific implementation of the device may be referred to the description of the embodiment of the method, and the repetition is omitted, as shown in fig. 9, where the device mainly includes:
the first obtaining module 901 is configured to obtain an original hand parameter in an original motion of an original object, where the original hand parameter includes original positions of a left hand end and a right hand end;
a second obtaining module 902, configured to obtain a target wrist parameter in a target motion of a target object, where the target wrist parameter includes a target position of each of a left wrist and a right wrist, where the target motion is obtained by redirecting the original motion to the target object;
A processing module 903, configured to determine target positions of the left hand end and the right hand end required for repairing the hand motion in the target motion, so that the target positions of the left hand end and the right hand end, the original hand parameters, and the target wrist parameters meet constraint conditions; repairing the hand motion in the target motion according to the target positions of the left hand tail end and the right hand tail end and the target wrist parameters;
the constraint conditions include: a first distance value determined by the target positions of the left hand end and the right hand end respectively, and is close to a second distance value determined by the original positions of the left hand end and the right hand end respectively; and the length of a connecting line between the target position of the tail end of the left hand and the target position of the left wrist is equal to a first set value; and the length of the connecting line between the target position of the tail end of the right hand and the target position of the right wrist is equal to a second set value.
Based on the same concept, the embodiment of the application also provides an electronic device, as shown in fig. 10, where the electronic device mainly includes: a processor 1001, a memory 1002, and a communication bus 1003, wherein the processor 1001 and the memory 1002 perform communication with each other through the communication bus 1003. The memory 1002 stores a program executable by the processor 1001, and the processor 1001 executes the program stored in the memory 1002 to implement the following steps:
Acquiring original hand parameters in original actions of an original object, wherein the original hand parameters comprise original positions of a left hand tail end and a right hand tail end;
obtaining target wrist parameters in target actions of a target object, wherein the target wrist parameters comprise respective target positions of a left wrist and a right wrist, and the target actions are obtained by redirecting the original actions to the target object;
determining respective target positions of a left hand end and a right hand end required for repairing hand motions in the target motions, so that the respective target positions of the left hand end and the right hand end, the original hand parameters and the target wrist parameters meet constraint conditions; repairing the hand motion in the target motion according to the target positions of the left hand tail end and the right hand tail end and the target wrist parameters;
the constraint conditions include: a first distance value determined by the target positions of the left hand end and the right hand end respectively, and is close to a second distance value determined by the original positions of the left hand end and the right hand end respectively; and the length of a connecting line between the target position of the tail end of the left hand and the target position of the left wrist is equal to a first set value; and the length of the connecting line between the target position of the tail end of the right hand and the target position of the right wrist is equal to a second set value.
The communication bus 1003 mentioned in the above-mentioned electronic device may be a peripheral component interconnect standard (Peripheral Component Interconnect, abbreviated to PCI) bus or an extended industry standard architecture (Extended Industry Standard Architecture, abbreviated to EISA) bus, or the like. The communication bus 1003 may be classified as an address bus, a data bus, a control bus, or the like. For ease of illustration, only one thick line is shown in fig. 10, but not only one bus or one type of bus.
The memory 1002 may include random access memory (Random Access Memory, simply RAM) or may include non-volatile memory (non-volatile memory), such as at least one magnetic disk memory. Optionally, the memory may also be at least one memory device located remotely from the processor 1001.
The processor 1001 may be a general-purpose processor including a central processing unit (Central Processing Unit, CPU), a network processor (Network Processor, NP), a digital signal processor (Digital Signal Processing, DSP), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), a Field programmable gate array (Field-Programmable Gate Array, FPGA), or other programmable logic device, discrete gate or transistor logic device, or discrete hardware components.
In a further embodiment of the present application, there is also provided a computer readable storage medium having stored therein a computer program which, when run on a computer, causes the computer to perform the motion redirection policy selection method described in the above embodiments.
In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer instructions are loaded and executed on a computer, the processes or functions described in accordance with the embodiments of the present application are produced in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, by a wired (e.g., coaxial cable, optical fiber, digital Subscriber Line (DSL)), or wireless (e.g., infrared, microwave, etc.) means from one website, computer, server, or data center to another. The computer readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that contains an integration of one or more available media. The usable medium may be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape, etc.), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid state disk), etc.
It should be noted that in this document, relational terms such as "first" and "second" and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The foregoing is only a specific embodiment of the invention to enable those skilled in the art to understand or practice the invention. 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 invention. Thus, the present invention 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 (8)

1. A hand motion repair method, comprising:
acquiring original hand parameters in original actions of an original object, wherein the original hand parameters comprise original positions of a left hand tail end and a right hand tail end;
obtaining target wrist parameters in target actions of a target object, wherein the target wrist parameters comprise respective target positions of a left wrist and a right wrist, and the target actions are obtained by redirecting the original actions to the target object;
acquiring original wrist parameters in the original action, wherein the original wrist parameters comprise original positions of a left wrist and a right wrist respectively;
calculating a sixth distance value between the original position of the left wrist and the original position of the tail end of the left hand, and taking the sixth distance value as a first set value;
calculating a seventh distance value between the original position of the right wrist and the original position of the tail end of the right hand, and taking the seventh distance value as a second set value;
determining respective target positions of a left hand end and a right hand end required for repairing hand motions in the target motions, so that the respective target positions of the left hand end and the right hand end, the original hand parameters and the target wrist parameters meet constraint conditions; repairing the hand motion in the target motion according to the target positions of the left hand tail end and the right hand tail end and the target wrist parameters;
The constraint conditions include: a first distance value determined by the target positions of the left hand end and the right hand end respectively, and is close to a second distance value determined by the original positions of the left hand end and the right hand end respectively; and the length of a connecting line between the target position of the tail end of the left hand and the target position of the left wrist is equal to a first set value; and the length of a connecting line between the target position of the tail end of the right hand and the target position of the right wrist is equal to a second set value, wherein the first distance value is equal to the second distance value.
2. The method of claim 1, wherein determining the target positions of the left-hand end and the right-hand end required for repairing the hand motion in the target motion so that the target positions of the left-hand end and the right-hand end, the original hand parameters, and the target wrist parameters satisfy constraint conditions comprises:
connecting the left hand tail end and the right hand tail end according to the original positions of the left hand tail end and the right hand tail end, and obtaining a first connecting line segment;
connecting the left wrist and the right wrist according to the target positions of the left wrist and the right wrist to obtain a second connecting line segment;
Taking the midpoint of the first connecting line segment as a first midpoint, taking the midpoint of the second connecting line segment as a second midpoint, and obtaining a first vector pointing to the first midpoint from the second midpoint, wherein the first vector is a third distance value from the second midpoint to the first midpoint;
drawing a first straight line parallel to the first vector through the original position of the left hand end, and drawing a second straight line parallel to the first vector through the original position of the right hand end;
and determining the target position of the left hand tail end on the first straight line, and determining the target position of the right hand tail end on the second straight line, so that the length of a connecting line from the target position of the left hand tail end to the target position of the left wrist is equal to the first set value, and the length of a connecting line from the target position of the right hand tail end to the target position of the right wrist is equal to the second set value.
3. The hand motion restoration method according to claim 2, wherein the target position of the left-hand end is further satisfied, and a ratio of a second vector, in which the target position of the left-hand end points to an original position of the left-hand end, to the first vector is greater than or equal to-1; the size of the second vector is equal to a fourth distance value between the target position of the left hand tail end and the original position of the left hand tail end;
The target position of the right hand tail end also meets the requirement that the ratio of a third vector, which points to the original position of the right hand tail end, of the target position of the right hand tail end to the first vector is greater than or equal to-1; the third vector has a size equal to a fifth distance value between the target position of the right-hand end and the original position of the right-hand end.
4. A hand motion restoration method according to any one of claims 1-3 and wherein said determining the respective target positions of the left hand end and the right hand end required for restoration of a hand motion in said target motion further comprises:
and determining the first distance value according to the original position of the left hand tail end and the original position of the right hand tail end, and determining that the first distance value is not larger than a preset distance value.
5. A hand motion restoration method according to any one of claims 1 to 3, wherein said obtaining raw hand parameters in the raw motion of the raw object comprises:
acquiring the original positions of the fingers of the left hand and the original positions of the fingers of the right hand in the original action;
for any one target finger in the fingers of the left hand, executing a calculation process: calculating the original positions of the target fingers, and respectively obtaining eighth distance values between the original positions of the fingers of the right hand;
And selecting a minimum distance value from the calculated eighth distance values, taking the original position of the left finger corresponding to the minimum distance value as the original position of the tail end of the left hand, and taking the original position of the right finger corresponding to the minimum distance value as the original position of the tail end of the right hand.
6. A hand motion restoration device, characterized by being applied to the hand motion restoration method according to any one of claims 1 to 5, comprising:
the first acquisition module is used for acquiring original hand parameters in original actions of an original object, wherein the original hand parameters comprise original positions of the left hand tail end and the right hand tail end;
a second acquisition module, configured to acquire a target wrist parameter in a target motion of a target object, where the target wrist parameter includes a target position of each of a left wrist and a right wrist, where the target motion is obtained by redirecting the original motion to the target object;
the processing module is used for determining the target positions of the left hand tail end and the right hand tail end, which are required for repairing the hand motion in the target motion, so that the target positions of the left hand tail end and the right hand tail end, the original hand parameters and the target wrist parameters meet constraint conditions; repairing the hand motion in the target motion according to the target positions of the left hand tail end and the right hand tail end and the target wrist parameters;
The constraint conditions include: a first distance value determined by the target positions of the left hand end and the right hand end respectively, and is close to a second distance value determined by the original positions of the left hand end and the right hand end respectively; and the length of a connecting line between the target position of the tail end of the left hand and the target position of the left wrist is equal to a first set value; and the length of the connecting line between the target position of the tail end of the right hand and the target position of the right wrist is equal to a second set value.
7. An electronic device, comprising: the device comprises a processor, a memory and a communication bus, wherein the processor and the memory are communicated with each other through the communication bus; the memory is used for storing a computer program; the processor is configured to execute a program stored in the memory to implement the hand motion restoration method according to any one of claims 1 to 5.
8. A computer readable storage medium storing a computer program, wherein the computer program when executed by a processor implements the hand motion restoration method of any one of claims 1 to 5.
CN202110391111.XA 2021-04-12 2021-04-12 Hand motion restoration method, device, equipment and storage medium Active CN113129414B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110391111.XA CN113129414B (en) 2021-04-12 2021-04-12 Hand motion restoration method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110391111.XA CN113129414B (en) 2021-04-12 2021-04-12 Hand motion restoration method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN113129414A CN113129414A (en) 2021-07-16
CN113129414B true CN113129414B (en) 2024-04-12

Family

ID=76776605

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110391111.XA Active CN113129414B (en) 2021-04-12 2021-04-12 Hand motion restoration method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113129414B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2012111622A1 (en) * 2011-02-16 2012-08-23 株式会社スクウェア・エニックス Movement modeling device, method, and program
GB201601775D0 (en) * 2016-02-01 2016-03-16 Naturalmotion Ltd Animating a virtual object in a virtual world
CN112562072A (en) * 2020-12-25 2021-03-26 北京爱奇艺科技有限公司 Action redirection method, device, equipment and storage medium
CN112562071A (en) * 2020-12-25 2021-03-26 北京爱奇艺科技有限公司 Method, device and equipment for calculating motion difference and storage medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10255712B2 (en) * 2016-04-08 2019-04-09 Adobe Inc. Animation using keyframing and projected dynamics simulation
CN110097639B (en) * 2019-03-18 2023-04-18 北京工业大学 Three-dimensional human body posture estimation method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2012111622A1 (en) * 2011-02-16 2012-08-23 株式会社スクウェア・エニックス Movement modeling device, method, and program
GB201601775D0 (en) * 2016-02-01 2016-03-16 Naturalmotion Ltd Animating a virtual object in a virtual world
CN112562072A (en) * 2020-12-25 2021-03-26 北京爱奇艺科技有限公司 Action redirection method, device, equipment and storage medium
CN112562071A (en) * 2020-12-25 2021-03-26 北京爱奇艺科技有限公司 Method, device and equipment for calculating motion difference and storage medium

Also Published As

Publication number Publication date
CN113129414A (en) 2021-07-16

Similar Documents

Publication Publication Date Title
US9208613B2 (en) Action modeling device, method, and program
US10062197B2 (en) Animating a virtual object in a virtual world
CN108090951B (en) Computer-implemented method for simulating a body taking a gesture
US9984488B2 (en) Animating a virtual object in a virtual world
US20210125393A1 (en) Parameterized animation modifications
US20170221251A1 (en) Animating a virtual object in a virtual world
JP2013120395A (en) Attitude control method for skeleton model, and program
CN113160189A (en) Blood vessel center line extraction method, device, equipment and storage medium
US10319135B2 (en) Computer-implemented method for simulating a body taking a posture, in particular to look at a target
CN112562072A (en) Action redirection method, device, equipment and storage medium
US10410393B2 (en) Animating a virtual object in a virtual world
CN113129414B (en) Hand motion restoration method, device, equipment and storage medium
WO2017054651A1 (en) Method and device for determining fusion coefficient
CN112884869B (en) Motion redirection policy selection method, device, equipment and storage medium
CN111462015B (en) Map track processing method and device, electronic equipment and storage medium
JP2021068438A (en) Computer-implemented method for making skeleton of modeled body take posture
JP5602043B2 (en) Control device, method, and program for difficulty in bending joint angle of skeleton model
JP2022518641A (en) Image processing methods and equipment, image processing devices and storage media
CN112000259A (en) Method and device for controlling camera based on touch event of mobile terminal
CN112102453B (en) Animation model skeleton processing method and device, electronic equipment and storage medium
CN109272485B (en) Method and device for repairing three-dimensional model of blood vessel and electronic equipment
CN114373531B (en) Behavior action monitoring and correcting method, behavior action monitoring and correcting system, electronic equipment and medium
CN116402989A (en) Data processing method, device, equipment and medium
CN116485954A (en) Virtual skeleton repairing method and device, storage medium and electronic equipment
CN116977505A (en) Gesture mapping method, gesture mapping device, computer equipment and 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
GR01 Patent grant
GR01 Patent grant