Method and device for evaluating motion posture based on key points and stride frequency
By detecting key points in the user's motion video, calculating the hand swing frequency and step frequency, and using the Kalman filter and fast Fourier transform to evaluate the motion posture, it solves the problem of relying on sensors and wearable devices in the existing technology and achieves Efficient and economical sports posture assessment and data analysis.
Patent Information
- Application Number
- CN202410856692.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-28
- Publication Date
- 2024-10-29
AI Technical Summary
Existing sports posture assessment methods rely on wearable devices or sensors, which have problems with signal interference, comfort, and accuracy. High-quality equipment is expensive, which limits its popularity.
By detecting key points in user motion videos, calculating hand swing frequency and step frequency, and using Kalman filter and fast Fourier transform to evaluate motion posture, it completely gets rid of the dependence on sensors and wearable devices.
It achieves accurate assessment of sports postures, improves the comfort and freedom of sports experience, reduces costs, and provides real-time and efficient sports data analysis.
Smart Images

Figure CN118865488A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer vision technology and provides a method and device for evaluating motion posture based on key points and cadence. Background Art
[0002] Currently, technologies such as motion posture estimation, cadence analysis, and speed calculation mainly rely on wearable devices or sensors to collect data and analyze it through positioning systems (such as GPS). However, these methods have some limitations. Interference with GPS signals may reduce the accuracy of positioning, which in turn affects the accuracy of cadence and speed measurement. In addition, wearable devices may affect the comfort and freedom of movement of athletes, especially during long-term exercise. At the same time, some sensors and GPS systems may have delays in data transmission, especially in situations where the signal is unstable or the environment is complex, which may affect the performance of applications with high real-time requirements. Moreover, high-quality wearable devices and positioning systems are often expensive, which limits their popularity. Summary of the invention
[0003] The present application provides a method and device for evaluating motion posture based on key points and cadence, which are used to solve the limitation problem of existing motion posture evaluation methods relying on wearable devices or sensors.
[0004] In a first aspect, a method for evaluating a motion posture based on key points and cadence is provided, comprising:
[0005] Detecting in sequence whether there is a person in each frame of the user's motion video, and determining a plurality of consecutive frames of images in which the person exists;
[0006] Performing key point detection on each frame of the continuous multiple frames of images to obtain information on multiple key points of the person in each frame of the image;
[0007] Calculate the hand swing frequency, movement step frequency, and actual values of multiple indicators according to the information of multiple key points in the continuous multiple frames of images;
[0008] The movement posture of the character is evaluated based on the frequency difference between the hand swing frequency and the movement step frequency, and the difference between the actual value and the standard value of each indicator.
[0009] Optionally, the information includes position coordinates and confidence levels; after performing key point detection on each of the continuous multiple frames of images to obtain information on multiple key points of the person in each frame of the image, the method includes:
[0010] If the position coordinates of the upper body key points among the multiple key points exceed the image boundary, the confidence of the upper body key points is set to zero;
[0011] Predicting the multiple key points through a Kalman filter to obtain predicted coordinates of the multiple key points;
[0012] If the confidence of a second key point among the multiple key points is less than a preset confidence, the position coordinates of the second key point are replaced by the predicted coordinates of the second key point.
[0013] Optionally, according to the information of multiple key points in the continuous multiple frames of images, the hand swing frequency, the movement step frequency, and the actual values of multiple indicators are calculated, including:
[0014] Determine a virtual point in each frame of the continuous multiple frames of images according to a plurality of key points in each frame of the continuous multiple frames of images, and obtain a virtual point sequence of the continuous multiple frames of images;
[0015] Performing fast Fourier transform on the virtual point sequence to obtain a frequency spectrum curve;
[0016] The maximum value in the frequency spectrum curve is determined as the movement frequency of the character.
[0017] Optionally, determining a virtual point in each frame of the continuous multiple frames of images according to a plurality of key points in each frame of the continuous multiple frames of images to obtain a virtual point sequence of the continuous multiple frames of images includes:
[0018] If the continuous multiple-frame images are images of the upper body of the person, selecting a plurality of upper body key points from the head and shoulders of the person;
[0019] If the continuous multiple frame images are full-body images of the person, selecting a plurality of leg key points from the legs of the person;
[0020] Obtaining position coordinates of a virtual point according to the position coordinates of the multiple upper body key points or the multiple leg key points;
[0021] According to the position coordinates of the virtual points in the continuous multiple-frame images, a virtual point sequence of the continuous multiple-frame images is obtained.
[0022] Optionally, the position coordinates of the plurality of upper body key points or the plurality of leg key points include:
[0023] Averaging the position coordinates of the plurality of upper body key points to obtain mean coordinates;
[0024] Subtract the mean coordinate from the position coordinates of the plurality of upper body key points to obtain the position coordinates of a plurality of centralized upper body key points;
[0025] The position coordinates of the plurality of centralized upper body key points are averaged to obtain the position coordinates of a virtual point.
[0026] Optionally, obtaining the position coordinates of a virtual point according to the position coordinates of the multiple upper body key points or the multiple leg key points includes:
[0027] Averaging the position coordinates of two leg key points of the target leg to obtain mean coordinates; the target leg is the left leg or the right leg; the two leg key points include key points of the knee and the ankle;
[0028] Subtract the mean coordinates from the position coordinates of the two leg key points to obtain the position coordinates of the two centralized leg key points;
[0029] Taking an average of the position coordinates of the two centralized leg key points to obtain the position coordinates of the virtual point of the target leg;
[0030] The position coordinates of a virtual point are obtained by subtracting the position coordinates of the virtual point of the right leg from the position coordinates of the virtual point of the left leg.
[0031] Optionally, performing a fast Fourier transform on the virtual point sequence to obtain a spectrum curve includes:
[0032] Performing median filtering and Gaussian filtering on the virtual point sequence to obtain a filtered virtual point sequence;
[0033] Removing a DC component from the filtered virtual point sequence to obtain a virtual point sequence after the DC component is removed;
[0034] The virtual point sequence after the DC component is removed is subjected to a fast Fourier transform to obtain a frequency spectrum curve.
[0035] Optionally, the evaluating the motion posture of the character according to the frequency difference between the hand swing frequency and the motion step frequency, and the difference between the actual value and the standard value of each indicator, includes:
[0036] A synchronization rate score is obtained according to the frequency difference between the hand swing frequency and the movement step frequency; the synchronization rate score is negatively correlated with the frequency difference;
[0037] The score of each indicator is obtained according to the difference between the actual value of each indicator and the standard value; the standard value is calculated based on the standard motion video; the score of each indicator is negatively correlated with the difference;
[0038] The average value between the synchronization rate score and the scores of the multiple indicators is determined as the motion posture score of the character; the higher the motion posture score is, the more standardized the motion posture of the character is.
[0039] Optionally, after determining the average of the synchronization rate score and the scores of the multiple indicators as the motion posture score of the character, the method further includes:
[0040] Substituting the movement frequency into a nonlinear polynomial function to obtain the movement speed of the character; the parameters of the nonlinear polynomial function are obtained by fitting a large number of videos with real speed labels using the least squares method;
[0041] The motion gesture score is determined as the confidence of the motion speed.
[0042] In a second aspect, a device for evaluating a motion posture based on key points and cadence is provided, comprising:
[0043] A detection module, used to detect in sequence whether there is a person in each frame of the user's motion video, and determine a plurality of consecutive frames of images containing the person;
[0044] The detection module is further used to perform key point detection on each frame of the continuous multiple frames of images to obtain information on multiple key points of the person in each frame of the image;
[0045] A calculation module, used to calculate the hand swing frequency, the movement step frequency, and actual values of multiple indicators according to the information of multiple key points in the continuous multiple frames of images;
[0046] An evaluation module is used to evaluate the movement posture of the character according to the frequency difference between the hand swing frequency and the movement step frequency, and the difference between the actual value and the standard value of each indicator.
[0047] In a third aspect, the present application provides a computer device comprising a memory and a processor, wherein the memory stores a computer program file, and the processor executes the computer program file to implement the method for evaluating motion posture based on key points and step frequency described in the first aspect.
[0048] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program file stored thereon, and a processor executes the computer program file to implement the method for evaluating motion posture based on key points and step frequency described in the first aspect.
[0049] Compared with the prior art, the present invention has the following beneficial effects:
[0050] The present application provides a method for evaluating motion posture based on key points and step frequency, which detects in turn whether there is a person in each frame of the user's motion video, and determines the continuous multiple frames of images in which the person exists; performs key point detection on each frame of the continuous multiple frames, and obtains information on multiple key points of the person in each frame; calculates the actual values of the hand swing frequency, motion step frequency, and multiple indicators based on the information of multiple key points in the continuous multiple frames; and evaluates the motion posture of the person based on the frequency difference between the hand swing frequency and the motion step frequency, and the difference between the actual value and the standard value of each indicator. The present application calculates the difference between the actual value and the standard value of multiple indicators based on the user's motion video and the standard motion video through the information of key points, and considers the frequency difference between the hand swing frequency and the motion step frequency, thereby realizing the evaluation of the motion posture of the person, completely getting rid of the dependence on sensors and wearable devices, and enabling athletes to enjoy a more comfortable and free exercise experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] Figure 1 A schematic diagram of an application scenario provided in an embodiment of the present application;
[0052] Figure 2 A schematic diagram of a flow chart of a method for evaluating motion posture based on key points and step frequency provided in an embodiment of the present application;
[0053] Figure 3 A schematic diagram of multiple key points provided in an embodiment of the present application;
[0054] Figure 4 A schematic diagram of upper body key points and virtual points provided in an embodiment of the present application;
[0055] Figure 5 A schematic diagram of a motion curve of a virtual point provided in an embodiment of the present application;
[0056] Figure 6 A schematic diagram of a signal before and after the DC component is removed provided in an embodiment of the present application;
[0057] Figure 7 A schematic diagram of a signal spectrum before and after the DC component is removed provided in an embodiment of the present application;
[0058] Figure 8 A schematic diagram of a nonlinear quartic polynomial function provided in an embodiment of the present application;
[0059] Fig. 9 A schematic diagram of a motion speed curve provided in an embodiment of the present application;
[0060] Fig.10 A schematic diagram of the overall process of the method for evaluating motion posture based on key points and step frequency provided in an embodiment of the present application;
[0061] Fig.11 A schematic diagram of a sports game of a method for evaluating sports posture based on key points and step frequency provided in an embodiment of the present application;
[0062] Fig.12 A schematic diagram of the structure of a device for evaluating motion posture based on key points and cadence provided in an embodiment of the present application.
[0063] Figure numerals: 101 - video acquisition device, 102 - motion posture assessment device. DETAILED DESCRIPTION
[0064] It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0065] The method of the embodiment of the present application can be executed in a program-based manner by running a program on a device that evaluates motion posture based on key points and cadence (hereinafter referred to as a motion posture evaluation device for ease of description). The motion posture evaluation device can be a mobile phone, a tablet, a desktop computer, etc. The motion posture evaluation device may include a processor, a storage medium, etc. The storage medium is used to store a program for executing the method of the present embodiment, and the processor is used to load and execute a computer program so that the motion posture evaluation device executes the method for evaluating motion posture based on key points and cadence as provided in the embodiment of the present application.
[0066] Please refer to Figure 1 , is a schematic diagram of an application scenario provided in an embodiment of the present application, and the schematic diagram of the application scenario includes a video acquisition device 101 and a motion posture assessment device 102.
[0067] The video acquisition device 101 is, for example, a terminal device, a camera, etc. The terminal device includes, for example, a camera, a mobile phone or a tablet computer (Portable Android Device, PAD), etc., and may also include other devices with shooting functions. The video acquisition device 101 collects user motion videos and sends the user motion videos to the motion posture evaluation device 102. After obtaining the user motion videos, the motion posture evaluation device 102 performs motion posture evaluation based on the user motion videos. Among them, the specific process of how to perform motion posture evaluation will be described in detail below.
[0068] It should be noted that the Figure 1 The video acquisition device 101 and the motion posture evaluation device 102 are taken as two independent devices for example. In fact, the video acquisition device 101 and the motion posture evaluation device 102 can also be coupled into one device, which can not only acquire user motion videos, but also perform motion posture evaluation based on user motion videos.
[0069] based on Figure 1The application scenario discussed below introduces a method for evaluating sports posture based on key points and step frequency involved in an embodiment of the present application. Figure 2 , which is a flow chart of a method for evaluating motion posture based on key points and step frequency provided in an embodiment of the present application.
[0070] S201, sequentially detecting whether each frame of the user's motion video contains a person, and determining a plurality of consecutive frames of images containing a person.
[0071] In the specific implementation process, first, the real-time target detection model (RTM-Det) is used to detect each frame of the image to determine whether there is a person in each frame of the image. The detection result output by the model includes the detected target frame and the corresponding confidence. Then, the target frame is input into the Kalman filter as an observation value. The Kalman filter can smooth the position of the target frame to reduce the jitter and error of the target frame. When a person is detected, the prediction result output by the Kalman filter and the detection result output by the model can be combined by weighted averaging or other fusion strategies to obtain the final target frame, further reduce noise, and improve the accuracy of the target frame. When no person is detected, the prediction result of the Kalman filter is used as the final target frame. If no person is detected in N consecutive frames of images, and the value range of N is 4 to 8, it is determined that there is no person in the user's motion video, and no subsequent processing is performed.
[0072] S202: Perform key point detection on each frame of the continuous multiple frames of images to obtain information on multiple key points of the person in each frame of the image.
[0073] In the specific implementation process, after determining that there are people in the image, the Real-Time Multi-Person Pose Estimation (RTMPose) algorithm is used to identify and locate the key points of the people in the image, and obtain the information of multiple key points of the people. The information includes position coordinates (x, y) and confidence.
[0074] Please refer to Figure 3 , is a schematic diagram of multiple key points provided in an embodiment of the present application, wherein the multiple key points are left and right eyes, left and right ears, nose, left and right shoulders, left and right elbows, left and right wrists, left and right hips, left and right knees and left and right ankles, a total of 17 key points.
[0075] In a possible embodiment, after obtaining information of multiple key points of a character, if the position coordinates of the upper body key points among the multiple key points exceed the image boundary, the confidence of the upper body key points is set to zero; the multiple key points are predicted through a Kalman filter to obtain the predicted coordinates of the multiple key points; if the confidence of the second key point among the multiple key points is less than the preset confidence, the position coordinates of the second key point are replaced by the predicted coordinates of the second key point.
[0076] In the specific implementation process, multiple boundary coordinates of the image are determined according to the width and height of the image. If the position coordinates of the upper body key points are greater than any boundary coordinates, it is determined that the upper body key points exceed the image boundary, and its confidence is set to zero, and the prediction results of the Kalman filter are used to replace the key points with lower confidence. In this way, the influence of abnormal data can be eliminated, the detection error and noise can be effectively reduced, and more stable and accurate detection results of human key points can be provided.
[0077] S203, calculating the hand swing frequency, the movement step frequency, and actual values of multiple indicators according to the information of multiple key points in the continuous multiple frame images.
[0078] First, we introduce how to calculate the motion frequency based on the information of multiple key points in multiple consecutive image frames.
[0079] In a possible embodiment, a virtual point in each frame of a continuous multi-frame image is determined based on a plurality of key points in each frame of the continuous multi-frame image to obtain a virtual point sequence of the continuous multi-frame image; a fast Fourier transform is performed on the virtual point sequence to obtain a frequency spectrum curve; and a maximum value in the frequency spectrum curve is determined as the movement frequency of the character.
[0080] In the specific implementation process, one key point can be selected from multiple key points in each frame of the continuous multi-frame image as a virtual point in each frame. Considering that a single key point may be affected by video quality, posture changes or model detection errors, resulting in inaccurate or offset positions, multiple key points can be combined to average these errors and improve the accuracy and stability of the virtual point.
[0081] In a possible embodiment, if the continuous multi-frame images are images of the upper body of the person, multiple upper body key points are selected from the head and shoulders of the person; if the continuous multi-frame images are full-body images of the person, multiple leg key points are selected from the legs of the person; based on the position coordinates of the multiple upper body key points or the multiple leg key points, the position coordinates of a virtual point are obtained; based on the position coordinates of the virtual points in the continuous multi-frame images, a virtual point sequence of the continuous multi-frame images is obtained.
[0082] In the specific implementation process, if only the upper body of the person is in the image, the key point position of the foot cannot be obtained, and only the head and shoulders are always kept in the video. Therefore, multiple upper body key points are selected from the head and shoulders of the person, such as 5 key points of the head (left and right eyes, left and right ears, nose) and 2 key points of the left and right shoulders, a total of 7 upper body. If the whole body of the person is in the image, multiple leg key points are selected from the legs of the person, such as 2 key points of the left and right knees and 2 key points of the left and right ankles, a total of 4 leg key points. The position coordinates of multiple upper body key points can be centered and averaged to obtain the position coordinates of a virtual point, or the position coordinates of multiple leg key points can be centered and averaged to obtain the position coordinates of a virtual point. Finally, according to the virtual points in multiple consecutive frames of images, a virtual point sequence can be obtained.
[0083] Please refer to Figure 4 , is a schematic diagram of upper body key points and virtual points provided in an embodiment of the present application. The image is an upper body image of a person. The black dots represent seven upper body key points, namely, left and right eyes, left and right ears, nose, and left and right shoulders. The box represents a virtual point obtained based on these seven upper body key points. The motion curve of the virtual point is shown in FIG. Figure 5 shown.
[0084] In the embodiment of the present application, according to different motion scenes, different key points are combined to determine the virtual points, which can improve the accuracy and adaptability of the virtual points, thereby better reflecting the nature and characteristics of the motion. The virtual point sequence provides an abstract representation of the character's movements and postures, simplifying the understanding and analysis of continuous multi-frame image data.
[0085] In a possible embodiment, the steps of obtaining the position coordinates of a virtual point according to the position coordinates of a plurality of upper body key points are as follows:
[0086] The position coordinates of multiple upper body key points are averaged to obtain mean coordinates; the position coordinates of each upper body key point among the multiple upper body key points are subtracted from the mean coordinates to obtain the position coordinates of multiple centralized upper body key points; the position coordinates of multiple centralized upper body key points are averaged to obtain the position coordinates of a virtual point.
[0087] In an embodiment of the present application, by subtracting the mean coordinates to centralize multiple upper body key points, the offset error caused by the overall displacement can be reduced, and the relative position relationship can be more accurately reflected instead of being subject to changes in the absolute position. And the centralization process will eliminate some global position information, so that the analysis focuses more on the relative position relationship between the key points. Through the centralization and averaging operations, even if some key points deviate from the original position due to posture changes or detection errors, this double averaging method can smooth out these outliers, thereby obtaining a more stable and reliable virtual point position.
[0088] In a possible embodiment, the steps of obtaining the position coordinates of a virtual point according to the position coordinates of a plurality of leg key points are as follows:
[0089] The position coordinates of the two leg key points of the target leg are averaged to obtain the mean coordinates; the target leg is the left leg or the right leg; the two leg key points include the key points of the knee and the ankle; the position coordinates of the two leg key points are subtracted from the mean coordinates to obtain the position coordinates of the two centralized leg key points; the position coordinates of the two centralized leg key points are averaged to obtain the position coordinates of the virtual point of the target leg; the position coordinates of the virtual point of the right leg are subtracted from the position coordinates of the virtual point of the left leg to obtain the position coordinates of a virtual point.
[0090] In the embodiment of the present application, considering that the movements of the left and right legs change alternately, in order to measure the difference changes between the left and right legs, the two leg key points of the left leg are respectively centered and averaged to obtain a virtual point of the left leg, and the two leg key points of the right leg are centered and averaged to obtain a virtual point of the right leg, and their position coordinates are subtracted to obtain a virtual point representing the left-right symmetry, which is very helpful for evaluating the symmetry of posture, detecting left-right differences, and performing motion analysis.
[0091] In a possible embodiment, after obtaining the virtual point sequence, the virtual point sequence can be directly subjected to fast Fourier transform to obtain a spectrum curve. The virtual point sequence can also be subjected to median filtering and Gaussian filtering to obtain a filtered virtual point sequence; the DC component can be removed from the filtered virtual point sequence to obtain a virtual point sequence after the DC component is removed; the virtual point sequence after the DC component is removed can be subjected to fast Fourier transform to obtain a spectrum curve.
[0092] In the specific implementation process, first, median filtering is performed on the virtual point sequence, and each point of the virtual point sequence is covered in turn through a sliding window (usually an odd size, such as 3x3, 5x5, etc.), and the values of all points in the window are sorted, and the sorted middle value is taken to replace the new value of the current point to obtain the virtual point sequence after median filtering. Then, Gaussian filtering is performed on the virtual point sequence after median filtering. For each pixel of the virtual point sequence, a two-dimensional Gaussian weight window is taken with each point of the virtual point sequence after median filtering as the center, and the weight of each point in the window, that is, the Gaussian function value, is calculated. The value of each point in the window is multiplied by the corresponding Gaussian weight, and then summed and divided by the total weight to obtain the filtered virtual point sequence. Next, the average value of the filtered virtual point sequence is calculated to obtain the DC component, and the DC component is subtracted from each point of the filtered virtual point sequence to obtain the virtual point sequence after the DC component is removed. Finally, the virtual point sequence after the DC component is removed is subjected to fast Fourier transform to obtain the spectrum curve.
[0093] Please refer to Figure 6 , which is a signal comparison diagram before and after the DC component is removed according to an embodiment of the present application. Figure 6 It can be seen that the original signal contains an obvious DC component, which makes the signal deviate from zero as a whole. After removing the DC component, the average value of the signal returns to near zero, so that the actual change trend of the signal can be observed more clearly.
[0094] Please refer to Figure 7 , is a comparison diagram of the signal spectrum before and after the DC component is removed according to the embodiment of the present application. Figure 7 It can be seen that the signal spectrum without removing the DC component has an obvious peak in the low-frequency region. This peak corresponds to the DC component. After removing the DC component, the peak disappears in the signal spectrum, and the low-frequency part becomes smoother.
[0095] In the embodiment of the present application, considering that there is usually a lot of noise in the original signal, the median filter is very effective in removing salt and pepper noise, and can well remove isolated extreme values. The Gaussian filter is a linear smoothing filter that can eliminate Gaussian noise. The two filtering processes can effectively reduce the noise, making the signal smoother and closer to the standard sine waveform, and effectively improving the accuracy of subsequent spectrum analysis. Further removing the DC component not only makes the spectrum of the signal more accurately reflect the actual frequency component, but also reduces the interference of the DC component on the frequency analysis, highlights other meaningful frequency components, and helps to analyze and process the signal more accurately.
[0096] As described above, how to calculate the movement frequency based on the information of multiple key points is introduced. The following describes how to calculate the hand swing frequency. You can select the left and right shoulders, left and right elbows, and left and right wrists as multiple hand key points. The hand swing frequency is calculated based on the information of multiple hand key points. The steps are the same as those for calculating the movement frequency, as follows:
[0097] The aforementioned centering and averaging operations are performed on multiple hand key points to obtain the position coordinates of a virtual hand point, and a sequence of virtual hand points in multiple consecutive frames of images is obtained based on the position coordinates of the virtual hand points in multiple consecutive frames of images. Furthermore, the sequence of virtual hand points is sequentially subjected to median filtering, Gaussian filtering, and fast Fourier transform to obtain a hand spectrum curve, and the maximum value in the hand spectrum curve is determined as the hand swing frequency.
[0098] The above describes how to calculate the exercise cadence and hand swing frequency. The following describes how to calculate the actual values of multiple indicators.
[0099] The multiple indicators include head swing amplitude, shoulder swing amplitude, hand swing amplitude and shoulder width. Among them, head swing amplitude refers to the horizontal movement range of the head, shoulder swing amplitude refers to the horizontal movement range of the shoulder, and hand swing amplitude refers to the horizontal movement range of the hand. The following describes how to calculate the head swing amplitude, shoulder swing amplitude and hand swing amplitude.
[0100] The maximum change in the horizontal coordinate value of the key point of the head within the preset time period is determined as the head swing amplitude, the maximum change in the horizontal coordinate value of the key point of the shoulder within the preset time period is determined as the shoulder swing amplitude, and the maximum change in the horizontal coordinate value of the key point of the hand within the preset time period is determined as the hand swing amplitude. The preset time period can be 2 seconds.
[0101] For example, the normalized sequence of the horizontal coordinate values of the key points of the head within the preset time period is: X = {x1, x2, ..., x n}, the calculation formula for the head swing amplitude is:
[0102] α2=max(X)-min(X)
[0103] Among them, α2 is the head swing amplitude, max(X) is the maximum value in X, that is, the maximum horizontal coordinate value of the key points of the head in the preset time period, and min(X) is the minimum value in X, that is, the minimum horizontal coordinate value of the key points of the head in the preset time period.
[0104] Shoulder width refers to the width between the left shoulder and the right shoulder, which can be expressed by the horizontal difference between the key points of the left shoulder and the right shoulder.
[0105] For example, the sequence of x-coordinates of the key points of the left shoulder within the preset time period is XL = {xl1, xl2, ..., xl n}, the sequence of x coordinates of the key points of the right shoulder within the preset time period is XR = {xr1, xr2, ...., xr n}, the calculation formula of shoulder width is as follows:
[0106]
[0107] Among them, α3 is the shoulder width, n is the total number of key points of the left shoulder or the total number of key points of the right shoulder detected within the preset time period, and xl i is the horizontal coordinate value of the i-th key point of the left shoulder, xr i is the horizontal coordinate value of the i-th key point of the right shoulder.
[0108] S204, evaluating the movement posture of the person according to the frequency difference between the hand swing frequency and the movement step frequency, and the difference between the actual value and the standard value of each indicator.
[0109] In the specific implementation process, the standard value is calculated based on a standard sports video, which can be a standard running video, a standard weightlifting video, etc. The sports posture score can be used to measure whether the sports posture of a person is standard. If the standard sports video is a standard running video, the sports posture score can be used to measure whether the running posture of the person is standard. If the standard sports video is a standard weightlifting video, the sports posture score can be used to measure whether the weightlifting posture of the person is standard.
[0110] There are many specific implementations of S204, which are introduced below respectively.
[0111] In a possible embodiment, the frequency difference between the hand swing frequency and the movement step frequency is calculated, and the difference between the actual value and the standard value of each indicator is calculated to obtain multiple differences; the frequency difference and the multiple differences are normalized and summed to obtain the character's movement posture score.
[0112] In the specific implementation process, the standard values of the head swing amplitude, shoulder swing amplitude, hand swing amplitude, and shoulder width can be calculated in advance according to the standard motion video, and the difference between the actual value and the standard value of the head swing amplitude, the difference between the actual value and the standard value of the shoulder swing amplitude, the difference between the actual value and the standard value of the hand swing amplitude, and the difference between the actual value and the standard value of the shoulder width are calculated respectively to obtain multiple differences. Then, the frequency difference and the multiple differences are normalized and summed to obtain the motion posture score of the character.
[0113] In the embodiment of the present application, since the difference between the user's motion video and the standard motion video is positively correlated with the motion posture score, the higher the motion posture score of the character, the greater the difference between the motion posture of the character and the standard motion video, and the less standardized the motion posture of the character. Conversely, the lower the motion posture score of the character, the smaller the difference between the motion posture of the character and the standard motion video, and the more standardized the motion posture of the character.
[0114] In a possible embodiment, a synchronization rate score can be obtained based on the frequency difference between the hand swing frequency and the movement step frequency; the synchronization rate score is negatively correlated with the frequency difference; the score of each indicator is obtained based on the difference between the actual value and the standard value of each indicator; the score of each indicator is negatively correlated with the difference; the average of the synchronization rate score and the scores of multiple indicators is determined as the character's movement posture score.
[0115] In the specific implementation process, the calculation formula of the synchronization rate score is as follows:
[0116]
[0117] Among them, score1 is the synchronization score, α1 is the hand swing frequency, and α1 t is the movement frequency, λ is the coefficient, which is usually 1.
[0118] The score for each indicator is calculated as follows:
[0119]
[0120] Among them, score is the score of each indicator, α is the actual value of each indicator, and α t is the standard value of each indicator, λ is the coefficient, which is generally 1.
[0121] Furthermore, the standard values of the head swing amplitude, shoulder swing amplitude, hand swing amplitude, and shoulder width can be calculated in advance based on the standard motion video, and the score of the head swing amplitude can be obtained according to the difference between the actual value of the head swing amplitude and the standard value, the score of the shoulder swing amplitude can be obtained according to the difference between the actual value of the shoulder swing amplitude and the standard value, the score of the hand swing amplitude can be obtained according to the difference between the actual value of the hand swing amplitude and the standard value, and the score of the shoulder width can be obtained according to the difference between the actual value of the shoulder width and the standard value. The synchronization rate score, the head swing amplitude score, the shoulder swing amplitude score, the hand swing amplitude score, and the shoulder width score are averaged to obtain the motion posture score of the character.
[0122] In the embodiment of the present application, the maximum value of the motion posture score is 1. Since the difference between the user's motion video and the standard motion video is negatively correlated with the motion posture score, the lower the motion posture score of the character, the greater the difference between the motion posture of the character and the standard motion video, and the less standardized the motion posture of the character. Conversely, the higher the motion posture score of the character, the smaller the difference between the motion posture of the character and the standard motion video, and the more standardized the motion posture of the character.
[0123] In a possible embodiment, the movement frequency can also be substituted into a nonlinear polynomial function to obtain the movement speed of the character; the parameters of the nonlinear polynomial function are obtained by fitting a large number of videos with real speed labels through the least squares method; and the movement posture score is used as the confidence level of the movement speed.
[0124] In the specific implementation process, a large number of videos with real speed labels can be collected as data sets, and a mapping relationship from the movement frequency to the real speed in the data sets can be established to obtain a nonlinear polynomial function, which can be a nonlinear quartic polynomial function, a nonlinear cubic polynomial function, etc. Parameter calculation is achieved through least squares fitting to obtain the values of each parameter of the nonlinear polynomial function.
[0125] For example, the nonlinear quartic polynomial function is as follows:
[0126] f(x)=ax 4 +bx 3 +cx 2 +dx+e
[0127] Among them, f(x) represents the speed of movement, x represents the frequency of movement, and a, b, c, d, and e are the parameters of the nonlinear quartic polynomial function. By fitting a large number of videos with real speed labels using the least squares method, we get: a = 0.69, b = -4.70, c = 11.02, d = -1.60, e = 0.52.
[0128] Please refer to Figure 8 , is a schematic diagram of a nonlinear quartic polynomial function provided in an embodiment of the present application. The curve represents a nonlinear quartic polynomial function, and + represents the true speed of each image in the data set. Figure 8 The nonlinear quartic polynomial function shown converts the spectrum curve into the movement speed of the character, such as Fig. 9 shown.
[0129] In an embodiment of the present application, the mapping relationship between movement frequency and movement speed is determined based on a real data set, the movement frequency is converted into movement speed, and the movement posture score is used as the confidence level of the movement speed. This method combines movement frequency and posture information to improve the accuracy of movement speed estimation and prevent false movements from being misjudged as running, weightlifting, etc.
[0130] Please refer to Fig.10 , which is an overall flow chart of a method for evaluating motion posture based on key points and step frequency provided in an embodiment of the present application.
[0131] First, initialize the parameters, load the model, and initialize the Kalman filter. Then perform target detection. If no person is detected, set cnt = cnt + 1, where cnt represents the total number of images where no person is detected. If cnt>N, where N is in the range of 4 to 8, continue to perform target detection on the next frame.
[0132] If a person is detected, let cnt = 0, or cnt ≤ N, then the target frame is predicted by the Kalman filter, and then key point detection is performed, and multiple key points are predicted by the Kalman filter. If the confidence of any key point is less than or equal to the preset confidence, the predicted coordinates of the key point by the Kalman filter are used as the position coordinates of the key point, and the predicted confidence of the key point by the Kalman filter is used as the confidence of the key point, and the position coordinates and confidence of multiple key points are stored in an array.
[0133] When the array reaches the specified length, the key points in the array are normalized, median filtered, Gaussian filtered, DC components removed, and fast Fourier transformed to obtain a spectrum curve. The maximum value in the spectrum curve is determined as the movement frequency, the movement frequency is converted into movement speed, and the speed is input into the Kalman filter for prediction and update. The key point that was first added to the array is removed until there are no subsequent frames and the process ends.
[0134] Please refer to Fig.11 , which is a flow chart of a sports game of a method for evaluating sports posture based on key points and step frequency provided in an embodiment of the present application.
[0135] First, the front camera is called to acquire video frames, and then the method for evaluating motion posture based on key points and step frequency provided in the embodiment of the present application is called to implement character scanning, perform target detection and key point detection. If the scan is unsuccessful and the character and key points are not detected, continue to acquire video frames. If the scan is successful, the speed is calculated according to the key points, and the running posture is monitored according to the motion speed. If the running posture is correct, the virtual character is driven to run in real time according to the updated speed value. If the running posture is incorrect, an incorrect posture prompt is given or running is stopped.
[0136] In summary, the embodiment of the present application provides a method for evaluating motion posture based on key points and step frequency, which uses a human key point detection algorithm to detect key points of important parts of the human body, and realizes motion speed calculation and posture evaluation through time series key point analysis. In terms of motion speed calculation, firstly, key points at different positions are selected according to different video types and integrated into a virtual point to reduce the impact of inaccurate prediction of individual points, and normalization, denoising and other means are combined to reduce the interference caused by noise. Then, the virtual point sequence is analyzed by fast Fourier transform, and its frequency spectrum is calculated to obtain the motion step frequency. Finally, the motion step frequency is converted into motion speed through the motion speed fitting function. The motion speed fitting function is a nonlinear quartic polynomial function, and its parameters are obtained by fitting a large number of data sets by the least squares method.
[0137] In terms of posture assessment, we first analyze the correct sports posture based on standard sports videos to obtain standard values for indicators such as head swing amplitude, shoulder swing amplitude, shoulder width, arm swing frequency and the synchronization rate of step frequency. By analyzing the movement patterns of key points in the user's sports video, we determine the actual values of various indicators and evaluate the sports posture based on the difference between the standard value and the actual value.
[0138] This method is based on computer vision technology and signal processing algorithms, combined with human key point positioning, Kalman filtering and fast Fourier transform technologies, and can monitor motion posture in real time and quantify its speed frequency, providing data support for the evaluation and improvement of sports performance, completely getting rid of the dependence on sensors and wearable devices, making posture estimation and speed calculation more convenient and economical. Through the application of fast Fourier transform and Kalman filter, the runner's posture can be monitored and analyzed in real time, and accurate data support can be provided under high real-time requirements. The application of Kalman filter effectively reduces the jitter and temporary error in the key point trajectory, making the posture estimation more stable, thereby improving the accuracy of the data. This method can be deployed on a variety of platforms and edge devices to complete a variety of functions, such as motion monitoring, game interaction, etc.
[0139] Based on the same inventive concept, Fig.12 As shown, the embodiment of the present application also provides a device for evaluating motion posture based on key points and cadence; the device includes:
[0140] A detection module is used to detect in sequence whether there is a person in each frame of the user's motion video, and determine a plurality of consecutive frames of images in which a person exists;
[0141] The detection module is also used to detect key points of each frame of the continuous multiple frames of images to obtain information on multiple key points of the person in each frame of the image;
[0142] A calculation module, used to calculate the hand swing frequency, movement step frequency, and actual values of multiple indicators based on information of multiple key points in multiple consecutive frames of images;
[0143] An evaluation module is used to evaluate the movement posture of the character according to the frequency difference between the hand swing frequency and the movement step frequency, and the difference between the actual value and the standard value of each indicator.
[0144] It should be noted that the modules in the device for evaluating motion posture based on key points and cadence in this embodiment correspond one-to-one to the steps in the method for evaluating motion posture based on key points and cadence in the aforementioned embodiment. Therefore, the specific implementation of this embodiment can refer to the implementation of the aforementioned method for evaluating motion posture based on key points and cadence, which will not be repeated here.
[0145] In addition, in one embodiment, the present application also provides a computer device, which is equivalent to the traffic optimization device discussed above, and the computer device includes a processor, a memory, and a computer program stored in the memory. When the computer program is executed by the processor, it implements the aforementioned method for evaluating motion posture based on key points and step frequency.
[0146] In addition, in one embodiment, the present application also provides a computer storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the aforementioned method for evaluating motion posture based on key points and step frequency is implemented.
[0147] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.
[0148] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0149] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as a read-only memory / random access memory, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a multimedia terminal device (which can be a mobile phone, a computer, a television receiver, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0150] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A method for evaluating motion posture based on key points and cadence, It is characterized in that include: Detecting in sequence whether there is a person in each frame of the user's motion video, and determining a plurality of consecutive frames of images in which the person exists; Performing key point detection on each frame of the continuous multiple frames of images to obtain information on multiple key points of the person in each frame of the image; Calculating the hand swing frequency, the movement step frequency, and actual values of multiple indicators according to the information of multiple key points in the continuous multiple frames of images; The movement posture of the character is evaluated based on the frequency difference between the hand swing frequency and the movement step frequency, and the difference between the actual value and the standard value of each indicator.
2. The method for evaluating motion posture based on key points and step frequency as claimed in claim 1, It is characterized in that The information includes position coordinates and confidence; after performing key point detection on each frame of the continuous multiple frames of images to obtain information of multiple key points of the person in each frame of the image, the method includes: If the position coordinates of the upper body key points among the multiple key points exceed the image boundary, the confidence of the upper body key points is set to zero; Predicting the multiple key points through a Kalman filter to obtain predicted coordinates of the multiple key points; If the confidence of a second key point among the multiple key points is less than a preset confidence, the position coordinates of the second key point are replaced by the predicted coordinates of the second key point.
3. The method for evaluating motion posture based on key points and step frequency as claimed in claim 1, It is characterized in that According to the information of the multiple key points in the continuous multiple frames of images, the hand swing frequency, the movement step frequency, and the actual values of multiple indicators are calculated, including: Determine a virtual point in each frame of the continuous multiple frames of images according to a plurality of key points in each frame of the continuous multiple frames of images, and obtain a virtual point sequence of the continuous multiple frames of images; Performing fast Fourier transform on the virtual point sequence to obtain a frequency spectrum curve; The maximum value in the frequency spectrum curve is determined as the movement frequency of the character.
4. The method for evaluating motion posture based on key points and step frequency as claimed in claim 3, It is characterized in that The step of determining a virtual point in each frame of the continuous multiple frames of images according to a plurality of key points in each frame of the continuous multiple frames of images to obtain a virtual point sequence of the continuous multiple frames of images includes: If the continuous multiple-frame images are images of the upper body of the person, selecting a plurality of upper body key points from the head and shoulders of the person; If the continuous multiple frame images are full-body images of the person, selecting a plurality of leg key points from the legs of the person; Obtaining position coordinates of a virtual point according to the position coordinates of the multiple upper body key points or the multiple leg key points; According to the position coordinates of the virtual points in the continuous multiple-frame images, a virtual point sequence of the continuous multiple-frame images is obtained.
5. The method for evaluating motion posture based on key points and step frequency as claimed in claim 4, It is characterized in that The step of obtaining the position coordinates of a virtual point according to the position coordinates of the plurality of upper body key points or the plurality of leg key points comprises: Averaging the position coordinates of the plurality of upper body key points to obtain mean coordinates; Subtract the mean coordinate from the position coordinates of the plurality of upper body key points to obtain the position coordinates of a plurality of centralized upper body key points; The position coordinates of the plurality of centralized upper body key points are averaged to obtain the position coordinates of a virtual point.
6. The method for evaluating motion posture based on key points and step frequency as claimed in claim 4, It is characterized in that The step of obtaining the position coordinates of a virtual point according to the position coordinates of the plurality of upper body key points or the plurality of leg key points comprises: Averaging the position coordinates of two leg key points of the target leg to obtain mean coordinates; the target leg is the left leg or the right leg; the two leg key points include key points of the knee and the ankle; Subtract the mean coordinates from the position coordinates of the two leg key points to obtain the position coordinates of the two centralized leg key points; Taking an average of the position coordinates of the two centralized leg key points to obtain the position coordinates of the virtual point of the target leg; The position coordinates of a virtual point are obtained by subtracting the position coordinates of the virtual point of the right leg from the position coordinates of the virtual point of the left leg.
7. The method for evaluating motion posture based on key points and step frequency as claimed in claim 3, It is characterized in that The performing fast Fourier transform on the virtual point sequence to obtain a spectrum curve comprises: Performing median filtering and Gaussian filtering on the virtual point sequence to obtain a filtered virtual point sequence; Removing a DC component from the filtered virtual point sequence to obtain a virtual point sequence after the DC component is removed; The virtual point sequence after the DC component is removed is subjected to a fast Fourier transform to obtain a frequency spectrum curve.
8. The method for evaluating motion posture based on key points and step frequency as claimed in claim 1, It is characterized in that The step of evaluating the motion posture of the character according to the frequency difference between the hand swing frequency and the motion step frequency and the difference between the actual value and the standard value of each indicator includes: A synchronization rate score is obtained according to the frequency difference between the hand swing frequency and the movement step frequency; the synchronization rate score is negatively correlated with the frequency difference; The score of each indicator is obtained according to the difference between the actual value of each indicator and the standard value; the standard value is calculated based on the standard motion video; the score of each indicator is negatively correlated with the difference; The average value between the synchronization rate score and the scores of the multiple indicators is determined as the motion posture score of the character; the higher the motion posture score is, the more standardized the motion posture of the character is.
9. The method for evaluating sports posture based on key points and step frequency as claimed in claim 8, It is characterized in that After determining the average value between the synchronization rate score and the scores of the multiple indicators as the motion posture score of the character, the method further includes: Substituting the movement frequency into a nonlinear polynomial function to obtain the movement speed of the character; the parameters of the nonlinear polynomial function are obtained by fitting a large number of videos with real speed labels using the least squares method; The motion gesture score is determined as the confidence of the motion speed.
10. A device for evaluating sports posture based on key points and step frequency, It is characterized in that include: A detection module, used to detect in sequence whether there is a person in each frame of the user's motion video, and determine a plurality of consecutive frames of images containing the person; The detection module is further used to perform key point detection on each frame of the continuous multiple frames of images to obtain information on multiple key points of the person in each frame of the image; A calculation module, used to calculate the hand swing frequency, the movement step frequency, and actual values of multiple indicators according to the information of multiple key points in the continuous multiple frames of images; An acquisition module, used to obtain a synchronization rate score according to a frequency difference between the hand swing frequency and the movement step frequency; the synchronization rate score is negatively correlated with the frequency difference; The obtaining module is further used to obtain the score of each indicator according to the difference between the actual value of each indicator and the standard value; the standard value is calculated based on the standard motion video; the score of each indicator is negatively correlated with the difference; The determination module is used to determine the average value between the synchronization rate score and the scores of the multiple indicators as the motion posture score of the character; the higher the motion posture score, the more standardized the motion posture of the character.
