Method for determining three-dimensional coordinates of joint key points and related equipment
Through the combination of multiple joint images and neural network models, the three-dimensional coordinates of joint key points are gradually calculated, which solves the problem in the existing technology of being unable to reversely determine the coordinates of joint key points, and achieves high-precision calculation of joint lengths and mutual relationships.
Patent Information
- Application Number
- CN202210028078.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-11
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2042-01-11
AI Technical Summary
The existing technology cannot reversely determine the coordinates of key joint points in a joint in three-dimensional space through joint images, resulting in the inability to accurately calculate joint lengths and mutual relationships.
Using multiple joint images, the scale factor and relative depth are predicted through the neural network model, combined with the camera internal parameters and the two-dimensional coordinates of the joint key points, to gradually calculate the three-dimensional coordinates of the joint key points, and use the iterative process to optimize the prediction accuracy until the iteration end condition is reached. .
It is possible to accurately determine the three-dimensional coordinates of joint key points from multiple joint images, improve calculation accuracy and speed, and ensure the accuracy of joint lengths and mutual relationships.
Smart Images

Figure CN114550203B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence, and more specifically, to a method for determining three-dimensional coordinates of joint key points and related equipment. Background Art
[0002] With the rapid development of computer vision technology, deep learning technology is increasingly being used in the field of image processing. In related technologies, although the joint image of the target joint can be acquired by a camera, the coordinates of the joint in three-dimensional space cannot be determined based on the joint image. Therefore, how to reversely determine the coordinates of the joint key points in the joint in three-dimensional space through the joint image is a technical problem that needs to be solved in related technologies. Summary of the invention
[0003] In view of the above problems, the embodiments of the present application propose a method, device, electronic device and storage medium for determining the three-dimensional coordinates of joint key points to improve the above problems.
[0004] According to one aspect of an embodiment of the present application, a method for determining the three-dimensional coordinates of a joint key point is provided, comprising: acquiring multiple joint images of a target joint; determining the intermediate three-dimensional coordinates of the joint key point corresponding to each of the joint images according to the two-dimensional coordinates of the joint key point in each of the joint images and the camera intrinsic parameters of the camera from which the joint image comes; determining the first input information corresponding to each of the joint images according to the intermediate three-dimensional coordinates of the joint key point corresponding to each of the joint images and the relative depth of the joint key point in each of the joint images; predicting the scale factor according to the first input information corresponding to each of the joint images by a first neural network model to obtain the predicted scale factor corresponding to each of the joint images; calculating the predicted three-dimensional coordinates of the joint key point corresponding to each of the joint images according to the predicted scale factor corresponding to each of the joint images and the intermediate three-dimensional coordinates of the joint key point corresponding to each of the joint images; calculating the first predicted joint length of the target joint corresponding to each of the joint images according to the predicted three-dimensional coordinates of the joint key point corresponding to each of the joint images; According to the predicted first measured joint length of the target joint corresponding to each joint image, the joint length loss corresponding to each joint image is determined; according to the joint length loss corresponding to each joint image and the first input information corresponding to each joint image, the second input information corresponding to each joint image is determined; the second neural network predicts the change in the scale factor according to the second input information corresponding to each joint image to obtain the predicted change in the scale factor corresponding to each joint image; the predicted change in the scale factor corresponding to each joint image is added to the predicted scale factor corresponding to each joint image to obtain the total scale factor corresponding to each joint image; according to the total scale factor corresponding to each joint image, the mutual length loss of the target joint corresponding to each joint image is calculated; according to the mutual length loss corresponding to each joint image, it is judged whether the iteration end condition is met; if the iteration end condition is met, the target three-dimensional coordinates of the joint key point are determined according to the total scale factor corresponding to each joint image and the intermediate three-dimensional coordinates of the joint key point corresponding to each joint image.
[0005] According to one aspect of the embodiments of the present application, a device for determining the three-dimensional coordinates of a joint key point is provided, comprising: a first acquisition module, for acquiring multiple joint images of a target joint. An intermediate three-dimensional coordinate determination module, for determining the intermediate three-dimensional coordinates of the joint key point corresponding to each of the joint images according to the two-dimensional coordinates of the joint key point in each of the joint images and the camera intrinsic parameters of the camera from which the joint image comes. A first input information determination module, for determining the first input information corresponding to each of the joint images according to the intermediate three-dimensional coordinates of the joint key point corresponding to each of the joint images and the relative depth of the joint key point in each of the joint images. A first prediction module, for predicting the scale factor according to the first input information corresponding to each of the joint images by a first neural network model, to obtain the predicted scale factor corresponding to each of the joint images. A predicted three-dimensional coordinate calculation module, for calculating the predicted three-dimensional coordinates of the joint key point corresponding to each of the joint images according to the predicted scale factor corresponding to each of the joint images and the intermediate three-dimensional coordinates of the joint key point corresponding to each of the joint images. A first predicted joint length calculation module, for calculating the first predicted joint length of the target joint corresponding to each of the joint images according to the predicted three-dimensional coordinates of the joint key point corresponding to each of the joint images. A joint length loss determination module is used to determine the joint length loss corresponding to each joint image based on the first predicted joint length of the target joint corresponding to each joint image. A second input information determination module is used to determine the second input information corresponding to each joint image based on the joint length loss corresponding to each joint image and the first input information corresponding to each joint image. A second prediction module is used to predict the change in the scale factor according to the second input information corresponding to each joint image by a second neural network to obtain the predicted change in the scale factor corresponding to each joint image. A total scale factor calculation module is used to add the predicted change in the scale factor corresponding to each joint image to the predicted scale factor corresponding to each joint image to obtain the total scale factor corresponding to each joint image. A mutual length loss calculation module is used to calculate the mutual length loss of the target joint corresponding to each joint image based on the total scale factor corresponding to each joint image. A judgment module is used to judge whether the iteration end condition is met based on the mutual length loss corresponding to each joint image. The target three-dimensional coordinate determination module is used to determine the target three-dimensional coordinates of the joint key points based on the total scale factor corresponding to each joint image and the intermediate three-dimensional coordinates of the joint key points corresponding to each joint image if the iteration end condition is met.
[0006] In some embodiments, the device for determining the three-dimensional coordinates of the joint key points also includes: a processing module, which is used to use the total scale factor corresponding to each of the joint images as the predicted scale factor of each of the joint images in the next round of iteration if it is determined that the iteration end condition has not been met, and return to execute the step of calculating the predicted three-dimensional coordinates of the joint key points corresponding to each of the joint images based on the predicted scale factors corresponding to each of the joint images and the intermediate three-dimensional coordinates of the joint key points corresponding to each of the joint images.
[0007] In some embodiments, the judgment module includes: a judgment unit, used to judge whether the mutual length losses corresponding to each of the joint images are less than a loss threshold. An iteration condition determination unit, used to determine that the iteration end condition is met if the mutual length losses corresponding to each of the joint images are less than the loss threshold; if there is a mutual length loss not less than the loss threshold among the mutual length losses corresponding to all of the joint images, then determine that the iteration end condition is not met.
[0008] In some embodiments, the device for determining the three-dimensional coordinates of the joint key point also includes: a predicted relative depth calculation module, which is used to calculate the predicted relative depth of the joint key point corresponding to each of the joint images based on the predicted three-dimensional coordinates of the joint key point corresponding to each of the joint images. A relative depth loss calculation module, which is used to calculate the relative depth loss of the joint key point corresponding to each of the joint images based on the predicted relative depth of the joint key point corresponding to each of the joint images and the relative depth of the joint key point in each of the joint images. An adding module, which is used to add the relative depth loss of the joint key point corresponding to each of the joint images to the second input information corresponding to the corresponding joint image.
[0009] In some embodiments, the device for determining the three-dimensional coordinates of the joint key point also includes: a relative depth calculation module, which is used to calculate the relative depth of the joint key point in each of the joint images based on the depth information of each pixel in each of the joint images and the depth value of the joint key point in each of the joint images.
[0010] In some embodiments, the second input information determination module includes: a second input information determination unit, used to combine the joint length loss corresponding to each of the joint images and the first input information corresponding to each of the joint images to obtain the second input information corresponding to each of the joint images.
[0011] In some embodiments, the joint key points include a first joint key point indicating one end of the target joint and a second joint key point indicating the other end of the target joint.
[0012] In some embodiments, the first predicted joint length calculation module includes: a Euclidean distance calculation unit, for each of the joint images, according to the predicted three-dimensional coordinates of the first joint key point corresponding to the joint image and the predicted three-dimensional coordinates of the second joint key point corresponding to the joint image, to calculate the Euclidean distance between the first joint key point and the second joint key point. A first processing unit, for using the calculated Euclidean distance as the first predicted joint length of the target joint corresponding to the joint image.
[0013] In some embodiments, the joint length loss determination module includes: an average predicted joint length calculation unit, used to average the first predicted joint lengths of the target joint corresponding to all the joint images to obtain the average predicted joint length. A joint length loss calculation unit, used to subtract the first predicted joint length of the target joint corresponding to each joint image from the average predicted joint length to obtain the joint length loss corresponding to each joint image.
[0014] In some embodiments, the device for determining the three-dimensional coordinates of the joint key points also includes: a candidate three-dimensional coordinate calculation module, which is used to multiply the total scale factor corresponding to each of the joint images and the intermediate three-dimensional coordinates of the joint key points in the corresponding joint image if the iteration end condition is met, to obtain the candidate three-dimensional coordinates of the joint key points corresponding to each of the joint images. A candidate joint length calculation module, which is used to determine the candidate joint length of the target joint corresponding to each of the joint images based on the candidate three-dimensional coordinates of the joint key points corresponding to each of the joint images. A target joint length calculation module, which is used to average the candidate joint lengths of the target joint corresponding to all of the joint images to obtain the target joint length of the target joint.
[0015] According to one aspect of an embodiment of the present application, an electronic device is provided, comprising: a processor; a memory, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the method for determining the three-dimensional coordinates of the joint key points as described above is implemented.
[0016] According to one aspect of an embodiment of the present application, a computer-readable storage medium is provided, on which computer-readable instructions are stored. When the computer-readable instructions are executed by a processor, the method for determining the three-dimensional coordinates of the joint key points as described above is implemented.
[0017] According to one aspect of an embodiment of the present application, a computer program product is provided, comprising computer instructions, which, when executed by a processor, implement the method for determining the three-dimensional coordinates of a joint key point as described above.
[0018] In the present application scheme, the scale factor corresponding to each joint image is determined in two stages, that is, after the first input information corresponding to each joint image is determined according to the two-dimensional coordinates of the joint key points corresponding to each joint image in the joint image, the first neural network first predicts the scale factor according to the first input information corresponding to each joint image to obtain the predicted scale factor corresponding to each joint image, and then the second neural network iteratively predicts the scale factor change according to the second input information corresponding to each joint image to obtain the predicted scale factor change corresponding to each joint image, and then, the predicted scale factor corresponding to each joint image and the corresponding predicted scale factor change are added to obtain the total scale factor corresponding to each joint image, and the three-dimensional coordinates of the joint key points in the corresponding joint image are determined based on the total scale factor corresponding to each joint image, thereby realizing the use of multiple joint images to determine the three-dimensional coordinates of the corresponding joint key points in each joint image in stages.
[0019] Moreover, in the scheme of the present application, the second input information corresponding to each joint image includes the joint length loss corresponding to each joint image, and the joint length loss is determined based on the average of the first predicted joint lengths corresponding to all joint images and the first predicted joint length corresponding to each joint image. Therefore, when the target joint remains unchanged, the joint length loss corresponding to the joint image is used as the supervisory information for determining the change in the scale factor corresponding to each joint image. Therefore, the accuracy of the predicted change in the scale factor corresponding to each joint image can be guaranteed, thereby ensuring the accuracy of the three-dimensional coordinates of the joint key points corresponding to each joint image subsequently determined.
[0020] It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] The drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present application, and together with the specification are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0022] Figure 1 A flow chart of a method for determining three-dimensional coordinates of joint key points according to an embodiment of the present application.
[0023] Figure 2 It is a specific step flow chart of step 112 according to an embodiment of the present application.
[0024] Figure 3 It is a flowchart of specific steps after step 105 according to an embodiment of the present application.
[0025] Figure 4 It is a flowchart of specific steps after step 112 according to an embodiment of the present application.
[0026] Figure 5 It is a schematic diagram of a process of determining three-dimensional coordinates of joint key points according to an embodiment of the present application.
[0027] Figure 6 It is a block diagram of a device for determining three-dimensional coordinates of joint key points according to an embodiment of the present application.
[0028] Figure 7 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown. DETAILED DESCRIPTION
[0029] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this application will be more comprehensive and complete and fully convey the concept of the example embodiments to those skilled in the art.
[0030] In addition, described feature, structure or characteristic can be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present application. However, those skilled in the art will appreciate that the technical scheme of the present application can be put into practice without one or more of the specific details, or other methods, components, devices, steps, etc. can be adopted. In other cases, known methods, devices, realizations or operations are not shown or described in detail to avoid blurring the various aspects of the application.
[0031] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0032] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.
[0033] Figure 11 is a flow chart of a method for determining the three-dimensional coordinates of a key point of a joint according to an embodiment of the present application. The method of the present application can be executed by an electronic device with processing capabilities, such as a server, a cloud server, etc., which is not specifically limited here. Figure 1 As shown, the method includes:
[0034] Step 101, obtaining multiple joint images of the target joint.
[0035] In some embodiments, the multiple joint images of the target joint may be grayscale images (grayscale images) or RGB images.
[0036] In some embodiments, the multiple joint images of the target joint may be acquired by the same camera. In other embodiments, the multiple joint images of the target joint may be acquired by different cameras.
[0037] Step 102, determining the intermediate three-dimensional coordinates of the joint key points corresponding to each joint image based on the two-dimensional coordinates of the joint key points in each joint image and the camera intrinsic parameters of the camera from which the joint image comes.
[0038] Joint key point refers to the point with joint identification effect on the joint, which can be a joint point, a bone point, etc., and of course, it can also be other points defined by the user. It is understandable that for the same joint, a plurality of joint key points can be included thereon, in the scheme of the present application, due to the joint length of the joint being calculated, therefore, the joint key points corresponding to each joint image in the present application at least include the first joint key point at one end of the target joint and the second joint key point at the other end of the target joint, and of course, in a specific embodiment, other joint key points except the first joint key point and the second joint key point can also be included. In the scheme of the present application, the joint key points in each joint image are all the same, and the joint key points are not necessarily the same corresponding to the two-dimensional coordinates in each joint image.
[0039] For example, the key joint points may be: the point at the tip of the finger, the point at the base of the distal phalanx of the finger, the point at the end of the phalanx of the finger, the point at the palmar-phalanx joint where the finger attaches to the palm, or the point at the wrist where the palm attaches to the human forearm, etc. The specific number and position of the key joint points may be set according to actual needs and are not specifically limited here.
[0040] In some embodiments, a joint key point set may be set in advance for the target joint, so that the joint key points in the joint key point set corresponding to the target joint are located in each joint image in step 102. It is understandable that for different joints, the joint key points included in the set joint key point set are different.
[0041] The two-dimensional coordinates of the joint key points in the joint images refer to the coordinates of the joint key points in the image coordinate system corresponding to each joint image. Therefore, after locating the pixels where the joint key points are located in each joint image, the two-dimensional coordinates of the joint key points in the corresponding joint images can be obtained.
[0042] In practice, there may be problems with incorrect positioning of joint key points due to unclear images and other reasons. In order to ensure the accuracy of the three-dimensional coordinates of the joint key points determined subsequently, the abnormal pixels of each joint image can be filtered first. Specifically, the isolation forest algorithm (Isolation Forest) or the Local Outlier Factor (LOF) algorithm can be used to exclude abnormal pixels.
[0043] The camera intrinsic parameters include the focal length of the camera and the coordinates of the optical center of the camera. The camera intrinsic parameter matrix is a matrix constructed based on the focal length of the camera and the coordinates of the optical center of the camera. This matrix is called the camera intrinsic parameter matrix, denoted by K, where K is:
[0044]
[0045] Where (f x , f y ) is the focal length of the camera, (c x , c y ) is the coordinate of the optical center of the camera.
[0046] For a point P in the world coordinate system, assuming that its coordinates in the world coordinate system are (X, Y, C), the coordinates of the point P in the camera coordinate system are (X C ,Y C ,Z C ), based on the camera, the coordinates of the point P in the image coordinate system are (u, v). The specific coordinate transformation process can be described by the following formula:
[0047]
[0048] From the above, we can get:
[0049]
[0050] Further transformation, we get:
[0051]
[0052] If point P is a joint key point corresponding to a joint image in this application, then the above coordinates The joint key points correspond to the intermediate 3D coordinates of the joint image, Z CIt can be regarded as the scale factor corresponding to the joint key point of the joint image in this application.
[0053] Specifically, in order to calculate the intermediate three-dimensional coordinates of the joint key points corresponding to each joint image, the two-dimensional coordinates of the joint key points corresponding to each joint image are first supplemented by one dimension to obtain Then multiply the inverse matrix of the corresponding camera intrinsic parameter matrix by the left, and get the intermediate three-dimensional coordinates of the joint key points corresponding to each joint image, which is recorded as
[0054]
[0055] Among them, K -1 is the inverse matrix of the camera's intrinsic parameter matrix.
[0056] Step 103, determining the first input information corresponding to each joint image according to the intermediate three-dimensional coordinates of the joint key points corresponding to each joint image and the relative depth of the joint key points in each joint image.
[0057] The relative depth of a joint key point corresponding to a joint image refers to one or more pixels in the joint image being used as reference pixels, and the depth value of the pixel where the joint key point is located in the joint image relative to the reference pixel.
[0058] In some embodiments, before step 103, the method further includes: calculating the relative depth of the joint key point in each joint image according to the depth information of each pixel in each joint image and the depth value of the joint key point in each joint image.
[0059] The depth information of each pixel in each joint image is used to indicate the depth value of each pixel in the joint image.
[0060] In some embodiments, during the process of image acquisition facing the target joint, multiple joint images of the target joint are acquired simultaneously, and depth images corresponding to each joint image of the target joint are acquired, and the value of each pixel in each depth image is the depth value of the corresponding pixel. Similarly, in order to determine the depth value corresponding to the joint key point in the corresponding joint image, the joint key point is located in the corresponding depth image, so as to obtain the depth value of the joint key point corresponding to each joint image.
[0061] On this basis, after obtaining the depth value of each pixel corresponding to each joint image, one pixel in each joint image is selected as a reference pixel point, and the relative depth of the joint key point corresponding to each joint image is calculated. Among them, the reference pixel can be the pixel with the smallest depth value in the joint image, or the pixel with the median depth value in the joint image, or of course other image points, which can be set according to actual needs.
[0062] When the pixel with the smallest depth value in the joint image is selected as the reference pixel of the corresponding joint image, the relative depth of the joint key point in each joint image can be calculated according to the following formula (5):
[0063]
[0064] In some embodiments, in order to unify the dimensions and avoid the large difference in the depth values of each pixel in each joint image, which leads to a large range of relative depth values determined by the corresponding joint image, the relative depth calculated according to formula (5) can be divided by the difference between the maximum depth value and the minimum depth value in the corresponding joint image, and the quotient obtained by the division is used as the final relative depth of the joint key point in the corresponding joint image, that is, the relative depth of the joint key point corresponding to each joint image is calculated according to the following formula (6):
[0065]
[0066] In the above formulas (5) and (6), is the relative depth of the joint key point in the nth joint image; is the depth value of the joint key point in the nth joint image; is the minimum depth value in the nth joint image; is the maximum depth value in the nth joint image.
[0067] In some embodiments, the intermediate three-dimensional coordinates of the joint key points in each joint image and the relative depth of the joint key points in the joint image may be spliced to obtain the first input information corresponding to the joint image.
[0068] Step 104, the first neural network model predicts the scale factor according to the first input information corresponding to each joint image, and obtains the predicted scale factor corresponding to each joint image.
[0069] In the present application, the scale factor predicted by the first neural network for the joint key points corresponding to the joint image is referred to as the predicted scale factor.
[0070] In some embodiments, the first neural network model can be constructed by a fully connected network, which can include multiple fully connected network layers. For example, if the first input information is a one-dimensional array, the scale factor can be predicted by the first neural network model constructed by the fully connected network. In a specific embodiment, the first neural network model can be a four-layer fully connected network layer.
[0071] In other embodiments, the first neural network model may also be constructed by a convolutional neural network. If the first input information is a two-dimensional array or an array of multiple dimensions, the scale factor prediction may be performed by the first neural network model constructed by the convolutional neural network.
[0072] Of course, in other embodiments, the first neural network model can also be constructed by other neural networks, which is not specifically limited here.
[0073] In other embodiments, the first neural network model can be set as a neural network model with multiple network structures, and the parameters of different network structures are different. The diversity of the prediction of the prediction proportional factor by the first neural network can be improved by changing the network structure of the first neural network model.
[0074] As described above, for the joint key points in the world coordinate system, the intermediate three-dimensional coordinates of the joint key points of the target joint can be determined through the perspective transformation of the camera, and then the coordinates of the joint key points in the corresponding joint image can be determined. Conversely, the intermediate three-dimensional coordinates of the joint key points corresponding to each joint image can also be reversely calculated based on the coordinates of the joint key points in the corresponding joint image and the scale factors of the joint key points corresponding to each joint image. The specific process can be described as:
[0075]
[0076] Among them, S n is the scale factor corresponding to the nth joint image, f represents the function of calculating the intermediate three-dimensional coordinates of the joint key point corresponding to the nth joint image based on the scale factor and the two-dimensional coordinates of the joint key point corresponding to the joint image, p roj represents a function for calculating the intermediate three-dimensional coordinates of the joint key points corresponding to the joint image according to the three-dimensional coordinates of the joint key points and the camera intrinsic parameter matrix of the corresponding camera; Represents the two-dimensional coordinates of the joint key point in the nth joint image.
[0077] Step 105, calculating the predicted three-dimensional coordinates of the joint key points corresponding to each joint image according to the predicted scale factor corresponding to each joint image and the intermediate three-dimensional coordinates of the joint key points corresponding to each joint image.
[0078] The predicted three-dimensional coordinates of a joint key point corresponding to a joint image refer to the three-dimensional coordinates calculated based on the predicted scale factor corresponding to the joint image and the intermediate three-dimensional coordinates of the joint key point corresponding to the joint image.
[0079] In this embodiment, the prediction scale factor corresponding to each joint image and the intermediate three-dimensional coordinates of the joint key point corresponding to the joint image are multiplied to obtain the predicted three-dimensional coordinates of the joint key point corresponding to the joint image.
[0080] Specifically, the predicted three-dimensional coordinates of the joint key points corresponding to each joint image are calculated according to the following formula:
[0081]
[0082] Among them, P′ 3d n is the predicted 3D coordinate of the joint key point in the nth joint image, S n is the prediction scale factor corresponding to the nth joint image, is the middle 3D coordinate of the joint key point in the nth joint image.
[0083] Step 106, calculating the first predicted joint length of the target joint corresponding to each joint image based on the predicted three-dimensional coordinates of the joint key points corresponding to each joint image.
[0084] The first predicted joint length is a predicted joint length calculated based on the predicted three-dimensional coordinates of the joint key points corresponding to each joint image.
[0085] As described above, the joint key points include a first joint key point indicating one end of the target joint and a second joint key point indicating the other end of the target joint; according to the above process, the predicted three-dimensional coordinates of the first joint key point and the predicted three-dimensional coordinates of the second joint key point in each joint image can be determined accordingly.
[0086] On this basis, the first predicted joint length of the target joint corresponding to each joint image can be calculated according to the following process: for each joint image, the Euclidean distance between the first joint key point and the second joint key point is calculated based on the predicted three-dimensional coordinates of the first joint key point corresponding to the joint image and the predicted three-dimensional coordinates of the second joint key point corresponding to the joint image; the calculated Euclidean distance is used as the first predicted joint length of the target joint corresponding to the joint image.
[0087] The calculation formula of Euclidean distance is as follows:
[0088]
[0089] Among them, the predicted three-dimensional coordinates of the first joint key point corresponding to the nth joint image are The predicted three-dimensional coordinates of the second joint key point corresponding to the nth joint image are: ρ n is the Euclidean distance between the first joint key point and the second joint key point corresponding to the nth joint image.
[0090] Step 107: Determine the joint length loss corresponding to each joint image according to the first predicted joint length of the target joint corresponding to each joint image.
[0091] In some embodiments, step 107 includes: calculating the mean of the first predicted joint lengths of the target joint corresponding to all joint images to obtain an average predicted joint length. Subtracting the first predicted joint length of the target joint corresponding to each joint image from the average predicted joint length to obtain a joint length loss corresponding to each joint image.
[0092] Step 108, determining second input information corresponding to each joint image according to the joint length loss corresponding to each joint image and the first input information corresponding to each joint image.
[0093] In some embodiments, the joint length loss corresponding to each joint image and the first input information corresponding to the joint image may be combined to obtain the second input information corresponding to the joint image.
[0094] Step 109, the second neural network predicts the change in the scale factor according to the second input information corresponding to each joint image, and obtains the predicted change in the scale factor corresponding to each joint image.
[0095] In some embodiments, the second neural network model can be constructed by a fully connected network, which can include multiple layers of fully connected network layers. In a specific embodiment, the second neural network model can be a four-layer fully connected network layer.
[0096] In other embodiments, the second neural network model may also be constructed by a convolutional neural network. Of course, in other embodiments, the second neural network model may also be constructed by other neural networks, which are not specifically limited here.
[0097] In some embodiments, the second neural network model can be set as a neural network model with multiple network structures. The parameters of different network structures are different. The value of the predicted proportional factor change can be enriched by setting the network structure of the second neural network model.
[0098] Step 110, the predicted scale factor change corresponding to each joint image is added to the predicted scale factor corresponding to each joint image to obtain the total scale factor corresponding to each joint image.
[0099] That is, for each joint image, the change in the predicted scale factor corresponding to the joint image is added to the predicted scale factor corresponding to the joint image to obtain the total scale factor corresponding to the joint image.
[0100] Step 111, calculating the mutual length loss of the target joint corresponding to each joint image according to the total scale factor corresponding to each joint image.
[0101] In some embodiments, step 111 includes: calculating the first three-dimensional coordinates of the joint key point corresponding to each joint image based on the total scale factor corresponding to each joint image; calculating the second predicted joint length of the target joint corresponding to each joint image based on the first three-dimensional coordinates of the joint key point corresponding to each joint image; calculating the mutual length loss of the target joint corresponding to each joint image based on the second predicted joint length of the target joint corresponding to each joint image and the first predicted joint length of the target joint corresponding to each joint image.
[0102] In a specific embodiment, according to formula (7), the first three-dimensional coordinates of the joint key points corresponding to each joint image can be calculated from the total scale factor corresponding to each joint image and the two-dimensional coordinates of the joint key points in each joint image. In the present application, the three-dimensional coordinates of the joint key points corresponding to each joint image calculated from the total scale factor corresponding to each joint image and the two-dimensional coordinates of the joint key points in each joint image are referred to as the first three-dimensional coordinates of the joint key points corresponding to each joint image.
[0103] After calculating the first three-dimensional coordinates of the joint key points corresponding to each joint image, as described above, the joint key points of the joint include a first joint key point indicating one end of the joint and a second joint key point indicating the other end of the joint; according to the above process, the first three-dimensional coordinates of the first joint key point and the first three-dimensional coordinates of the second joint key point of each joint image can be determined. On this basis, the second predicted joint length of the target joint corresponding to each joint image can be calculated according to formula (9). The predicted joint length calculated from the first three-dimensional coordinates of the joint key points corresponding to each joint image is called the second predicted joint length.
[0104] The mutual length loss of the target joint corresponding to each joint image is calculated based on the first predicted joint length of the target joint corresponding to all joint images and the second predicted joint length of the target joint corresponding to each joint image. The first predicted joint length of the target joint corresponding to all joint images calculated in step 107 is averaged to obtain the average predicted joint length, and the second predicted joint length of the target joint corresponding to each joint image is subtracted from the average predicted joint length to obtain the mutual length loss of the target joint corresponding to each joint image.
[0105] Step 112, judging whether the iteration end condition is met according to the total scale factor corresponding to each joint image.
[0106] In some embodiments, Figure 2 As shown, step 112 includes:
[0107] Step 210, determining whether the mutual length losses corresponding to each joint image are all less than a loss threshold.
[0108] In step 112, the Figure 2 The process shown is used to determine whether the iteration end condition is reached.
[0109] The loss threshold can be set according to actual needs and is not specifically limited here.
[0110] Step 220: If the mutual length losses corresponding to the joint images are all less than the loss threshold, it is determined that the iteration end condition is met.
[0111] Step 230: If there is a mutual length loss not less than a loss threshold among the mutual length losses corresponding to all joint images, it is determined that the iteration end condition is not met.
[0112] The difference threshold can be set according to actual needs and is not specifically limited here.
[0113] Please continue reading Figure 1 , step 113, if the iteration end condition is reached, the target three-dimensional coordinates of the joint key points are determined according to the total scale factor corresponding to each joint image and the intermediate three-dimensional coordinates of the joint key points corresponding to each joint image.
[0114] The target three-dimensional coordinates of the joint key point refer to the coordinates of the joint key point in the world coordinate system.
[0115] As can be seen from the above formula (8), for each joint image, the total scale factor corresponding to the joint image is multiplied by the intermediate three-dimensional coordinates of the joint key point corresponding to the joint image to obtain a three-dimensional coordinate of the joint key point. In this application, for ease of distinction, the three-dimensional coordinates of the joint key point obtained by multiplying the total scale factor corresponding to the joint image with the intermediate three-dimensional coordinates of the joint key point corresponding to the joint image are called candidate three-dimensional coordinates of the joint key point.
[0116] It can be understood that if the number of joint images is m, by repeating the above process, m candidate three-dimensional coordinates of the joint key points can be obtained. On this basis, the m candidate three-dimensional coordinates of the same joint key point can be averaged to obtain the target three-dimensional coordinates of the joint key point.
[0117] In some embodiments, after step 240 , the method further includes: if it is determined that the iteration end condition has not been met, using the total proportional factor as the predicted proportional factor in the next round of iteration, and returning to execute step 105 .
[0118] When it is determined that the iteration end condition has not been met, it is necessary to continue to use the second neural network model for prediction. When performing the next iteration, the total scale factor of each joint image in the previous iteration is used as the prediction scale factor of the corresponding joint image in step 105, and step 105 and subsequent steps are re-executed according to the replaced prediction scale factor until the iteration end condition is determined to be met according to the total scale factor corresponding to each joint image obtained again. The prediction scale factor corresponding to each joint image in the previous round of iteration refers to the total scale factor obtained in the previous round of iteration relative to the current iteration round.
[0119] In the present application scheme, the scale factor corresponding to each joint image is determined in two stages, that is, after the first input information corresponding to each joint image is determined according to the two-dimensional coordinates of the joint key points in each joint image, the first neural network first predicts the scale factor according to the first input information corresponding to each joint image to obtain the predicted scale factor corresponding to each joint image, and then the second neural network iteratively predicts the scale factor change according to the second input information of each joint image to obtain the predicted scale factor change corresponding to each joint image, and then, the predicted scale factor corresponding to each joint image and the predicted scale factor change of the corresponding joint image are added to obtain the total scale factor corresponding to each joint image, and the three-dimensional coordinates of each joint key point are determined based on the total scale factor corresponding to each joint image, thereby realizing the use of multiple joint images to determine the three-dimensional coordinates of the joint key points in stages.
[0120] Moreover, in the scheme of the present application, the second input information includes the joint length loss corresponding to each joint image, and the joint length loss corresponding to each joint image is determined based on the mean predicted joint length calculated based on the first predicted joint length of all joint images and the first predicted joint length corresponding to each joint image; thus, under the condition that the target joint remains unchanged, the joint length loss corresponding to the joint image is used as the supervisory information for determining the change in the scale factor corresponding to each joint image, thereby ensuring the accuracy of the predicted change in the scale factor corresponding to each joint image, and further ensuring the accuracy of the three-dimensional coordinates of the joint key points corresponding to each joint image determined subsequently.
[0121] Further, in the scheme of the present application, when it is judged that the iteration end condition is not reached based on the total scale factor corresponding to each joint image, the execution of step 105 is returned to re-predict the predicted scale factor change amount corresponding to each joint image, without repeating the prediction of the scale factor corresponding to each joint image. Compared with the prediction process of the scale factor, the calculation amount in the prediction process of the scale factor change amount is smaller, and the iteration rate is faster. Therefore, this scheme can improve the speed of determining the three-dimensional coordinates of the key points of the joint. In practice, the scheme of the present application was tested. Generally, the iteration end condition can be reached by repeating the iteration three times.
[0122] Furthermore, the solution of the present application can be applied to the online application stage and also to the training stage of the second neural network. It can be understood that in the training stage, if it is judged that the iteration end condition has not been met, it is necessary to adjust the parameters of the second neural network model so that the second neural network with adjusted parameters can re-predict the change in the proportional factor based on the new second input information. Therefore, the solution of the present application has a wide range of applications.
[0123] In some embodiments, Figure 3 As shown, after step 105, the method further includes:
[0124] Step 310, calculating the predicted relative depth of the joint key points corresponding to each joint image based on the predicted three-dimensional coordinates of the joint key points corresponding to each joint image.
[0125] The predicted relative depth of a joint key point corresponding to a joint image refers to the relative depth determined according to the predicted three-dimensional coordinates of the joint key point corresponding to the joint image. The predicted relative depth of the joint key point corresponding to each joint image can be calculated according to Formula 5 or Formula 6. During the calculation process, the depth value of the joint key point in the joint image is replaced by the depth value indicated by the predicted three-dimensional coordinates of the joint image corresponding to the joint key point. The depth value indicated by the predicted three-dimensional coordinates of the joint image corresponding to the joint key point is the Z-axis coordinate value in the predicted three-dimensional coordinates.
[0126] Step 320, calculate the relative depth loss of the joint key points corresponding to each joint image according to the predicted relative depth of the joint key points corresponding to each joint image and the relative depth of the joint key points in each joint image.
[0127] Specifically, for each joint image, the predicted relative depth of the joint key point corresponding to the joint image is subtracted from the relative depth of the joint key point corresponding to the joint image calculated in step 103 to obtain the relative depth loss of the joint key point corresponding to the joint image.
[0128] Step 330 , adding the relative depth loss of the joint key point corresponding to each joint image to the second input information corresponding to the corresponding joint image.
[0129] In this embodiment, the relative depth loss of the joint key points corresponding to each joint image is also used as the data basis for the second neural network to predict the change in the scale factor, thereby providing more data for predicting the change in the scale factor and improving the accuracy of the predicted change in the scale factor corresponding to each joint image.
[0130] Figure 4 FIG. 1 is a flowchart of steps after step 112 according to an embodiment of the present application. Figure 4 As shown, after step 112, the method further includes:
[0131] Step 410, if the iteration end condition is met, multiply the total scale factor corresponding to each joint image and the intermediate three-dimensional coordinates of the joint key point in the corresponding joint image to obtain the candidate three-dimensional coordinates of the joint key point corresponding to each joint image.
[0132] The calculation of specific candidate three-dimensional coordinates can refer to the above description and will not be repeated here.
[0133] Step 420, determining the candidate joint length of the target joint corresponding to each joint image based on the candidate three-dimensional coordinates of the joint key points corresponding to each joint image.
[0134] In the present application, the joint length of the target joint calculated based on the candidate three-dimensional coordinates of the joint key points corresponding to the joint image is called the candidate joint length of the target joint corresponding to the joint image.
[0135] Similarly, for each joint image, the Euclidean distance between the first joint key point and the second joint key point is calculated based on the candidate three-dimensional coordinates of the first joint key point corresponding to the joint image and the candidate three-dimensional coordinates of the second joint key point corresponding to the joint image, and the candidate joint length of the target joint corresponding to the joint image is obtained.
[0136] Step 430 , average the candidate joint lengths of the target joint corresponding to all joint images to obtain the target joint length of the target joint.
[0137] In this embodiment, for a target joint whose joint length is unknown, the joint length of the target joint, ie, the target joint length, can be determined according to a plurality of joint images of the target joint according to the scheme of this embodiment.
[0138] Figure 5 is a schematic diagram of a process for determining the three-dimensional coordinates of a joint key point according to an embodiment of the present application, such as Figure 5As shown, the three-dimensional coordinate confirmation process of the joint key points is divided into two stages: the first stage and the second stage. In the first stage, the first neural network model is used to predict the scale factor corresponding to each joint image. In the second stage, the second neural network model is used to predict the change in the scale factor corresponding to each joint image.
[0139] Now take the nth joint image of the target joint as an example for explanation.
[0140] The specific process of the first stage is: according to the two-dimensional coordinates of the joint key point in the nth joint image And the inverse matrix K of the camera intrinsic parameter matrix of the camera from which the joint image comes -1 Calculate the intermediate three-dimensional coordinates of the joint key point corresponding to the nth joint image Then according to the relative depth value of the joint key point in the nth joint image The intermediate 3D coordinates of the joint key point corresponding to the nth joint image Determine the first input information corresponding to the nth joint image The first neural network model net1 is based on the first input information corresponding to the nth joint image. Perform scale factor prediction to obtain the predicted scale factor S corresponding to the nth joint image n .
[0141] The process of the second stage is as follows: According to the predicted scale factor S corresponding to the nth joint image n and the joint key points correspond to the intermediate 3D coordinates of the nth joint image Calculate the predicted three-dimensional coordinates P′ of the joint key point corresponding to the nth joint image 3d n ; Then, according to the predicted three-dimensional coordinates P′ of the joint key point corresponding to the nth joint image 3d n Calculate the first predicted joint length B of the target joint corresponding to the nth joint image n ; Then, according to the first predicted joint length B′ of the target joint corresponding to the nth joint image, calculate the joint length loss ΔB of the target joint corresponding to the nth joint image n .
[0142] Then, based on the joint length loss ΔB corresponding to the nth joint image of the target joint n and the first input information corresponding to the nth joint image Determine the second input information corresponding to the nth joint image
[0143] In some embodiments, the joint length loss ΔB corresponding to the target joint in the nth joint image may ben The first input information corresponding to the nth joint image Combine to obtain the second input information corresponding to the nth joint image
[0144] In some embodiments, the predicted relative depth loss ΔP′ of the joint key point corresponding to the nth joint image can be further calculated based on the predicted three-dimensional coordinates of the joint key point corresponding to the nth joint image. 0.5d n Then, the first input information corresponding to the nth joint image is Joint length loss ΔB n and predicted relative depth loss ΔP′ 0.5d n Splice and obtain the second input information corresponding to the nth joint image
[0145] Afterwards, the second neural network model net2 is used according to the second input information corresponding to the nth joint image. Predict the change in the scale factor and obtain the predicted change in the scale factor S′ corresponding to the nth joint image n .
[0146] Afterwards, the predicted scale factor corresponding to each joint image is added to the predicted scale factor change corresponding to each joint image to obtain the total scale factor corresponding to each joint image. The first three-dimensional coordinates of the joint key points corresponding to each joint image are calculated according to the total scale factor corresponding to each joint image; the second predicted joint length of the target joint corresponding to each joint image is calculated according to the first three-dimensional coordinates of the joint key points corresponding to each joint image; the second predicted joint length of the target joint corresponding to each joint image is subtracted from the average predicted joint length to obtain the mutual length loss of the target joint corresponding to each joint image. When the mutual length loss of the target joint corresponding to each joint image is less than the loss threshold, the iteration is terminated, the total scale factor corresponding to each joint image of the last iteration is output, and the total scale factor corresponding to each joint image is multiplied by the intermediate three-dimensional coordinates of the joint key points corresponding to each joint image to calculate the target three-dimensional coordinates of the joint key points.
[0147] Of course, further, when the iteration end condition is determined, the target joint length of the target joint can be calculated and determined based on the total scale factor corresponding to each joint image and the intermediate three-dimensional coordinates of the joint key points corresponding to each joint image.
[0148] Figure 6 A device for determining the three-dimensional coordinates of a key point of a joint according to an embodiment of the present application is shown. Figure 6As shown, the device 600 for determining the three-dimensional coordinates of the joint key points includes: a first acquisition module 601, which is used to acquire multiple joint images of the target joint. An intermediate three-dimensional coordinate determination module 620, which is used to determine the intermediate three-dimensional coordinates of the joint key points corresponding to each joint image according to the two-dimensional coordinates of the joint key points in each joint image and the camera internal parameters of the camera from which the joint images come. A first input information determination module 603, which is used to determine the first input information corresponding to each joint image according to the intermediate three-dimensional coordinates of the joint key points corresponding to each joint image and the relative depth of the joint key points in each joint image. A first prediction module 604, which is used to predict the scale factor according to the first input information corresponding to each joint image by the first neural network model, and obtain the predicted scale factor corresponding to each joint image. A predicted three-dimensional coordinate calculation module 605, which is used to calculate the predicted three-dimensional coordinates of the joint key points corresponding to each joint image according to the predicted scale factor corresponding to each joint image and the intermediate three-dimensional coordinates of the joint key points corresponding to each joint image. A first predicted joint length calculation module 606, which is used to calculate the first predicted joint length of the target joint corresponding to each joint image according to the predicted three-dimensional coordinates of the joint key points corresponding to each joint image. The joint length loss determination module 607 is used to determine the joint length loss corresponding to each joint image according to the first predicted joint length of the target joint corresponding to each joint image. The second input information determination module 608 is used to determine the second input information corresponding to each joint image according to the joint length loss corresponding to each joint image and the first input information corresponding to each joint image. The second prediction module 609 is used to predict the change amount of the scale factor according to the second input information corresponding to each joint image by the second neural network to obtain the predicted change amount of the scale factor corresponding to each joint image. The total scale factor calculation module 610 is used to add the predicted change amount of the scale factor corresponding to each joint image to the predicted scale factor corresponding to each joint image to obtain the total scale factor corresponding to each joint image. The mutual length loss calculation module 611 is used to calculate the mutual length loss of the target joint corresponding to each joint image according to the total scale factor corresponding to each joint image. The judgment module 612 is used to judge whether the iteration end condition is met according to the mutual length loss corresponding to each joint image. The target three-dimensional coordinate determination module 613 is used to determine the target three-dimensional coordinates of the joint key points according to the total scale factor corresponding to each joint image and the intermediate three-dimensional coordinates of the joint key points corresponding to each joint image if the iteration end condition is met.
[0149] In some embodiments, the device 600 for determining the three-dimensional coordinates of the joint key points also includes: a processing module, which is used to use the total scale factor corresponding to each joint image as the predicted scale factor of each joint image in the next round of iteration if it is determined that the iteration end condition has not been met, and return to execute the step of calculating the predicted three-dimensional coordinates of the joint key points corresponding to each joint image based on the predicted scale factor corresponding to each joint image and the intermediate three-dimensional coordinates of the joint key points corresponding to each joint image.
[0150] In some embodiments, the judgment module 612 includes: a judgment unit, used to judge whether the mutual length losses corresponding to each joint image are all less than the loss threshold. An iteration condition determination unit, used to determine that the iteration end condition is met if the mutual length losses corresponding to each joint image are all less than the loss threshold; if there is a mutual length loss not less than the loss threshold among the mutual length losses corresponding to all joint images, then determine that the iteration end condition is not met.
[0151] In some embodiments, the device 600 for determining the three-dimensional coordinates of the joint key points further includes: a predicted relative depth calculation module, which is used to calculate the predicted relative depth of the joint key points corresponding to each joint image based on the predicted three-dimensional coordinates of the joint key points corresponding to each joint image. A relative depth loss calculation module, which is used to calculate the relative depth loss of the joint key points corresponding to each joint image based on the predicted relative depth of the joint key points corresponding to each joint image and the relative depth of the joint key points in each joint image. An adding module, which is used to add the relative depth loss of the joint key points corresponding to each joint image to the second input information corresponding to the corresponding joint image.
[0152] In some embodiments, the device 600 for determining the three-dimensional coordinates of the joint key point also includes: a relative depth calculation module, which is used to calculate the relative depth of the joint key point in each joint image based on the depth information of each pixel in each joint image and the depth value of the joint key point in each joint image.
[0153] In some embodiments, the second input information determination module 608 includes: a second input information determination unit, used to combine the joint length loss corresponding to each joint image and the first input information corresponding to each joint image to obtain the second input information corresponding to each joint image.
[0154] In some embodiments, the joint key point includes a first joint key point indicating one end of the target joint and a second joint key point indicating the other end of the target joint. In this embodiment, the first predicted joint length calculation module 606 includes: a Euclidean distance calculation unit, which is used to calculate the Euclidean distance between the first joint key point and the second joint key point for each joint image according to the predicted three-dimensional coordinates of the first joint key point corresponding to the joint image and the predicted three-dimensional coordinates of the second joint key point corresponding to the joint image. A first processing unit is used to use the calculated Euclidean distance as the first predicted joint length of the target joint corresponding to the joint image.
[0155] In some embodiments, the joint length loss determination module 607 includes: an average predicted joint length calculation unit, used to average the first predicted joint lengths of the target joint corresponding to all joint images to obtain the average predicted joint length. A joint length loss calculation unit, used to subtract the first predicted joint length of the target joint corresponding to each joint image from the average predicted joint length to obtain the joint length loss corresponding to each joint image.
[0156] In some embodiments, the device 600 for determining the three-dimensional coordinates of the joint key points further includes: a candidate three-dimensional coordinate calculation module, which is used to multiply the total scale factor corresponding to each joint image and the intermediate three-dimensional coordinates of the joint key points in the corresponding joint image if the iteration end condition is met, to obtain the candidate three-dimensional coordinates of the joint key points corresponding to each joint image. A candidate joint length calculation module, which is used to determine the candidate joint length of the target joint corresponding to each joint image based on the candidate three-dimensional coordinates of the joint key points corresponding to each joint image. A target joint length calculation module, which is used to average the candidate joint lengths of the target joint corresponding to all joint images to obtain the target joint length of the target joint.
[0157] Figure 7 The structure diagram of the computer system suitable for implementing the electronic device of the embodiment of the present application is shown. It should be noted that: Figure 7 The computer system 700 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0158] like Figure 7As shown, computer system 700 includes a central processing unit (CPU) 701, which can perform various appropriate actions and processes according to the program stored in a read-only memory (ROM) 702 or the program loaded from a storage part 708 to a random access memory (RAM) 703, such as executing the method in the above embodiment. In RAM 703, various programs and data required for system operation are also stored. CPU 701, ROM 702 and RAM 703 are connected to each other through a bus 704. Input / output (I / O) interface 705 is also connected to bus 704.
[0159] The following components are connected to the I / O interface 705: an input section 706 including a keyboard, a mouse, etc.; an output section 707 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 708 including a hard disk, etc.; and a communication section 709 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the I / O interface 705 as needed. A removable medium 711, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 710 as needed so that a computer program read therefrom is installed into the storage section 706 as needed.
[0160] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication section 708, and / or installed from a removable medium 711. When the computer program is executed by a central processing unit (CPU) 701, various functions defined in the system of the present application are executed.
[0161] It should be noted that the computer-readable medium shown in the embodiment of the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, - but not limited to - an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by an instruction execution system, device or device or used in combination with it. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a computer-readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate, or transmit programs for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0162] The flowchart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present application. Wherein, each box in the flowchart or block diagram can represent a module, a program segment, or a part of the code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0163] The units involved in the embodiments described in this application may be implemented by software or hardware, and the units described may also be set in a processor. The names of these units do not, in some cases, constitute limitations on the units themselves.
[0164] As another aspect, the present application further provides a computer-readable storage medium, which may be included in the electronic device described in the above embodiments; or may exist independently without being assembled into the electronic device. The above computer-readable storage medium carries computer-readable instructions, and when the computer-readable storage instructions are executed by a processor, the method in any of the above embodiments is implemented.
[0165] According to one aspect of the present application, an electronic device is also provided, which includes: a processor; a memory, wherein computer-readable instructions are stored in the memory, and when the computer-readable instructions are executed by the processor, the method in any of the above embodiments is implemented.
[0166] According to one aspect of the embodiments of the present application, a computer program product or a computer program is provided, the computer program product or the computer program includes computer instructions, the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the method in any of the above embodiments.
[0167] It should be noted that, although several modules or units of the equipment for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into being embodied by multiple modules or units.
[0168] Through the description of the above implementation methods, it is easy for those skilled in the art to understand that the example implementation methods described here can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the implementation methods of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the implementation methods of the present application.
[0169] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the embodiments disclosed herein. The present application is intended to cover any variations, uses or adaptations of the present application, which follow the general principles of the present application and include common knowledge or customary technical means in the art that are not disclosed in the present application.
[0170] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
Claims
1. A method for determining the three-dimensional coordinates of a joint key point, characterized in that: The method comprises: Acquire multiple joint images of the target joint; Determine the intermediate three-dimensional coordinates of the joint key points corresponding to each of the joint images according to the two-dimensional coordinates of the joint key points in each of the joint images and the camera intrinsic parameters of the camera from which the joint images are derived; Determine the first input information corresponding to each of the joint images according to the intermediate three-dimensional coordinates of the joint key points corresponding to each of the joint images and the relative depth of the joint key points in each of the joint images; The first neural network model predicts the scale factor according to the first input information corresponding to each of the joint images to obtain the predicted scale factor corresponding to each of the joint images; Calculate the predicted three-dimensional coordinates of the joint key points corresponding to each of the joint images according to the predicted scale factors corresponding to each of the joint images and the intermediate three-dimensional coordinates of the joint key points corresponding to each of the joint images; Calculating a first predicted joint length of the target joint corresponding to each of the joint images according to the predicted three-dimensional coordinates of the joint key points corresponding to each of the joint images; Determine a joint length loss corresponding to each joint image according to a first predicted joint length of the target joint corresponding to each joint image; Determine second input information corresponding to each joint image according to the joint length loss corresponding to each joint image and the first input information corresponding to each joint image; The second neural network predicts the change amount of the scale factor according to the second input information corresponding to each joint image, and obtains the predicted change amount of the scale factor corresponding to each joint image; Adding the predicted scale factor change corresponding to each of the joint images to the predicted scale factor corresponding to each of the joint images to obtain a total scale factor corresponding to each of the joint images; Calculate the mutual length loss of the target joint corresponding to each of the joint images according to the total scale factor corresponding to each of the joint images; Determining whether an iteration end condition is reached according to the mutual length loss corresponding to each of the joint images; If the iteration end condition is reached, the target three-dimensional coordinates of the joint key points are determined according to the total scale factor corresponding to each of the joint images and the intermediate three-dimensional coordinates of the joint key points corresponding to each of the joint images; If the iteration end condition is met, multiply the total scale factor corresponding to each of the joint images and the intermediate three-dimensional coordinates of the joint key point in the corresponding joint image to obtain the candidate three-dimensional coordinates of the joint key point corresponding to each of the joint images; Determine the candidate joint length of the target joint corresponding to each of the joint images according to the candidate three-dimensional coordinates of the joint key point corresponding to each of the joint images; Calculate the mean of the candidate joint lengths of the target joint corresponding to all the joint images to obtain the target joint length of the target joint; If it is determined that the iteration end condition has not been met, the total scale factor corresponding to each of the joint images is used as the predicted scale factor of each of the joint images in the next round of iteration, and the process is returned to execute the step of calculating the predicted three-dimensional coordinates of the joint key points corresponding to each of the joint images based on the predicted scale factors corresponding to each of the joint images and the intermediate three-dimensional coordinates of the joint key points corresponding to each of the joint images.
2. The method according to claim 1, characterized in that After calculating the predicted three-dimensional coordinates of the joint key points corresponding to each of the joint images according to the predicted scale factors corresponding to each of the joint images and the intermediate three-dimensional coordinates of the joint key points corresponding to each of the joint images, the method further comprises: Calculating the predicted relative depth of the joint key point corresponding to each of the joint images according to the predicted three-dimensional coordinates of the joint key point corresponding to each of the joint images; Calculate the relative depth loss of the joint key point corresponding to each of the joint images according to the predicted relative depth of the joint key point corresponding to each of the joint images and the relative depth of the joint key point in each of the joint images; The relative depth loss corresponding to each of the joint images of the joint key point is added to the second input information corresponding to the corresponding joint image.
3. The method according to claim 1, characterized in that Determining second input information corresponding to each joint image according to the joint length loss corresponding to each joint image and the first input information corresponding to each joint image includes: The joint length loss corresponding to each of the joint images and the first input information corresponding to each of the joint images are combined to obtain the second input information corresponding to each of the joint images.
4. The method according to claim 1, characterized in that: The joint key points include a first joint key point indicating one end of the target joint and a second joint key point indicating the other end of the target joint; The step of calculating the first predicted joint length of the target joint corresponding to each of the joint images according to the predicted three-dimensional coordinates of the joint key points corresponding to each of the joint images comprises: For each of the joint images, calculating the Euclidean distance between the first joint key point and the second joint key point according to the predicted three-dimensional coordinates of the first joint key point corresponding to the joint image and the predicted three-dimensional coordinates of the second joint key point corresponding to the joint image; The calculated Euclidean distance is used as the first predicted joint length of the target joint corresponding to the joint image.
5. The method according to claim 1, characterized in that The determining of the joint length loss corresponding to each joint image according to the first predicted joint length of the target joint corresponding to each joint image comprises: Calculate the mean of the first predicted joint lengths of the target joint corresponding to all the joint images to obtain an average predicted joint length; The first predicted joint length of the target joint corresponding to each of the joint images is subtracted from the average predicted joint length to obtain a joint length loss corresponding to each joint image.
6. A device for determining the three-dimensional coordinates of a joint key point, characterized in that: The device comprises: A first acquisition module is used to acquire multiple joint images of a target joint; An intermediate three-dimensional coordinate determination module, used to determine the intermediate three-dimensional coordinates of the joint key point corresponding to each of the joint images according to the two-dimensional coordinates of the joint key point in each of the joint images and the camera intrinsic parameters of the camera from which the joint image comes; A first input information determination module, used to determine the first input information corresponding to each of the joint images according to the intermediate three-dimensional coordinates of the joint key points corresponding to each of the joint images and the relative depth of the joint key points in each of the joint images; A first prediction module, configured to predict a scale factor according to first input information corresponding to each of the joint images by a first neural network model, to obtain a predicted scale factor corresponding to each of the joint images; A predicted three-dimensional coordinate calculation module, used to calculate the predicted three-dimensional coordinates of the joint key points corresponding to each of the joint images according to the predicted scale factors corresponding to each of the joint images and the intermediate three-dimensional coordinates of the joint key points corresponding to each of the joint images; A first predicted joint length calculation module, used to calculate the first predicted joint length of the target joint corresponding to each of the joint images according to the predicted three-dimensional coordinates of the joint key points corresponding to each of the joint images; A joint length loss determination module, used to determine the joint length loss corresponding to each joint image according to the first predicted joint length of the target joint corresponding to each joint image; A second input information determination module, used to determine the second input information corresponding to each joint image according to the joint length loss corresponding to each joint image and the first input information corresponding to each joint image; A second prediction module is used to predict the change of the scale factor according to the second input information corresponding to each joint image by a second neural network, so as to obtain the predicted change of the scale factor corresponding to each joint image; A total scale factor calculation module is used to add the predicted scale factor change corresponding to each joint image to the predicted scale factor corresponding to each joint image to obtain the total scale factor corresponding to each joint image; A mutual length loss calculation module, used for calculating the mutual length loss of the target joint corresponding to each of the joint images according to the total scale factor corresponding to each of the joint images; A judgment module, used for judging whether an iteration end condition is reached according to the mutual length loss corresponding to each of the joint images; A target three-dimensional coordinate determination module, for determining the target three-dimensional coordinates of the joint key points according to the total scale factor corresponding to each of the joint images and the intermediate three-dimensional coordinates of the joint key points corresponding to each of the joint images if the iteration end condition is met; A candidate three-dimensional coordinate calculation module, for multiplying the total scale factor corresponding to each of the joint images and the intermediate three-dimensional coordinates of the joint key point in the corresponding joint image if the iteration end condition is met, to obtain the candidate three-dimensional coordinates of the joint key point corresponding to each of the joint images; A candidate joint length calculation module, used to determine the candidate joint length of the target joint corresponding to each of the joint images according to the candidate three-dimensional coordinates of the joint key point corresponding to each of the joint images; A target joint length calculation module is used to calculate the mean of the candidate joint lengths of the target joint corresponding to all the joint images to obtain the target joint length of the target joint; A processing module, which is used to use the total scale factor corresponding to each of the joint images as the predicted scale factor of each of the joint images in the next round of iteration if it is determined that the iteration end condition has not been met, and return to execute the step of calculating the predicted three-dimensional coordinates of the joint key points corresponding to each of the joint images based on the predicted scale factors corresponding to each of the joint images and the intermediate three-dimensional coordinates of the joint key points corresponding to each of the joint images.
7. An electronic device, characterized in that: The electronic device comprises: one or more processors; a memory, electrically connected to the one or more processors; One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, and the one or more applications are configured to execute the method according to any one of claims 1-5.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores program codes, which can be called by a processor to execute the method according to any one of claims 1 to 5.
