Gesture training data generation method and device, electronic equipment and storage medium

By continuously sampling real gesture motion trajectories and updating the skeletal Euler angles of the virtual hand model, gesture training data is generated, which solves the problem of low virtual gesture sample size and poor authenticity, and achieves more accurate gesture recognition and coherence.

CN118675223APending Publication Date: 2024-09-20TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202310284795.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-03-17
Publication Date
2024-09-20

AI Technical Summary

Technical Problem

In the existing technology, the number of skeletal animations of virtual hand models for gesture interaction is limited, which makes it difficult to cover different angles and hand habits, and the authenticity and dynamic trajectory capture of gestures cannot be guaranteed.

Method used

By continuously sampling the real gesture motion trajectory, a video frame sequence is obtained, and the gesture recognition results are used to update the skeletal Euler angles and joint coordinates of the virtual hand model, generate the virtual gesture motion trajectory, and then generate gesture training data.

Benefits of technology

It improves the authenticity and consistency of gesture training data, overcomes the problem of low virtual gesture sample size and difference with real gestures, supports more accurate gesture recognition, and is suitable for coherent gesture recognition scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118675223A
    Figure CN118675223A
Patent Text Reader

Abstract

The embodiment of the invention provides a gesture training data generation method and device, electronic equipment and a computer readable storage medium, and relates to the field of gesture recognition and artificial intelligence. The method comprises the steps that a first recognition result of gesture recognition on a first video frame sequence is obtained, the first video frame sequence is obtained by conducting continuous sampling on a real gesture movement track through a camera, the length of each skeleton of a virtual hand model in a first coordinate system is obtained, and the first recognition result is obtained according to the sequence from the wrist to the fingers; and obtaining a target Euler angle of the skeleton and a target coordinate of the tail joint, rendering the virtual hand model according to the target coordinate of each joint and the target Euler angle of each skeleton in the video frame, obtaining a corresponding virtual gesture, forming a virtual gesture movement track, and generating gesture training data based on the virtual gesture movement track. According to the embodiment of the invention, the authenticity of gestures and the consistency of gesture changes can be ensured, and a gesture recognition model supporting time sequence information is trained.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of gesture recognition and artificial intelligence technology. Specifically, the present application relates to a method, device, electronic device, computer-readable storage medium and computer program product for generating gesture training data. Background Art

[0002] As artificial intelligence technology continues to mature, more and more application scenarios are beginning to support human-computer interaction, and gesture interaction is a common method of human-computer interaction.

[0003] The key to gesture interaction lies in the recognition of key points of the hand. In one method of hand key point recognition, the developer first builds a virtual 3D model of the hand through a computer, and uses the virtual image of the virtual 3D model and the 3D coordinate data of the corresponding key points of the hand as training samples.

[0004] The number of skeletal animations of the artificially created virtual 3D hand model is limited, and the movement trajectory is different from that of the real human hand, making it difficult to cover the hand movements of people with different angles and different hand habits. Data based on random gestures cannot guarantee the authenticity of the gestures, nor can it capture the dynamic trajectory between gesture changes.

[0005] Third-party gesture models usually provide SDKs for rendering hand models bound to them. However, such hand models are usually simplified models, the key points will not match accurately, and the model surface is too simple. The generated images are too different from real human hands and are difficult to use for model training. Summary of the invention

[0006] The embodiments of the present application provide a method, device, electronic device, computer-readable storage medium and computer program product for generating gesture training data, which can solve the above-mentioned problems of the prior art. The technical solution is as follows:

[0007] According to one aspect of an embodiment of the present application, a method for generating gesture training data is provided, the method comprising:

[0008] Obtaining a first recognition result of gesture recognition for a first video frame sequence, where the first video frame sequence is obtained by continuously sampling a real gesture motion trajectory by a camera, and the first recognition result includes a first Euler angle of each bone and a first coordinate of each joint in a first coordinate system in each video frame;

[0009] Obtain the length of each bone of the virtual hand model in the first coordinate system, and for each video frame, in the order from wrist to finger, for each bone, obtain the target Euler angle of the bone and the target coordinate of the end joint according to the target coordinate of the first joint of the bone, the first coordinate of the end joint, the first Euler angle and the length of the bone, wherein the target coordinate of the first joint of the first bone is the first coordinate of the joint, and the target coordinate of the first joint of the non-first bone is the target coordinate when the joint is the end joint of the previous bone of the non-first bone;

[0010] For each video frame, the virtual hand model is rendered according to the target coordinates of each joint and the target Euler angles of each bone in the video frame to obtain the corresponding virtual gesture;

[0011] The virtual gestures corresponding to each video frame are combined into a virtual gesture motion trajectory according to the time sequence of the video frames, and gesture training data is generated based on the virtual gesture motion trajectory, the target coordinates of each joint of each virtual gesture and the target Euler angle of each bone.

[0012] According to another aspect of an embodiment of the present application, a device for generating gesture training data is provided, the device comprising:

[0013] A first recognition result obtaining module is used to obtain a first recognition result of gesture recognition for a first video frame sequence, where the first video frame sequence is obtained by continuously sampling a real gesture motion trajectory by a camera, and the first recognition result includes a first Euler angle of each bone and a first coordinate of each joint in a first coordinate system in each video frame;

[0014] A data updating module is used to obtain the length of each bone of the virtual hand model in the first coordinate system, and for each video frame, in the order from wrist to finger, for each bone, according to the target coordinate of the first joint of the bone, the first coordinate of the last joint, the first Euler angle and the length of the bone, obtain the target Euler angle of the bone and the target coordinate of the last joint, wherein the target coordinate of the first joint of the first bone is the first coordinate of the joint, and the target coordinate of the first joint of the non-first bone is the target coordinate when the joint is the last joint of the previous bone of the non-first bone;

[0015] A gesture rendering module is used to render the virtual hand model for each video frame according to the target coordinates of each joint and the target Euler angles of each bone in the video frame to obtain the corresponding virtual gesture;

[0016] The training data generation module is used to organize the virtual gestures corresponding to each video frame into a virtual gesture motion trajectory according to the timing of the video frames, and generate gesture training data based on the virtual gesture motion trajectory, the target coordinates of each joint of each virtual gesture and the target Euler angle of each bone.

[0017] As an optional implementation, the data updating module includes:

[0018] A direction obtaining unit, used for obtaining a direction vector of the bone according to the target coordinates of the first joint of the bone and the first coordinates of the last joint;

[0019] An Euler angle updating unit, used for updating the first Euler angle according to the orientation vector of the bone to obtain the target Euler angle of the bone;

[0020] The coordinate updating unit is used to obtain the target coordinates of the end joint of the bone according to the length of the bone, the target Euler angle and the target coordinates of the first joint.

[0021] As an optional implementation, if it is determined that there is a missing bone, the missing bone is a bone for which the first Euler angle and the first coordinate of the end joint are not recorded in the first recognition result, and the device further includes:

[0022] A parameter acquisition module, for obtaining the bone length, reference Euler angle and reference coordinates of the end joint of each missing bone in the hand model;

[0023] An initial Euler angle acquisition module is used to update the reference Euler angle according to the bone length of the missing bone in the hand model, the reference coordinates of the end joint and the first coordinates of the first joint to obtain the initial Euler angle of the missing bone;

[0024] A target Euler angle obtaining module is used to determine the difference in the roll angle component between the initial Euler angle of the missing bone and the reference Euler angle, the reference Euler angle being the target Euler angle of the next bone of the missing bone, and obtaining the target Euler angle of the missing bone according to the difference and the initial Euler angle;

[0025] The joint coordinate acquisition module is used to obtain the target coordinates of the end joint of the missing bone according to the first coordinates of the first joint of the missing bone, the bone length and the target Euler angle.

[0026] As an optional implementation, the target Euler angle acquisition module includes:

[0027] A first conversion unit, used for converting the initial Euler angle of the missing bone into a first quaternion, and converting the reference Euler angle into a second quaternion;

[0028] an angle updating unit, configured to determine a difference between the first quaternion and the second quaternion, convert the difference into a third Euler angle, and set a pitch angle component and a yaw angle component in the third Euler angle to preset values ​​to obtain a fourth Euler angle;

[0029] A first conversion unit, used for converting the fourth Euler angle into a third quaternion;

[0030] The inverse calculation unit is used for inversely calculating a fourth quaternion which is equal to the third quaternion in the rolling angle component of the first quaternion, and taking the Euler angle represented by the fourth quaternion as the target Euler angle of the missing bone.

[0031] As an optional implementation, the training data generation module includes:

[0032] A multi-view acquisition unit, used to acquire images of the virtual gesture motion trajectory through virtual cameras of multiple different view angles;

[0033] A data generating unit is used to use, for each second video frame sequence captured by the virtual camera, the second video frame sequence as a training sample in a set of gesture training data, and use the target coordinates of each joint and the target Euler angles of each bone corresponding to the virtual gesture in the corresponding video frames in the second video frame sequence as training labels in a set of gesture training data.

[0034] As an optional implementation, the device further includes:

[0035] A rotation superposition module is used to superimpose a rotation offset on each virtual gesture in a virtual gesture motion trajectory when generating gesture training data, so as to obtain a new virtual gesture motion trajectory;

[0036] The parameter update module is used to update the target coordinates of each joint and the target Euler angles of each bone corresponding to each virtual gesture in the new virtual gesture motion trajectory according to the rendering offset corresponding to the virtual gesture.

[0037] As an optional implementation manner, the Euler angle updating unit is specifically used for:

[0038] According to the orientation vector of the bone, the pitch angle component and the yaw angle component of the target Euler angle of the bone are obtained;

[0039] Use the roll component of the first Euler angle as the roll component of the bone's target Euler angle.

[0040] As an optional implementation, the first recognition result obtaining module includes:

[0041] A third-party data acquisition unit, used to obtain a second recognition result of gesture recognition performed by a third-party gesture recognition model on the first video frame sequence, the second recognition result including a second Euler angle of each bone and a second coordinate of each joint in a second coordinate system in each video frame;

[0042] The coordinate system conversion unit is used to convert the second coordinates of each joint and the second Euler angle of each bone in the video frame to the first coordinate system for each video frame, so as to obtain the first Euler angle of each bone and the first coordinate of each joint in the video frame.

[0043] According to another aspect of an embodiment of the present application, an electronic device is provided, which includes a memory, a processor, and a computer program stored in the memory, and the processor executes the computer program to implement the steps of the above-mentioned method for generating gesture training data.

[0044] According to another aspect of the embodiments of the present application, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method for generating gesture training data are implemented.

[0045] According to one aspect of an embodiment of the present application, a computer program product is provided, including a computer program, which implements the steps of the above-mentioned method for generating gesture training data when the computer program is executed by a processor.

[0046] The beneficial effects of the technical solution provided by the embodiment of the present application are:

[0047] A first recognition result of gesture recognition for a first video frame sequence is obtained. The first video frame sequence is obtained by continuously sampling the real gesture motion trajectory. On the one hand, there is no need to render the virtual gesture motion trajectory first, and the acquisition efficiency is greatly improved. On the other hand, the problem of low sample size of the virtual gesture motion trajectory and the difference between the virtual gesture motion trajectory and the real gesture motion trajectory is overcome. On the other hand, by sampling different hand habits and shooting the real gesture at different angles, a large number of first video frame sequences with different characteristics can be easily obtained. By obtaining the length of each bone, the present application updates the first Euler angle of each bone and the first coordinate of each joint in the order from wrist to finger. The obtained target Euler angle of each bone and the target coordinate of each joint are used to render the virtual gesture, which can avoid the problem of distortion of the hand skin. The virtual gestures are combined in the order of video frames to obtain the virtual gesture motion trajectory. The gesture training data is obtained through the virtual gesture motion trajectory. Compared with the random gesture motion trajectory rendered or shot, the present solution can ensure the authenticity of the gesture and the coherence of the gesture change. The gesture recognition model supporting time series information is trained using the gesture training data obtained by the present application, which is more in line with the actual application scenario, that is, the scenario of recognizing coherent gestures. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in describing the embodiments of the present application are briefly introduced below.

[0049] Figure 1 A schematic diagram of an implementation environment provided for an embodiment of the present application;

[0050] Figure 2 A flowchart of a method for generating gesture training data provided in an embodiment of the present application;

[0051] Figure 3 A schematic diagram of an example of a second recognition result provided in an embodiment of the present application;

[0052] Figure 4 A schematic diagram of the arrangement of hand bones provided in an embodiment of the present application;

[0053] Figure 5 A schematic diagram of hand bones recognized by a third-party gesture recognition model provided in an embodiment of the present application;

[0054] Figure 6 A difference diagram between information about bones and joints obtained based on a first recognition result and information about bones and joints actually to be obtained provided in an embodiment of the present application;

[0055] Figure 7 A schematic diagram of the layout of a virtual camera provided in an embodiment of the present application;

[0056] Figure 8 A flowchart of a method for generating gesture training data provided by another embodiment of the present application;

[0057] Fig. 9 An architectural diagram of a gesture training system provided in an embodiment of the present application;

[0058] Fig.10 A schematic diagram of the structure of a device for generating gesture training data provided in an embodiment of the present application;

[0059] Fig.11 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0060] The embodiments of the present application are described below in conjunction with the drawings in the present application. It should be understood that the implementation methods described below in conjunction with the drawings are exemplary descriptions for explaining the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions of the embodiments of the present application.

[0061] It will be understood by those skilled in the art that, unless specifically stated, the singular forms "one", "an" and "the" used herein may also include plural forms. It should be further understood that the terms "including" and "comprising" used in the embodiments of the present application refer to that the corresponding features can be implemented as the presented features, information, data, steps, operations, elements and / or components, but do not exclude the implementation as other features, information, data, steps, operations, elements, components and / or combinations thereof supported by the technical field. It should be understood that when we call an element "connected" or "coupled" to another element, the one element can be directly connected or coupled to the other element, or it can refer to that the one element and the other element establish a connection relationship through an intermediate element. In addition, the "connection" or "coupling" used here may include wireless connection or wireless coupling. The term "and / or" used here indicates at least one of the items defined by the term, for example, "A and / or B" can be implemented as "A", or as "B", or as "A and B".

[0062] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.

[0063] First, several terms involved in this application are introduced and explained:

[0064] Depth camera, through which the depth of field of the shooting space can be detected. The distance of each point in the image from the camera is obtained by the depth camera, and the 2D coordinates of the point in the 2D image are added to obtain the 3D spatial coordinates of each point in the image.

[0065] The LeapMotion device is a gesture recognition device based on binocular vision. The device uses the LeapMotion model to perform gesture recognition based on binocular vision. Binocular vision is to use two cameras to extract information including three-dimensional position through the two cameras to conduct comprehensive analysis and judgment of gestures, and to establish a three-dimensional model of the hand.

[0066] The Oculus Quest all-in-one device is a virtual reality (VR) helmet that supports gesture recognition. The device specifically performs gesture recognition through the Quest model.

[0067] Euler angles are a set of three independent angular parameters used to uniquely determine the position of a fixed-point rotating rigid body. They consist of the pitch angle (Pitch), the yaw angle (Yaw), and the roll angle (Roll).

[0068] Quaternions are simple hypercomplex numbers. Complex numbers are composed of real numbers plus an imaginary unit i, where i 2=-1. Similarly, quaternions are composed of real numbers plus three imaginary units i, j and k, and they have the following relationship: i 2 =j 2 =k 2 =-1, i0=j0=k0=1, each quaternion is a linear combination of 1, i, j and k, that is, the quaternion can generally be expressed as a+bi+cj+dk, where a, b, c, d are real numbers.

[0069] The geometric meaning of i, j and k themselves can be understood as a rotation, where i rotation represents the rotation from the positive direction of the Z axis to the positive direction of the Y axis in the plane where the Z axis intersects the Y axis, j rotation represents the rotation from the positive direction of the X axis to the positive direction of the Z axis in the plane where the X axis intersects the Z axis, k rotation represents the rotation from the positive direction of the Y axis to the positive direction of the X axis in the plane where the Y axis intersects the X axis, -i, -j, and -k represent the reverse rotations of i, j, and k rotations, respectively.

[0070] When rendering in a rendering engine, coordinate transformations between multiple coordinate systems are usually involved. The multiple coordinate systems may include:

[0071] Model coordinate system (model / object coordinates, also known as object coordinate system);

[0072] World coordinates;

[0073] Eye coordinates, also called camera coordinates;

[0074] In some embodiments, the world coordinate system is the real coordinate system where the virtual scene is located. For a virtual scene, there is usually one and only one world coordinate system. The world coordinate system uses the scene base point of the virtual scene as the coordinate origin, and the position of the pixel point of each virtual object in the world coordinate system is called the world coordinate.

[0075] In some embodiments, the camera coordinate system is the coordinate system in which the user observes the virtual scene based on the current perspective. The visual coordinate system uses the viewpoint as the coordinate origin, and the position of the pixel points of each object in the visual coordinate system is called the visual coordinate. Since the current perspective can be expressed in the form of a camera in a common rendering engine, the visual coordinate system can also be called the camera coordinate system. When the user observes the virtual scene based on the current perspective, it is equivalent to observing the virtual scene through a camera in the virtual scene, where the camera is equivalent to a model of a special transparent virtual object.

[0076] In some embodiments, the model coordinate system in the rendering engine is the coordinate system of the virtual object in the three-dimensional model. For at least one virtual object in the virtual scene, the model of each virtual object has its own model coordinate system, and the position of the pixel points of each virtual object in the model coordinate system is also the model coordinate. The model coordinate system is an imaginary coordinate system with the center of each virtual object as the coordinate origin. Therefore, even if the virtual object is dynamically changing, the relative position of the model coordinate system and the virtual object is always unchanged.

[0077] The gesture training data generation method, device, electronic device, computer-readable storage medium, and computer program product provided in the present application are intended to solve the above technical problems in the prior art.

[0078] The following describes several exemplary embodiments to illustrate the technical solutions of the embodiments of the present application and the technical effects produced by the technical solutions of the present application. It should be noted that the following embodiments can refer to, draw on or combine with each other, and the same terms, similar features and similar implementation steps in different embodiments will not be described repeatedly.

[0079] Please refer to Figure 1 , which shows a schematic diagram of an implementation environment provided by an embodiment of the present application. The implementation environment includes at least one terminal 110 and a server 120. The terminal 110 is an electronic device with an image acquisition function, which can be a smart phone equipped with a camera, a tablet computer, a somatosensory game device or a personal computer, etc. For example, Figure 1 As shown, when the terminal 110 is a mobile phone equipped with a camera 111, the camera 111 can be a front camera (located on one side of the mobile phone screen) or a rear camera (located on the back side of the mobile phone screen).

[0080] In a possible usage scenario, when a preset application (supporting gesture interaction function) is started, the terminal 110 captures video through the camera. For example, when a somatosensory game supporting gesture interaction is started, the terminal 110 enables the camera to continuously capture images of the gesture motion trajectory, and marks the second Euler angle of each bone in the gesture and the second coordinate of each joint in each video frame, and the second Euler angle and the second coordinate are both in the camera coordinate system.

[0081] The terminal 110 and the server 120 are connected via a wired or wireless network.

[0082] The server 120 is a server or a server cluster or a cloud computing center composed of one server or a plurality of servers. In a possible implementation, the server 120 is a background server of a preset application in the terminal 110 .

[0083] In a possible application scenario, such as Figure 1 As shown, after the terminal 110 captures the video frame sequence through the camera 111, the video frame sequence is sent to the server 120. The server 120 converts the second coordinates of each joint and the second Euler angle of each bone in the video frame to the model coordinate system through the gesture recognition model, obtains the first Euler angle of each bone and the first coordinate of each joint in the video frame, and then updates the first Euler angle of the bone and the first coordinate of the joint in each video frame in combination with the length of the bone, and then renders the corresponding virtual gesture using the target coordinates of each joint and the target Euler angle of each bone, and composes the virtual gesture corresponding to each video frame into a virtual gesture motion trajectory according to the timing of the video frame, and generates gesture training data based on the virtual gesture motion trajectory.

[0084] In another possible application scenario, when the terminal 110 has a gesture training data generation function, the terminal 110 generates gesture training data locally for the collected video frame sequence without the need for the server 120 .

[0085] Optionally, the terminal 110 or the server 120 implements the gesture recognition function through a neural network chip.

[0086] Optionally, the wireless network or wired network described above uses standard communication technology and / or protocol. The network is usually the Internet, but it can also be any network, including but not limited to a local area network (LAN), a metropolitan area network (MAN), a wide area network (WAN), a mobile, wired or wireless network, a dedicated network or any combination of a virtual private network). In some embodiments, technologies and / or formats including Hyper Text Mark-up Language (HTML), Extensible Markup Language (XML), etc. are used to represent data exchanged through the network. In addition, conventional encryption technologies such as Secure Socket Layer (SSL), Transport Layer Security (TLS), Virtual Private Network (VPN), Internet Protocol Security (IPsec) can also be used to encrypt all or some links. In other embodiments, customized and / or dedicated data communication technologies can also be used to replace or supplement the above data communication technologies.

[0087] The method for generating gesture training data provided in each embodiment of the present application can be executed by a model training device, which can be a computer or server with strong computing power; the method for generating gesture training data provided in each embodiment of the present application can be executed by a recognition device, which can be Figure 1 The terminal 110 or the server 120 in.

[0088] The present application provides a method for generating gesture training data. Figure 2 As shown, the method includes:

[0089] S101. Obtain a first recognition result of gesture recognition for a first video frame sequence, where the first video frame sequence is obtained by continuously sampling a real gesture motion trajectory by a camera, and the first recognition result includes a first Euler angle of each bone and a first coordinate of each joint in a first coordinate system in each video frame.

[0090] In the related art, gesture training data is usually generated based on artificially produced virtual skeletal animations. This method has a limited number of animations and is different from real gesture movements. It is difficult to cover the hand movements of people with different angles and different hand habits. Other technologies based on random gestures or isolated gestures also have the problem of not being able to guarantee the authenticity of gestures and not being able to capture the dynamic trajectory between gesture changes. In order to overcome this problem, the present application continuously samples the real gesture movement through an image acquisition device to obtain a first video frame sequence. On the basis of ensuring authenticity, it can also capture the dynamic trajectory of the natural transformation of the gesture, laying the foundation for the subsequent acquisition of continuous frame gesture virtual data. It should be understood that since the first video frame sequence is obtained by continuously sampling the real gesture movement trajectory, the gestures in any two adjacent video frames in the first video frame sequence are coherent. In addition, since the information of bones and joints in a three-dimensional coordinate system needs to be recorded in the gesture training data, the camera of the embodiment of the present application can capture the information of gestures in a three-dimensional coordinate system. In one embodiment, the camera of the present application is a depth camera.

[0091] After obtaining the first video frame sequence, the embodiment of the present application can perform gesture recognition on each frame in the first video frame sequence through a third-party gesture recognition model to obtain the second Euler angle of each bone and the second coordinate of each joint in the camera coordinate system (i.e., the second coordinate system) in the video frame. Figure 3, which exemplarily shows a schematic diagram of an example of the second recognition result of the present application, and the recognition result is saved in a json file. It can be seen that the second Euler angle of the bone (i.e., the angle in the figure) and the second coordinate of the joint (i.e., the coordinate in the figure) are stored separately, and the second coordinate is composed of three parts, that is, the second coordinate is the coordinate in the three-dimensional coordinate system, and each second Euler angle is composed of four parts, that is, the second Euler angle is represented by quaternion here.

[0092] In one embodiment, the gesture recognition model of the present application may be a LeapMotion model, a Quest model, etc., and accordingly, the first video frame sequence may be acquired by a camera configured on a LeapMotion device or an Oculus Quest all-in-one device. In other words, the embodiment of the present application may continuously sample the real gesture motion trajectory through a third-party gesture recognition device, and perform gesture recognition on the sampled first video frame sequence to obtain a recognition result.

[0093] The training samples of gesture training data are virtual gestures, and virtual gestures are obtained by rendering. The execution subject of the embodiment of the present application may be a rendering engine, and usually the coordinate system of the rendering engine and the gesture recognition model that obtains the recognition result are different. The recognition result obtained by the gesture recognition model is based on the camera coordinate system, and the rendering engine needs to render the virtual gesture in its own model coordinate system. Therefore, after obtaining the recognition result, the embodiment of the present application needs to convert the second Euler angle of each bone and the second coordinate of each joint in the recognition result from the camera coordinate system to the model coordinate system (that is, the first coordinate system). That is, the embodiment of the present application obtains the first recognition result of gesture recognition for the first video frame sequence, including:

[0094] Obtaining a second recognition result of gesture recognition performed by a third-party gesture recognition model on the first video frame sequence, wherein the second recognition result includes a second Euler angle of each bone and a second coordinate of each joint in a second coordinate system in each video frame;

[0095] For each video frame, the second coordinates of each joint and the second Euler angle of each bone in the video frame are converted to the first coordinate system to obtain the first Euler angle of each bone and the first coordinates of each joint in the video frame.

[0096] S102. Obtain the length of each bone of the virtual hand model in the first coordinate system. For each video frame, in the order from wrist to finger, for each bone, obtain the target Euler angle of the bone and the target coordinate of the end joint according to the target coordinate of the first joint of the bone, the first coordinate of the end joint, the first Euler angle and the length of the bone.

[0097] In the embodiment of the present application, a set of hand models with fixed bone lengths (also referred to as virtual hand models) can be pre-rendered in a rendering engine. The hand model has no set posture. The lengths of the bones in the hand model can be determined by the following methods:

[0098] 1) For each bone in the hand model, use the coordinates P of the first joint of the bone start and the coordinates of the end joint P end , calculate the bone's orientation vector D:

[0099] D=P end -P start

[0100] Calculate the length L of the bone:

[0101]

[0102] 2) Provide the fixed bone length of each joint directly in numerical form. The numerical value can be the average value taken from a data set of finger lengths of many people.

[0103] It should be noted that if the virtual gestures are not rendered based on the bone length, the bones of the virtual gestures observed at certain angles will be different from normal bones. For example, when the gestures are rendered close to the line of sight, based directly on the Euler angles of the bones and the coordinates of the joints provided by the Leap Motion model, almost all the bones are 30% shorter than normal bones, resulting in distortion.

[0104] The Euler angles of each bone given by the first recognition result and the second recognition result usually have deviations in the yaw angle and pitch angle components. If used directly, it will cause the skin of the hand model to be distorted. For each video frame, this application updates the first Euler angle, the target coordinates of the first joint and the end joint of each bone in the order from wrist to finger. Please refer to Figure 4 , which exemplarily shows a schematic diagram of the arrangement of hand bones. The human hand bones include metacarpal bones and phalanges. It can be seen from the figure that each finger is connected to a group of metacarpal bones, so the embodiment of the present application can start from bone 1 and process from each group of metacarpal bones to the frontmost phalanges on the connected fingers in parallel. The specific calculation process includes:

[0105] Starting from metacarpal 11, update metacarpal 12, phalanx 13, phalanx 14, and phalanx 15 in order;

[0106] Starting from metacarpal 21, update metacarpal 22, phalanx 23, phalanx 24, and phalanx 25 in order;

[0107] Starting from metacarpal 31, update metacarpal 32, phalanx 33, phalanx 34, and phalanx 35 in order;

[0108] Starting from metacarpal 41, update metacarpal 42, phalanx 43, phalanx 44, and phalanx 45 in order;

[0109] Starting from metacarpal bone 51, metacarpal bone 52, phalange 53, phalange 54, and phalange 55 are updated in sequence.

[0110] For each bone, the present application obtains the target Euler angles and target coordinates of the end joint of the bone according to the target coordinates of the first joint of the bone, the first coordinates of the end joint, the first Euler angle and the length of the bone. The target coordinates of the first joint of the first bone are the first coordinates of the joint, and the target coordinates of the first joint of a non-first bone are the target coordinates when the joint is the end joint of the previous bone of the non-first bone.

[0111] by Figure 4 Taking metacarpal bone 11 and metacarpal bone 12 in as an example, metacarpal bone 11 is the first bone, so the target coordinate of the first joint of metacarpal bone 11: joint a is the first coordinate of joint a. Then, according to the first coordinate of joint a, the first coordinate of joint b (i.e., the end joint of metacarpal bone 11), the first Euler angle and length of metacarpal bone 11, the target Euler angle of metacarpal bone 11 and the target coordinate of the end joint: joint b are obtained. For metacarpal bone 12, the first joint of metacarpal bone 12 is joint b, and the target coordinate of joint b is obtained in the previous step. Therefore, according to the target coordinate of joint b, the first coordinate of joint c, the first Euler angle and length of metacarpal bone 12, the target Euler angle of metacarpal bone 12 and the target coordinate of the end joint: joint c are obtained.

[0112] The embodiment of the present application updates the Euler angles of the bones and the coordinates of the joints in sequence from the wrist to the fingers, which can ensure that the changes in the Euler angles of each bone are smoother and the positions of the joints are more accurate, and can effectively avoid distortion of the hand skin when rendering gestures later.

[0113] S103 . For each video frame, render the virtual hand model according to the target coordinates of each joint and the target Euler angles of each bone in the video frame to obtain a corresponding virtual gesture.

[0114] The embodiment of the present application can adjust the bones and joints in the pre-acquired hand model without gesture settings with corresponding target coordinates and target Euler angles, so as to obtain virtual gestures that correspond one-to-one to each video frame in the second video frame sequence.

[0115] S104. The virtual gestures corresponding to the video frames are combined into virtual gesture motion trajectories according to the time sequence of the video frames, and gesture training data is generated based on the virtual gesture motion trajectories, the target coordinates of each joint of each virtual gesture, and the target Euler angles of each bone.

[0116] After obtaining the virtual gestures corresponding one-to-one to each video frame in the first video frame sequence, the embodiment of the present application can then group the virtual gestures into a virtual gesture motion trajectory according to the timing of the video frames, obtain training samples in the gesture training data from the virtual gesture motion trajectory, and use the Euler angles of each bone and the target coordinates of each joint of each virtual gesture in the virtual gesture motion trajectory as training labels. It can be seen that the training samples of the gesture training data obtained by the present application are continuous gesture motion trajectories rather than random or isolated gestures. Therefore, the model trained using the gesture training data obtained by the present application has a higher gesture recognition rate and is more in line with actual needs - gesture recognition on gesture trajectories.

[0117] The method for generating gesture training data of the embodiment of the present application obtains a first recognition result of gesture recognition for a first video frame sequence, where the first video frame sequence is obtained by continuously sampling the real gesture motion trajectory. On the one hand, there is no need to render the virtual gesture motion trajectory in advance, so the acquisition efficiency is greatly improved. On the other hand, the problem of low sample size of the virtual gesture motion trajectory and the difference between the virtual gesture motion trajectory and the real gesture motion trajectory is overcome. On the other hand, by sampling different hand habits and shooting the real gesture at different angles, a large number of first video frame sequences with different characteristics can be easily obtained. By obtaining the length of each bone, the present application updates the first Euler angle of each bone and the first coordinate of each joint in the order from wrist to finger, and the obtained target Euler angle of each bone and the target coordinate of each joint are used to render the virtual gesture, which can avoid the problem of distortion of the hand skin. The virtual gestures are combined in the order of video frames to obtain the virtual gesture motion trajectory, and the gesture training data is obtained through the virtual gesture motion trajectory. Compared with the random gesture motion trajectory rendered or shot, the present solution can ensure the authenticity of the gesture and the coherence of the gesture change. The gesture training data obtained by the present application is used to train a gesture recognition model that supports timing information, which is more in line with the actual application scenario, that is, the scenario of recognizing coherent gestures.

[0118] On the basis of the above embodiments, as an optional embodiment, according to the target coordinates of the first joint of the bone, the first coordinates of the end joint, the first Euler angle and the length of the bone, the target Euler angle of the bone and the target coordinates of the end joint are obtained, including:

[0119] S201, obtaining a direction vector of the bone according to the target coordinates of the first joint of the bone and the first coordinates of the last joint;

[0120] S202, updating the first Euler angle according to the orientation vector of the bone to obtain the target Euler angle of the bone;

[0121] S203. Obtain the target coordinates of the end joint of the bone according to the length of the bone, the target Euler angle, and the target coordinates of the first joint.

[0122] The basic idea of ​​the embodiment of the present application is to use the first recognition result to generate continuous virtual gestures in the virtual engine. Virtual gestures not only need to pay attention to the coordinates of the joints, but also need the orientation of the bones to correctly render the skin of the hand. But in fact, the coordinates of the joints in the second recognition result obtained from the third-party gesture recognition model and the joint positions of the rendered hand model cannot be directly mapped because of different bone lengths and different palm sizes. Therefore, the application calculates the orientation vectors of each bone in order (the orientation vector is a quaternion) by taking the first Euler angles of the bones in the first recognition result and the first coordinates of the joints, and then uses the orientation vector to calculate the position of the end joint of the bone (i.e., the target coordinates), and then uses the target coordinates of the joints to calculate the Euler angles of the next bone and the target coordinates of the next key, and constantly repeats this process until the position and orientation of all joints from the wrist to the fingers are recalculated.

[0123] Specifically, for each bone, the present application calculates the target coordinate P' of the first joint of the bone. start and the first coordinate P of the end joint end , calculate the orientation vector D of the bone:

[0124] D=P end -P' start

[0125] The target Euler angle R' of the bone is calculated using the orientation vector D. R' is used to calculate the correct bone skin when rendering gestures. The calculation formulas for the three components of the target Euler angle are:

[0126] R' yaw =tan -1 (D y ,D x )

[0127]

[0128] R' roll =R roll

[0129] From the above formula, it can be seen that the yaw angle component R' of the target Euler angle yaw and the pitch angle component R' pitch Based on the orientation vector D, the roll angle component R' of the target Euler angle is updated. roll Then keep the roll angle component R in the first Euler angle roll Consistent.

[0130] After obtaining the target Euler angle of the bone, the target coordinates P' of the end joint of the bone are obtained by combining the length of the bone and the target coordinates of the first joint. end, the specific calculation formula can be expressed as:

[0131] P' end =P' start +L*R'

[0132] It should be noted that the recognition results output by third-party gesture recognition models generally lack information about some joints. Figure 5 , Figure 5 The middle dotted line indicates the missing metacarpal bone. For example, the coordinates of the end joint of the metacarpal bone are not available in the output of the Leap Motion model, but the virtual engine needs the data of the metacarpal bone to render correctly. Otherwise, the rendered hand will be uneven at the position of the metacarpal bone. It should be noted that Figure 5 The metacarpal bones are represented by dotted lines, which does not mean that the coordinates and orientation of the missing bones are known, but only serve to indicate that the bones are missing.

[0133] In the commonly used rendering engine Unreal, the tool used for gesture rendering is MetaHuman. The missing bones in the data source (i.e., the output recognition result) of Leap Motion corresponding to this tool are metacarpal bones. If other data sources are used or different permutations and combinations of stock prices rendered by the rendering engine are used, the missing bones may be different. The metacarpal bones listed above in the embodiment of the present application are only examples.

[0134] In the embodiment of the present application, if it is determined that there is a missing bone, and the missing bone is a bone for which the first Euler angle and the first coordinate of the end joint are not recorded in the recognition result, the method further includes:

[0135] S301, for each missing bone, obtaining the bone length, reference coordinates of the end joint, and reference Euler angle of the missing bone in the hand model;

[0136] S302, updating the reference Euler angle according to the bone length of the missing bone in the hand model, the reference coordinates of the end joint, and the first coordinates of the first joint;

[0137] S303, determining the difference in the roll angle component between the initial Euler angle of the missing bone and the reference Euler angle, the reference Euler angle being the target Euler angle of the next bone of the missing bone, and obtaining the target Euler angle of the missing bone according to the difference and the initial Euler angle;

[0138] S304. Obtain the target coordinates of the end joint of the missing bone according to the first coordinates of the first joint of the missing bone, the bone length and the target Euler angle.

[0139] by Figure 5For example, in the recognition result output by LeapMotion, since the front and back metacarpal bones are regarded as one bone, there is no second coordinate of the end joint of the first metacarpal bone, but there are coordinates of the joints of the wrist and phalanges. Therefore, in the recognition result output by LeapMotion, the bone after the wrist carpal bone is the first metacarpal bone, while in the hand model of MetaHuman, the connection order of bones is carpal bone->first metacarpal bone->second metacarpal bone->phalanges. It can be seen that although the metacarpal bone is missing in LeapMotion, and the first joint of the metacarpal bone is the wrist, LeapMotion records the second coordinate of the first joint of the wrist, but does not record the second coordinate of the end joint of the metacarpal bone (correspondingly, there is no first coordinate of this joint in the first recognition result). However, the hand model stores the bone length of the missing bone, the reference coordinate of the end joint, and the reference Euler angle.

[0140] After obtaining the target Euler angles of all bones and the target coordinates of all joints in the first recognition result, the embodiment of the present application needs to further obtain the target Euler angles of the missing bones and the target coordinates of the end joints. Figure 6 , which exemplarily shows the difference between the bone and joint information obtained by the embodiment of the present application based on the first recognition result and the actual bone and joint information that is expected to be obtained. The solid arrows in the figure are the bone orientations and joint coordinates recorded in the first recognition result, and the dotted arrows in the figure are the actual bone orientations and joint coordinates. It can be seen that the bone points directly from the joint of the carpal bone to the joint of the terminal phalanx, and the joint of the metacarpal bone is missing. The purpose of the embodiment of the present application is to reversely calculate the target Euler angles of the metacarpal bone and the target coordinates of the metacarpal joint after obtaining the target coordinates of the joint of the terminal phalanx.

[0141] In the hand model rendered by the virtual engine, when calculating the bones below the wrist, the Euler angles of the wrist will be taken. In other words, the orientation of each bone in the hand model is the local rotation of the bone relative to the previous bone (also referred to as the Euler angle offset). Therefore, a reference bone is usually specified in the hand data, and the reference Euler angles of the reference bone are saved. In this way, for bones other than the reference bone, the reference Euler angles of the bone can be obtained based on the reference Euler angles of the reference bone and the local rotations corresponding to all bones between the bone and the reference bone. The reference bone can be a wrist bone, or it can be any bone that is not missing in the third-party gesture recognition model, and the embodiments of the present application are not specifically limited.

[0142] In the embodiment of the present application, for each missing bone, the missing bone (as a subsequent joint of the wrist) already carries the position and orientation of the wrist, so the relevant information of the missing bone can be directly obtained from the hand model to calculate the rough Euler angle of the missing bone.

[0143] The embodiment of the present application directly reads the bone length of the missing bone, the reference coordinates of the end joint, the reference Euler angle of the reference bone, and the local rotation from the reference bone to the missing bone from the hand model. According to the reference Euler angle of the reference bone in the hand model and the local rotation from the reference bone to the missing part, the reference Euler angle of the missing bone can be obtained.

[0144] Through the method of the above embodiment, the embodiment of the present application obtains the orientation vector of the missing bone based on the first coordinate of the first joint of the missing bone and the reference coordinate of the last joint, and then obtains the initial Euler angle (i.e., a rough Euler angle) of the missing bone according to the orientation vector of the missing bone and the reference Euler angle. It can be understood that the yaw angle component and pitch angle component of the initial Euler angle are updated based on the orientation vector, while the roll angle component of the initial Euler angle remains consistent with the roll angle component in the reference Euler angle.

[0145] In the embodiment of the present application, the target Euler angle of the next bone of the missing bone is used as the reference Euler angle. After obtaining the initial Euler angle of the missing bone, the difference in the roll angle component of the initial Euler angle relative to the reference Euler angle is first determined, that is, the relative change in the roll angle component of the missing bone compared to the next bone. The reason for choosing to determine the difference in the roll angle component is that the roll angle component in the recognition result is more accurate than the yaw angle component and the pitch angle component. The initial Euler angle is updated according to the difference to obtain a more accurate target Euler angle of the missing bone.

[0146] After the target Euler angle of the missing bone is determined, the algorithm for calculating the target coordinates of the end joint provided in the above embodiment is used to substitute the bone length of the missing bone and the first coordinates of the first joint to obtain the target coordinates of the end joint of the missing bone.

[0147] Based on the above embodiments, as an optional embodiment, determining the difference in the roll angle component of the initial Euler angle of the missing bone relative to the reference Euler angle, and obtaining the target Euler angle of the missing bone according to the difference and the initial Euler angle, includes:

[0148] S401, converting the initial Euler angle of the missing bone into a first quaternion, and converting the reference Euler angle into a second quaternion;

[0149] S402, determining a difference between the first quaternion and the second quaternion, converting the difference into a third Euler angle, and setting a pitch angle component and a yaw angle component in the third Euler angle to preset values ​​to obtain a fourth Euler angle;

[0150] S403, converting the fourth Euler angle into a third quaternion;

[0151] S404, inversely calculate a fourth quaternion that is equal to the third quaternion in terms of the roll angle component of the first quaternion, and use the Euler angle represented by the fourth quaternion as the target Euler angle of the missing bone.

[0152] The embodiment of the present application first converts the initial Euler angle of the missing bone and the target Euler angle of the next bone of the missing bone (i.e., the reference Euler angle) into quaternions. If the representation of three angle components is directly adopted, it will be very cumbersome to represent the coordinate system of the Euler angle later. The present application can avoid this problem by continuously converting Euler angles and quaternions.

[0153] After determining the difference between the first quaternion and the second quaternion, the embodiment of the present application converts the difference into Euler angles, i.e., the third Euler angles, updates the pitch angle component and the yaw angle in the third Euler angles to 0, obtains the fourth Euler angles, and then backcalculates the fourth quaternion that is equal to the third quaternion in the roll angle component of the first quaternion, and uses the Euler angle represented by the fourth quaternion as the target Euler angle for the missing bone. The reason why the backcalculation step is set last is that if the roll angle component of the initial Euler angle is different from the roll angle component of the next bone, then an error will occur when rendering the skin bound to the missing bone, causing the skin of the missing bone and the skin of the next bone to be discontinuous or distorted.

[0154] The process of obtaining the target Euler angle of the missing bone and the target coordinates of the end joint provided in the embodiment of the present application includes:

[0155] S501, obtaining the bone length L, reference Euler angle R and reference coordinates P of the end joint of the missing bone in the hand model end ;

[0156] S502, according to the first coordinate P of the first joint of the missing bone start And the reference coordinates P of the end joint end , get the initial orientation vector D of the missing bone:

[0157] D=P end -P start

[0158] S503. Obtain the initial Euler angle r′ of the missing bone according to the initial orientation vector D and the reference Euler angle R:

[0159] r′ yaw =tan -1 (D y , D x )

[0160]

[0161] r′ roll =R roll

[0162] S504: Determine the reference Euler angle, that is, the target Euler angle R of the next bone of the missing bone n+1 , R′ and R n+1 Convert to quaternion Q respectively miss and Q n+1 ;

[0163] S505, determine the difference Q′ between the two quaternions:

[0164]

[0165] S506: Calculate the difference quaternion Q′ and convert it into the third Euler angle R′, and update R′ in the third Euler angle R′ yaw and R′ pitch Set to 0 to obtain the fourth Euler angle R″;

[0166] S507, converting the fourth Euler angle R″ into a third quaternion Q″;

[0167] S508, back calculation and Q n+1 The fourth quaternion Q″ equal to the roll component miss :

[0168] Q″ miss =Q miss ·Q″

[0169] S509, the fourth quaternion Q″ miss The Euler angle represented by is used as the target Euler angle r′ of the missing bone;

[0170] S510, using the target coordinates P of the first joint of the missing bone start , target Euler angle r′, and the bone length L of the missing bone, recalculate the target coordinates P of the end joint of the missing bone end :

[0171] P end =P start +L·r′

[0172] The gesture data synthesized in the rendering engine will be significantly weaker than the real collected data in terms of texture details and lighting changes. If only a single perspective is used during synthesis, the deep learning model can easily overfit on the generated data. In order to solve this problem, based on the above embodiments, as an optional embodiment, gesture training data is generated based on the virtual gesture motion trajectory, the target coordinates of each joint of each virtual gesture, and the target Euler angles of each bone, including:

[0173] The image of the virtual gesture motion trajectory is collected through multiple virtual cameras with different viewing angles;

[0174] For the second video frame sequence captured by each virtual camera, the second video frame sequence is used as a training sample in a set of gesture training data, and the target coordinates of each joint and the target Euler angles of each bone corresponding to the virtual gestures in the corresponding video frames in the second video frame sequence are used as training labels in a set of gesture training data.

[0175] See also Figure 7 , which exemplarily shows a schematic diagram of the layout of the virtual camera of an embodiment of the present application, and shows a total of 8 virtual cameras with different viewing angles. There are differences in the pictures of the same gesture taken by virtual cameras with different viewing angles. For example, the picture of a gesture taken by a virtual camera with a vertical viewing angle is very different from the picture of the gesture taken by a virtual camera with a horizontal viewing angle.

[0176] The embodiment of the present application can obtain a set of gesture training data based on the second video frame sequence captured by the virtual camera of each perspective. Specifically, the second video frame sequence is used as a training sample in a set of gesture training data, and the target coordinates of each joint and the target Euler angles of each bone corresponding to the virtual gesture in each frame of the second video frame sequence are already determined. Therefore, the target coordinates of each joint and the target Euler angles of each bone corresponding to the virtual gesture in each video frame in the second video frame sequence are used as training labels in a set of gesture training data.

[0177] It should be understood that the training labels record the target coordinates of each joint and the target Euler angles of each bone in each virtual gesture in the order of the virtual gesture as a set of training labels in gesture training data. The embodiment of the present application collects images of the virtual gesture motion trajectory based on virtual gestures from multiple different perspectives, and can obtain multi-angle and mutually corresponding gesture training data, thereby improving the robustness of the gesture recognition model for subsequent training.

[0178] Based on the above embodiments, as an optional embodiment, gesture training data is generated based on the virtual gesture motion trajectory, the target coordinates of each joint of each virtual gesture, and the target Euler angles of each bone, which also includes:

[0179] Superimposing a rotation offset on each virtual gesture in the virtual gesture motion trajectory to obtain a new virtual gesture motion trajectory;

[0180] For each virtual gesture in the new virtual gesture motion trajectory, the target coordinates of each joint and the target Euler angles of each bone corresponding to the virtual gesture are updated according to the rendering offset corresponding to the virtual gesture.

[0181] In order to generate more gesture training data based on the first video frame sequence, the embodiment of the present application can superimpose additional rotation angles at the wrist or arm. The rotation of the wrist and arm will be transmitted to the palm through cascade operations, forming a smooth displacement from the arm to the palm as a whole, thereby generating more gesture training data beyond the recorded first video frame sequence.

[0182] In one embodiment, the rotation angle is added by using sin(delta_time) to calculate a rotation offset for each virtual gesture, and superimposing it on the arm and wrist. For the next virtual gesture of the virtual gesture, the delta_time corresponding to the next virtual gesture will be used to recalculate the offset. Since the offset generated by sin(delta_time) is a continuous value, even if the offset superimposed on each virtual gesture is different, the final action is still continuous and natural.

[0183] See also Figure 8 , which exemplarily shows a flow chart of a method for generating gesture training data according to another embodiment of the present application, as shown in the figure, including:

[0184] S601, obtaining a second recognition result of gesture recognition performed by a third-party gesture recognition model on a first video frame sequence, the second recognition result comprising a second Euler angle of each bone and a second coordinate of each joint in a second coordinate system in each video frame;

[0185] S602: for each video frame, convert the second coordinates of each joint and the second Euler angle of each bone in the video frame into the first coordinate system to obtain the first Euler angle of each bone and the first coordinates of each joint in the video frame;

[0186] S603, obtaining a direction vector of the bone according to the target coordinates of the first joint of the bone and the first coordinates of the last joint;

[0187] S604, obtaining a pitch angle component and a yaw angle component of a target Euler angle of the bone according to the orientation vector of the bone;

[0188] S605, using the roll angle component of the first Euler angle as the roll angle component of the target Euler angle of the bone;

[0189] S606, obtaining the target coordinates of the end joint of the bone according to the length of the bone, the target Euler angle, and the target coordinates of the first joint;

[0190] S607, for each missing bone, obtaining the bone length, reference Euler angle, and reference coordinates of the end joint of the missing bone in the hand model;

[0191] S608, updating the reference Euler angle according to the bone length of the missing bone in the hand model, the reference coordinates of the end joint, and the first coordinates of the first joint to obtain the initial Euler angle of the missing bone;

[0192] S609, converting the initial Euler angle of the missing bone into a first quaternion, and converting the reference Euler angle into a second quaternion;

[0193] S610, determining a difference between the first quaternion and the second quaternion, converting the difference into a third Euler angle, and setting a pitch angle component and a yaw angle component in the third Euler angle to preset values ​​to obtain a fourth Euler angle;

[0194] S611, converting the fourth Euler angle into a third quaternion;

[0195] S612, inversely calculating a fourth quaternion that is equal to the third quaternion in terms of the roll angle component of the first quaternion, and using the Euler angle represented by the fourth quaternion as the target Euler angle of the missing bone;

[0196] S613, obtaining the target coordinates of the end joint of the missing bone according to the first coordinates of the first joint of the missing bone, the bone length, and the target Euler angle;

[0197] S614, composing a virtual gesture motion trajectory by combining virtual gestures corresponding to each video frame according to the time sequence of the video frames;

[0198] S615, superimposing a rotation offset on each virtual gesture in the virtual gesture motion trajectory to obtain a new virtual gesture motion trajectory, and for each virtual gesture in the new virtual gesture motion trajectory, updating the target coordinates of each joint and the target Euler angles of each bone corresponding to the virtual gesture according to the rendering offset corresponding to the virtual gesture;

[0199] S617, collecting images of the virtual gesture motion trajectory through multiple virtual cameras with different viewing angles;

[0200] S618. For the second video frame sequence captured by each virtual camera, use the second video frame sequence as a training sample in a set of gesture training data, and use the target coordinates of each joint and the target Euler angles of each bone corresponding to the virtual gesture in the corresponding video frames in the second video frame sequence as training labels in a set of gesture training data.

[0201] See also Fig. 9 , which exemplarily shows the architecture diagram of the gesture training system of an embodiment of the present application. As shown in the figure, it includes an image acquisition device 901, a third-party gesture recognition device 902, a gesture training data generation device 903 and a gesture recognition model training device 904.

[0202] The image acquisition device 901 acquires the real gesture movement to obtain a first video frame sequence, and transmits it to the third-party gesture recognition device 902. The third-party gesture recognition device 902 runs a third-party gesture recognition model. The third-party gesture recognition model performs gesture recognition on the first video frame sequence to obtain a second recognition result. The second recognition result includes the first Euler angle of each bone and the first coordinate of each joint in the first coordinate system in each video frame of the first video frame sequence. The third-party gesture recognition device 902 transmits the second recognition result to the gesture training data generation device 903. The gesture training data generation device 903 first converts the second recognition result into a coordinate system to obtain a first recognition result, and then converts the second recognition result into a first coordinate system. According to the first recognition result and the length of each bone of the virtual hand model, the virtual gesture motion trajectory is reconstructed in the rendering engine, and rotation is superimposed on the arm and wrist connected to the virtual hand model to obtain more virtual gesture motion trajectories beyond the first video frame sequence. Image acquisition is performed on each virtual gesture motion trajectory through multiple virtual cameras to obtain multiple second video frame sequences, and gesture training data is generated in combination with the target coordinates of each joint of each virtual gesture and the target Euler angle of each bone. The gesture training data generating device 903 sends the gesture training data to the gesture recognition model training device 904, and the gesture recognition model training device 904 trains the initial model according to the gesture training data to obtain a gesture recognition model.

[0203] The present application embodiment provides a device for generating gesture training data, such as Fig.10 As shown, the device for generating gesture training data may include: a first recognition result obtaining module 101, a data updating module 102, a gesture rendering module 103 and a training data generating module 104, wherein:

[0204] A first recognition result obtaining module 101 is used to obtain a first recognition result of gesture recognition for a first video frame sequence, where the first video frame sequence is obtained by continuously sampling a real gesture motion trajectory by a camera, and the first recognition result includes a first Euler angle of each bone and a first coordinate of each joint in a first coordinate system in each video frame;

[0205] The data updating module 102 is used to obtain the length of each bone of the virtual hand model in the first coordinate system. For each video frame, in the order from wrist to finger, for each bone, according to the target coordinate of the first joint of the bone, the first coordinate of the last joint, the first Euler angle and the length of the bone, the target Euler angle of the bone and the target coordinate of the last joint are obtained, wherein the target coordinate of the first joint of the first bone is the first coordinate of the joint, and the target coordinate of the first joint of the non-first bone is the target coordinate when the joint is the last joint of the previous bone of the non-first bone;

[0206] A gesture rendering module 103 is used to render a virtual hand model according to the target coordinates of each joint and the target Euler angles of each bone in each video frame to obtain a corresponding virtual gesture;

[0207] The training data generation module 104 is used to organize the virtual gestures corresponding to each video frame into a virtual gesture motion trajectory according to the timing of the video frames, and generate gesture training data based on the virtual gesture motion trajectory, the target coordinates of each joint of each virtual gesture and the target Euler angle of each bone.

[0208] The device of the embodiments of the present application can execute the method provided by the embodiments of the present application, and the implementation principles are similar. The actions performed by each module in the device of each embodiment of the present application correspond to the steps in the method of each embodiment of the present application. For the detailed functional description of each module of the device, please refer to the description in the corresponding method shown in the previous text, which will not be repeated here.

[0209] As an optional implementation, the data updating module includes:

[0210] A direction obtaining unit, used for obtaining a direction vector of the bone according to the target coordinates of the first joint of the bone and the first coordinates of the last joint;

[0211] An Euler angle updating unit, used for updating the first Euler angle according to the orientation vector of the bone to obtain the target Euler angle of the bone;

[0212] The coordinate updating unit is used to obtain the target coordinates of the end joint of the bone according to the length of the bone, the target Euler angle and the target coordinates of the first joint.

[0213] As an optional implementation, if it is determined that there is a missing bone, the missing bone is a bone for which the first Euler angle and the first coordinate of the end joint are not recorded in the first recognition result, and the device further includes:

[0214] A parameter acquisition module, for obtaining the bone length, reference Euler angle and reference coordinates of the end joint of each missing bone in the hand model;

[0215] An initial Euler angle acquisition module is used to update the reference Euler angle according to the bone length of the missing bone in the hand model, the reference coordinates of the end joint and the first coordinates of the first joint to obtain the initial Euler angle of the missing bone;

[0216] A target Euler angle obtaining module is used to determine the difference in the roll angle component between the initial Euler angle of the missing bone and the reference Euler angle, the reference Euler angle being the target Euler angle of the next bone of the missing bone, and obtaining the target Euler angle of the missing bone according to the difference and the initial Euler angle;

[0217] The joint coordinate acquisition module is used to obtain the target coordinates of the end joint of the missing bone according to the first coordinates of the first joint of the missing bone, the bone length and the target Euler angle.

[0218] As an optional implementation, the target Euler angle acquisition module includes:

[0219] A first conversion unit, used for converting the initial Euler angle of the missing bone into a first quaternion, and converting the reference Euler angle into a second quaternion;

[0220] an angle updating unit, configured to determine a difference between the first quaternion and the second quaternion, convert the difference into a third Euler angle, and set a pitch angle component and a yaw angle component in the third Euler angle to preset values ​​to obtain a fourth Euler angle;

[0221] A first conversion unit, used for converting the fourth Euler angle into a third quaternion;

[0222] The inverse calculation unit is used for inversely calculating a fourth quaternion which is equal to the third quaternion in the rolling angle component of the first quaternion, and taking the Euler angle represented by the fourth quaternion as the target Euler angle of the missing bone.

[0223] As an optional implementation, the training data generation module includes:

[0224] A multi-view acquisition unit, used to acquire images of the virtual gesture motion trajectory through virtual cameras of multiple different view angles;

[0225] A data generating unit is used to use, for each second video frame sequence captured by the virtual camera, the second video frame sequence as a training sample in a set of gesture training data, and use the target coordinates of each joint and the target Euler angles of each bone corresponding to the virtual gesture in the corresponding video frames in the second video frame sequence as training labels in a set of gesture training data.

[0226] As an optional implementation, the device further includes:

[0227] A rotation superposition module is used to superimpose a rotation offset on each virtual gesture in a virtual gesture motion trajectory when generating gesture training data, so as to obtain a new virtual gesture motion trajectory;

[0228] The parameter update module is used to update the target coordinates of each joint and the target Euler angles of each bone corresponding to each virtual gesture in the new virtual gesture motion trajectory according to the rendering offset corresponding to the virtual gesture.

[0229] As an optional implementation manner, the Euler angle updating unit is specifically used for:

[0230] According to the orientation vector of the bone, the pitch angle component and the yaw angle component of the target Euler angle of the bone are obtained;

[0231] Use the roll component of the first Euler angle as the roll component of the bone's target Euler angle.

[0232] As an optional implementation, the first recognition result obtaining module includes:

[0233] A third-party data acquisition unit, used to obtain a second recognition result of gesture recognition performed by a third-party gesture recognition model on the first video frame sequence, the second recognition result including a second Euler angle of each bone and a second coordinate of each joint in a second coordinate system in each video frame;

[0234] The coordinate system conversion unit is used to convert the second coordinates of each joint and the second Euler angle of each bone in the video frame to the first coordinate system for each video frame, so as to obtain the first Euler angle of each bone and the first coordinate of each joint in the video frame.

[0235] In an embodiment of the present application, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory. The processor executes the above-mentioned computer program to implement the steps of a method for generating gesture training data. Compared with the related art, it can achieve: obtaining a first recognition result of gesture recognition for a first video frame sequence, the first video frame sequence is obtained by continuous sampling of a real gesture motion trajectory. On the one hand, there is no need to render a virtual gesture motion trajectory in advance, and the acquisition efficiency is greatly improved. On the other hand, the problem of low sample size of virtual gesture motion trajectory and difference from real gesture motion trajectory is overcome. On the other hand, by sampling different hand habits and shooting real gestures at different angles, a large number of different characteristics can be easily obtained. The first video frame sequence, by obtaining the length of each bone, the present application updates the first Euler angle of each bone and the first coordinate of each joint in the order from wrist to finger, and obtains the target Euler angle of each bone and the target coordinate of each joint to render the virtual gesture, which can avoid the problem of distortion of the hand skin, and combines the virtual gestures in the order of video frames to obtain the virtual gesture motion trajectory, and obtains the gesture training data through the virtual gesture motion trajectory. Compared with the random gesture motion trajectory rendered or photographed, this scheme can ensure the authenticity of the gesture and the continuity of the gesture change. The gesture training data obtained by the present application is used to train a gesture recognition model that supports timing information, which is more in line with the actual application scenario, that is, the scenario of recognizing coherent gestures.

[0236] In an alternative embodiment, an electronic device is provided, such as Fig.11 As shown, Fig.11The electronic device 4000 shown includes: a processor 4001 and a memory 4003. The processor 4001 and the memory 4003 are connected, such as through a bus 4002. Optionally, the electronic device 4000 may also include a transceiver 4004, which may be used for data interaction between the electronic device and other electronic devices, such as data transmission and / or data reception. It should be noted that in actual applications, the transceiver 4004 is not limited to one, and the structure of the electronic device 4000 does not constitute a limitation on the embodiments of the present application.

[0237] Processor 4001 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. It may implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the disclosure of this application. Processor 4001 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.

[0238] The bus 4002 may include a path to transmit information between the above components. The bus 4002 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The bus 4002 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig.11 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0239] The memory 4003 may be a ROM (Read Only Memory) or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory) or other types of dynamic storage devices that can store information and instructions, or an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical disk storage, optical disk storage (including compressed optical disk, laser disk, optical disk, digital versatile disk, Blu-ray disk, etc.), magnetic disk storage media, other magnetic storage devices, or any other medium that can be used to carry or store computer programs and can be read by a computer, without limitation herein.

[0240] The memory 4003 is used to store the computer program for executing the embodiment of the present application, and the execution is controlled by the processor 4001. The processor 4001 is used to execute the computer program stored in the memory 4003 to implement the steps shown in the above method embodiment.

[0241] An embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps and corresponding contents of the aforementioned method embodiment can be implemented.

[0242] The embodiment of the present application also provides a computer program product, including a computer program, which can implement the steps and corresponding contents of the aforementioned method embodiment when executed by a processor.

[0243] The terms "first", "second", "third", "fourth", "1", "2", etc. (if any) in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than that shown or described in the drawings.

[0244] It should be understood that, although each operation step is indicated by arrows in the flowchart of the embodiment of the present application, the implementation order of these steps is not limited to the order indicated by the arrows. Unless clearly stated herein, in some implementation scenarios of the embodiment of the present application, the implementation steps in each flowchart can be performed in other orders according to demand. In addition, some or all of the steps in each flowchart may include multiple sub-steps or multiple stages based on actual implementation scenarios. Some or all of these sub-steps or stages may be executed at the same time, and each sub-step or stage in these sub-steps or stages may also be executed at different times respectively. In different scenarios of execution time, the execution order of these sub-steps or stages may be flexibly configured according to demand, and the embodiment of the present application does not limit this.

[0245] The above are only optional implementation methods for some implementation scenarios of the present application. It should be pointed out that for ordinary technicians in this technical field, without departing from the technical concept of the scheme of the present application, other similar implementation methods based on the technical ideas of the present application are also within the protection scope of the embodiments of the present application.

Claims

1. A method for generating gesture training data, characterized in that: include: Obtaining a first recognition result of gesture recognition for a first video frame sequence, where the first video frame sequence is obtained by continuously sampling a real gesture motion trajectory by a camera, and the first recognition result includes a first Euler angle of each bone and a first coordinate of each joint in a first coordinate system in each video frame; Obtain the length of each bone of the virtual hand model in the first coordinate system, and for each video frame, in the order from wrist to finger, for each bone, obtain the target Euler angle of the bone and the target coordinate of the end joint according to the target coordinate of the first joint of the bone, the first coordinate of the end joint, the first Euler angle of the bone and the length, wherein the target coordinate of the first joint of the first bone is the first coordinate of the joint, and the target coordinate of the first joint of a non-first bone is the target coordinate when the joint is the end joint of the previous bone of the non-first bone; For each video frame, the virtual hand model is rendered according to the target coordinates of each joint and the target Euler angles of each bone in the video frame to obtain a corresponding virtual gesture; The virtual gestures corresponding to each video frame are combined into a virtual gesture motion trajectory according to the time sequence of the video frames, and gesture training data is generated based on the virtual gesture motion trajectory, the target coordinates of each joint of each virtual gesture, and the target Euler angle of each bone.

2. The method according to claim 1, wherein the step of obtaining the target Euler angle of the bone and the target coordinate of the end joint according to the target coordinate of the first joint of the bone, the first coordinate of the end joint, the first Euler angle and the length of the bone comprises: Obtaining a direction vector of the bone according to the target coordinates of the first joint of the bone and the first coordinates of the last joint; Update the first Euler angle according to the orientation vector of the bone to obtain the target Euler angle of the bone; The target coordinates of the end joint of the bone are obtained according to the length of the bone, the target Euler angle and the target coordinates of the first joint.

3. The method according to claim 2, characterized in that If it is determined that there is a missing bone, and the missing bone is a bone whose first Euler angle and the first coordinate of the end joint are not recorded in the first recognition result, the method further includes: For each missing bone, obtain the bone length, reference Euler angle and reference coordinates of the end joint of the missing bone in the hand model; updating the reference Euler angle according to the bone length of the missing bone in the hand model, the reference coordinates of the end joint and the first coordinates of the first joint to obtain the initial Euler angle of the missing bone; Determine the difference in the roll angle component between the initial Euler angle of the missing bone and the reference Euler angle, wherein the reference Euler angle is the target Euler angle of the next bone of the missing bone, and obtain the target Euler angle of the missing bone according to the difference and the initial Euler angle; According to the first coordinate of the first joint of the missing bone, the bone length and the target Euler angle, the target coordinate of the end joint of the missing bone is obtained.

4. The method according to claim 3, characterized in that: Determining the difference in the roll angle component between the initial Euler angle of the missing bone and the reference Euler angle, and obtaining the target Euler angle of the missing bone according to the difference and the initial Euler angle, comprises: Convert the initial Euler angle of the missing bone into a first quaternion, and convert the reference Euler angle into a second quaternion; Determine a difference between the first quaternion and the second quaternion, convert the difference into a third Euler angle, and set a pitch angle component and a yaw angle component in the third Euler angle to preset values ​​to obtain a fourth Euler angle; Convert the fourth Euler angle into a third quaternion; Inversely calculate a fourth quaternion that is equal to the third quaternion in the roll angle component of the first quaternion, and use the Euler angle represented by the fourth quaternion as the target Euler angle of the missing bone.

5. The method according to claim 1, characterized in that: The generating of gesture training data based on the virtual gesture motion trajectory, the target coordinates of each joint of each virtual gesture and the target Euler angle of each bone includes: Capturing images of the virtual gesture motion trajectory using multiple virtual cameras with different viewing angles; For the second video frame sequence captured by each virtual camera, the second video frame sequence is used as a training sample in a set of gesture training data, and the target coordinates of each joint and the target Euler angles of each bone corresponding to the virtual gestures in the corresponding video frames in the second video frame sequence are used as training labels in a set of gesture training data.

6. The method according to claim 4, characterized in that The step of generating gesture training data based on the virtual gesture motion trajectory, the target coordinates of each joint of each virtual gesture, and the target Euler angles of each bone also includes: superimposing a rotation offset on each virtual gesture in the virtual gesture motion trajectory to obtain a new virtual gesture motion trajectory; For each virtual gesture in the new virtual gesture motion trajectory, target coordinates of each joint and target Euler angles of each bone corresponding to the virtual gesture are updated according to the rendering offset corresponding to the virtual gesture.

7. The method according to claim 2, characterized in that The updating of the first Euler angle according to the orientation vector of the bone to obtain the target Euler angle of the bone includes: Obtaining a pitch angle component and a yaw angle component of a target Euler angle of the bone according to the orientation vector of the bone; The roll angle component of the first Euler angle is used as the roll angle component of the target Euler angle of the bone.

8. The method according to claim 1, characterized in that The obtaining a first recognition result of gesture recognition for the first video frame sequence includes: Obtaining a second recognition result of gesture recognition performed by a third-party gesture recognition model on the first video frame sequence, wherein the second recognition result includes a second Euler angle of each bone and a second coordinate of each joint in a second coordinate system in each video frame; For each video frame, the second coordinates of each joint and the second Euler angles of each bone in the video frame are converted to the first coordinate system to obtain the first Euler angles of each bone and the first coordinates of each joint in the video frame.

9. A device for generating gesture training data, characterized in that: include: A first recognition result obtaining module is used to obtain a first recognition result of gesture recognition for a first video frame sequence, where the first video frame sequence is obtained by continuously sampling a real gesture motion trajectory by a camera, and the first recognition result includes a first Euler angle of each bone and a first coordinate of each joint in a first coordinate system in each video frame; A data updating module is used to obtain the length of each bone of the virtual hand model in the first coordinate system, and for each video frame, in the order from wrist to finger, for each bone, according to the target coordinate of the first joint of the bone, the first coordinate of the last joint, the first Euler angle of the bone and the length, obtain the target Euler angle of the bone and the target coordinate of the last joint, wherein the target coordinate of the first joint of the first bone is the first coordinate of the joint, and the target coordinate of the first joint of a non-first bone is the target coordinate when the joint is the last joint of the previous bone of the non-first bone; A gesture rendering module, used for rendering the virtual hand model for each video frame according to the target coordinates of each joint and the target Euler angles of each bone in the video frame to obtain a corresponding virtual gesture; The training data generation module is used to organize the virtual gestures corresponding to each video frame into a virtual gesture motion trajectory according to the timing of the video frames, and generate gesture training data based on the virtual gesture motion trajectory, the target coordinates of each joint of each virtual gesture and the target Euler angle of each bone.

10. An electronic device comprising a memory, a processor and a computer program stored in the memory, characterized in that: The processor executes the computer program to implement the steps of the method for generating gesture training data according to any one of claims 1 to 8.

11. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method for generating gesture training data according to any one of claims 1 to 8 are implemented.

12. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method for generating gesture training data according to any one of claims 1 to 8 are implemented.

Citation Information

Cited By

  • Data set generation method, model training method and behavior recognition method

    CN120877365A