Real-time tennis motion recognition method, device, equipment and medium

By using OpenPose and k-nearest neighbor algorithms to recognize tennis movements in real time, the problems of large training sample requirements and low recognition efficiency in existing technologies are solved, and efficient and accurate tennis movement recognition and guidance are achieved.

CN114694256BActive Publication Date: 2024-09-24CENT SOUTH UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210356003.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-06
Publication Date
2024-09-24
Estimated Expiration
2042-04-06

AI Technical Summary

Technical Problem

Existing technologies for tennis motion recognition require a large number of training samples and have poor recognition efficiency and accuracy, making it impossible to achieve real-time and efficient motion recognition.

Method used

OpenPose is used to identify the two-dimensional coordinates of joints in videos of athletes. The coordinates are normalized by taking the midpoint between the two hips as the origin. The k-nearest neighbor algorithm is used to identify the sub-motion type and calculate the joint angle value to determine whether the movement is standard.

Benefits of technology

It improves the efficiency, accuracy, and real-time performance of tennis motion recognition, enabling accurate identification of tennis motions and providing real-time guidance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114694256B
    Figure CN114694256B
Patent Text Reader

Abstract

The disclosed embodiments provide a real-time tennis action recognition method, device, equipment and medium, which belongs to the field of image processing technology, and specifically includes: using OpenPose to identify the two-dimensional coordinates of multiple joint points in each frame of a target video containing a sports person; normalizing the two-dimensional coordinates of all joint points to obtain scaled joint point coordinates; identifying the sub-action type corresponding to the scaled joint point coordinates in each frame according to the k-nearest neighbor algorithm and obtaining the key frame corresponding to each sub-action type; calculating the angle value of the specified joint in each key frame; when all angle values ​​are within the preset range corresponding to the sub-action, the sub-action is determined to be standard. Through the disclosed solution, based on the real-time tennis action recognition algorithm of OpenPose, the identified joint point coordinates are standardized, and then the k-nearest neighbor method is used to identify the action to determine whether the specific action is standard, thereby improving the efficiency, accuracy and real-time performance of the recognition.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The disclosed embodiments relate to the field of image processing technology, and in particular to a real-time tennis action recognition method, device, equipment and medium. Background Art

[0002] At present, with the development of sports and the progress of life, people gradually pay attention to the impact of sports on life. Sports can not only give people a sense of relaxation in busy life, but also strengthen the body and improve people's physical fitness. As a sport, tennis is loved by many people and has gradually entered people's lives and students' physical education classes. Tennis has large movements, fast changes, and high difficulty. It requires the guidance of professionals, but time constraints will have a great impact on the training effect. The development of computers in recent years has provided a solution to this problem. The combination of tennis and computer technology provides detailed training data and specific movement guidance, and corrects movements. However, in the human posture assessment method, some methods identify by extracting the human body contour movement shape, which depends on the light environment. Some methods extract the spatiotemporal features of the action and extract local features for recognition. These methods cannot handle fine movements. In terms of action recognition, some use convolutional neural network methods to distinguish actions. Such methods have high accuracy, but require a large number of training samples, cannot identify a certain action, and have a slow running speed.

[0003] It can be seen that there is an urgent need for an accurate and efficient real-time tennis motion recognition method. Summary of the invention

[0004] In view of this, the embodiments of the present disclosure provide a real-time tennis action recognition method, device, equipment and medium, which at least partially solve the problem in the prior art that a large number of training samples are required and the recognition efficiency and accuracy are poor.

[0005] In a first aspect, an embodiment of the present disclosure provides a real-time tennis action recognition method, comprising:

[0006] Use Openpose to identify the 2D coordinates of multiple joint points in each frame of the target video containing the moving person;

[0007] Taking the joint points corresponding to the midpoints of the two hips of the athlete as the coordinate origin, normalizing the two-dimensional coordinates of all the joint points to obtain scaled joint point coordinates;

[0008] Identify the sub-action type corresponding to the coordinates of the scaling joint points in each frame according to the k-nearest neighbor algorithm and obtain a key frame corresponding to each sub-action type;

[0009] Calculating the angle value of the specified joint in each of the key frames;

[0010] When all of the angle values ​​are within the preset range corresponding to the sub-action, the sub-action is determined to be standard.

[0011] According to a specific implementation of the embodiment of the present disclosure, the step of taking the joint point corresponding to the midpoint of the two hips of the athlete as the coordinate origin, normalizing the two-dimensional coordinates of all the joint points, and obtaining the scaled joint point coordinates includes:

[0012] The two-dimensional coordinates of each joint point are divided by the body size of the athlete to obtain the scaled joint point coordinates corresponding to each joint point.

[0013] According to a specific implementation of the embodiment of the present disclosure, before the step of dividing the two-dimensional coordinates of each joint point by the body size of the athlete to obtain the scaled joint point coordinates corresponding to each joint point, the method further includes:

[0014] Calculate the center point of the joint points corresponding to the athlete, and use the center point as the coordinate origin;

[0015] Calculating the mean between the joint points of the left shoulder and the right shoulder of the athlete, and calculating the Euclidean distance between the mean and the coordinate origin as the minimum body size;

[0016] Calculate the maximum distance between each joint point and the coordinate origin as the maximum size of the body;

[0017] The body size is calculated according to the minimum body size and the maximum body size.

[0018] According to a specific implementation of an embodiment of the present disclosure, the step of identifying the sub-action type corresponding to the scaling joint point coordinates in each frame according to the k-nearest neighbor algorithm and obtaining a key frame corresponding to each sub-action type includes:

[0019] According to the scaled joint point coordinates in each frame, the distance between the joints and the body distortion direction are defined, and a feature vector is extracted;

[0020] The k-nearest neighbor algorithm is used to search and compare the feature vector of each frame with the sample vector corresponding to the sample action type in turn, so as to obtain the sub-action type corresponding to the coordinates of the scaling joint point in each frame;

[0021] The frame corresponding to each sub-action type is used as the key frame.

[0022] According to a specific implementation of the embodiment of the present disclosure, before the step of using the k-nearest neighbor algorithm to sequentially search and compare the feature vector of each frame with the sample vector corresponding to the sample action to obtain the sub-action type corresponding to the coordinates of the scaling joint point in each frame, the method further includes:

[0023] The maximum distance between the feature vector of the current frame and the sample vector is calculated and eliminated.

[0024] According to a specific implementation of an embodiment of the present disclosure, the step of using the k-nearest neighbor algorithm to sequentially search and compare the feature vector of each frame with the sample vector corresponding to the sample action to obtain the sub-action type corresponding to the coordinates of the scaling joint point in each frame includes:

[0025] According to the k-nearest neighbor algorithm, the distances between the feature vector and the sample vectors corresponding to the plurality of sample actions are respectively calculated, and the probability that the scaled joint point coordinates of each frame belong to each sample action type is obtained as a recognition result;

[0026] Smoothing all the recognition results in turn to obtain an exponential moving average;

[0027] When the exponential moving average is greater than a threshold, the sub-action type corresponding to the current frame is identified as the sample action type and subsequent frames are identified as the same sub-action type until the exponential moving average is less than the threshold.

[0028] In a second aspect, the present disclosure provides a real-time tennis motion recognition device, comprising:

[0029] A recognition module is used to use Openpose to recognize the two-dimensional coordinates of multiple joint points in each frame of a target video containing a moving person;

[0030] A scaling module, used to normalize the two-dimensional coordinates of all the joint points with the joint points corresponding to the midpoints of the two hips of the athlete as the coordinate origin, to obtain scaled joint point coordinates;

[0031] A classification module, used for identifying the sub-action type corresponding to the coordinates of the scaling joint points in each frame according to a k-nearest neighbor algorithm and obtaining a key frame corresponding to each sub-action type;

[0032] A calculation module, used for calculating the angle value of a specified joint in each of the key frames;

[0033] The judgment module is used to judge that the sub-action is standard when all the angle values ​​are within the preset range corresponding to the sub-action.

[0034] In a third aspect, an embodiment of the present disclosure further provides an electronic device, the electronic device comprising:

[0035] at least one processor; and,

[0036] a memory communicatively connected to the at least one processor; wherein,

[0037] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the real-time tennis action recognition method in the aforementioned first aspect or any implementation of the first aspect.

[0038] In a fourth aspect, an embodiment of the present disclosure further provides a non-transitory computer-readable storage medium, which stores computer instructions, and the computer instructions are used to enable the computer to execute the real-time tennis action recognition method in the aforementioned first aspect or any implementation of the first aspect.

[0039] In a fifth aspect, an embodiment of the present disclosure further provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer executes the real-time tennis action recognition method in the aforementioned first aspect or any implementation of the first aspect.

[0040] The real-time tennis action recognition scheme in the disclosed embodiment includes: using OpenPose to identify the two-dimensional coordinates of multiple joint points in each frame of a target video containing an athlete; taking the joint points corresponding to the midpoints of the two hips of the athlete as the coordinate origin, normalizing the two-dimensional coordinates of all the joint points to obtain scaled joint point coordinates; identifying the sub-action type corresponding to the scaled joint point coordinates in each frame according to the k-nearest neighbor algorithm and obtaining the key frame corresponding to each sub-action type; calculating the angle value of a specified joint in each key frame; and determining that the sub-action is standard when all the angle values ​​are within the preset range corresponding to the sub-action.

[0041] The beneficial effects of the embodiments of the present disclosure are as follows: through the scheme of the present disclosure, the real-time tennis action recognition algorithm based on OpenPose is used to standardize the identified joint point coordinates, and then the k-nearest neighbor method is used to identify the action to determine whether the specific action is standard, thereby improving the efficiency, accuracy and real-time performance of the recognition. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0043] Figure 1 A flowchart of a real-time tennis motion recognition method provided by an embodiment of the present disclosure;

[0044] Figure 2 A schematic diagram of human joints provided in an embodiment of the present disclosure;

[0045] Figure 3 A schematic diagram of the overall process of a real-time tennis motion recognition method provided by an embodiment of the present disclosure;

[0046] Figure 4 A schematic diagram of the structure of a real-time tennis motion recognition device provided by an embodiment of the present disclosure;

[0047] Figure 5 A schematic diagram of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0048] The embodiments of the present disclosure are described in detail below with reference to the accompanying drawings.

[0049] The following describes the embodiments of the present disclosure through specific examples, and those skilled in the art can easily understand other advantages and effects of the present disclosure from the contents disclosed in this specification. Obviously, the described embodiments are only a part of the embodiments of the present disclosure, rather than all of the embodiments. The present disclosure can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present disclosure. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present disclosure.

[0050] It should be noted that various aspects of the embodiments within the scope of the appended claims are described below. It should be apparent that the aspects described herein may be embodied in a wide variety of forms, and any specific structure and / or function described herein is merely illustrative. Based on the present disclosure, it should be understood by those skilled in the art that an aspect described herein may be implemented independently of any other aspect, and two or more of these aspects may be combined in various ways. For example, any number of aspects described herein may be used to implement the device and / or practice the method. In addition, other structures and / or functionalities other than one or more of the aspects described herein may be used to implement this device and / or practice this method.

[0051] It should also be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present disclosure. The drawings only show components related to the present disclosure rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed arbitrarily, and the component layout may also be more complicated.

[0052] Additionally, in the following description, specific details are provided to facilitate a thorough understanding of the examples. However, it will be understood by those skilled in the art that the aspects described may be practiced without these specific details.

[0053] The disclosed embodiments provide a real-time tennis motion recognition method, which can be applied to tennis motion recognition processes in physical examinations, sports training and other scenarios.

[0054] See also Figure 1 , is a flow chart of a real-time tennis motion recognition method provided by an embodiment of the present disclosure. Figure 1 As shown, the method mainly comprises the following steps:

[0055] S101, using Openpose to identify the two-dimensional coordinates of multiple joint points in each frame of a target video containing a moving person;

[0056] In the specific implementation, taking the serve action as an example, we can first use openpose to process the target video containing the sports personnel, the main joint points, and obtain the two-dimensional coordinates of 25 joint points. Figure 2 As shown, each frame M={m1,m2,…,m i The joint point coordinates N = {n1, n2, ..., n 25}.

[0057] S102, taking the joint points corresponding to the midpoints of the two hips of the athlete as the coordinate origin, normalizing the two-dimensional coordinates of all the joint points to obtain scaled joint point coordinates;

[0058] On the basis of the above embodiment, the step S102, taking the joint point corresponding to the midpoint of the two hips of the athlete as the coordinate origin, normalizing the two-dimensional coordinates of all the joint points to obtain the scaled joint point coordinates, includes:

[0059] The two-dimensional coordinates of each joint point are divided by the body size of the athlete to obtain the scaled joint point coordinates corresponding to each joint point.

[0060] Furthermore, before the step of dividing the two-dimensional coordinates of each joint point by the body size of the athlete to obtain the scaled joint point coordinates corresponding to each joint point, the method further includes:

[0061] Calculate the center point of the joint points corresponding to the athlete, and use the center point as the coordinate origin;

[0062] Calculating the mean between the joint points of the left shoulder and the right shoulder of the athlete, and calculating the Euclidean distance between the mean and the coordinate origin as the minimum body size;

[0063] Calculate the maximum distance between each joint point and the coordinate origin as the maximum size of the body;

[0064] The body size is calculated according to the minimum body size and the maximum body size.

[0065] In the specific implementation, considering that the action recognition method is heavily dependent on distance, all joint point coordinates are converted to the same size during normalization. The specific calculation method is to divide each joint coordinate by the body size body size , and get the standardized joint coordinates. Figure 2 As shown in the figure, according to the characteristics of each joint of the human body, the middle of the hip, that is, joint 8, is the center of the human body. However, during the movement of a person, the body will tilt and rotate. The mean of the left and right hips can better represent the center of the human body. The calculation method is as shown in formula 1, and the mean of the center point of the human body (n 9,12 ).

[0066]

[0067] In different videos, the camera height is different, and the origin of the obtained human joint points needs to be adjusted. Specifically, the human center point mean(n 9,12 ) is the coordinate origin, and the coordinates of each joint are adjusted.

[0068] For example, the mean value between the joint points of the left shoulder and the right shoulder of the athlete can be calculated, and the Euclidean distance between the mean value and the coordinate origin can be calculated as the minimum body size, specifically, the torso size minS, that is, the distance from the shoulder to the hip of the human body. The average value of the left shoulder n2 and the right shoulder n5 is used to calculate mean(n 2,5 ), and then calculate the mean of the left and right shoulders mean(n 2,5 ) minus the center point mean(n 9,12 ), as shown in Formula 2:

[0069]

[0070] Then, the maximum distance between each joint point and the coordinate origin is calculated as the maximum size of the body, as shown in Formula 3:

[0071]

[0072] The body size represents the length that best represents the human body, and is obtained by the minimum body size and the maximum body size. The calculation method is as shown in Formula 4, where λ is the adjustment coefficient.

[0073] body size =max(maxS,λ·minS) (4)

[0074] After obtaining the body size, the two-dimensional coordinates of each joint point are divided by the body size of the athlete to obtain the scaled joint point coordinates corresponding to each joint point.

[0075] S103, identifying the sub-action type corresponding to the scaling joint point coordinates in each frame according to a k-nearest neighbor algorithm and obtaining a key frame corresponding to each sub-action type;

[0076] Based on the above embodiment, the step S103, identifying the sub-action type corresponding to the scaling joint point coordinates in each frame according to the k-nearest neighbor algorithm and obtaining the key frame corresponding to each sub-action type, includes:

[0077] According to the scaled joint point coordinates in each frame, the distance between the joints and the body distortion direction are defined, and a feature vector is extracted;

[0078] The k-nearest neighbor algorithm is used to search and compare the feature vector of each frame with the sample vector corresponding to the sample action type in turn, so as to obtain the sub-action type corresponding to the coordinates of the scaling joint point in each frame;

[0079] The frame corresponding to each sub-action type is used as the key frame.

[0080] Optionally, before the step of using the k-nearest neighbor algorithm to sequentially search and compare the feature vector of each frame with the sample vector corresponding to the sample action to obtain the sub-action type corresponding to the coordinates of the scaling joint point in each frame, the method further includes:

[0081] The maximum distance between the feature vector of the current frame and the sample vector is calculated and eliminated.

[0082] Furthermore, the step of using the k-nearest neighbor algorithm to sequentially search and compare the feature vector of each frame with the sample vector corresponding to the sample action to obtain the sub-action type corresponding to the coordinates of the scaling joint point in each frame includes:

[0083] According to the k-nearest neighbor algorithm, the distances between the feature vector and the sample vectors corresponding to the plurality of sample actions are respectively calculated, and the probability that the scaled joint point coordinates of each frame belong to each sample action type is obtained as a recognition result;

[0084] Smoothing all the recognition results in turn to obtain an exponential moving average;

[0085] When the exponential moving average is greater than a threshold, the sub-action type corresponding to the current frame is identified as the sample action type and subsequent frames are identified as the same sub-action type until the exponential moving average is less than the threshold.

[0086] For example, according to the guidance of the tennis coach and the specific action characteristics, the present invention has made a specific division of tennis actions. It is divided into six categories, including serving, forehand, backhand, high-pressure ball, slice and net volley, and there are huge differences between these actions. Taking the serving action as an example, it is decomposed into 3 sub-actions: starting action, racket delivery, and hitting. Each sub-action has its specific requirements. For example, racket delivery is the action of the athlete throwing the ball upward and preparing to hit the ball, which is subdivided into sideways racket delivery, left-handed delivery, and hip thrust before hitting the ball. The hitting action is the action of the athlete hitting the ball. The rules can be summarized as holding the racket high with the right hand and hitting the tennis ball vertically with the body. According to these sub-actions, corresponding sample actions and sample vectors can be set, and rules are set for each sub-action to facilitate subsequent angle value calculations.

[0087] Intuitively, the distance between the joints and the body twist direction represent the characteristic vector pose of a movement posture. m .

[0088] Distance between joints: Among the 25 joints, the distance between some joints can represent the type and amplitude of movement during exercise, and the distance between multiple joints can roughly represent the athlete's posture. Because tennis movements are relatively complex, a total of 56 pairs of joint distances are defined, such as shoulder to elbow, elbow to wrist, hip to ankle, etc. These distances can distinguish different tennis movements.

[0089] Body twist direction: The difference in angles means that the left and right directions of the body are inconsistent, and such movements are also very different. The distance from the average of the left wrist and left ankle to the left hip is defined as the body bending direction.

[0090] K nearest neighbor algorithm: This algorithm mainly judges whether they belong to the same category based on the distance. Given the training data, find the first k closest data. In the context of the present invention, it is mainly based on the distance from the template posture to determine which category the current posture belongs to. Before calculation, some abnormal values ​​need to be processed according to the characteristics of human joints. For some postures, although the overall joint distance is close to the template distance, there will be some joint bending directions that are inconsistent. Such postures cannot be identified as the same category as the template posture. Those with closer distances and basically consistent joint bending directions can be identified as belonging to the same category. The maximum distance and average distance are defined below.

[0091] In specific implementation, after obtaining the coordinates of the scaling joint points, the distance between the joints and the body distortion direction can be defined according to the coordinates of the scaling joint points in each frame, and the feature vector pose can be extracted. m , use the k nearest neighbor method to search the current frame. In the first search, filter out the outliers according to the maximum distance maxD, where the maximum distance is the maximum distance between the feature vector and the sample vector, calculated as formula 5, pose t It is a pre-selected template pose, representing a type of action. m The current pose is considered to be basically the same as the template in terms of the distance between joints and the bending direction, but the overall left and right are opposite. This mirror pose is defined as pose m' ω is the weight of the coordinate axis. When calculating, each coordinate axis will be assigned a different weight. Finally, the current pose is calculated. m Or flip pose m' With template pose t The value with the largest difference.

[0092] maxD=min(max(|pose t -pose m |*ω),max(|pose t -pose m' |*ω)),m∈M (5)

[0093] The second time, according to the average distance meanD, the posture closest to the template posture is found in the results of the first search, and the sub-action type corresponding to the coordinates of the scaling joint point in each frame is obtained and the frame corresponding to each sub-action type is used as the key frame, wherein the average distance is the minimum value of the template posture mean, as shown in Formula 6

[0094] meanD=min(mean(|pose t -pose m |*ω),mean(|pose t -pose m' |*ω)),m∈M (6).

[0095] At the same time, the current pose is obtained through the k-nearest neighbor algorithm mThe distance from each template posture is converted into the probability of belonging to a certain category, and the recognition result is judged by the set threshold. Considering that the recognized joint coordinates may not be accurate in some frames, and when people are exercising, there will be no sudden large changes in the joints. In order to prevent the influence of joint recognition errors on action recognition, it is necessary to smooth it, and apply the exponential moving average (EMA) to deal with the noise generated during recognition. The exponential moving average is an approximate averaging method and a trend indicator that can eliminate the influence of noise and give more accurate results. The average confidence of the recognized action is obtained through formula 7.

[0096] C t =β·C t-1 +(1-β)·θ t (7)

[0097] In formula 5, C t represents the average confidence level of the recognition of the previous t frames as a certain action (C0=0), β is the weighted value, generally set to 0.9-0.999, θ t is the confidence of identifying an action in the tth frame.

[0098] When the exponential moving average is greater than a threshold, the sub-action type corresponding to the current frame is identified as the sample action type and subsequent frames are identified as the same sub-action type until the exponential moving average is less than the threshold. It is then considered that it no longer belongs to the action, and all frames during this period are taken as the key frames.

[0099] It should be noted that after obtaining the exponential moving average, F1 and accuracy Acc can also be used to evaluate the recognition results. The calculation method of F1 is as shown in Formula 8, where P is the precision and R is the recall. The calculation method of accuracy Acc is as shown in Formula 9, where TP is predicted to be a true class and is actually a true class; FP is predicted to be a false class and is actually a true class; TN is predicted to be a true class and is actually a false class; FN is predicted to be a false class and is actually a false class.

[0100]

[0101]

[0102] S104, calculating the angle value of a specified joint in each of the key frames;

[0103] After the action is recognized, the angle of the specified joint in each key frame can be calculated, where the joint point n i With joint point n j and the line between them forms a vector V i,j (x i,j ,y i,j), as shown in Formula 10, and the method for calculating the angle between two vectors is shown in Formula 11.

[0104] V i,j (x i,j ,y i,j )=(x i -x j ,y i -y j ) (10)

[0105]

[0106] S105: When all the angle values ​​are within the preset range corresponding to the sub-action, the sub-action is determined to be standard.

[0107] During specific implementation, the action rules can be defined with the guidance of professionals to obtain the preset range specified for each sub-action. After calculating the angle value of the joint specified in each key frame, all the angle values ​​corresponding to each sub-action need to be compared with the preset range corresponding to the sub-action. When all the angle values ​​are within the preset range corresponding to the sub-action, the sub-action is judged to be standard. If one or more frames are not within the preset range corresponding to the sub-action, the sub-action is judged to be non-standard, and a specific detection result can be generated for subsequent action guidance.

[0108] The following will analyze the algorithm from the perspective of real-time performance and accuracy in conjunction with a specific embodiment. The specific processing flow is as follows: Figure 3 shown.

[0109] Real-time analysis: The algorithm was run on the server, and the video captured by the camera in real time was input, with a resolution of 1920*896 and a frame rate of 30FPS. Ten videos of different categories and different video lengths were selected, and run using Openpose and the action recognition method based on Openpose. The measured results showed that when processing the video, it was more time-consuming to use Openpose to obtain the coordinates of the human joint points, with a frame rate of about 18.7FPS. The frame rate of using the k-nearest neighbor recognition results plus the joint angle evaluation was 13.5FPS, which basically met the real-time requirements.

[0110] Accuracy analysis: This algorithm mainly identifies the category of the athlete's action in the video and evaluates whether it is standard according to the rules. Different measurement methods will get different evaluation scores, and such comparison is meaningless. Therefore, we verify the accuracy of the algorithm by comparing the recognition results with the results given by the tennis coach. Table 1 shows the actual category and the recognition result table. Compared with the actual category, the recognized result category is basically correct, but the corresponding frame number range of the result is large. Considering the temporal sequence of the actions in the video and the continuity of the athlete's actions, the result basically meets the requirements.

[0111] Table 1. Serving action recognition results

[0112]

[0113]

[0114] Among the six actions, 2-4 videos are taken for each action, and the corresponding action is performed 4-7 times in each video. The F1 and accuracy Acc of the recognized sub-actions are calculated. The results are shown in Table 2. The final F1 value reaches 0.90 and the accuracy Acc is 0.84, which is at a relatively high level and can achieve accurate action recognition.

[0115] Table 2 F1 value and accuracy of each action

[0116] category F1 Acc Serve 0.9607 0.9276 Backhand 0.7434 0.6706 High pressure ball 0.9006 0.8461 Net volley 0.7952 0.7264 Slice 0.7151 0.6979 Forehand 0.8793 0.8214 comprehensive 0.9000 0.8410

[0117] The real-time tennis action recognition method provided in this embodiment standardizes the recognized joint point coordinates through a real-time tennis action recognition algorithm based on OpenPose, and then uses the k-nearest neighbor method to recognize the action to determine whether the specific action is standard, thereby improving the efficiency, accuracy and real-time performance of recognition.

[0118] Corresponding to the above method embodiment, see Figure 4 The embodiment of the present disclosure further provides a real-time tennis action recognition device 40, comprising:

[0119] The recognition module 401 is used to recognize the two-dimensional coordinates of multiple joint points in each frame of the target video containing the moving person by using OpenPose;

[0120] A scaling module 402 is used to normalize the two-dimensional coordinates of all the joint points with the joint points corresponding to the midpoints of the two hips of the athlete as the coordinate origin to obtain scaled joint point coordinates;

[0121] A classification module 403 is used to identify the sub-action type corresponding to the scaling joint point coordinates in each frame according to a k-nearest neighbor algorithm and obtain a key frame corresponding to each sub-action type;

[0122] A calculation module 404 is used to calculate the angle value of a specified joint in each of the key frames;

[0123] The judgment module 405 is used to judge that the sub-action is standard when all the angle values ​​are within the preset range corresponding to the sub-action.

[0124] Figure 4 The device shown can correspondingly execute the contents of the above method embodiment. For the parts not described in detail in this embodiment, refer to the contents recorded in the above method embodiment and will not be repeated here.

[0125] See also Figure 5 The embodiment of the present disclosure further provides an electronic device 50, which includes: at least one processor and a memory connected to the at least one processor. The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can perform the real-time tennis motion recognition method in the above method embodiment.

[0126] The embodiment of the present disclosure also provides a non-transitory computer-readable storage medium, which stores computer instructions, and the computer instructions are used to enable the computer to execute the real-time tennis action recognition method in the aforementioned method embodiment.

[0127] The embodiment of the present disclosure also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium. The computer program includes program instructions. When the program instructions are executed by a computer, the computer executes the real-time tennis action recognition method in the aforementioned method embodiment.

[0128] Reference below Figure 5 , which shows a schematic diagram of the structure of an electronic device 50 suitable for implementing the embodiment of the present disclosure. The electronic device in the embodiment of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 5 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 disclosure.

[0129] like Figure 5As shown, the electronic device 50 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage device 508 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the electronic device 50 are also stored. The processing device 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.

[0130] Typically, the following devices may be connected to the I / O interface 505: input devices 506 including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; output devices 507 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 508 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 509. The communication device 509 may allow the electronic device 50 to communicate with other devices wirelessly or by wire to exchange data. Although the electronic device 50 with various devices is shown in the figure, it should be understood that it is not required to implement or have all the devices shown. More or fewer devices may be implemented or have alternatively.

[0131] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains 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 device 509, or installed from a storage device 508, or installed from a ROM 502. When the computer program is executed by the processing device 501, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.

[0132] It should be noted that the computer-readable medium disclosed above 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 or 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 disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program 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 suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0133] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.

[0134] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device can execute the relevant steps of the method embodiment.

[0135] Alternatively, the computer-readable medium carries one or more programs, and when the one or more programs are executed by the electronic device, the electronic device can perform the relevant steps of the method embodiment.

[0136] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages, or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).

[0137] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the 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 implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square 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 square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart 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.

[0138] The units involved in the embodiments described in the present disclosure may be implemented by software or by hardware.

[0139] It should be understood that various parts of the present disclosure may be implemented in hardware, software, firmware or a combination thereof.

[0140] The above is only a specific implementation of the present disclosure, but the protection scope of the present disclosure is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present disclosure should be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be based on the protection scope of the claims.

Claims

1. A real-time tennis action recognition method, characterized in that: include: Use Openpose to identify the 2D coordinates of multiple joint points in each frame of the target video containing the moving person; Taking the joint points corresponding to the midpoints of the two hips of the athlete as the coordinate origin, normalizing the two-dimensional coordinates of all the joint points to obtain scaled joint point coordinates; The step of taking the joint points corresponding to the midpoints of the two hips of the athlete as the coordinate origin and normalizing the two-dimensional coordinates of all the joint points to obtain the scaled joint point coordinates includes: Dividing the two-dimensional coordinates of each joint point by the body size of the athlete to obtain scaled joint point coordinates corresponding to each joint point; Before the step of dividing the two-dimensional coordinates of each joint point by the body size of the athlete to obtain the scaled joint point coordinates corresponding to each joint point, the method further includes: Calculate the center point of the joint points corresponding to the athlete, and use the center point as the coordinate origin; Calculating the mean between the joint points of the left shoulder and the right shoulder of the athlete, and calculating the Euclidean distance between the mean and the coordinate origin as the minimum body size; Calculate the maximum distance between each joint point and the coordinate origin as the maximum size of the body; Calculate the body size according to the minimum body size and the maximum body size; Identify the sub-action type corresponding to the coordinates of the scaling joint points in each frame according to the k-nearest neighbor algorithm and obtain a key frame corresponding to each sub-action type; Calculating the angle value of the specified joint in each of the key frames; When all of the angle values ​​are within the preset range corresponding to the sub-action, the sub-action is determined to be standard.

2. The method according to claim 1, characterized in that The step of identifying the sub-action type corresponding to the coordinates of the scaling joint points in each frame according to the k-nearest neighbor algorithm and obtaining the key frame corresponding to each sub-action type includes: According to the scaled joint point coordinates in each frame, the distance between the joints and the body distortion direction are defined, and a feature vector is extracted; The k-nearest neighbor algorithm is used to search and compare the feature vector of each frame with the sample vector corresponding to the sample action type in turn, so as to obtain the sub-action type corresponding to the coordinates of the scaling joint point in each frame; The frame corresponding to each sub-action type is used as the key frame.

3. The method according to claim 2, characterized in that Before the step of using the k-nearest neighbor algorithm to sequentially search and compare the feature vector of each frame with the sample vector corresponding to the sample action to obtain the sub-action type corresponding to the coordinates of the scaling joint point in each frame, the method further includes: The maximum distance between the feature vector of the current frame and the sample vector is calculated and eliminated.

4. The method according to claim 2, characterized in that The step of using the k-nearest neighbor algorithm to search and compare the feature vector of each frame with the sample vector corresponding to the sample action in turn to obtain the sub-action type corresponding to the coordinates of the scaling joint point in each frame includes: According to the k-nearest neighbor algorithm, the distances between the feature vector and the sample vectors corresponding to the plurality of sample actions are respectively calculated, and the probability that the scaled joint point coordinates of each frame belong to each sample action type is obtained as a recognition result; Smoothing all the recognition results in turn to obtain an exponential moving average; When the exponential moving average is greater than a threshold, the sub-action type corresponding to the current frame is identified as the sample action type and subsequent frames are identified as the same sub-action type until the exponential moving average is less than the threshold.

5. A real-time tennis action recognition device, characterized in that: include: A recognition module is used to use Openpose to recognize the two-dimensional coordinates of multiple joint points in each frame of a target video containing a moving person; A scaling module, used to normalize the two-dimensional coordinates of all the joint points with the joint points corresponding to the midpoints of the two hips of the athlete as the coordinate origin, to obtain scaled joint point coordinates; The specific process of the scaling module includes: Dividing the two-dimensional coordinates of each joint point by the body size of the athlete to obtain scaled joint point coordinates corresponding to each joint point; The specific process of the scaling module also includes: Calculate the center point of the joint points corresponding to the athlete, and use the center point as the coordinate origin; Calculating the mean between the joint points of the left shoulder and the right shoulder of the athlete, and calculating the Euclidean distance between the mean and the coordinate origin as the minimum body size; Calculate the maximum distance between each joint point and the coordinate origin as the maximum size of the body; Calculate the body size according to the minimum body size and the maximum body size; A classification module, used for identifying the sub-action type corresponding to the coordinates of the scaling joint points in each frame according to a k-nearest neighbor algorithm and obtaining a key frame corresponding to each sub-action type; A calculation module, used for calculating the angle value of a specified joint in each of the key frames; The judgment module is used to judge that the sub-action is standard when all the angle values ​​are within the preset range corresponding to the sub-action.

6. An electronic device, characterized in that: The electronic device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the real-time tennis action recognition method according to any one of claims 1 to 4.

7. A non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable the computer to execute the real-time tennis action recognition method according to any one of claims 1 to 4.