Basketball Action Data Processing Method Based on Mode Symmetric Algorithm

In the course of basketball training, a large number of basketball action data are generated according to the athletes’ body movements. Due to the low precision of the basketball action data processed by the traditional method in basketball technical training, basketball action processing is not in place. The basketball motion data processing method, based on the mode symmetric algorithm was studied. The basketball motion detection algorithm based on symmetric difference and background reduction was used to remove the background influence of basketball movement and obtain the binary basketball action target image containing the data. On this basis, the pole symmetric mode decomposition (ESMD) method was used to modally decompose the binary basketball action target image containing the data, and the least squares method was used to optimize the elliptic (AGM) curve to realize the screening of basketball action modal data. Through the cleaning and integration of basketball action modal data, integration and data reduction basketball action modal data, the data was processed efficiently. The experimental results showed that the proposed method was a high precision and high efficiency basketball action data processing method.


Introduction
Along the path of wisdom, a high body, being strong and fierce, proactive, fast, witty, and comprehensive and accurate, the evolution of contemporary basketball is developed in the direction of high acceleration, skill, and wisdom.On the one hand, in a basketball game, due to fierce competition in the arena, coaches and athletes often fail to complete technical and tactics scheduled before a game.Therefore, through the statistics of the game field, various rules can be found to reduce mistakes and win the game.On the other hand, in basketball teaching, training, and competition, circumstances of when technology should be used normally relies on coaches and athletes' past experiences.In technical basketball training, basic knowledge of technical action is emphasized and the application ability of the athlete to perform the technical action training cannot be ignored.Nowadays, with the information technology revolution changing people's lifestyles, computer technology is gradually being applied to basketball analysis.In the analysis of basketball technology, the overall data of basketball technical movements is also developing rapidly, and within these basketball databases, only part of the data is worthy of use and reasoning.
Moving target detection extracts the target from the video image stream in real time.As a key technology in video image processing, it not only plays a very important role in basketball, pattern recognition, and video coding, but is also the basis for various follow-up treatments such as basketball action data statistics, target classification, behavior understanding, etc. [1,2].

Algorithm Definitions
The basketball motion detection algorithm based on symmetrical difference and background reduction was used to detect basketball action data in order to reduce the background influence of basketball.The binary basketball action target image with basketball action data was decomposed by the empirical mode decomposition (EMD) method.The basketball action data that needed to be processed are filtered effectively to realize the selection of basketball action modal data.Through the cleaning and integration of basketball action pattern data, the basketball action data were effectively handled.

Calculation of Symmetric Difference
The symmetric differential algorithm removed the effects of the background revealed by basketball and accurately captured the outline of the basketball goal.f (k−1) (x, y), f (k) (x, y), and f (k+1) (x, y) represents three-frame continuous source basketball action images [5], with the symmetric difference diagram shown in Figure 1, b (k−1,k) (x, y) and b (k,k+1) (x, y) are a schematic diagram of the binary image obtained by a time difference between every two adjacent frames, wherein the shaded portion indicates the moving human body, and the dotted portion indicates the background revealed by the human basketball movement [6][7][8].Obviously b (k−1,k) (x, y) and b (k,k+1) (x, y) contain the background area revealed by the human basketball action, which cannot detect the basketball action in the source image very well.d (k) s (x, y) is the result image of the symmetric difference, as is seen from the figure that the symmetric difference can detect the outline of the basketball action.The basic algorithm is embodied in the schematic diagram of symmetric difference, as shown in Figure 1.
Symmetry 2019, 11, 560 3 of 14 In the above figure, the symmetry difference between the two sets belongs to only one set, not to the set of elements of the other set.
(1) The video serial number of the three consecutive basketball action source images are where W is a window function that suppresses noise.Since the mean filtering will blur the basketball action image [9][10][11] to lose the edge information, the median filter function with window 3*3 is employed to suppress the noise.
(2) Take a threshold for ( In the upper expression, s is the pixel value， () ( , ) k d x y is the operating frequency.

Background subtraction calculation
The basic idea of background reduction is to subtract the current basketball action image from the background image stored in advance or in real time.The pixel with a greater difference than a certain threshold is considered to be the point on the basketball action target [12][13][14][15], otherwise considered to be a background point, which is suitable for detecting a moving target in the case where the background image does not change much with time.By comparing the gray value difference between the current basketball action image ( , ) k f x y and the background image ( , ) k B x y , the foreground image can be obtained.The calculation formula is as follows: In the above figure, the symmetry difference between the two sets belongs to only one set, not to the set of elements of the other set.
(1) The video serial number of the three consecutive basketball action source images are f (k−1) (x, y), f (k) (x, y), and f (k+1) (x, y).Calculate absolute difference grayscale images b (k−1,k) (x, y) adjacent to the basketball action source image: where W is a window function that suppresses noise.Since the mean filtering will blur the basketball action image [9][10][11] to lose the edge information, the median filter function with window 3*3 is employed to suppress the noise.
(2) Take a threshold for b (k−1,k) (x, y) and b (k,k+1) (x, y), respectively, to binarize and obtain two binarized images, b (k−1,k) (x, y) and b (k,k+1) (x, y).The logical and operation of b (k−1,k) (x, y) and b (k,k+1) (x, y) at each pixel position is performed to obtain a binary image of symmetric difference results.The calculation formula is as follows: In the upper expression, s is the pixel value, d (k) (x, y) is the operating frequency.

Background Subtraction Calculation
The basic idea of background reduction is to subtract the current basketball action image from the background image stored in advance or in real time.The pixel with a greater difference than a certain threshold is considered to be the point on the basketball action target [12][13][14][15], otherwise considered to be a background point, which is suitable for detecting a moving target in the case where the background image does not change much with time.By comparing the gray value difference between the current basketball action image f k (x, y) and the background image B k (x, y), the foreground image can be obtained.The calculation formula is as follows: In the upper formula, b is the filter value,T is the threshold, W is the window function for suppressing noise, and median filtering was still used.

Basketball Action Detection
From the symmetric difference to the binarized image d (k) S (x, y), a more accurate outline of the basketball action can be detected, but only some information is included.Since the gray level of the basketball action target is similar to the background gray level [16][17][18], the foreground image d b (x, y) will result in a complete foreground image F k (x, y) at each pixel location: Due to the influence of noise, some of the residual isolated noise front spots still exists in the image F k (x, y) obtained by formula (4), and some parts of the target area may be missed.
In addition, background disturbance, such as the slight shaking of the branches, will also cause this part to be misjudged as a basketball action.The basketball action image can be post-processed through basketball action detection and morphological operations.Firstly, the foreground image is morphologically filtered.In this paper, a circular structural element was used, which is first expanded and then etched (i.e., closed operation) to get the complete area of the basketball action target image, then formula (4) was used to connect the connected areas in order to calculate the current foreground image so as to summarize the size of each independent foreground area.In general, a pixel with less than 8 connected areas can be considered as noise-caused areas with less than 8 pixels, and finally the area filling algorithm is used to fill the small holes in the target area [19].Only the binary basketball action target image containing the basketball action target data is left.

Pole Symmetric Mode Decomposition (ESMD) and Basketball Action Modal Data Generation
The EMD method decomposes a nonlinear non-stationary signal into a number of Intrinsic Mode Functions (IMFs), where each intrinsic mode function is a time-scale local feature signal containing the original signal.
The EMD decomposition method is based on the following assumptions: (1) The basketball action data has at least two extreme values, a maximum value and a minimum value; (2) the local time domain characteristics of the data are determined by the time scale between the extreme points; and (3) if there is no extreme point in the basketball action data but there is an inflection point, the extreme value can be obtained by deriving the data one or more times [20], and then the decomposition result is obtained by integration.The essence of the EMD method is to decompose the data by the time scale feature of the data itself in order to obtain the basketball action mode data.This decomposition process is called data sifting.
The ESMD method is an improvement based on the EMD method and is expressed in the following aspects: 1.
The maximum and minimum values of the original basketball action data are separated because in the ESMD algorithm, adjacent equal extremes are treated as one point; 2.
The ESMD method proposes decomposition methods for optimal data screening times and determines the suspension criteria; 3.
The ESMD method can obtain a better adaptive global mean (AGM) curve and optimize the AGM curve by least squares to optimize the number of data screenings.
The specific algorithm flow is as follows: 1.
Find the midpoint of all adjacent extreme points of the original basketball action data x(t) [21], and add the boundary midpoints of the left and right sides; 2.
Subtract the mean envelope from the original basketball action sequence x(t) to obtain a new sequence h(t), as shown in Equation ( 5): Verify if the new sequence h(t) satisfies the following two conditions: |L * | ≤ ε (allowed to be an error); the number of data screenings reaches the expected maximum K, and if the above two conditions are met, it is treated as a mode, otherwise, h(t) is set as the original data to iterate the above three steps until the above two conditions are met; 5.
With x(t) − M i , M i as the maximum fixed number, repeat the above four steps until the last residual amount has no more than a fixed number of extremes; 6.
Change the value of the expected maximum value K of the number of screenings, repeat the above five steps, calculate the variance σ 2 of x(t) − R, and plot the relationship between σ/σ 0 and K, where σ 0 is the standard deviation of x(t); 7.
According to the minimum value of σ/σ 0 , find σ/σ 0 and then repeat the previous six steps through K 0 to output the entire mode.Then, the last residual R is an optimized AGM curve.
The following two sets of basketball action data are representative of the two sets of representative basketball action data after a large number of ESMD method decomposition experiments and a large number of statistical analysis of the mode frequency and amplitude data obtained by the decomposition [22].It is separately performed ESMD decomposition for these two sets of data.
The ESMD method is used to perform the modal decomposition experiment on the basketball action data (the basketball action data observed on a fixed platform with a sampling frequency of 20 Hz).The specific modal decomposition variance ratio varies with the maximum number of data screening times as shown in Figure 2: 1. Find the midpoint of all adjacent extreme points of the original basketball action data () xt [21], and add the boundary midpoints of the left and right sides; 2. Using the midpoints of the above extreme points, construct p difference curves  and then repeat the previous six steps through 0 K to output the entire mode.Then, the last residual R is an optimized AGM curve.The following two sets of basketball action data are representative of the two sets of representative basketball action data after a large number of ESMD method decomposition experiments and a large number of statistical analysis of the mode frequency and amplitude data obtained by the decomposition [22].It is separately performed ESMD decomposition for these two sets of data.
The ESMD method is used to perform the modal decomposition experiment on the basketball action data (the basketball action data observed on a fixed platform with a sampling frequency of 20 Hz).The specific modal decomposition variance ratio varies with the maximum number of data screening times as shown in Figure 2:  It can be seen from Figure 2 that the optimal number of screenings is three, which corresponds to the minimum variance ratio.Similarly, the mode decomposition is optimal at this time, and then the basketball action modal data is processed in detail.

Basketball Action Mode Data Processing
The data processing of basketball action mode was divided into two steps.Firstly, the data of basketball action mode was cleaned and integrated.After the data of basketball action mode was cleaned and integrated, the data of basketball action mode was integrated and reduced.Figure 3 shows a picture of basketball action.Figure 4 is a data processing flow chart of basketball action mode.
It can be seen from Figure 2 that the optimal number of screenings is three, which corresponds to the minimum variance ratio.Similarly, the mode decomposition is optimal at this time, and then the basketball action modal data is processed in detail.

Basketball action mode data processing
The data processing of basketball action mode was divided into two steps.Firstly, the data of basketball action mode was cleaned and integrated.After the data of basketball action mode was cleaned and integrated, the data of basketball action mode was integrated and reduced.Figure 3 shows a picture of basketball action.Figure 4 is a data processing flow chart of basketball action mode.

Cleaning and integration of basketball action mode data
There are incomplete and inconsistent problems in the basketball action modal data collected by the above method [23].It needs to correct these problems and fill in the vacancy values.The essence of a basketball game is a round game in which the ball is exchanged after each attack with 24 seconds of mandatory offensive and defensive conversion rules, which is called a round.Therefore, It can be seen from Figure 2 that the optimal number of screenings is three, which corresponds to the minimum variance ratio.Similarly, the mode decomposition is optimal at this time, and then the basketball action modal data is processed in detail.

Basketball action mode data processing
The data processing of basketball action mode was divided into two steps.Firstly, the data of basketball action mode was cleaned and integrated.After the data of basketball action mode was cleaned and integrated, the data of basketball action mode was integrated and reduced.Figure 3 shows a picture of basketball action.Figure 4 is a data processing flow chart of basketball action mode.

Cleaning and integration of basketball action mode data
There are incomplete and inconsistent problems in the basketball action modal data collected by the above method [23].It needs to correct these problems and fill in the vacancy values.The essence of a basketball game is a round game in which the ball is exchanged after each attack with 24 seconds of mandatory offensive and defensive conversion rules, which is called a round.Therefore,

Cleaning and Integration of Basketball Action Mode Data
There are incomplete and inconsistent problems in the basketball action modal data collected by the above method [23].It needs to correct these problems and fill in the vacancy values.The essence of a basketball game is a round game in which the ball is exchanged after each attack with 24 s of mandatory offensive and defensive conversion rules, which is called a round.Therefore, basketball data analysis needs to be standardized based on the round.(1) Impute missing values According to the meaning of a basketball action modal data item, a default value is defined for the missing data item to replace the missing vacancy value.If the offensive round lacks 3 points, blocks, etc., use '?' instead.
(2) Correcting inconsistent data The collected basketball action modal data sometimes appears inconsistent, such as 'dribbling' is the same technical action as 'balling', dribble and ball have the same technical action but their meaning is not related, and have an independent existence of two individuals [24].It can be determined which one is appropriate to change by analyzing the correlation between certain data.'Dribbling' and 'balling' can be represented as Aand B respectively, the correlation between the two can be expressed as: In the upper form, i represents the same as the two.represents the degree of correlation, A, B represents the average of A, B, respectively, δ A ,δ B represents the capacity parameters for A and B, when s = 0, A and B are independent and irrelevant; s < 0, A is negatively related to B; s > 0, A is positively correlated with B. Then the 'dribbling' and 'balling' are corrected to be consistent with the dribble.The correction method is shown in Table 2. (3) Clean up the noise of basketball action mode data Actions such as technical fouls, interference balls, etc. are meaningless data, so it can be cleaned up directly without dealing with data.Another example is that it is unreasonable to score 2 points and 3 points for each offensive contract, so it needs to clear one and usually clear 3 points.

Basketball Action Mode Data Integration and Data Reduction
Data integration is to store lots of relevant data in the same technical action database, thus avoiding the scattered distribution of various data, which is not conducive to research.For example, multiple recurring data are combined (such as pick-and-roll, dribble, etc.).
Data reduction can reduce the amount of data on the basis of maintaining the integrity of the original data, thereby reducing the processing time of basketball action data [25], including: (1) Heap reduction Technical actions such as dribbling and passing are deleted, and only the technical actions with great significance are studied.For example, nine basketball technical moves of only steals, assists, free throws, pick-and-rolls, blocks, rebounds, 2 points, 3 points, and breakthrough are retained in this study.
(2) Data compression In order to further verify the accuracy of the method for processing basketball action data, it also took the basketball action data of the above-mentioned experiment as the research object, and simulated the accuracy of this method to deal with different basketball action data.The experiment selected a total of 300 basketball action data, including in-place shooting (34), three-step layup (52), ball break (74), personal defense (95), and basket throw (45).The correct number and ratio of three methods for handling different basketball action data are described in Table 6, Table 7, Table 8, and Table 9, respectively: Table 6 data shows that the use of data mining technology to analyze basketball action data results in lower accuracy.The results of detailed analysis of the data show that the experiment processed a total of 52 three-step basket action data, with lower accuracy using data mining processing to get the correct number of processing, the average number of correct processing, and with ratios of 27 and 0.52 respectively.This method resulted in the highest ratio of the three-step basket action data.The method handled the in-situ shooting, ball-breaking, personal defense, and basket-scoring action data with correct numbers of 17, 29, 34, and 16, respectively, accounting for 0.49, 0.39, 0.35, and 0.34, respectively.The correct ratio of basketball action data was only 0.52, which indicated that the method was less reliable in dealing with basketball action data.
Table 7 data shows that the processing accuracy of processing data of different types of basketball action using the big data processing platform was at an intermediate level.The average correct rate of the method for in-place shooting, three-step layup, ball break, personal defense, and basket-shot data is 0.65, 0.64, 0.58, 0.67, and 0.58, respectively, which is better than the data mining method.
From the results of Table 8 of basketball action data, it can be concluded that the method has a higher correct rate of processing basketball action data.In the process of handling three-step layup, ball break, and personal defensive basketball action data, the average correct rate is 0.99, which can basically handle basketball action data correctly.The correct rate of handling in-field shooting and basketball shooting data was as high as 0.96.The overall comparison data showed that the number and correctness of the correct processing of various types of basketball action data were far superior to the other two methods, indicating that the method has an excellent basketball action data processing performance.The experiment highlights the high performance of the method for processing various types of basketball action data, and the data results of Table 7, Table 8,and  From the results of Table 8 of basketball action data, it can be concluded that the method has a higher correct rate of processing basketball action data.In the process of handling three-step layup, ball break, and personal defensive basketball action data, the average correct rate is 0.99, which can basically handle basketball action data correctly.The correct rate of handling in-field shooting and basketball shooting data was as high as 0.96.The overall comparison data showed that the number and correctness of the correct processing of various types of basketball action data were far superior to the other two methods, indicating that the method has an excellent basketball action data processing performance.The experiment highlights the high performance of the method for processing various types of basketball action data, and the data results of Table 7, Table 8, and Table 9 are depicted by the bar graph shown in Figure 5: From Figure 5, it can be seen that the average correct rate of different types of basketball action data using big data's treatment platform method is between 58% and 67%, and the accuracy rate of three-point basket scoring action data is 65%.The average correct rate of different types of basketball action data using the data mining method is between 34% and 52%, and the accuracy rate of the three-point basket scoring action data is 52%.The average correct rate of the different types of basketball action data by this method is between 95% and 100%, and the accuracy rate of the three-point basket scoring action data is 99.9%.The accuracy of this method is 34% higher than that of the other two methods, 9% and 47.9%, respectively.By combining the different actions, the average processing accuracy of basketball data in this paper is 96.8%.The average processing accuracy of basketball game data based on the data mining method is 43.8%.The average processing accuracy of basketball sports data based on the big data's platform processing method is 62%, which shows that the method of dealing with basketball action data has high reliability.
Through statistical analysis, this method was compared with the method based on data mining and the method based on the big data's processing platform to test students' average difference.The formulas for calculating the average error of students' basketball action are as follows: From Figure 5, it can be seen that the average correct rate of different types of basketball action data using big data's treatment platform method is between 58% and 67%, and the accuracy rate of three-point basket scoring action data is 65%.The average correct rate of different types of basketball action data using the data mining method is between 34% and 52%, and the accuracy rate of the three-point basket scoring action data is 52%.The average correct rate of the different types of basketball action data by this method is between 95% and 100%, and the accuracy rate of the three-point basket scoring action data is 99.9%.The accuracy of this method is 34% higher than that of the other two methods, 9% and 47.9%, respectively.By combining the different actions, the average processing accuracy of basketball data in this paper is 96.8%.The average processing accuracy of basketball game data based on the data mining method is 43.8%.The average processing accuracy of basketball sports data based on the big data's platform processing method is 62%, which shows that the method of dealing with basketball action data has high reliability.screening time is difficult to determine, the decomposition trend function is too rough and so on.Not only can it intuitively reflect the time-varying amplitude and frequency, but it also clearly reflects the change of total energy.The time-frequency distribution map is more intuitive and reasonable, and it has unique advantages in the analysis of time-frequency changes.Based on a large number of statistical studies on the modalities obtained by the ESMD method, the advantages of the ESMD method are as follows: The statistical normal distribution of mode frequencies and amplitudes is obvious when the amount of data is appropriate.From a statistical point of view, the skewness analysis and skewness analysis of its statistical samples also prove that its statistical distribution of samples can be treated as a normal distribution curve.From the perspective of analysis of variance, the trend of the change curve with variance also conforms to the characteristics of normal distribution.Estimates of the average frequency and amplitude are within the allowable range, so the average frequency and amplitude of the modal can be estimated by the number of extreme points.Mathematically, the estimated average frequency and amplitude can be used mathematically to estimate the change in mode.t can also be seen that the modality obtained by the decomposition of the ESMD method is considerable, and ESMD is more feasible in the analysis of basketball action data.

Conclusions
This paper studied the basketball motion data processing method based on mode symmetric algorithm.It firstly reduced the noise interference in basketball action images through symmetric difference and background subtraction, and effectively separated the basketball action from the background, which is helpful for the decomposition of negative basketball action images in the ESMD method.The method effectively filtered out the basketball action data needed to be processed, reduced the influence of some interference data, and improved the processing accuracy of the basketball action data.After that, through the cleanup and integration of basketball action modal data, it also solved the problem of incomplete and inconsistent basketball modal data; data integration and data reduction reduce the scattered distribution of various basketball action data and improve the efficiency of basketball action data processing.The experimental results showed that the proposed method can efficiently process various types of basketball action data, and the processing accuracy was also high, which demonstrated an efficient basketball action processing method.

+
at each pixel position is performed to obtain a binary image of symmetric difference results.The calculation formula is as follows:

b
(x, y) obtained by the background subtraction fails to detect the complete motion of the basketball action information, and the missed part of the background subtraction method is in the symmetric difference method.It is just detected, so logically 'or' operation of d (k) S (x, y) and d (k)

Figure 2 .
Figure 2. The variance ratio varies with the maximum number of filters.Figure 2. The variance ratio varies with the maximum number of filters.

Figure 2 .
Figure 2. The variance ratio varies with the maximum number of filters.Figure 2. The variance ratio varies with the maximum number of filters.

Figure 4 .
Figure 4. Data processing flow chart of basketball action mode.

Figure 5 .
Figure 5.The accuracy rate (%) of the three methods to process different types of basketball movement data.

Figure 5 .
Figure 5.The accuracy rate (%) of the three methods to process different types of basketball movement data.
as the maximum fixed number, repeat the above four steps until the last residual amount has no more than a fixed number of extremes;6.Change the value of the expected maximum value K of the number of screenings, repeat the above five steps, calculate the variance2 i M 0 /

Table 1 .
Table 1 is a basketball action statistics table.Basketball action statistics table.

Table 2 .
Revised basketball action statistics table.

Table 4 .
Processing time of basketball action data based on the big data processing platform (s).

Table 5 .
Basketball action data processing time (s) of the method in this paper.

Table 6 .
Basketball action data processing results based on data mining (%).

Table 7 .
Basketball action data processing results based on big data processing platform (%).

Table 8 .
Basketball action data processing results of the method in this paper (%).