Motion analysis and correction method and system for aerobics training and storage medium
By classifying the image elements in aerobics training videos and removing non-human objects, combining the comparison between standard images and training images and analysis of personal body key points, the problems of the complexity of action recognition and the impact of non-human objects in the prior art are solved, and efficient and accurate generation of action correction suggestions are achieved.
Patent Information
- Application Number
- CN202411729896.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2025-03-18
- Estimated Expiration
- 2044-11-29
AI Technical Summary
When identifying actions from aerobics training videos, the prior art fails to effectively exclude the influence of other objects other than the human body in the image frame, and the motion analysis method is relatively complex.
By extracting training images from aerobics training videos, classifying each image element, removing image elements of preset categories, and comparing the standard images with the removed training images, detecting individual body key points, generating feature sequences to analyze action deviations and provide correction suggestions.
It realizes the correction suggestions for automatically generating aerobics movements, simplifies the action recognition process, eliminates the influence of non-human objects, and improves recognition efficiency and accuracy.
Smart Images

Figure CN119649455A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of aerobics movement correction, and in particular relates to a movement analysis and correction method, a system and a storage medium for aerobics training. Background Art
[0002] Currently, aerobics is becoming more and more popular as a fitness exercise, but people usually practice aerobics offline under the guidance of teachers, which is very costly. Therefore, a new way to practice aerobics online is needed. By analyzing aerobics training videos, problems in training movements can be automatically identified, and corrective suggestions can be given.
[0003] Similar prior art includes a Chinese patent application with publication number CN113065505A, which provides a method and system for rapid recognition of body movements, the method comprising: selecting body movement discrimination joint points in human joint points, establishing a simplified model of human joints; using joint angle parameters and joint vertical height parameters in the simplified model of human joints as movement discrimination parameters; using a body movement discrimination joint point in the simplified model of human joints as the coordinate origin, establishing a human body center projection coordinate system for obtaining movement discrimination parameters; establishing a movement recognition model according to the change characteristics of the movement discrimination parameters corresponding to the body movement; continuously collecting movement image frames, obtaining movement discrimination parameters from the human body center projection coordinate system according to the movement image frames, and using the movement recognition model according to the obtained movement discrimination parameters to realize specific movement recognition. However, this patent application does not consider excluding the influence of other objects other than the human body in the image frame when recognizing the movement from the image frame. In addition, similar prior art also includes a Chinese patent application with publication number CN110490034A, which provides a motion analysis device, a motion analysis method, a recording medium and a motion analysis system. The motion analysis device has: an acquisition unit, which acquires multiple motion information representing the motions of multiple subjects; a classification unit, which classifies the multiple motion information into any group among multiple groups; and an analysis unit, which analyzes the motion of the subject according to the motion information classified into any group among multiple groups, the multiple motion information respectively includes skeleton information, and the skeleton information represents the positions of multiple parts of the body of the multiple subjects associated with the skeleton, and the classification unit uses the skeleton information respectively included in the multiple motion information to classify the multiple motion information. However, the method of motion analysis in this patent application is relatively complicated. Summary of the invention
[0004] The present invention extracts all training images from aerobics training videos, classifies each image element in all the training images, removes image elements of preset categories from all the training images, compares each standard image with all the training images that have been removed, determines the training image corresponding to each standard image, and generates correction suggestions for the training images corresponding to each standard image.
[0005] In order to achieve the above-mentioned object of the invention, the present invention provides the following motion analysis and correction method for aerobics training, which mainly includes the following steps:
[0006] S1. The preprocessing module obtains a training video, extracts all training images from the training video, and selects a preset number of training images from all training images each time, generates a classification function for each image element based on image element values of all image elements in the preset number of training images, and determines the category of each image element according to the function value of the classification function corresponding to each image element;
[0007] S2, for each training image, the preprocessing module removes image elements of a preset category from the training image, and the comparison module obtains a plurality of standard images, compares each standard image with all the training images that have undergone the removal process, and determines a training image corresponding to each standard image;
[0008] S3, the comparison module detects a number of key points of the human body in each standard image and the training image corresponding to each standard image, the key points of the human body including head feature points, shoulder feature points, elbow feature points, wrist feature points, hip feature points, knee feature points, and ankle feature points, extracts feature values of the key points of the human body including position, direction, and speed, and composes feature sequences with the feature values of the key points of the human body;
[0009] S4. The analysis module analyzes several human key points in the training image corresponding to each standard image and the feature sequence of the training image corresponding to each standard image, where there are deviations between different human key points in each standard image, and generates correction suggestions for the training image corresponding to each standard image.
[0010] As a preferred technical solution of the present invention, generating a classification function for each image element based on the image element values of all image elements in a preset number of training images includes the following steps:
[0011] S111, obtaining a first image element value component, a second image element value component, and a third image element value component of each image element based on a preset number of image elements with the same coordinates in a preset number of training images each time;
[0012] S112, with respect to a preset number of image elements, sequentially calculating a first difference between a first image element value component of a previous image element and a first image element value component of a subsequent image element, and determining a specific first difference in the first differences of the preset number minus one, and sequentially calculating a second difference between a second image element value component of a previous image element and a second image element value component of a subsequent image element, and determining a specific second difference in the second differences of the preset number minus one, and sequentially calculating a third difference between a third image element value component of a previous image element and a third image element value component of a subsequent image element, and determining a specific third difference in the third differences of the preset number minus one;
[0013] S113. Calculate a first representative value according to a specific first difference, calculate a second representative value according to a specific second difference, calculate a third representative value according to a specific third difference, and for each image element in a preset number of image elements, generate a first intermediate function according to the first image element value component of the image element and the first representative value, generate a second intermediate function according to the second image element value component of the image element and the second representative value, generate a third intermediate function according to the third image element value component of the image element and the third representative value, multiply the first intermediate function, the second intermediate function, and the third intermediate function to obtain a sub-classification function, and add the sub-classification functions corresponding to the preset number of image elements to obtain the classification function corresponding to the preset number of image elements.
[0014] As a preferred technical solution of the present invention, determining the category of each image element according to the function value of the classification function corresponding to each image element includes: when the function value of the classification function corresponding to the image element is less than a first threshold, classifying the image element into a first category; when the function value of the classification function corresponding to the image element is greater than a second threshold, classifying the image element into a second category; when the function value of the classification function corresponding to the image element is greater than or equal to the first threshold and less than or equal to the second threshold, classifying the image element into a third category.
[0015] As a preferred technical solution of the present invention, after determining the category of each image element according to the function value of the classification function corresponding to each image element, the following steps are also included:
[0016] S121, using the same segmentation method to respectively segment a preset number of training images into a plurality of training image regions, and each time based on the preset number of training image regions at the same position in the preset number of training images, calculating the difference between the number of image elements belonging to the first category in a later training image region and the number of image elements belonging to the first category in a previous training image region, determining a first value and a second value according to the difference of the preset number minus a number, calculating the difference between the number of image elements belonging to the third category in a later training image region and the number of image elements belonging to the third category in a previous training image region, and determining a third value and a fourth value according to the difference of the preset number minus a number;
[0017] S122. For a preset number of training image regions, determine a value range of a first contrast value and a value range of a second contrast value, wherein the first contrast value is greater than or equal to a result value obtained by subtracting the first value from the product of the second value and a preset ratio, and is less than or equal to a result value obtained by adding the first value to the product of the second value and the preset ratio, and the second contrast value is greater than or equal to a result value obtained by subtracting the third value from the product of the fourth value and the preset ratio, and is less than or equal to a result value obtained by adding the third value to the product of the fourth value and the preset ratio.
[0018] As a preferred technical solution of the present invention, after determining the value of the first contrast value and the value of the second contrast value for a preset number of training image regions, the following steps are also included:
[0019] S1221, in a preset number of training image regions, calculating a first numerical difference between the number of image elements belonging to the first category in a subsequent training image region and the number of image elements belonging to the first category in a previous training image region, and simultaneously calculating a second numerical difference between the number of image elements belonging to the third category in the subsequent training image region and the number of image elements belonging to the third category in the previous training image region;
[0020] S1222, judging whether the first digital difference is within the value range of the first comparison value, if not, updating the first threshold, if yes, maintaining the first threshold, judging whether the second digital difference is within the value range of the second comparison value, if not, updating the second threshold, if yes, maintaining the second threshold, and if the first threshold and the second threshold are not updated, continuing S1224, otherwise, continuing S1223;
[0021] S1223, reclassify the category to which each image element in the next training image region belongs, and jump to S1221;
[0022] S1224: Update the next training image area, and jump to S1221.
[0023] As a preferred technical solution of the present invention, each standard image is compared with all the training images that have undergone the removal process to determine the training image corresponding to each standard image, including the following steps:
[0024] S211, determining a number of image elements and a number of standard image blocks with the coordinates of the number of image elements as central coordinates in the standard image, and searching for a number of training image blocks corresponding to the number of standard image blocks in each training image that has undergone the removal processing, and recording the central coordinates of the number of training image blocks;
[0025] S212, for each training image block in each training image that has undergone the removal processing, determining whether the central coordinate of the training image block is close to the central coordinate of the standard image block corresponding to the training image block, and if so, increasing the preset recorded value by 1, and if not, maintaining the recorded value;
[0026] S213. For each training image that has undergone removal processing, calculate the result value of dividing the record value corresponding to the training image by the number of all training image blocks in the training image, and among several training images corresponding to result values greater than the first result value threshold, determine the training image corresponding to the largest result value as the training image corresponding to the standard image.
[0027] As a preferred technical solution of the present invention, each standard image is compared with all the training images that have undergone the removal process to determine the training image corresponding to each standard image, and the following steps are also included:
[0028] S221, determining a number of image elements and a number of standard image blocks with the coordinates of the number of image elements as central coordinates in the standard image, and searching for a number of training image blocks corresponding to the number of standard image blocks in each training image that has undergone the removal processing;
[0029] S222, for each training image block in each training image that has been processed by the removal, calculating the sameness value between the training image block and the standard image block corresponding to the training image block, and based on the sameness values corresponding to all the training image blocks in each training image that has been processed by the removal, determining the first importance value and the second importance value, and calculating the result value obtained by dividing the first importance value by the second importance value;
[0030] S223. Based on all the training images that have undergone the removal processing, among a plurality of training images corresponding to result values greater than the second result value threshold, determine the training image corresponding to the largest result value as the training image corresponding to the standard image.
[0031] The present invention also provides a motion analysis and correction system for aerobics training, comprising the following modules:
[0032] A preprocessing module, used to obtain a training video, extract all training images from the training video, select a preset number of training images from all training images each time, generate a classification function for each image element based on the image element values of all image elements in the preset number of training images, determine the category of each image element according to the function value of the classification function corresponding to each image element; and for removing image elements of a preset category from each training image;
[0033] A comparison module is used to obtain a plurality of standard images, compare each standard image with all the training images that have been removed, and determine the training image corresponding to each standard image; and to detect a plurality of key points of the human body in each standard image and the training image corresponding to each standard image, the plurality of key points of the human body including the head, shoulder, elbow, wrist, hip, knee, and ankle, respectively extract characteristic values of the plurality of key points of the human body including position, direction, and speed, and respectively form a characteristic sequence with the characteristic values of the plurality of key points of the human body;
[0034] The analysis module is used to analyze a number of human key points in the training image corresponding to each standard image that deviate from different human key points in each standard image based on the feature sequence of each standard image and the feature sequence of the training image corresponding to each standard image, and generate correction suggestions for the training image corresponding to each standard image.
[0035] The present invention also provides a storage medium, wherein the storage medium stores program instructions, wherein when the program instructions are executed, the device where the storage medium is located is controlled to execute any one of the above methods.
[0036] Compared with the prior art, the beneficial effects of the present invention are at least as follows:
[0037] In the present invention, first, the preprocessing module obtains the training video, and extracts all the training images from the training video, and selects a preset number of training images from all the training images each time, and determines the category of each image element according to the function value of the classification function corresponding to each image element; secondly, for each training image, the preprocessing module removes the image elements of the preset category from the training image, and the comparison module obtains several standard images, compares each standard image with all the training images that have been removed, and determines the training image corresponding to each standard image; thirdly, the comparison module detects several human key points in each standard image and the training image corresponding to each standard image, extracts the feature values of several human key points, and composes the feature values of several human key points into a feature sequence; S4, the analysis module analyzes several human key points in the training image corresponding to each standard image and different human key points in each standard image that have deviations, and generates correction suggestions for the training image corresponding to each standard image. The present invention can automatically generate correction suggestions for aerobics movements, and the present invention classifies each image element in all training images, removes image elements of preset categories from all training images, thereby eliminating the influence of other objects except the human body in the training images when recognizing movements from the training images. In addition, the present invention compares the standard image with all the training images that have been removed, searches for the training image that is most similar to the standard image, and can simply and efficiently recognize the movements in the training images. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 A flow chart of the steps of the motion analysis and correction method for aerobics training of the present invention;
[0039] Figure 2 The present invention is a structural diagram of the motion analysis and correction system for aerobics training. DETAILED DESCRIPTION
[0040] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0041] It is understood that the terms "first", "second", etc. used in this application may be used herein to describe various elements, but unless otherwise specified, these elements are not limited by these terms. These terms are only used to distinguish a first element from another element. For example, without departing from the scope of this application, a first xx script may be referred to as a second xx script, and similarly, a second xx script may be referred to as a first xx script.
[0042] References Figure 1 As shown, the present invention provides a motion analysis and correction method for aerobics training, which is implemented by executing the following main steps:
[0043] S1. The preprocessing module obtains a training video, extracts all training images from the training video, and selects a preset number of training images from all training images each time, generates a classification function for each image element based on image element values of all image elements in the preset number of training images, and determines the category of each image element according to the function value of the classification function corresponding to each image element;
[0044] S2. For each training image, the preprocessing module removes image elements of a preset category from the training image, and the comparison module obtains a number of standard images, compares each standard image with all the training images that have undergone the removal process, and determines a training image corresponding to each standard image;
[0045] S3, the comparison module detects a number of key points of the human body in each standard image and the training image corresponding to each standard image, the key points of the human body include head feature points, shoulder feature points, elbow feature points, wrist feature points, hip feature points, knee feature points, and ankle feature points, extracts feature values of the key points of the human body including position, direction, and speed, and composes the feature values of the key points of the human body into feature sequences;
[0046] S4. The analysis module analyzes several human key points in the training image corresponding to each standard image and the feature sequence of the training image corresponding to each standard image, where there are deviations between different human key points in each standard image, and generates correction suggestions for the training image corresponding to each standard image.
[0047] Specifically, in S1, the preprocessing module extracts all the training images that constitute the training video based on the acquired aerobics training video, and the preprocessing module selects a preset number of training images from all the training images each time, and classifies all the image elements in the preset number of training images. The preset number of training images selected by the preprocessing module each time is different. Of course, if the number of unselected training images is less than the preset number, only those unselected training images can be selected. Here, a processing performed by the preprocessing module is used for explanation. After selecting the preset number of training images, the preprocessing module generates a classification function for each image element based on the image element values of all the image elements in the preset number of training images, and determines the category of each image element according to the function value of the classification function corresponding to each image element. The specific process will be described below. In S2, the preprocessing module removes image elements of a preset category from each training image. The preset category will be described below. On this basis, the comparison module obtains several standard images, compares each standard image with all the training images that have been removed, and determines the training image corresponding to each standard image. It should be noted that the training image corresponding to the standard image refers to the training image that is most similar to the standard image. It can be considered that the action in the standard image and the action in the training image corresponding to the standard image are the same. In addition, since several standard images have been processed in advance, the several standard images do not contain image elements of the preset category. In S3, the processing performed by the comparison module on a standard image is described. The comparison module detects several human key points in the standard image and the training image corresponding to the standard image, respectively. The several human key points include head feature points, shoulder feature points, elbow feature points, wrist feature points, hip feature points, knee feature points, and ankle feature points, etc., and extracts feature values including position, direction, and speed of the several human key points respectively, and also forms feature sequences with the feature values of the several human key points respectively. In S4, the processing performed by the analysis module on a standard image is explained. Based on the feature sequence of the standard image and the feature sequence of the training image corresponding to the standard image, the analysis module analyzes several human key points in the training image corresponding to the standard image that have deviations from different human key points in the standard image, and generates correction suggestions for the training image corresponding to the standard image, wherein the deviation includes position deviation, direction deviation, and speed deviation.
[0048] Through the above method, problems in training movements can be identified based solely on aerobics training videos, thereby giving corrective suggestions on training movements, thereby enhancing the training effect of aerobics.
[0049] Furthermore, generating a classification function for each image element based on the image element values of all image elements in a preset number of training images includes the following steps:
[0050] S111, obtaining a first image element value component, a second image element value component, and a third image element value component of each image element based on a preset number of image elements with the same coordinates in a preset number of training images each time;
[0051] S112, with respect to a preset number of image elements, sequentially calculating a first difference between a first image element value component of a previous image element and a first image element value component of a subsequent image element, and determining a specific first difference in the first differences of the preset number minus one, and sequentially calculating a second difference between a second image element value component of a previous image element and a second image element value component of a subsequent image element, and determining a specific second difference in the second differences of the preset number minus one, and sequentially calculating a third difference between a third image element value component of a previous image element and a third image element value component of a subsequent image element, and determining a specific third difference in the third differences of the preset number minus one;
[0052] S113. Calculate a first representative value according to a specific first difference, calculate a second representative value according to a specific second difference, calculate a third representative value according to a specific third difference, and for each image element in a preset number of image elements, generate a first intermediate function according to the first image element value component of the image element and the first representative value, generate a second intermediate function according to the second image element value component of the image element and the second representative value, generate a third intermediate function according to the third image element value component of the image element and the third representative value, multiply the first intermediate function, the second intermediate function, and the third intermediate function to obtain a sub-classification function, and add the sub-classification functions corresponding to the preset number of image elements to obtain the classification function corresponding to the preset number of image elements.
[0053] Specifically, it is introduced here how to generate a classification function for each image element in a preset number of training images. In S111, a preset number of image elements with the same coordinates in the preset number of training images are determined, and the determination process includes: establishing an image coordinate system on the preset number of training images, determining a preset number of image elements with the same coordinates in the image coordinate system, and after determining the preset number of image elements, obtaining a first image element value component, a second image element value component, and a third image element value component of each image element, wherein the first image element value component can be a Red value, the second image element value component can be a Green value, and the third image element value component can be a Blue value. In S112, based on a preset number of image elements, the first difference between the first image element value component of the previous image element and the first image element value component of the next image element is calculated in sequence. For ease of understanding, for example, the first difference between the first image element value component of the first image element and the first image element value component of the second image element is calculated, and the first difference between the first image element value component of the second image element and the first image element value component of the third image element is calculated, and so on, to obtain the first difference of the preset number minus one. It should be noted that the calculation of the first difference is actually to calculate the difference between the two values first, and then calculate the absolute value of the difference, and then determine the specific first difference in the first difference of the preset number minus one. The specific first difference can be the preset number minus one. The middle number among the first differences of the preset number, and the second difference between the second image element value component of the previous image element and the second image element value component of the next image element are calculated in sequence, and a specific second difference is determined in the second differences of the preset number minus one number, wherein the second difference is calculated in the same way as the first difference, and the specific second difference may be the middle number among the second differences of the preset number minus one number, and the third difference between the third image element value component of the previous image element and the third image element value component of the next image element are calculated in sequence, and a specific third difference is determined in the third difference of the preset number minus one number, wherein the third difference is calculated in the same way as the first difference, and the specific third difference may be the middle number among the third differences of the preset number minus one number.In S113, a first representative value is calculated according to the specific first difference value, and the calculation process includes first calculating the product of 0.68 and square root 2, and then dividing the specific first difference value by the product, and calculating the second representative value according to the specific second difference value, and further calculating the third representative value according to the specific third difference value. The calculation process of the second representative value and the calculation process of the third representative value are similar to the calculation process of the first representative value. Then, for each image element in the preset number of image elements, a first intermediate function is generated according to the first image element value component of the image element and the first representative value. The first intermediate function can be Normal. distribution function, the first image element value component and the first representative value are expectation and variance respectively, similarly, a second intermediate function is generated according to the second image element value component and the second representative value of the image element, and a third intermediate function is generated according to the third image element value component and the third representative value of the image element, and then the first intermediate function, the second intermediate function, and the third intermediate function are multiplied to obtain a sub-classification function, and after a preset number of image elements correspond to sub-classification functions, the sub-classification functions corresponding to the preset number of image elements are added to obtain the classification functions corresponding to the preset number of image elements, that is, the classification functions corresponding to the preset number of image elements are the same, and thereafter, S111 to S113 are repeatedly executed until each image element in the preset number of training images corresponds to a classification function.
[0054] Furthermore, determining the category of each image element based on the function value of the classification function corresponding to each image element includes: when the function value of the classification function corresponding to the image element is less than a first threshold, classifying the image element into a first category; when the function value of the classification function corresponding to the image element is greater than a second threshold, classifying the image element into a second category; when the function value of the classification function corresponding to the image element is greater than or equal to the first threshold and less than or equal to the second threshold, classifying the image element into a third category.
[0055] Specifically, the method of generating a classification function for each image element in all the training images has been introduced above. Here, the category classification of an image element is taken as an example to illustrate. The first image element value component of the image element is input as a variable into all the first intermediate functions in the classification function, the second image element value component is input as a variable into all the second intermediate functions in the classification function, and the third image element value component is input as a variable into all the third intermediate functions in the classification function, so as to obtain the function value of the classification function. According to the properties of the classification function, if there are many image element values close to the image element value of the image element in other training images, the classification function If the function value of the classification function is greater than the first threshold, the image element is divided into the first category, and the image element of the first category corresponds to the human body image. If the function value of the classification function corresponding to the image element is greater than the second threshold, the image element is divided into the second category, and the image element of the second category corresponds to the image of other objects other than the human body, such as the image of a fixed object. If the function value of the classification function corresponding to the image element is greater than or equal to the first threshold and less than or equal to the second threshold, the image element is divided into the third category, and it is uncertain what image the image element of the third category corresponds to. Through the above method, each image element can be preliminarily divided into its own category.
[0056] Furthermore, after determining the category of each image element according to the function value of the classification function corresponding to each image element, the following steps are also included:
[0057] S121, using the same segmentation method to respectively segment a preset number of training images into a plurality of training image regions, and each time based on the preset number of training image regions at the same position in the preset number of training images, calculating the difference between the number of image elements belonging to the first category in a later training image region and the number of image elements belonging to the first category in a previous training image region, determining a first value and a second value according to the difference of the preset number minus a number, calculating the difference between the number of image elements belonging to the third category in a later training image region and the number of image elements belonging to the third category in a previous training image region, and determining a third value and a fourth value according to the difference of the preset number minus a number;
[0058] S122. For a preset number of training image regions, determine a value range of a first contrast value and a value range of a second contrast value, wherein the first contrast value is greater than or equal to a result value obtained by subtracting the first value from the product of the second value and a preset ratio, and is less than or equal to a result value obtained by adding the first value to the product of the second value and the preset ratio, and the second contrast value is greater than or equal to a result value obtained by subtracting the third value from the product of the fourth value and the preset ratio, and is less than or equal to a result value obtained by adding the third value to the product of the fourth value and the preset ratio.
[0059] Specifically, in the above text, a preliminary classification has been performed for each image element in a preset number of training images. In order to ensure the accuracy of the category corresponding to each image element, it is necessary to perform a further classification for each image element in a preset number of training images. Before introducing this process, it is necessary to first introduce the preparatory work for this process. In S121, the preset number of training images are divided into a number of training image areas using the same segmentation method. For ease of understanding, for example, each training image is equally divided into four training image areas, including a training image area in the upper left corner, a training image area in the lower left corner, a training image area in the upper right corner, and a training image area in the lower right corner. After that, the value range of the first contrast value and the value range of the second contrast value are determined for the preset number of training image areas at the same position in the preset number of training images each time. Here, a determination process is taken as an example to illustrate that a preset number of training image areas at the same position in a preset number of training images are determined. For the sake of ease of understanding, for example, a preset number of training image areas in the upper left corner of a preset number of training images are determined. After the preset number of training image areas are determined, the difference between the number of image elements belonging to the first category in the latter training image area and the number of image elements belonging to the first category in the previous training image area is calculated. For the sake of ease of understanding, for example, the difference between the number of image elements belonging to the first category in the second training image area and the number of image elements belonging to the first category in the first training image area is calculated. The difference between the number of image elements belonging to the first category in the third training image area is calculated. The difference between the number of image elements belonging to the first category in the second training image area and the number of image elements belonging to the first category in the second training image area is calculated, and so on, the difference of the preset number minus one number is obtained, and the first value and the second value are determined according to the difference of the preset number minus one number, the first value can be calculated by the calculation formula of the μ value, and the second value can be calculated by the calculation formula of the σ value, and the difference between the number of image elements belonging to the third category in the latter training image area and the number of image elements belonging to the third category in the former training image area is calculated, and the third value and the fourth value are determined according to the difference of the preset number minus one number, and the calculation method of the third value and the calculation method of the fourth value are respectively similar to the calculation method of the first value and the calculation method of the second value. In S122, for a preset number of training image areas, a value range of the first contrast value and a value range of the second contrast value are determined, wherein the first contrast value is greater than or equal to the result value of the first value minus the product of the second value and a preset ratio, and is less than or equal to the result value of the first value plus the product of the second value and the preset ratio, and the second contrast value is greater than or equal to the result value of the third value minus the product of the fourth value and the preset ratio, and is less than or equal to the result value of the third value plus the product of the fourth value and the preset ratio. It should be noted that the preset ratio is a value greater than or equal to zero and less than one.
[0060] Furthermore, after determining the value of the first contrast value and the value of the second contrast value for a preset number of training image regions, the method further includes the following steps:
[0061] S1221, in a preset number of training image regions, calculating a first numerical difference between the number of image elements belonging to the first category in a subsequent training image region and the number of image elements belonging to the first category in a previous training image region, and simultaneously calculating a second numerical difference between the number of image elements belonging to the third category in the subsequent training image region and the number of image elements belonging to the third category in the previous training image region;
[0062] S1222, judging whether the first digital difference is within the value range of the first comparison value, if not, updating the first threshold, if yes, maintaining the first threshold, judging whether the second digital difference is within the value range of the second comparison value, if not, updating the second threshold, if yes, maintaining the second threshold, and if the first threshold and the second threshold are not updated, continuing S1224, otherwise, continuing S1223;
[0063] S1223, reclassify the category to which each image element in the next training image region belongs, and jump to S1221;
[0064] S1224, update the next training image area, and jump to S1221.
[0065] Specifically, the preset number of training images have been divided into a number of training image regions in the above text, and the process of determining the first contrast value and the second contrast value has been described based on the preset number of training image regions in the upper left corner of the preset number of training images. For ease of understanding, how to perform a second classification for each image element in these preset number of training image regions is described here. In S1221, in the preset number of training image regions, the first numerical difference between the number of image elements belonging to the first category in the next training image region and the number of image elements belonging to the first category in the previous training image region is calculated, and the second numerical difference between the number of image elements belonging to the third category in the next training image region and the number of image elements belonging to the third category in the previous training image region is calculated. For ease of understanding, the next training image region at this time is the second training image region, and the previous training image region at this time is the first training image region. In S1222, it is determined whether the first numerical difference is within the value range of the first comparison value. If not, the first threshold is updated. The update process includes adaptively increasing the first threshold if the first numerical difference is less than the minimum value of the value range of the first comparison value, and adaptively decreasing the first threshold if the first numerical difference is greater than the maximum value of the value range of the first comparison value. In the case of yes, the first threshold is kept unchanged. At the same time, it is determined whether the second numerical difference is within the value range of the second comparison value. If not, the second threshold is updated. The update process includes adaptively increasing the second threshold if the second numerical difference is less than the minimum value of the value range of the second comparison value, and adaptively decreasing the second threshold if the second numerical difference is greater than the maximum value of the value range of the second comparison value. In the case of yes, the second threshold is kept unchanged. After the determination process is completed, if neither the first threshold nor the second threshold is updated, S1224 is continued. Otherwise, that is, the first threshold and the second threshold are updated separately, or the first threshold and the second threshold are updated simultaneously, S1223 is continued.For ease of understanding, following the above example, first assume that neither the first threshold nor the second threshold has been updated, then jump to S1224, at which time the next training image region is updated to the third training image region, then jump to S1221, and then assume that the first threshold and the second threshold are updated at the same time, then jump to S1223, because both the first threshold and the second threshold are updated, the category to which each image element in the next training image region belongs is re-divided based on the updated first threshold and the second threshold, and at this time the next training image region is still the second training image region, then jump to S1221, and continue to assume that when S1222 is executed, neither the first threshold nor the second threshold has been updated, then jump to S1224, it should be noted that at this time, it is necessary to re-divide the category to which each image element in all other training image regions except the first training image region and the second training image region belongs based on the updated first threshold and the second threshold, and at this time the next training image region is updated to the third training image region, and jump to S1221. It should be noted that the end condition of the above method is that the next training image region can no longer be updated in S1224. Through the above method, the accuracy of the categories into which the image elements are divided can be ensured.
[0066] Further, the preset category refers to the second category.
[0067] Furthermore, each standard image is compared with all the training images that have undergone the removal process to determine the training image corresponding to each standard image, including the following steps:
[0068] S211, determining a number of image elements and a number of standard image blocks with the coordinates of the number of image elements as central coordinates in the standard image, and searching for a number of training image blocks corresponding to the number of standard image blocks in each training image that has undergone the removal processing, and recording the central coordinates of the number of training image blocks;
[0069] S212, for each training image block in each training image that has undergone the removal processing, determining whether the central coordinate of the training image block is close to the central coordinate of the standard image block corresponding to the training image block, and if so, increasing the preset recorded value by 1, and if not, maintaining the recorded value;
[0070] S213. For each training image that has undergone removal processing, calculate the result value of dividing the record value corresponding to the training image by the number of all training image blocks in the training image, and among several training images corresponding to result values greater than the first result value threshold, determine the training image corresponding to the largest result value as the training image corresponding to the standard image.
[0071] Specifically, the image elements belonging to the second category have been removed from all the training images in the above text. On this basis, how to find the training images corresponding to each standard image is introduced. In S211, several image elements are determined in the standard image. It should be noted that the several image elements have certain uniqueness. At the same time, several standard image blocks with the coordinates of the several image elements as the central coordinates are determined. In each training image that has been removed, several training image blocks corresponding to the several standard image blocks are found. The correspondence here can be understood as the standard image block and the training image block having a certain degree of similarity. The central coordinates of several training image blocks are recorded. The central coordinates are the coordinates of the central image elements in the training image blocks. In S212, for each training image block in each training image that has been removed, it is determined whether the central coordinates of the training image block are close to the central coordinates of the standard image block corresponding to the training image block. If yes, the preset recorded value is increased by 1. It should be noted that the initial value of the recorded value is zero. If no, the recorded value remains unchanged. In S213, for each training image that has undergone removal processing, the result value of dividing the record value corresponding to the training image by the total number of training image blocks in the training image is calculated, and then, among several training images corresponding to result values greater than the first result value threshold, the training image corresponding to the largest result value is determined to be the training image corresponding to the standard image, and the training image corresponding to the standard image refers to the training image that is most similar to the standard image.
[0072] Furthermore, each standard image is compared with all the training images that have undergone the removal process to determine the training image corresponding to each standard image, and the following steps are also included:
[0073] S221, determining a number of image elements and a number of standard image blocks with the coordinates of the number of image elements as central coordinates in the standard image, and searching for a number of training image blocks corresponding to the number of standard image blocks in each training image that has undergone the removal processing;
[0074] S222, for each training image block in each training image that has been processed by the removal, calculating the sameness value between the training image block and the standard image block corresponding to the training image block, and based on the sameness values corresponding to all the training image blocks in each training image that has been processed by the removal, determining the first importance value and the second importance value, and calculating the result value obtained by dividing the first importance value by the second importance value;
[0075] S223. Based on all the training images that have undergone the removal processing, among a plurality of training images corresponding to result values greater than the second result value threshold, determine the training image corresponding to the largest result value as the training image corresponding to the standard image.
[0076] Specifically, another method for finding a training image corresponding to each standard image is introduced here. In S221, a number of image elements and a number of standard image blocks with the coordinates of the number of image elements as the central coordinates are determined in the standard image. The number of image elements also have a certain uniqueness, and in each training image that has been processed after removal, a number of training image blocks corresponding to the number of standard image blocks are found. The correspondence here can also be understood as a certain degree of similarity between the standard image block and the training image block. In S222, for each training image block in each training image that has been processed after removal, the sameness value between the training image block and the standard image block corresponding to the training image block is calculated, wherein the larger the sameness value, the more similar it is. Then, based on the sameness values corresponding to all the training image blocks in each training image that has been processed after removal, the first importance value and the second importance value are determined. The first importance value can be calculated by the calculation formula of the μ value, and the second importance value can be calculated by the calculation formula of σ 2 The calculation formula of the value is calculated, and the result value obtained by dividing the first important value by the second important value is also calculated. In S223, based on all the training images that have been removed, among the several training images corresponding to the result values greater than the second result value threshold, the training image corresponding to the largest result value is determined as the training image corresponding to the standard image, and the training image corresponding to the standard image also refers to the training image that is most similar to the standard image.
[0077] According to another aspect of the embodiment of the present invention, Figure 2 As shown, a motion analysis and correction system for aerobics training is also provided, including a preprocessing module, a comparison module, and an analysis module, which are used to implement the motion analysis and correction method for aerobics training as described above.
[0078] The specific functions of each module are as follows:
[0079] A preprocessing module, used to obtain a training video, extract all training images from the training video, select a preset number of training images from all training images each time, generate a classification function for each image element based on the image element values of all image elements in the preset number of training images, determine the category of each image element according to the function value of the classification function corresponding to each image element; and for removing image elements of a preset category from each training image;
[0080] A comparison module is used to obtain a plurality of standard images, compare each standard image with all the training images that have been removed, and determine the training image corresponding to each standard image; and to detect a plurality of key points of the human body in each standard image and the training image corresponding to each standard image, the plurality of key points of the human body including head feature points, shoulder feature points, elbow feature points, wrist feature points, hip feature points, knee feature points, and ankle feature points, respectively extract feature values of the plurality of key points of the human body including position, direction, and speed, and respectively form feature sequences with the feature values of the plurality of key points of the human body;
[0081] The analysis module is used to analyze a number of human key points in the training image corresponding to each standard image that deviate from different human key points in each standard image based on the feature sequence of each standard image and the feature sequence of the training image corresponding to each standard image, and generate correction suggestions for the training image corresponding to each standard image.
[0082] According to another aspect of an embodiment of the present invention, a storage medium is provided, wherein the storage medium stores program instructions, wherein when the program instructions are executed, a device where the storage medium is located is controlled to execute any one of the above methods.
[0083] It should be understood that, although each step in the flow chart of each embodiment of the present invention is shown in sequence according to the indication of the arrow, these steps are not necessarily performed in sequence according to the order indicated by the arrow. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be performed in other orders. Moreover, at least a portion of the steps in each embodiment may include a plurality of sub-steps or a plurality of stages, and these sub-steps or stages are not necessarily performed at the same time, but can be performed at different times, and the execution order of these sub-steps or stages is not necessarily performed in sequence, but can be performed in turn or alternately with at least a portion of other steps or sub-steps or stages of other steps.
[0084] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program. The above-mentioned program can be stored in a non-volatile computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0085] The technical features of the above-mentioned embodiments can be combined arbitrarily. In order to make the description concise, not all possible combinations of the technical features in the above-mentioned embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0086] The above-mentioned embodiments only express several implementation methods of the present invention, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the patent of the present invention. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present invention, and these all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be subject to the attached claims.
[0087] The above are only preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A motion analysis and correction method for aerobics training, characterized in that: The method comprises the following steps: S1. The preprocessing module obtains a training video, extracts all training images from the training video, and selects a preset number of training images from all training images each time, generates a classification function for each image element based on image element values of all image elements in the preset number of training images, and determines the category of each image element according to the function value of the classification function corresponding to each image element; S2, for each training image, the preprocessing module removes image elements of a preset category from the training image, and the comparison module obtains a plurality of standard images, compares each standard image with all the training images that have undergone the removal process, and determines a training image corresponding to each standard image; S3, the comparison module detects a number of key points of the human body in each standard image and the training image corresponding to each standard image, the key points of the human body including head feature points, shoulder feature points, elbow feature points, wrist feature points, hip feature points, knee feature points, and ankle feature points, extracts feature values of the key points of the human body including position, direction, and speed, and composes feature sequences with the feature values of the key points of the human body; S4. The analysis module analyzes several human key points in the training image corresponding to each standard image and the feature sequence of the training image corresponding to each standard image, where there are deviations between different human key points in each standard image, and generates correction suggestions for the training image corresponding to each standard image.
2. The method according to claim 1, characterized in that Generating a classification function for each image element based on the image element values of all image elements in a preset number of training images comprises the following steps: S111, obtaining a first image element value component, a second image element value component, and a third image element value component of each image element based on a preset number of image elements with the same coordinates in a preset number of training images each time; S112, with respect to a preset number of image elements, sequentially calculating a first difference between a first image element value component of a previous image element and a first image element value component of a subsequent image element, and determining a specific first difference in the first differences of the preset number minus one, and sequentially calculating a second difference between a second image element value component of a previous image element and a second image element value component of a subsequent image element, and determining a specific second difference in the second differences of the preset number minus one, and sequentially calculating a third difference between a third image element value component of a previous image element and a third image element value component of a subsequent image element, and determining a specific third difference in the third differences of the preset number minus one; S113. Calculate a first representative value according to a specific first difference, calculate a second representative value according to a specific second difference, calculate a third representative value according to a specific third difference, and for each image element in a preset number of image elements, generate a first intermediate function according to the first image element value component of the image element and the first representative value, generate a second intermediate function according to the second image element value component of the image element and the second representative value, generate a third intermediate function according to the third image element value component of the image element and the third representative value, multiply the first intermediate function, the second intermediate function, and the third intermediate function to obtain a sub-classification function, and add the sub-classification functions corresponding to the preset number of image elements to obtain the classification function corresponding to the preset number of image elements.
3. The method according to claim 2, characterized in that Determining the category of each image element based on the function value of the classification function corresponding to each image element includes: when the function value of the classification function corresponding to the image element is less than a first threshold, classifying the image element into a first category; when the function value of the classification function corresponding to the image element is greater than a second threshold, classifying the image element into a second category; when the function value of the classification function corresponding to the image element is greater than or equal to the first threshold and less than or equal to the second threshold, classifying the image element into a third category.
4. The method according to claim 3, characterized in that After determining the category of each image element according to the function value of the classification function corresponding to each image element, the following steps are also included: S121, using the same segmentation method to respectively segment a preset number of training images into a plurality of training image regions, and each time based on the preset number of training image regions at the same position in the preset number of training images, calculating the difference between the number of image elements belonging to the first category in a later training image region and the number of image elements belonging to the first category in a previous training image region, determining a first value and a second value according to the difference of the preset number minus a number, calculating the difference between the number of image elements belonging to the third category in a later training image region and the number of image elements belonging to the third category in a previous training image region, and determining a third value and a fourth value according to the difference of the preset number minus a number; S122. For a preset number of training image regions, determine a value range of a first contrast value and a value range of a second contrast value, wherein the first contrast value is greater than or equal to a result value obtained by subtracting the first value from the product of the second value and a preset ratio, and is less than or equal to a result value obtained by adding the first value to the product of the second value and the preset ratio, and the second contrast value is greater than or equal to a result value obtained by subtracting the third value from the product of the fourth value and the preset ratio, and is less than or equal to a result value obtained by adding the third value to the product of the fourth value and the preset ratio.
5. The method according to claim 4, characterized in that After determining the value of the first contrast value and the value of the second contrast value for a preset number of training image regions, the method further includes the following steps: S1221, in a preset number of training image regions, calculating a first numerical difference between the number of image elements belonging to the first category in a subsequent training image region and the number of image elements belonging to the first category in a previous training image region, and simultaneously calculating a second numerical difference between the number of image elements belonging to the third category in the subsequent training image region and the number of image elements belonging to the third category in the previous training image region; S1222, judging whether the first digital difference is within the value range of the first comparison value, if not, updating the first threshold, if yes, maintaining the first threshold, judging whether the second digital difference is within the value range of the second comparison value, if not, updating the second threshold, if yes, maintaining the second threshold, and if the first threshold and the second threshold are not updated, continuing S1224, otherwise, continuing S1223; S1223, reclassify the category to which each image element in the next training image region belongs, and jump to S1221; S1224: Update the next training image area, and jump to S1221.
6. The method according to claim 1, characterized in that Comparing each standard image with all the training images that have undergone the removal process, and determining a training image corresponding to each standard image, comprises the following steps: S211, determining a number of image elements and a number of standard image blocks with the coordinates of the number of image elements as central coordinates in the standard image, and searching for a number of training image blocks corresponding to the number of standard image blocks in each training image that has undergone the removal processing, and recording the central coordinates of the number of training image blocks; S212, for each training image block in each training image that has undergone the removal processing, determining whether the central coordinate of the training image block is close to the central coordinate of the standard image block corresponding to the training image block, and if so, increasing the preset recorded value by 1, and if not, maintaining the recorded value; S213. For each training image that has undergone removal processing, calculate the result value of dividing the record value corresponding to the training image by the number of all training image blocks in the training image, and among several training images corresponding to result values greater than the first result value threshold, determine the training image corresponding to the largest result value as the training image corresponding to the standard image.
7. The method according to claim 1, characterized in that Comparing each standard image with all the training images that have undergone the removal process to determine a training image corresponding to each standard image, the method further includes the following steps: S221, determining a number of image elements and a number of standard image blocks with the coordinates of the number of image elements as central coordinates in the standard image, and searching for a number of training image blocks corresponding to the number of standard image blocks in each training image that has undergone the removal processing; S222, for each training image block in each training image that has been processed by the removal, calculating the sameness value between the training image block and the standard image block corresponding to the training image block, and based on the sameness values corresponding to all the training image blocks in each training image that has been processed by the removal, determining the first importance value and the second importance value, and calculating the result value obtained by dividing the first importance value by the second importance value; S223. Based on all the training images that have undergone the removal processing, among a plurality of training images corresponding to result values greater than the second result value threshold, determine the training image corresponding to the largest result value as the training image corresponding to the standard image.
8. A motion analysis and correction system for aerobics training, used to implement the method according to any one of claims 1 to 7, characterized in that: Includes the following modules: A preprocessing module is used to obtain a training video, extract all training images from the training video, select a preset number of training images from all training images each time, generate a classification function for each image element based on image element values of all image elements in the preset number of training images, and determine the category of each image element according to the function value of the classification function corresponding to each image element; and for removing, for each training image, image elements of a preset category from the training image; A comparison module is used to obtain a plurality of standard images, compare each standard image with all the training images that have been removed, and determine the training image corresponding to each standard image; and to detect a plurality of key points of the human body in each standard image and the training image corresponding to each standard image, the plurality of key points of the human body including the head, shoulder, elbow, wrist, hip, knee, and ankle, respectively extract characteristic values of the plurality of key points of the human body including position, direction, and speed, and respectively form a characteristic sequence with the characteristic values of the plurality of key points of the human body; The analysis module is used to analyze a number of human key points in the training image corresponding to each standard image that deviate from different human key points in each standard image based on the feature sequence of each standard image and the feature sequence of the training image corresponding to each standard image, and generate correction suggestions for the training image corresponding to each standard image.
9. A storage medium, characterized in that: The storage medium stores program instructions, wherein when the program instructions are executed, the device where the storage medium is located is controlled to execute the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Motion analysis apparatus, motion analysis method, recording medium, and motion analysis system
CN110490034A
Method and system for quickly identifying body actions
CN113065505A
Fitness action correction method and electronic equipment
CN112237730A
Human body three-dimensional key point prediction method and device and electronic equipment
CN112966574A
Method for correcting training action in real time based on deep learning and related equipment thereof
CN113743362A
Cited By
Bronchoscope image analysis method and system based on deep learning and storage medium
CN120598873A