A method and device for restoring 3D posture of 2D human body image

Through the 2D to 3D pose generation network and camera parameter prediction network, combined with the pose judgment network and specific projection methods, the problem of uncertainty and complexity in the restoration of human body 2D images to 3D poses is solved, achieving higher accuracy and stability. It is suitable for accurate restoration in multi-person and occlusion situations.

CN118447135BActive Publication Date: 2024-10-15SENINT(SUZHOU) TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410536244.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-04-30
Publication Date
2024-10-15
Estimated Expiration
2044-04-30

AI Technical Summary

Technical Problem

The existing technology has uncertainty and complexity in the process of restoring human body 2D images to 3D postures. Especially in situations where there are multiple people and occlusions, the accuracy and stability are insufficient, making it difficult to achieve accurate 3D posture restoration.

Method used

Using a 2D to 3D pose generation network and a camera parameter prediction network, combined with a pose judgment network and a specific projection method, Wasserstein loss and projection loss functions are used to optimize computing speed and reduce deviations, achieving accurate restoration from 2D to 3D.

Benefits of technology

It effectively makes up for the lack of depth information, improves the accuracy and stability of 3D posture restoration, can handle complex postures and occlusion situations, and achieves accurate restoration of human body 2D images to 3D postures.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118447135B_ABST
    Figure CN118447135B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and device for restoring the 3D posture of a 2D image of a human body, and relates to the technical field of 3D posture estimation, including S1, a network for generating 2D to 3D posture; S2, a camera parameter prediction network; S3, 2D projection restoration; S4, a posture judgment network; S5, a posture judgment network loss function; S6, a camera prediction network loss function. The method and device for restoring the 3D posture of a 2D image of a human body, by learning the mapping from input distribution to output distribution, that is, the mapping from 2D posture to 3D posture, observing and counting 2D data, and performing regression calculation on the 3D posture, effectively compensates for the influence of the lack of depth information, and obtains the 3D posture through the 2D to 3D image generation network, cooperates with the camera parameter prediction network, so as to more accurately perform 2D projection restoration, and combines with the posture judgment network to handle complex postures and occlusion situations.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of 3D posture estimation, and in particular to a method and device for restoring the 3D posture of a 2D image of a human body. Background Art

[0002] 3D posture estimation, also known as 3D HPE technology, has the main goal of estimating the position of key points of the human body in three-dimensional space. In the existing technology, 3D HPE is widely used in fields such as human-computer interaction, motion analysis, rehabilitation training, etc. In addition, 3D HPE can also provide information about the skeletal structure for other computer vision tasks. At present, the representation of the human body generally adopts the following two methods: 1. Representing the human body posture in the form of a skeleton, which is composed of a series of human body key points and the lines between the key points; 2. Parameterized human body model, which represents the human body posture and body shape in the form of mesh.

[0003] However, estimating 3D pose based on 2D images is a problem with uncertainties. The same 2D pose may have multiple different 3D poses. In addition, methods based on monocular images also have problems such as self-occlusion, object occlusion, and depth uncertainty.

[0004] At present, the technology for identifying the location of key joints based on human body images is relatively mature. However, how to use limited images to restore the 3D position of joints in the presence of multiple people and occlusion, and further infer the posture and movement intention, requires further research and exploration.

[0005] In the actual process of restoring the 3D posture of a 2D human body image, since the 2D image is a two-dimensional projection of the three-dimensional world, it lacks depth information. In addition, the human body posture is extremely diverse and complex, which makes it difficult to restore from 2D to 3D. The accuracy and stability of the existing restoration algorithms still need to be improved. In particular, when dealing with complex postures and occlusions, the performance of the algorithm is often affected, resulting in deviations in the restoration, affecting the accuracy of the restoration of the human body 2D image to 3D posture.

[0006] Therefore, it is urgent to improve this shortcoming. The present invention studies and improves the existing structure and shortcomings, and provides a method and device for restoring the 3D posture of a 2D image of a human body. Summary of the invention

[0007] The purpose of the present invention is to provide a method and device for restoring the 3D posture of a 2D image of a human body, so as to solve the problems raised in the above background technology.

[0008] To achieve the above object, the present invention provides the following technical solutions:

[0009] In a first aspect, a method for restoring a 3D posture of a 2D image of a human body comprises:

[0010] S1. Network for 2D to 3D pose generation:

[0011] Construct a 2D to 3D pose generation network according to the target task, wherein the activation function of the network adopts ReLU, and the pose estimation part of the network consists of two consecutive residual network blocks, wherein each residual network block contains three hidden layers, and each hidden layer is fully connected with 1000 neurons;

[0012] The main network structure of the network is as follows: input layer, residual network block 1, residual network block 2, output layer;

[0013] The residual network block structure is as follows: input, hidden layer 1, hidden layer 2, hidden layer 3, output;

[0014] The last layer outputs a 3n-dimensional vector containing the 3D pose and can be reshaped as X, X∈R 3xn , X is a three-dimensional coordinate xyz, representing the 3D position of a key point, n represents the number of key points, and the value of n is a positive integer, R 3xn represents the output dimension vector;

[0015] S2, Camera parameter prediction network:

[0016] The camera parameter prediction network structure adopts a similar structure to the network for 2D to 3D pose generation, and outputs a 6-dimensional vector containing camera parameters. By using the perspective camera model defined by six variables, the camera matrix is ​​obtained, and the output vector is defined as K∈R 2x3 ;

[0017] S3, 2D projection restoration:

[0018] The output posture X of the network for 2D to 3D posture generation and the output K of the camera parameter prediction network are used as the input of the projection restoration layer, and reprojected to the 2D coordinate space through a specific projection method;

[0019] S4, posture judgment network:

[0020] In the network structure of the posture judgment network, the motion space matrix is ​​a representation of the human body posture including joint angles and bone lengths, and can be calculated by only two matrix multiplications. By introducing the motion space matrix, the operation speed is optimized, and then the bones are defined. The bones are defined as the vectors between the rth and tth joints, and the definition formula is as follows:

[0021] b k =p r -p t =Xc

[0022] Where c = (0, 0, 1...0, -1, 0, 0..0) T , position r is 1, position t is -1, b k The direction and length of represent the direction and length of bone k;

[0023] The number of bones is specified as b, and the bone matrix B∈R is defined 3xb , introduce it into C∈R jxb , where j represents the number of joints, and B = XC, so the motion space matrix is ​​defined as:

[0024]

[0025] Among them, the diagonal line is the length of the bone;

[0026] S5, posture judgment network loss function:

[0027] The loss function uses Wasserstein loss to measure the distance between the image generated by the generator and the real image, and the function is defined as follows:

[0028] L w (G, D) = W (P r , P g )

[0029] Among them, P r is the probability distribution of real images, P g is the probability distribution of images generated by the generator;

[0030] W(P,Q)=i11f γ∈Π(P,Q) ∫|xy|dγ(x,y)

[0031] Where P and Q are two probability distributions, Π(P, Q) is the set of all probability distributions from P to Q, and γ∈Π(P, Q) is a probability distribution from P to Q;

[0032] S6, Camera prediction network loss function:

[0033] Output a 6-dimensional vector and use the loss function to calculate the prediction loss.

[0034] Furthermore, in step S1, the input of the camera is a 2-dimensional vector. For n key points, in the neural network, the description matrix is ​​written as a 3n-dimensional vector. Accordingly, if n joints are reconstructed, the input of the pose and camera estimation network is a 2n-dimensional vector containing the coordinates of the joints detected in the image.

[0035] Furthermore, in step S3, the projection method is as follows:

[0036] W r =KX

[0037] Among them, W r The reprojection is calculated and restored. The dimension of K is 2x3, and the dimension of X is 3xn, so W r The dimension is 2xn, and the loss function is defined as:

[0038] L rep (X,K)=||W-KX||2

[0039] Among them, ||*||2 refers to the L2 norm operation of the matrix, and W is the real input image.

[0040] Furthermore, in step S3, according to the projection mode W r =KX, K meets

[0041]

[0042] Among them, s represents the scale scalar of the projection, which is a 2×2 unit matrix, and trace represents the trace of the matrix, which refers to the sum of all elements on the main diagonal of the matrix;

[0043] In addition, the loss function is defined as follows

[0044]

[0045] In a second aspect, a device for restoring a 2D human body image in 3D posture comprises: a memory, a processor, and computer program instructions stored in the memory and executable on the processor, wherein the processor implements the method for restoring a 2D human body image in 3D posture as described above when executing the computer program instructions.

[0046] In a third aspect, a computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method for restoring a 2D image of a human body in 3D posture as described above.

[0047] The present invention provides a method and device for restoring a 2D human body image to a 3D posture, which has the following beneficial effects:

[0048] The present invention learns the mapping from input distribution to output distribution, that is, the mapping from 2D posture to 3D posture, observes and counts 2D data, and performs regression calculation on 3D posture, which effectively compensates for the influence of missing depth information, and obtains 3D posture through 2D to 3D image generation network, cooperates with camera parameter prediction network to more accurately perform 2D projection restoration, and combines with posture judgment network to process complex posture and occlusion. In addition, posture judgment network loss function, projection loss function, and camera prediction network loss function are designed to further improve the accuracy and stability of the restoration algorithm, reduce restoration deviation, and realize accurate restoration of human body 2D image to 3D posture. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] Figure 1 A schematic diagram of the operation flow of a method for restoring a 2D image of a human body to a 3D posture according to the present invention;

[0050] Figure 2 The present invention is a schematic diagram of the network structure of a posture judgment network of a method for restoring a 2D human body image in 3D. DETAILED DESCRIPTION

[0051] The following embodiments of the present invention are described in further detail in conjunction with the accompanying drawings and examples. The following examples are used to illustrate the present invention, but are not intended to limit the scope of the present invention.

[0052] like Figure 1-Figure 2 As shown, a method for restoring a 3D posture of a 2D image of a human body includes:

[0053] S1. Network for 2D to 3D pose generation:

[0054] Construct a 2D to 3D pose generation network according to the target task, wherein the activation function of the network adopts ReLU, and the pose estimation part of the network consists of two consecutive residual network blocks, wherein each residual network block contains three hidden layers, and each hidden layer is fully connected with 1000 neurons;

[0055] The main network structure of the network is as follows: input layer, residual network block 1, residual network block 2, output layer;

[0056] The residual network block structure is as follows: input, hidden layer 1, hidden layer 2, hidden layer 3, output;

[0057] The last layer outputs a 3n-dimensional vector containing the 3D pose and can be reshaped as X, X∈R 3xn , X is a three-dimensional coordinate xyz, representing the 3D position of a key point, n represents the number of key points, and the value of n is a positive integer, R 3xn represents the output dimension vector;

[0058] In step S1, the input of the camera is a 2-dimensional vector. For n key points, in the neural network, the description matrix is ​​written as a 3n-dimensional vector. Correspondingly, if n joints are reconstructed, the input of the pose and camera estimation network is a 2n-dimensional vector containing the coordinates of the joints detected in the image.

[0059] S2, Camera parameter prediction network:

[0060] The camera parameter prediction network structure adopts a similar structure to the network for 2D to 3D pose generation, and outputs a 6-dimensional vector containing camera parameters. By using the perspective camera model defined by six variables, the camera matrix is ​​obtained, and the output vector is defined as K∈R 2x3 ;

[0061] S3, 2D projection restoration:

[0062] The output posture X of the network for 2D to 3D posture generation and the output K of the camera parameter prediction network are used as the input of the projection restoration layer, and reprojected to the 2D coordinate space through a specific projection method;

[0063] In step S3, the projection method is as follows:

[0064] W r =KX

[0065] Among them, W r The reprojection is calculated and restored. The dimension of K is 2x3, and the dimension of X is 3xn, so W r The dimension is 2xn, and the loss function is defined as:

[0066] L rep (X,K)=||W-KX||2

[0067] Among them, ||*||2 refers to the L2 norm operation of the matrix, and W is the real input image;

[0068] S4, posture judgment network:

[0069] In the network structure of the posture judgment network, the motion space matrix is ​​a representation of the human body posture including joint angles and bone lengths, and can be calculated by only two matrix multiplications. By introducing the motion space matrix, the operation speed is optimized, and then the bones are defined. The bones are defined as the vectors between the rth and tth joints, and the definition formula is as follows:

[0070] b k =p r -p t =Xc

[0071] Where c = (0, 0, 1...0, -1, 0, 0..0)T , position r is 1, position t is -1, b k The direction and length of represent the direction and length of bone k;

[0072] The number of bones is specified as b, and the bone matrix B∈R is defined 3xb , introduce it into C∈R jxb , where j represents the number of joints, and B = XC, so the motion space matrix is ​​defined as:

[0073]

[0074] Among them, the diagonal line is the length of the bone;

[0075] S5, posture judgment network loss function:

[0076] The loss function uses Wasserstein loss to measure the distance between the image generated by the generator and the real image, and the function is defined as follows:

[0077] L w (G, D) = W (P r , P g )

[0078] Among them, P r is the probability distribution of real images, P g is the probability distribution of images generated by the generator;

[0079] W(P,Q)=inf γ∈Π(P,Q) ∫|xy|dγ(x,y)

[0080] Where P and Q are two probability distributions, Π(P, Q) is the set of all probability distributions from P to Q, and γ∈Π(P, Q) is a probability distribution from P to Q;

[0081] S6, Camera prediction network loss function:

[0082] Output a 6-dimensional vector and use the loss function to calculate the prediction loss;

[0083] According to the projection method W r =KX, K meets

[0084]

[0085] Among them, s represents the scale scalar of the projection, which is a 2×2 unit matrix, and trace represents the trace of the matrix, which refers to the sum of all elements on the main diagonal of the matrix;

[0086] In addition, the loss function is defined as follows

[0087]

[0088] A device for restoring a 2D human body image to a 3D posture comprises: a memory, a processor and computer program instructions stored in the memory and executable on the processor. When the processor executes the computer program instructions, the method for restoring a 2D human body image to a 3D posture is implemented as described above.

[0089] A computer-readable storage medium, in which computer-executable instructions are stored, which, when executed by a processor, are used to implement the method for restoring a 3D posture of a 2D image of a human body as described above

[0090] In summary, combined Figure 1-Figure 2 As shown, the working principle of the method and device for restoring the 3D posture of a human body 2D image is as follows:

[0091] S1. Network for 2D to 3D pose generation:

[0092] Construct a 2D to 3D pose generation network according to the target task, wherein the activation function of the network adopts ReLU, and the pose estimation part of the network consists of two consecutive residual network blocks, wherein each residual network block contains three hidden layers, and each hidden layer is fully connected with 1000 neurons;

[0093] The main network structure of the network is as follows: input layer, residual network block 1, residual network block 2, output layer;

[0094] The residual network block structure is as follows: input, hidden layer 1, hidden layer 2, hidden layer 3, output;

[0095] The last layer outputs a 3n-dimensional vector containing the 3D pose and can be reshaped as X, X∈R 3xn , X is a three-dimensional coordinate xyz, representing the 3D position of a key point, n represents the number of key points, and the value of n is a positive integer, R 3xn Represents the output dimensional vector; in addition, the input of the camera is a 2-dimensional vector. For n key points, in the neural network, the description matrix is ​​written as a 3n-dimensional vector. Correspondingly, if n joints are reconstructed, the input of the pose and camera estimation network is a 2n-dimensional vector containing the coordinates of the joints detected in the image;

[0096] S2, Camera parameter prediction network:

[0097] The camera parameter prediction network structure adopts a similar structure to the network for 2D to 3D pose generation, and outputs a 6-dimensional vector containing camera parameters. By using the perspective camera model defined by six variables, the camera matrix is ​​obtained, and the output vector is defined as K∈R 2x3 ;

[0098] S3, 2D projection restoration:

[0099] The output posture X of the network for 2D to 3D posture generation and the output K of the camera parameter prediction network are used as the input of the projection restoration layer and reprojected to the 2D coordinate space through a specific projection method; the projection method is as follows:

[0100] W r =KX

[0101] Among them, W r The reprojection is calculated and restored. The dimension of K is 2x3, and the dimension of X is 3xn, so W r The dimension is 2xn, and the loss function is defined as:

[0102] L rep (X,K)=||W-KX||2

[0103] Among them, ||*||2 refers to the L2 norm operation of the matrix, and W is the real input image;

[0104] S4, posture judgment network:

[0105] In the network structure of the posture judgment network, the motion space matrix is ​​a representation of the human body posture including joint angles and bone lengths, and can be calculated by only two matrix multiplications. By introducing the motion space matrix, the operation speed is optimized, and then the bones are defined. The bones are defined as the vectors between the rth and tth joints, and the definition formula is as follows:

[0106] b k =p r -p t =Xc

[0107] Where c = (0, 0, 1…0, -1, 0, 0..0) T , position r is 1, position t is -1, b k The direction and length of represent the direction and length of bone k;

[0108] The number of bones is specified as b, and the bone matrix B∈R is defined 3xb , introduce it into C∈R jxb , where j represents the number of joints, and B = XC, so the motion space matrix is ​​defined as:

[0109]

[0110] Among them, the diagonal line is the length of the bone;

[0111] S5, posture judgment network loss function:

[0112] The loss function uses Wasserstein loss to measure the distance between the image generated by the generator and the real image, and the function is defined as follows:

[0113] L w (G, D) = W (P r , P g )

[0114] Among them, P r is the probability distribution of real images, P g is the probability distribution of images generated by the generator;

[0115] W(P,Q)=inf γ∈Π(P,Q) ∫|xy|dγ(x,y)

[0116] Where P and Q are two probability distributions, Π(P, Q) is the set of all probability distributions from P to Q, and γ∈Π(P, Q) is a probability distribution from P to Q;

[0117] S6, Camera prediction network loss function:

[0118] Output a 6-dimensional vector and use the loss function to calculate the prediction loss according to the projection method W r =KX, K meets

[0119]

[0120] Among them, s represents the scale scalar of the projection, which is a 2×2 unit matrix, and trace represents the trace of the matrix, which refers to the sum of all elements on the main diagonal of the matrix;

[0121] In addition, the loss function is defined as follows

[0122]

[0123] The embodiments of the present invention are given for the purpose of illustration and description, and are not intended to be exhaustive or to limit the invention to the disclosed forms. Many modifications and variations will be apparent to those of ordinary skill in the art. The embodiments are selected and described in order to better illustrate the principles and practical applications of the present invention and to enable those of ordinary skill in the art to understand the present invention and thereby design various embodiments with various modifications suitable for specific uses.

Claims

1. A method for restoring a 3D posture of a 2D image of a human body, characterized in that: include: S1. Network for 2D to 3D pose generation: Construct a 2D to 3D pose generation network according to the target task, wherein the activation function of the network adopts ReLU, and the pose estimation part of the network consists of two consecutive residual network blocks, wherein each residual network block contains three hidden layers, and each hidden layer is fully connected with 1000 neurons; The main network structure of the network is as follows: input layer, residual network block 1, residual network block 2, output layer; The residual network block structure is as follows: input, hidden layer 1, hidden layer 2, hidden layer 3, output; The last layer outputs a 3n-dimensional vector containing the 3D pose and can be reshaped as X, X∈R 3xn , X is a three-dimensional coordinate xyz, representing the 3D position of a key point, n represents the number of key points, and the value of n is a positive integer, R 3xn represents the output dimension vector; S2, Camera parameter prediction network: The camera parameter prediction network structure adopts a similar structure to the network for 2D to 3D pose generation, and outputs a 6-dimensional vector containing camera parameters. By using the perspective camera model defined by six variables, the camera matrix is ​​obtained, and the output vector is defined as K∈R 2x3 ; S3, 2D projection restoration: The output posture X of the network for 2D to 3D posture generation and the output K of the camera parameter prediction network are used as the input of the projection restoration layer, and reprojected to the 2D coordinate space through a specific projection method; S4, posture judgment network: In the network structure of the posture judgment network, the motion space matrix is ​​a representation of the human body posture including joint angles and bone lengths, and can be calculated by only two matrix multiplications. By introducing the motion space matrix, the operation speed is optimized, and then the bones are defined. The bones are defined as the vectors between the rth and tth joints, and the definition formula is as follows: b k =p r -p t =Xc Where c = (0, 0, 1...0, -1, 0, 0..0) T , position r is 1, position t is -1, b k The direction and length of represent the direction and length of bone k; The number of bones is specified as b, and the bone matrix B∈R is defined 3xb , introduce it into C∈R jxb , where j represents the number of joints, and B = XC, so the motion space matrix is ​​defined as: Among them, the diagonal line is the length of the bone; S5, posture judgment network loss function: The loss function uses Wasserstein loss to measure the distance between the image generated by the generator and the real image, and the function is defined as follows: L w (G,D)=W(P r ,P g ) Among them, P r is the probability distribution of real images, P g is the probability distribution of images generated by the generator; W(P,Q)=inf γ∈Π(P,Q) ∫|x-y|dγ(x,y) Where P and Q are two probability distributions, Π(P, Q) is the set of all probability distributions from P to Q, and γ∈Π(P, Q) is a probability distribution from P to Q; S6, Camera prediction network loss function: Output a 6-dimensional vector and use the loss function to calculate the prediction loss.

2. The method for restoring a 2D human body image to a 3D posture according to claim 1, characterized in that: In step S1, the input of the camera is a 2-dimensional vector. For n key points, in the neural network, the description matrix is ​​written as a 3n-dimensional vector. Accordingly, if n joints are reconstructed, the input of the pose and camera estimation network is a 2n-dimensional vector containing the coordinates of the joints detected in the image.

3. The method for restoring a 2D human body image to a 3D posture according to claim 1, characterized in that: In step S3, the projection method is as follows: W r =KX Among them, W r The reprojection is calculated and restored. The dimension of K is 2x3, and the dimension of X is 3xn, so W r The dimension is 2xn, and the loss function is defined as: L rep (X,K)=||W-KX||2 Among them, ||*||2 refers to the L2 norm operation of the matrix, and W is the real input image.

4. The method for restoring a 3D posture of a 2D human body image according to claim 1, characterized in that: In step S3, according to the projection mode W r =KX, K meets Among them, s represents the scale scalar of the projection, which is a 2×2 unit matrix, and trace represents the trace of the matrix, which refers to the sum of all elements on the main diagonal of the matrix; In addition, the loss function is defined as follows 5. A device for restoring a 3D posture of a 2D image of a human body, characterized in that: include: A memory, a processor, and computer program instructions stored in the memory and executable on the processor, wherein when the processor executes the computer program instructions, the method for restoring the 3D posture of a 2D image of a human body as described in any one of claims 1 to 4 above is implemented.

6. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method for restoring a 3D posture of a 2D image of a human body as described in any one of claims 1 to 4 above.