A tennis action real-time biomechanics analysis system and method based on computer vision and pose estimation
Patent Information
- Application Number
- CN202611247238.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-17
- Publication Date
- 2026-10-13
AI Technical Summary
[0004]一、穿戴传感器动作捕捉方案(如Xsens MVN),依托惯性传感器采集运动参数,精度较高,但设备昂贵、穿戴繁琐,不适用于日常训练
[0053]另一方面,本发明提供了一种实现上述方法的网球动作智能分析系统以实现上述方法,包括:
Smart Images

Figure CN122906722A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of computer vision and sports biomechanics, and in particular to a real-time biomechanical analysis system and method for tennis movements based on computer vision and posture estimation. Background Technology
[0002] Human pose estimation is an important research area in computer vision, aiming to detect the location of key points on the human body from images or videos and build a skeleton model. Mainstream methods include bottom-up methods (such as OpenPose) and top-down methods (such as MediaPipe BlazePose). Among them, the top-down method is fast and accurate in single-person scenes, making it suitable for real-time applications.
[0003] Furthermore, in the field of sports training, existing technical solutions can be mainly categorized as follows:
[0004] I. Wearable sensor motion capture solutions (such as Xsens MVN) rely on inertial sensors to collect motion parameters, offering high accuracy, but the equipment is expensive and cumbersome to wear, making it unsuitable for daily training. II. Multi-camera optical motion capture solutions (such as Vicon) can achieve millimeter-level high-precision 3D motion reconstruction, but are costly, require dedicated facilities and professional operation, and are only suitable for top-level competitive training. III. Ordinary video image analysis solutions use ordinary cameras combined with depth algorithms to perform motion analysis, such as Chinese patent CN201910981141.9, which relies on multiple cameras to collect images and combines traditional algorithms with a lightweight network to match motion databases to achieve motion standardization scoring. IV. Rule-based threshold evaluation solutions judge motion by setting normal ranges for joint angles, offering simplicity but a single evaluation dimension.
[0005] However, the existing technical solutions have the following shortcomings: (1) The evaluation granularity is coarse. The whole-frame image classification method can only give qualitative conclusions and cannot accurately analyze the quantitative aspects of specific joint angles, making it difficult to locate the specific parts and extent of movement defects; (2) The multi-camera solution has high hardware costs and complex deployment. It requires complex camera array installation and calibration processes, which are not suitable for individual users or small venues; (3) The standard movement library relies on manual 3D modeling, which cannot reflect the movement characteristics and individual differences of real athletes. Moreover, modeling is time-consuming and laborious, and it is difficult to extend to multiple sports; (4) There is a lack of temporal movement stage analysis. Only single-frame images are classified, without considering the continuous temporal characteristics of movement, and it cannot fully reflect the quality of movement; (5) The feedback form is singular. Fixed rule template matching is used, and there is a lack of personalized natural language guidance for individual characteristics; (6) There is a lack of training data management and long-term tracking capabilities, which cannot support the long-term development evaluation of athletes. Summary of the Invention
[0006] In view of the shortcomings of the prior art, the purpose of this invention is to provide a real-time biomechanical analysis system and method for tennis movements based on computer vision and posture estimation. The aim is to provide a low-cost, high-precision, time-seriesd, intelligent and traceable real-time biomechanical analysis solution for tennis movements, so as to solve at least one of the technical problems mentioned in the background art.
[0007] On the one hand, the present invention provides a tennis motion intelligent analysis method for implementing the above method, comprising the following steps:
[0008] S100: Acquire video frame data of tennis movements;
[0009] S200: Obtain the coordinates of 33 human body key points from the video frame;
[0010] S300: Calculate posture feature parameters based on the coordinates of the 33 key human body points. The posture feature parameters include 12 key joint angle values and 6 high-level posture feature values. The 12 key joints include the left and right elbow joints, left and right shoulder joints, left and right wrist joints, left and right hip joints, left and right knee joints, and left and right ankle joints. The 6 high-level posture feature values include head tilt angle, neck tilt angle, body tilt angle, shoulder tilt angle, hip tilt angle, and spinal curvature.
[0011] S400: Perform time-series smoothing on the posture feature parameters, derive motion analysis indicators based on continuous posture feature parameters, identify the current hitting pattern based on the motion analysis indicators, determine the corresponding motion phase division strategy based on the hitting pattern identification result, divide tennis motion into multiple continuous action phases, load the phase threshold configuration corresponding to the mode, output the phase identification result, calculate parameter deviation and generate an error list, and construct structured motion information in real time.
[0012] S500: Inputs structured motion information into a large language model for analysis and outputs multi-dimensional coaching feedback;
[0013] S600: The analysis results and attitude feature parameters are rendered and overlaid on the video frames and presented to the user in an interactive manner.
[0014] In a preferred embodiment, in step S300, the angle values θ of the 12 key joints... j The calculation formula is:
[0015] ;
[0016] in,
[0017] Let P be the vector pointing from the joint to the proximal end point. j P is the coordinate of the joint to be calculated.prox The coordinates of the proximal joint;
[0018] , Let P be the vector pointing from the joint to the far end. dist These are the coordinates of the distal joint.
[0019] In a preferred embodiment, in step S300, the calculation formulas for the six advanced attitude feature values are as follows:
[0020] The head tilt angle θ head tilt The calculation formula is:
[0021] ;
[0022] Where P5 and P2 are the coordinates of the left and right eyes, respectively. This represents the difference in coordinates between the two eyes in the vertical direction. The actual pixel distance between the two eyes, ê h It is a unit vector in the horizontal direction. Ideal range for head tilt angle: ;
[0023] The neck tilt angle θ neck The calculation formula is:
[0024] ;
[0025] Among them, P ear mid The midpoint of the left and right ear coordinates is calculated using the following formula: P8 and P7 are the coordinates of the left and right ears; P sho mid The midpoint of the left and right shoulder coordinates is calculated using the following formula: P 12 P 11 The coordinates of the left and right shoulders; ê v Let be the unit vector in the vertical direction. Ideal range for neck tilt angle: ;
[0026] The body tilt angle θ body lean The calculation formula is:
[0027] ;
[0028] Among them, P hip mid The midpoint of the left and right hip coordinates is calculated using the following formula: P 24 P 23 Left and right hip coordinates; ideal range for body tilt angle: ;
[0029] The shoulder tilt angle θsho tilt The calculation formula is:
[0030] ;
[0031] in, Vertical coordinate difference between the two shoulders The actual pixel distance between the shoulders; the ideal range for the shoulder tilt angle: ;
[0032] The hip tilt angle θ hip tilt The calculation formula is:
[0033] ;
[0034] in, Vertical coordinate difference between the two hips The actual pixel distance between the two hips, and the ideal range of hip tilt angle: ;
[0035] The formula for calculating the spinal curvature k is:
[0036] ;
[0037] Where A is the midpoint P of the shoulder. sho mid B is the midpoint of the hip P. hip mid C is the midpoint of the torso, and the formula for calculating C is: Ideal range of spinal curvature: .
[0038] In a preferred embodiment, in step S400, identifying the current hitting mode includes: first identifying whether the dominant arm of the action is the right arm or the left arm, determining the action type as a serve or a hit based on the dominant arm, and if it is a hit, comprehensively judging the hitting mode as a forehand hit, a backhand hit, or a serve mode based on the dominant arm, the torso twisting direction, and the wrist movement direction.
[0039] In a preferred embodiment, in step S400, determining the corresponding motion phase segmentation strategy based on the ball-hitting pattern recognition result, and dividing the tennis motion into multiple consecutive action phases, includes:
[0040] When a forehand or backhand pattern is identified, a shot segmentation strategy is adopted, dividing the tennis motion into: preparation phase, backswing phase, acceleration phase, hitting phase, and follow-through phase.
[0041] When a serve pattern is identified, a serve segmentation strategy is adopted, which divides the hitting action into: preparation phase, ball toss phase, acceleration phase, hitting phase, and follow-through phase.
[0042] Furthermore, the division of action phases according to the hitting strategy is based on a comprehensive judgment of one or more characteristic parameters and changes of the elbow joint, shoulder joint, wrist joint, knee joint, and body tilt angle.
[0043] Furthermore, when the movement employs a shot-based strategy, the corresponding phase transition conditions are as follows:
[0044] Preparation - Lead-off: The shoulder rotation angular velocity is greater than the first preset threshold and the elbow joint angle is less than the first preset angle. The transition is triggered after N1 consecutive frames.
[0045] Lead-up - Acceleration: The shoulder rotation direction is reversed and the rotational angular velocity is greater than the second preset threshold. At the same time, the knee joint angle increases. After N2 consecutive frames, the transition is triggered.
[0046] Acceleration-Striking: The wrist movement speed reaches a preset percentage of the local maximum value and the elbow joint angle is greater than or equal to the second preset angle. The transition is triggered after N3 consecutive frames.
[0047] Hit-follow-swing: The wrist movement speed decreases and the elbow joint angle decreases. The transition is triggered after N4 consecutive frames.
[0048] Follow-up - Preparation: The elbow joint angle change rate is less than the third preset threshold, the body tilt angle is less than the fourth preset threshold, and the angles of both knee joints return to the preset angle range. After N5 consecutive frames, the transfer is triggered.
[0049] The finite state machine is equipped with at least one of the following fault tolerance mechanisms: each stage transition is configured with a minimum dwell time N. m State transition is prohibited when the number of resident frames is insufficient; a timeout protection frame number N is set for each stage. t If the duration of a certain stage exceeds N t When this happens, the state machine automatically resets to S0.
[0050] Furthermore, the N1, N 2、 The values of N3, N4, and N5 range from 2 to 5 frames. m The range of values for: N t The range of values for: .
[0051] As a preferred implementation, the method also includes a step of calculating statistical indicators: after each complete action phase cycle, the number of hits is counted, and five statistical indicators of posture characteristic parameters, namely the minimum, maximum, average, standard deviation and current value, are calculated.
[0052] Compared with existing methods and technologies, the technical solution adopted in this invention has the following advantages:
[0053] On the other hand, the present invention provides a tennis motion intelligent analysis system for implementing the above method, comprising:
[0054] Video Input Module: Supports two input modes: real-time acquisition from a monocular USB camera and local video files. In one implementation, the video input module can be a capture camera (default USB camera) from a cross-platform computer vision library, with the acquisition resolution set and image data output frame-by-frame in BGR color channel format. In another implementation, the video input module can also read locally stored video files, decode them into a continuous sequence of image frames to adapt to the input specifications of the pose estimation module.
[0055] Pose estimation module: Encapsulates the MediaPipe Pose Landmarker model to perform pose estimation inference on each input frame of image, outputting the 2D normalized coordinates (x, y) and 3D world coordinates (world_x, world_y, world_z) of 33 human keypoints, as well as the visibility and existence scores of each keypoint.
[0056] Biomechanical calculation module: used to calculate posture characteristic parameters based on the coordinates of key points on the human body.
[0057] Movement phase recognition module: Based on the built-in motion analysis strategy, it identifies the hitting pattern and action phase according to the changes in posture feature parameters. It adopts a finite state machine recognition algorithm to divide tennis motion into multiple action phases. Each phase is configured with independent threshold conditions to construct structured motion information.
[0058] AI Intelligent Analysis Module: This module encapsulates a dual-channel LLM client, enabling intelligent analysis of structured motion information and generation of coach feedback. The large language model includes, but is not limited to, a local visual model and the DeepSeek remote text API. In one implementation, the local visual model uses a multimodal model that supports visual understanding, such as... The feedback includes screenshots of incorrect movements and structured motion information. In another implementation, the DeepSeek remote text API uses the deepseek-chat model to construct plain text prompts from the structured motion information, outputting structured professional coaching commentary.
[0059] Visual rendering module: Renders the calculation and analysis results of the motion process into color-coded annotated images and overlays them onto the video frames. The annotated images include human skeleton lines, angle annotations, statistical summaries, and coach comments.
[0060] Output Display Module: A web-based interactive interface is built on the Streamlit framework, presenting a three-column UI layout: the first column (col1) displays a skeleton view overlaid on the original image frame; the second column (col2) displays the live feed with overlaid angle numerical annotations and statistical summaries; the third column (col3) displays the AI coach's commentary panel, specifically showcasing the four-dimensional structured analysis text. Specifically, the web interface provides filtering options such as grouping by date, filtering by shot type, displaying only unanalyzed records, and switching between LLM channels / models. It also supports deleting records and triggering AI re-analysis.
[0061] The data persistence module is used to implement read and write operations for index files (JSON) and screenshot files (JPEG), complete historical record query and maintenance, disk usage statistics, and persistent storage and loading of user configuration files. The index file stores training data records, with each record containing a unique identifier, timestamp, date, hitting mode, action stage, joint angle snapshot, posture index, error list, screenshot file path, and AI analysis text. The user configuration file stores large model configuration parameters, including at least the service provider type, model name, interface address, interface key, and timeout duration. The user configuration file is automatically loaded upon system startup.
[0062] As a preferred approach, the system architecture adopts a layered architecture and strategy pattern design. It achieves modular decoupling by defining three standard strategy interfaces: the PoseEstimator abstract base class defines a standardized pose estimation interface, uniformly declaring four core abstract methods: initialization, single-frame image processing, system resource release, and key point name acquisition, supporting seamless switching between multiple pose estimation backends such as MediaPipe, YOLO-Pose, and OpenPose; LLMClient supports switching between multiple AI providers such as Ollama and DeepSeek; and the motion analysis strategy can be extended to other racket sports such as badminton, golf, and table tennis.
[0063] Compared with existing technical solutions, the technical solution adopted in this invention has the following advantages:
[0064] 1. This invention achieves refined and quantitative posture detection for tennis movements, significantly improving the accuracy of motion analysis. Based on MediaPipe Pose Landmarker, it extracts 33 key points on the human body and combines a three-point normal vector dot product algorithm to solve for 12 joint angle data and 6 high-level posture feature parameters in real time. This breaks through the limitations of traditional tennis motion evaluation, which relies solely on visual observation and qualitative judgment, achieving a technological leap from subjective qualitative assessment to objective and precise quantitative analysis. Simultaneously, it refines the granularity of motion analysis from the traditional overall image level to the human joint point level, accurately capturing subtle posture deviations and providing high-precision data support for subsequent motion correction, stage recognition, and intelligent commentary.
[0065] 2. This invention enables full-process temporal analysis of tennis strokes, effectively eliminating detection noise and filling a gap in dynamic analysis technology. It introduces a sliding window and temporal smoothing algorithm to effectively filter out noise from single-frame keypoint detection, improving the temporal stability and accuracy of posture data. Simultaneously, a five-stage state machine model is constructed to perform stage-by-stage temporal segmentation and continuous identification of continuous swing actions such as tennis serves and forehand / backhand ground shots. This accurately detects deep-seated temporal problems such as abnormalities in action stages and discontinuous stage transitions, overcoming the limitations of existing technologies that can only determine posture in a single frame and cannot achieve full-process dynamic analysis. This invention comprehensively covers the full-process temporal characteristics of tennis strokes.
[0066] 3. Leveraging a large language model to achieve in-depth, personalized intelligent teaching feedback, enhancing the value of training guidance. This invention inputs structured, standardized motion data such as joint angles, posture features, movement stages, and error types into a large language model. Relying on the model's semantic understanding and reasoning capabilities, it generates multi-dimensional, targeted, and professionally in-depth natural language feedback content. This overcomes the limitations of traditional devices that only output data without teaching guidance capabilities, providing trainees with personalized movement correction suggestions and training optimization plans, significantly improving the effectiveness of intelligent teaching.
[0067] 4. Low hardware deployment threshold and strong adaptability, significantly reducing implementation costs. This invention uses only a regular monocular USB camera or a mobile phone built-in camera to complete RGB video acquisition, and relies on the BlazePose model to realize monocular image key point analysis. It does not require multi-camera arrays, multi-view geometric reconstruction, or complex equipment synchronization control devices. The hardware deployment cost is only 1 / 10 to 1 / 20 of the traditional professional motion analysis solution, which greatly reduces the threshold for equipment deployment and application, and facilitates large-scale popularization and application in civilian scenarios and daily training scenarios.
[0068] 5. Employing a lightweight file persistence architecture, this invention enables traceable, verifiable, and long-term analyzable training data. It utilizes a lightweight file storage scheme combining JSON index files and JPEG screenshots to completely preserve posture snapshots, motion parameters, analysis information, and image data for each erroneous movement record, achieving structured and persistent storage of training data. Simultaneously, the system supports historical data management functions such as grouping by date, filtering by shot type, filtering unanalyzed records, record deletion, and re-analysis. This allows for long-term tracking of athletes' movement improvement trends and training progress trajectories, providing comprehensive data support for long-term systematic training evaluation. Attached Figure Description
[0069] Figure 1 This is a schematic diagram of the architecture of a real-time biomechanical analysis system for tennis movements based on computer vision and posture estimation, according to the present invention.
[0070] Figure 2 This is a flowchart of a real-time biomechanical analysis method for tennis movements based on computer vision and posture estimation, according to the present invention.
[0071] Figure 3 This invention provides a 33-point skeletal diagram of the actual human body.
[0072] Figure 4 This is a schematic diagram of the three-point method computational geometry of the present invention (taking the right elbow as an example).
[0073] Figure 5 This is a flowchart of the ball-hitting pattern recognition process in Embodiment 1 of the present invention.
[0074] Figure 6 This is a schematic diagram of a five-stage finite state machine for right-handed ball striking in Embodiment 1 of the present invention. Detailed Implementation
[0075] To make the above-mentioned objects, features, and advantages of the present invention more apparent and understandable, specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the invention. Furthermore, it should be noted that, for ease of description, only the parts relevant to the present invention are shown in the accompanying drawings, not the entire structure.
[0076] Example 1
[0077] This embodiment describes a real-time biomechanical analysis system for tennis movements based on computer vision and posture estimation. Figure 1 Implement this method ( Figure 2 This describes a typical forehand shot training analysis process, with the following specific steps:
[0078] Step S100: Capture video frames of the user's tennis movements using a regular home USB camera or mobile phone camera, with a capture resolution of 640×480 pixels.
[0079] Step S200: The pose estimation module, based on the MediaPipe Pose Landmarker model, obtains the coordinates of 33 human body keypoints in real time from a single frame image and defines the index according to the MediaPipe Pose standard specification. For example... Figure 2 As shown, the 33 key points of the human body specifically cover the face (nose, eyes, ears, and mouth, a total of 11 points), the trunk (shoulders and hips, a total of 4 points), the upper limbs (arms, elbows, wrists, and hands, a total of 8 points), and the lower limbs (knees, ankles, and feet, a total of 8 points). The specific functional definitions of these key points are shown in Table 1 below.
[0080]
[0081] Step S300: The biomechanical calculation module obtains coordinate values by calling the indexes of corresponding key points, calculates posture feature parameters based on the built-in algorithm, and outputs them to the motion phase recognition module. The posture feature parameters can evaluate the user's overall body posture during the movement process. The posture feature parameters include 12 key joint angle values and 6 high-level posture feature values.
[0082] Preferably, the 12 key joint angle values include: left elbow joint, right elbow joint, left shoulder joint, right shoulder joint, left wrist joint, right wrist joint, left hip joint, right hip joint, left knee joint, right knee joint, left ankle joint, and right ankle joint. Specifically, this invention uses the standard three-point vector dot product formula to calculate the flexion-extension angle values θ of the 12 joint points. j The specific calculation formula is as follows:
[0083] ;
[0084] Among them, such as Figure 3 As shown, Let P be the vector pointing from the joint to the proximal end point. j P is the coordinate of the joint to be calculated. prox The coordinates of the proximal joint (closest to the center of the body); , Let P be the vector pointing from the joint to the far end. dist These are the coordinates of the remote joint points (away from the center of the body). All coordinates are two-dimensional or three-dimensional pixel coordinates output by MediaPipe Pose.
[0085] Table 2 below shows the three-point combination schemes (proximal end point - joint point - distal end point) for 12 key joints and their corresponding MediaPipe key point coordinate indices. It should be noted that the ideal angle ranges in the table are reference values for the tennis forehand hitting posture, determined based on sports biomechanics literature and the practical experience of professional coaches.
[0086]
[0087] Preferably, the six advanced posture values include head tilt angle, neck tilt angle, body tilt angle, shoulder tilt angle, hip tilt angle, and spinal curvature. The function and calculation formula of each indicator are as follows. It should be noted that, to avoid repetition, if the meaning of characters appearing in the formula is consistent, they will not be described again in subsequent occurrences.
[0088] (1) Head tilt angle (θ) head tilt (This is used to assess the degree of head tilt relative to the horizontal plane, and is calculated by taking the angle between the vector connecting the eyes and the horizontal direction. The formula is:)
[0089] ;
[0090] Where P2 is the right eye coordinate and P5 is the left eye coordinate. This represents the difference in coordinates between the two eyes in the vertical direction. The actual pixel distance between the two eyes, ê h It is a unit vector in the horizontal direction. Ideal range for head tilt angle: This indicates that the head is basically horizontal.
[0091] (2) Neck tilt angle (θ) neck (This is used to assess the degree of head tilt relative to the torso, calculated by taking the angle between the line connecting the ear and shoulder and the vertical direction. The formula is:)
[0092] ;
[0093] Among them, P ear mid The midpoint of the left and right ear coordinates is calculated using the following formula: P8 represents the coordinates of the left ear, and P7 represents the coordinates of the right ear; P sho mid The midpoint of the left and right shoulder coordinates is calculated using the following formula: P 12 Let P be the coordinate of the left shoulder. 11 The coordinates of the right shoulder; ê v Let be the unit vector in the vertical direction. Ideal range for neck tilt angle: ,like This indicates excessive forward tilting of the neck.
[0094] (3) Body tilt angle (θ) body lean (This is used to assess the degree of tilt of the torso relative to the vertical direction, and is determined by calculating the angle between the line connecting the torso and the vertical direction. The calculation formula is:)
[0095] ;
[0096] Among them, P hip mid The midpoint of the left and right hip coordinates is calculated using the following formula: P 24 Let P be the coordinate of the left hip. 23 Right hip coordinates; ideal range for body tilt angle: .
[0097] (4) Shoulder tilt angle (θ) sho tilt (This is used to assess the inclination of the line connecting the shoulders relative to the horizontal plane, calculated by determining the angle between the line connecting the shoulders and the horizontal direction. The calculation formula is:)
[0098] ;
[0099] in, Vertical coordinate difference between the two shoulders The actual pixel distance between the shoulders; the ideal range for the shoulder tilt angle: ,like This indicates an imbalance in the shoulders.
[0100] (5) Hip tilt angle (θ) hip tilt ): Used to assess the inclination of the bihip line relative to the horizontal plane, by calculating the inclination of the bihip line relative to the horizontal direction. h The angle is obtained from the included angle. The calculation formula is:
[0101] ;
[0102] in, Vertical coordinate difference between the two hips The actual pixel distance between the two hips, and the ideal range of hip tilt angle: ,like This indicates that the hips are tilted and the center of gravity may be shifted.
[0103] (6) Spinal curvature (k): Used to assess the degree of curvature of the spine. The calculation formula is:
[0104] ;
[0105] Among them, the midpoint P of the shoulder sho mid Let A be the midpoint of the hip and P be the midpoint of the hip. hip mid Let B be the midpoint of the torso, and C be the midpoint of the trunk. The formula for calculating C is: Ideal range of spinal curvature: (Normalized coordinate space), the larger the k value, the more pronounced the spinal curvature.
[0106] Step S400: The motion phase recognition module performs temporal smoothing processing on the attitude feature parameters based on either SMA or EMA temporal smoothing algorithms. A sliding window mechanism is used to maintain historical data for the most recent N frames (N=30), implemented using a collections.deque double-ended queue to eliminate single-frame detection noise and output stable angle estimates. The calculation formula for the temporal smoothing algorithm is as follows:
[0107] (1) Simple moving average: Where N=30 is the window size, x t Let t be the original angle value of the t-th frame. SMA assigns the same weight 1 / N to all historical frames.
[0108] (2) Exponential moving average: ;in, EMA is the smoothing factor (when N=30). t-1 The EMA value is the value of the previous frame. The EMA assigns higher weight to recent frames, with the weight decaying exponentially: α, α(1−α), α(1−α)², ... The smoothing factor α can be dynamically adjusted according to the speed of movement, making it more suitable for fast-moving scenarios. For example, a larger α value (0.10-0.15) is used during the fast swing phase, and a smaller α value (0.04-0.06) is used during the preparation phase. Therefore, this system uses the EMA smoothing method by default.
[0109] The motion phase recognition module calculates motion analysis indices based on continuous changes in posture feature parameters within a window, and identifies the current hitting pattern based on the motion analysis indices and posture feature parameters, such as... Figure 4 As shown, it includes the following steps:
[0110] Step S401: A cascaded judgment mechanism is used to compare the peak wrist movement speed, the change in shoulder angle, and the change in elbow angle to determine whether the current movement is right-arm dominant or left-arm dominant. The specific judgment rules are as follows:
[0111] Rule a1: When the ratio of the peak speed of the right wrist to the peak speed of the left wrist is greater than 1.3, the right arm is determined to be dominant; when the ratio of the peak speed of the left wrist to the peak speed of the right wrist is greater than 1.3, the left arm is determined to be dominant; if the ratio is less than or equal to 1.3, then proceed to rule b1.
[0112] Rule b1: When the ratio of the change in the right shoulder joint angle to the change in the left shoulder joint angle is greater than 1.5, the right arm is determined to be dominant; when the ratio of the change in the left shoulder rotation angle to the change in the right shoulder rotation angle is greater than 1.5, the right arm is determined to be dominant; if the ratio is less than or equal to 1.5, then proceed to rule c1.
[0113] Rule c1: When the ratio of the change in the right elbow joint angle to the change in the left elbow joint angle is greater than 1.5, the right arm is determined to be dominant; when the ratio of the change in the left elbow joint angle to the change in the right elbow joint angle is greater than 1.5, the left arm is determined to be dominant; if the ratio is less than or equal to 1.5, then proceed to rule c1.
[0114] When the above judgment rules meet the conditions, the result is output directly without executing subsequent rules. If the ratio of all three rules is below the threshold, the module adopts the following fallback strategy: if two of the three rules tend to the same result (the ratio is larger, even if it does not reach the threshold), the side that tends to the result is taken as the standard; if it still cannot be determined, the default output is right-arm dominant (considering that about 90% of tennis players are right-handed), and the judgment result is marked as low confidence (<60%). The user is prompted to confirm in the UI. The user can manually switch through the interactive interface and manually select the one with the highest priority.
[0115] Step S402: After determining the dominant arm, simultaneously compare three indicators on the dominant arm side: the height of the hitting point, the change in shoulder tilt angle, and the wrist height difference (whether they are close to and all higher than the shoulder). Use a majority voting principle to determine whether the current action type is a ground shot or a serve. The specific determination rules are as follows:
[0116] Rule a2: If the difference between the vertical coordinate value of the wrist and the vertical coordinate value of the shoulder on the dominant arm side is greater than the threshold and lasts for 3 frames or more, a serving tendency is determined; otherwise, a ground hitting tendency is determined.
[0117] Rule b2: When the difference between the maximum and minimum shoulder tilt angles is greater than 15° and the maximum shoulder tilt angle is greater than 20°, a serving tendency is determined; otherwise, a ground shot tendency is determined.
[0118] Rule c2: If the difference between the vertical coordinate value of the wrist on the dominant arm side and the vertical coordinate value of the wrist on the non-dominant arm side is less than a threshold, and the vertical coordinate values of both wrists are greater than the vertical coordinate values of the corresponding shoulder, a serving tendency is determined; otherwise, a ground hitting tendency is determined.
[0119] The above three rules are judged simultaneously. If two or more outputs point to the serving tendency, it is judged as a serving mode; otherwise, it is a ground shot type, and proceed to step S403.
[0120] Step S403: After determining that the current shot is a ground shot, the system further distinguishes between a forehand and a backhand shot based on the dominant arm, torso rotation, and wrist movement direction. The determination principle for this step is as follows: For a forehand shot, the hitting arm is the same side arm (right hand uses the right arm, left hand uses the left arm), and the hitting point is in front of or to the side of the body; for a backhand shot, the hitting arm is the opposite side arm (for both-handed backhands, the non-dominant arm is used as a reference), and the hitting point is on the opposite side of the body. Specific determination rules are as follows:
[0121] Rule a3: When the right arm is the dominant arm: if the right torso tilt angle is greater than the left torso tilt angle, it is judged as a forehand shot; if the right torso tilt angle is less than the left torso tilt angle, it is judged as a backhand shot; the logic is reversed when the left arm is dominant.
[0122] Rule b3: When the right arm is the dominant arm: if the wrist movement is from left to right (or from back to front), it is judged as a forehand stroke; if the wrist movement is from right to left (or from back to front in a cross motion), it is judged as a backhand stroke; the logic is reversed when the left arm is dominant.
[0123] Overall judgment output of hitting mode:
[0124] 1. If the right arm leads the movement, the body turns to the left, and the wrist moves from left to right, it is considered a dominant hand (right-handed).
[0125] 2. If the right arm leads the movement, the body turns to the right, and the wrist moves from right to left, it is considered a backhand (right-handed).
[0126] 3. If the left arm leads the movement, the body turns to the right, and the wrist moves from right to left, it is considered a dominant hand (left-handed).
[0127] 4. If the left arm leads the movement, the body turns to the left, and the wrist moves from left to right, it is considered a backhand (left-handed) hand.
[0128] Based on the shot pattern recognition results, and using either a shot segmentation strategy or a serve segmentation strategy, the motion phase recognition module divides the tennis motion into five consecutive motion phases using a finite state machine recognition algorithm:
[0129] When a forehand or backhand pattern is identified, a shot division strategy is adopted, which divides the tennis motion into five phases: Ready, Preparation, Acceleration, Impact, and Follow-through.
[0130] When a serve pattern is identified, a serve segmentation strategy is adopted, dividing the hitting action into five phases: trophy position, ball toss, racket drop / acceleration, impact, and follow-through.
[0131] like Figure 5 As shown, the module synchronously loads the angle threshold configuration for the corresponding mode, executes a finite state machine each frame, and achieves stage switching and recognition by relying on the threshold condition crossing and temporal constraint relationship of the index. This invention mainly describes the forehand / backhand mode in detail. The characteristics of each stage in this mode are shown in Table 3 below:
[0132]
[0133] The transition conditions for each stage are shown in Table 4 below:
[0134]
[0135] To avoid incorrect stage identification, the finite state machine described above also has the following fault-tolerant design:
[0136] Anti-shake mechanism: All stage transitions require 2-5 consecutive frames to be satisfied before the transition is triggered, to prevent false switching caused by single-frame noise.
[0137] Minimum Residential Duration per Stage: Set the minimum residential duration N frames for each stage. m State transitions are prohibited when the number of resident frames is insufficient to avoid abnormal stage jumps. The minimum number of resident frames N for each stage is specified. m They are: S0: 5 frames, S1: 8 frames, S2: 5 frames, S3: 3 frames, and S4: 10 frames.
[0138] Timeout Protection: Set the timeout protection frame number N for each stage. T If the number of frames exceeds the preset upper limit N for a certain period of time T If S2 exceeds 40 frames, the system will automatically reset the state machine to S0.
[0139] Mid-stage access: The state machine supports starting analysis from any stage. For example, if a user uploads a video of a shot that has already started, the system can automatically determine the current stage based on the joint angle features of the initial frame.
[0140] It should be noted that the indicators mentioned in the hitting pattern and phase recognition are all calculated based on the coordinates of key human body points and the changing posture feature parameters. Those skilled in the art can obtain the corresponding values using conventional planar geometric calculation methods. For example, the right torso tilt angle is obtained by the angle between the line connecting the right shoulder and right hip and the horizontal plane, and the wrist movement speed is calculated by the ratio of continuous inter-frame displacement to time interval. To avoid excessive detail, these will not be listed one by one in this embodiment. In addition, the serve pattern shares the same finite state machine framework and fault tolerance mechanism as the forehand / backhand pattern, but the selection of the dominant joint, the ideal angle range, and the phase transition conditions are independently configured according to the biomechanical characteristics of the serve. For example, the main focus is on the upward movement of the racket arm, and the ideal angle range is adjusted to the right shoulder angle. (Raise), right elbow angle (Greater flexion and extension range); during the preparation phase, it is necessary to check whether the y-coordinate of the left hand (the ball-throwing hand) is higher than the head; two additional posture characteristic parameters need to be added: "knee flexion and extension range" (used to assess lower limb power efficiency) and "trunk tilt angle" (to assess the bow-shaped power-gathering posture), etc. Based on the methodological framework disclosed in this invention, those skilled in the art can refer to the serving biomechanics literature (Kovacs & Ellenbecker, 2011) to complete the specific parameter configuration of the serving mode. Therefore, this embodiment will not describe the hitting mode in detail.
[0141] Meanwhile, the motion phase recognition module determines the end of a complete shot by automatically incrementing the shot count after each complete shot cycle from the preparation stage, following all five phases. An internal counter increments by 1 during the follow-through-preparation transition to avoid double counting. Additionally, it calculates five statistical indicators for each joint angle sequence within the sliding window and generates a statistical summary, which is persistently stored by the data persistence module for AI analysis and historical backtesting. Specifically, the five statistical indicators include:
[0142] Minimum value (Min):
[0143] Maximum value (Max):
[0144] Mean:
[0145] Standard deviation (Std):
[0146] Current value:
[0147] Where W represents the complete frame sequence from the start frame to the end frame within the sliding window, t is the frame number, and θ tLet θ be the joint angle value of frame t, N be the total number of frames within W, and T be the frame number of the latest frame in the window. current It indicates the instantaneous state of the joint angle at the end of the stroke.
[0148] In addition, the system simultaneously performs error detection and deviation calculation during the stage recognition process. Based on the posture condition configuration corresponding to the current hitting mode, it compares the posture angle parameters of the current frame with the ideal range value of the posture conditions within the stage (given in step 300) to determine whether the action posture is abnormal. Simultaneously, all detected errors are summarized into an error list. Error detection includes, but is not limited to: if the smoothed value of the right elbow angle during the hitting stage is >160°, then record the error "right elbow angle too large"; if the head tilt angle is >5°, then record the error "abnormal head tilt", etc. It should be noted that the right elbow angle during the hitting stage... The ideal angle range is defined as 155°-160°. When the right elbow smooth angle is detected to be greater than 160°, the system only outputs and records the error defect label "right elbow angle too large" without stopping the stage transfer.
[0149] Calculate the numerical deviation (unit: °) for subsequent color coding rendering. Deviation calculation: If the attitude angle value is within the condition range, then deviation = 0; if the attitude angle value is higher than the upper limit of the condition range, then deviation = attitude angle - upper limit angle; if the angle value is lower than the lower limit of the ideal range, then deviation = lower limit angle - attitude angle.
[0150] After the deviation calculation is completed, the system immediately constructs structured motion information, including the hitting mode, action stage, current values of posture feature parameters and posture condition range, error list, and screenshots. When an error occurs, the system automatically takes a screenshot of the current annotation frame and saves it to the data persistence module. When the error list is not empty (i.e., at least one erroneous action is detected), and the time since the last error screenshot was saved exceeds a preset cooldown time (3 seconds, to prevent duplicate screenshots), the system sends the structured motion information to the AI intelligent analysis module, triggering the intelligent feedback generation process.
[0151] Step S500: The system inputs the structured motion information into the AI intelligent analysis module for analysis and outputs multi-dimensional coaching feedback. The AI intelligent analysis module encapsulates local multimodal channel (Ollama) and remote text channel (DeepSeek) clients. This embodiment uses the DeepSeek remote text API as an example for detailed explanation. Since the current version of deepseek-chat does not support multimodal image input, this channel only obtains plain text professional coaching feedback. The AI intelligent analysis module constructs the above structured motion information (excluding screenshots) into plain text prompts and sends them to deepseek-chat via an OpenAI-compatible API protocol.
[0152] Preferably, the prompt words adopt a design pattern of role setting and structured sports information template: the model role is set as "a professional tennis biomechanics coach who is good at analyzing the technical details of tennis movements", and the large language model is required to analyze from four dimensions: "main technical problems, possible causes, specific improvement suggestions, and recommended training methods". The returned text is parsed into four structured fields through regular expressions and displayed on the web interface in natural language description.
[0153] Step S600: During the motion analysis process, the visual rendering module completes the rendering and overlay of skeleton lines, angle annotations, statistical panels, and AI intelligent analysis text onto the video frames.
[0154] Skeleton Connection: Render and connect 33 human body key points to form a human skeleton frame. The module sets the connection line width to 3px, the drawing radius of key joint dots to 8px, and the drawing radius of secondary joint dots to 5px. The human skeleton connection is then rendered and superimposed on the original image frame.
[0155] Angle annotation: A semi-transparent background is overlaid on key pose positions in the original image frame. The background contains color-coded pose parameter annotations, using a standardized bias scheme: deviations <10° are rendered as green, and deviations <10° are rendered as green. Render orange, render red if the deviation is >20°, and use standard vector font annotation with a scaling factor of 0.7.
[0156] Statistics panel: A semi-transparent background is superimposed on one of the four positions (top left, top right, bottom left, bottom right) of the original image frame. The semi-transparent background contains a statistical summary of the pose angles of the current frame (minimum / maximum / average / standard deviation / current value), which helps users to monitor biomechanical data in real time.
[0157] After rendering, the system presents the calculation and analysis results of the aforementioned motion process to the user in three columns through a web interface: video overlay of the human skeleton, video overlay of angle annotations and statistical summaries, and AI intelligent commentary results. The web interface uses a page placeholder container mode to achieve frame-level flicker-free screen refresh with a fixed refresh interval of 33ms, corresponding to a low-latency real-time visualization of 30 frames per second, making it easy for users to observe the posture during the motion process. At the same time, this structured motion information, AI intelligent commentary results, and JPEG screenshots are written to the data persistence module, allowing users to query and review historical motion data, which is beneficial for adjusting motion posture.
[0158] Example 2
[0159] This embodiment is based on the aforementioned Embodiment 1, and lists the hardware and software configurations for implementing the system, thereby realizing the tennis motion analysis method. The configuration is as follows:
[0160] (1) Hardware: Intel Core i5-12400 (6 cores and 12 threads, base frequency 2.5GHz / turbo frequency 4.4GHz), 16GB DDR4-3200 RAM, USB 2.0 webcam (Logitech C270, 1280×720@30fps, actual input resolution 640×480)
[0161] (2) Operating System: Windows 11 Home China
[0162] (3) Software environment: Python 3.10, MediaPipe 0.10.14 (Tasks API), OpenCV 4.8.1, Streamlit 1.28
[0163] (4) AI service: Ollam 0.1.27 running locally qwen3-vl:9b (Q4_K_M quantization, approximately 5.5GB VRAM / RAM usage)
[0164] The system execution flow is as follows:
[0165] Upon system startup, the pose estimation module file (MediaPipe PoseLandmarker model, .task format, approximately 9.4MB) is loaded in binary mode. Model data is passed via binary cache parameters, ensuring complete compatibility with non-ASCII path encoding issues on Windows systems and preventing loading failures due to Chinese characters in the file path. The model is configured to run in video mode (VIDEO), with human detection confidence thresholds set to 0.5, tracking confidence thresholds set to 0.5, and the number of people detected per instance (num_poses) set to 1. The model performs inference entirely on the CPU. On standard hardware with an Intel Core i5-12400 processor, 16GB of RAM, and a 640×480 input resolution, the system achieves a stable inference frame rate of 25-30fps.
[0166] Subsequently, based on the user channel selection, the system automatically loads the relevant LLM configuration parameters from the user configuration file (user_config.json), creates a time-series sliding window with a capacity of 30 frames to wait for continuous frames of attitude data, creates a finite state machine instance, and sets the state and initial default state to the ready state (S0_Ready) to wait for video input.
[0167] After system initialization, the local default USB monocular camera is invoked via cv2.VideoCapture, an instance of the OpenCV library's video capture class. The camera maintains a fixed capture resolution of 640×480 pixels, continuously reading real-time images and outputting raw image frames in BGR format. In an alternative implementation, the video input module can also read locally stored video files (such as .mp4 or .avi formats), decoding them into a continuous sequence of image frames for processing.
[0168] The BGR format image frames acquired by the video input module are converted to RGB color space using the core function (cv2.cvtColor) to adapt to the input specifications of the pose estimation module. MediaPipeBackend constructs an inference framework image object (MediaPipeImage) based on the converted RGB image, obtains the timestamp of the current frame (in milliseconds), calls PoseLandmarker.detect_for_video() to perform video-level continuous pose inference, and outputs a pose result object (PoseResult) containing the coordinates of 33 human keypoints.
[0169] Twelve joint angle values are calculated using AngleCalculator.calculate_all_angles(), and six high-level pose features are calculated using calculate_posture_metrics(). The output of the 12 joint angle values and the six high-level pose features are simultaneously subjected to EMA timing smoothing.
[0170] The sliding window is updated using MotionAnalyzer.update(). All calculated attitude feature parameters are smoothed using EMA with a smoothing factor of α=0.0645 and input into TennisCoach.analyze(). The current mode is identified as a hitting mode. Continuous timing motion analysis is performed, the phase state machine is run, and feedback text, indicator dictionary, and error list are output.
[0171] Error detection is performed synchronously. When the error list is not empty and more than 3 seconds have passed since the last screenshot, the system automatically saves the annotation image of the current frame as a JPEG file through the data persistence module. The compression quality is preferably 85%. The screenshot file is named with a universally unique identifier (UUID) and stored in the path %LOCALAPPDATA%\Tapp\history\images\. The current annotation frame is captured and sent to the AI intelligent analysis module along with the structured motion information.
[0172] This embodiment primarily uses a local visual model (Ollama channel) as an example to illustrate the AI analysis steps. The local visual model uses a multimodal model qwen3-vl:9b that supports visual understanding, employing the Q4_K_M quantization scheme, and occupies approximately 5.5GB of memory. Saved error screenshots (JPEG format) are encoded into Base64 strings (image size limited to a maximum of 1280×1280 pixels) and sent along with structured motion information to the local Ollam service (default endpoint http: / / localhost:11434 / api / generate). The model can then directly understand the action posture from the image and provide coach feedback based on the structured motion information. To ensure the professionalism and security of the feedback generated by the LLM, the following output protection mechanisms are set up:
[0173] Structured parsing: The LLM output text is parsed into four structured fields, "Main technical issues, possible causes, improvement suggestions, and training methods", using regular expressions. If parsing fails, it will revert to the original text format for display.
[0174] Confidence threshold: The system sets a lower threshold for filtering motion deviations. The system determines the motion posture to be standard and does not trigger AI intelligent analysis (only recording structured motion information in the background) if and only if the deviation of all calculated posture feature parameters is less than 5°, thus avoiding excessive feedback on minor limb tremors. Conversely, if any deviation of a key joint angle or high-level posture feature value in the error list is detected to be greater than or equal to 5°, the motion is judged as abnormal, triggering the AI intelligent analysis process.
[0175] Safety Filter: The output text is filtered by keywords to remove potentially unsafe or inappropriate content, such as encouragement of overtraining or suggestions for dangerous actions.
[0176] Manual review label: For training modes marked as "high-level athlete" by users, the AI analysis results will be appended with the prefix "[AI automatic analysis, for reference only]".
[0177] Error handling: All HTTP requests are equipped with a complete error handling mechanism. When connection errors, HTTP errors, or 60-second timeouts occur, errors are reported to the user in Chinese.
[0178] Finally, the visual rendering module overlays the skeleton, angle annotations, and statistics panel onto the original frame to generate a color-coded annotation image. This image is then displayed to the user in a three-column layout via a web interface. Streamlit's placeholder mode (st.empty()) enables frame-level web interface refresh with a refresh interval of approximately 33ms (corresponding to 30fps real-time display). Simultaneously, the data persistence module writes the complete training data record for the current frame to the index.json file, and the history panel displays the data in descending date groups.
[0179] The above description of the embodiments is provided to enable those skilled in the art to understand and use the present invention. It will be apparent to those skilled in the art that various modifications can be easily made to these embodiments, and the general principles described herein can be applied to other embodiments without inventive effort. Therefore, the present invention is not limited to the above embodiments, and any improvements and modifications made by those skilled in the art based on the disclosure of the present invention without departing from the scope of the present invention are within the protection scope of the present invention.
Claims
1. A real-time biomechanical analysis method for tennis movements based on computer vision and posture estimation, characterized in that, Includes the following steps: S100: Acquire video frame data of tennis movements; S200: Obtain the coordinates of 33 human body key points from the video frame; S300: Calculate posture feature parameters based on the coordinates of the 33 key human body points. The posture feature parameters include 12 key joint angle values and 6 high-level posture feature values. The 12 key joints include the left and right elbow joints, left and right shoulder joints, left and right wrist joints, left and right hip joints, left and right knee joints, and left and right ankle joints. The 6 high-level posture feature values include head tilt angle, neck tilt angle, body tilt angle, shoulder tilt angle, hip tilt angle, and spinal curvature. S400: Perform time-series smoothing on the posture feature parameters, derive motion analysis indicators based on continuous posture feature parameters, identify the current hitting pattern based on the motion analysis indicators, determine the corresponding motion phase division strategy based on the hitting pattern identification result, divide tennis motion into multiple continuous action phases, load the phase threshold configuration corresponding to the mode, output the phase identification result, calculate parameter deviation and generate an error list, and construct structured motion information in real time. S500: Inputs structured motion information into a large language model for analysis and outputs multi-dimensional coaching feedback; S600: The analysis results and attitude feature parameters are rendered and overlaid on the video frames and presented to the user in an interactive manner.
2. The real-time biomechanical analysis method for tennis movements based on computer vision and posture estimation according to claim 1, characterized in that, In step S300, the angle values θ of the 12 key joints j The calculation formula is: ; in, Let P be the vector pointing from the joint to the proximal end point. j P is the coordinate of the joint to be calculated. prox The coordinates of the proximal joint; , Let P be the vector pointing from the joint to the far end. dist These are the coordinates of the distal joint.
3. The real-time biomechanical analysis method for tennis movements based on computer vision and posture estimation according to claim 1, characterized in that, In step S300, the calculation formulas for the six high-level attitude feature values are as follows: The head tilt angle θ head tilt The calculation formula is: ; Where P5 and P2 are the coordinates of the left and right eyes, respectively. This represents the difference in coordinates between the two eyes in the vertical direction. The actual pixel distance between the two eyes, ê h It is a unit vector in the horizontal direction. Ideal range for head tilt angle: ; The neck tilt angle θ neck The calculation formula is: ; Among them, P ear mid The midpoint of the left and right ear coordinates is calculated using the following formula: P8 and P7 are the coordinates of the left and right ears; P sho mid The midpoint of the left and right shoulder coordinates is calculated using the following formula: P 12 P 11 The coordinates of the left and right shoulders; ê v Let be the unit vector in the vertical direction. Ideal range for neck tilt angle: ; The body tilt angle θ body lean The calculation formula is: ; Among them, P hip mid The midpoint of the left and right hip coordinates is calculated using the following formula: P 24 P 23 Left and right hip coordinates; ideal range for body tilt angle: ; The shoulder tilt angle θ sho tilt The calculation formula is: ; in, Vertical coordinate difference between shoulders The actual pixel distance between the shoulders; the ideal range for the shoulder tilt angle: ; The hip tilt angle θ hip tilt The calculation formula is: ; in, Vertical coordinate difference between the two hips The actual pixel distance between the two hips, and the ideal range of hip tilt angle: ; The formula for calculating the spinal curvature k is: ; Where A is the midpoint P of the shoulder. sho mid B is the midpoint of the hip P. hip mid C is the midpoint of the torso, and the formula for calculating C is: Ideal range of spinal curvature: .
4. The real-time biomechanical analysis method for tennis movements based on computer vision and posture estimation according to claim 1, characterized in that, In step S400, identifying the current hitting mode includes: first identifying whether the dominant arm of the action is the right arm or the left arm, and determining the action type as a serve or a hit based on the dominant arm. If it is a hit, the hitting mode is determined to be one of forehand hit, backhand hit, or serve mode based on the dominant arm, the direction of torso twist, and the direction of wrist movement.
5. The real-time biomechanical analysis method for tennis movements based on computer vision and posture estimation according to claim 1, characterized in that, In step S400, determining the corresponding motion phase segmentation strategy based on the ball-hitting pattern recognition result, and dividing the tennis motion into multiple consecutive action phases, includes: When a forehand or backhand pattern is identified, a shot segmentation strategy is adopted, dividing the tennis motion into: preparation phase, backswing phase, acceleration phase, hitting phase, and follow-through phase. When a serve pattern is identified, a serve segmentation strategy is adopted, which divides the hitting action into: preparation phase, ball toss phase, acceleration phase, hitting phase, and follow-through phase.
6. The real-time biomechanical analysis method for tennis movements based on computer vision and posture estimation according to claim 5, characterized in that, The action phase division based on the hitting strategy is determined by a comprehensive assessment of one or more characteristic parameters and changes of the elbow joint, shoulder joint, wrist joint, knee joint, and body tilt angle.
7. The real-time biomechanical analysis method for tennis movements based on computer vision and posture estimation according to claim 6, characterized in that, When the movement employs a shot-based strategy, the corresponding phase transition conditions are as follows: Preparation - Lead-off: The shoulder rotation angular velocity is greater than the first preset threshold and the elbow joint angle is less than the first preset angle. The transition is triggered after N1 consecutive frames. Lead-up - Acceleration: The shoulder rotation direction is reversed and the rotational angular velocity is greater than the second preset threshold. At the same time, the knee joint angle increases. After N2 consecutive frames, the transition is triggered. Acceleration-Striking: The wrist movement speed reaches a preset percentage of the local maximum value and the elbow joint angle is greater than or equal to the second preset angle. The transition is triggered after N3 consecutive frames. Hit-follow-swing: The wrist movement speed decreases and the elbow joint angle decreases. The transition is triggered after N4 consecutive frames. Follow-up - Preparation: The elbow joint angle change rate is less than the third preset threshold, the body tilt angle is less than the fourth preset threshold, and the angles of both knee joints return to the preset angle range. After N5 consecutive frames, the transfer is triggered. The finite state machine is equipped with at least one of the following fault tolerance mechanisms: each stage transition is configured with a minimum dwell time N. m State transition is prohibited when the number of resident frames is insufficient; a timeout protection frame number N is set for each stage. t If the duration of a certain stage exceeds N t When this happens, the state machine automatically resets to S0.
8. The real-time biomechanical analysis method for tennis movements based on computer vision and posture estimation according to claim 7, characterized in that, The N1, N 2、 The values of N3, N4, and N5 range from 2 to 5 frames. m The range of values for: N t The range of values for: .
9. The real-time biomechanical analysis method for tennis movements based on computer vision and posture estimation according to claim 1, characterized in that, It also includes the step of calculating statistical indicators: after each complete action phase cycle, the number of hits is counted, and five statistical indicators of posture characteristic parameters, namely minimum, maximum, average, standard deviation and current value, are calculated.
10. A real-time biomechanical analysis system for tennis movements based on computer vision and posture estimation, characterized in that, The system includes at least a video input module, a pose estimation module, a biomechanical calculation module, a motion phase recognition module, an AI intelligent analysis module, a visual rendering module, and an output display module, wherein: Video input module: Supports two input modes: real-time capture from a monocular USB camera and local video files; Pose estimation module: encapsulates the MediaPipe Pose Landmarker model for use in... Two-dimensional and three-dimensional coordinates of 33 human body key points were obtained from video frames, as well as the visibility and existence scores of each key point; Biomechanical calculation module: used to calculate posture characteristic parameters based on the coordinates of key points on the human body; Movement phase recognition module: Based on the built-in motion analysis strategy, it identifies the hitting pattern and action phase according to the motion analysis indicators. It adopts the finite state machine recognition algorithm to divide the tennis motion into multiple action phases. Each phase is configured with independent threshold conditions to construct structured motion information. AI Intelligent Analysis Module: Encapsulates a dual-channel LLM client to enable intelligent analysis of structured motion information and generation of coach comments; Visual rendering module: renders and overlays the calculation and analysis results of the motion process onto the video frames; Output display module: Based on the Streamlit framework, a web interactive interface is built to synchronously display the rendered video to the user via the web interface.
Citation Information
Patent Citations
Badminton action analysis system and method based on Mobilenet
CN110610173A