Automatic Tracking Method of Basketball Flight Trajectory Based on Data Fusion and Sparse Representation Model

The appearance model of flying basketball obtained by the traditional basketball flight trajectory tracking method is not accurate, which leads the anti-interference performance of trajectory tracking not ideal. Based on data fusion and sparse representation model, a new automatic trajectory tracking method is proposed. Firstly, the relevant technologies of basketball flight trajectory automatic tracking are studied and summarized, and then the method is studied. The specific implementation steps of this method are as follows: the features of flying basketball images were extracted by the target feature extraction algorithm, and the appearance model of flying basketball was built based on sparse representation. Data fusion technology and particle filter algorithm are combined to realize automatic tracking of basketball flight path. Through three axial basketball trajectories of automatic tracking test and noise test and verify the design method under the 3D world coordinate system to achieve the X, Y, and Z axis up more accurate tracking, at the same time, after applying measurement signal to noise, automatic trajectory tracking results affected by some, but still managed to realize the trajectory tracking.


Introduction
e current research on sports video mainly focuses on the following aspects: first, extract wonderful clips, that is, summarize and collect the wonderful clips, so as to meet the audience who cannot watch the live broadcast, so that they can save time and enjoy the fun of watching the game to the greatest extent [1]. e second is the technical statistical analysis of the event [2], that is, the analysis of the competition situation.
rough computer-aided, it can automatically analyze and count the competition video so as to obtain detailed competition technical statistics, reduce errors, and save human resources. And the last is identifying athletes' behavior, which is not only the most widely used but also the ultimate goal of most sports video analysis work.
rough the recognition of athletes' competition actions, more advanced applications can be realized, such as simulated sports competition. In basketball, most of the content of the game is the interaction between basketball and players.
Tracking basketball is the basic work of game situation analysis and other applications [3,4].
Foreign countries began to study and analyze sports video in the late 1980s. is field has potential economic value and broad application prospects. For the flight trajectory tracking problem of the ball, some classical research results have been obtained at home and abroad. Literature [5] proposed an image fusion scheme based on image cartoon texture decomposition and sparse representation. e proposed image fusion method decomposes the source multimodal image into cartoon image and texture image. For cartoon components, a suitable space-based morphological structure preservation method is proposed. Energy-based fusion rules are used to maintain the structure information of the source image. For texture components, a method based on sparse representation is proposed. For the proposed fusion method based on sparse representation, a dictionary with strong representation ability is trained. Finally, according to the texture enhancement fusion rules, the fused animation and texture components are fused. Reference [6] proposed a twin neural network target tracking algorithm integrating the disturbance perception model. e low-level structural features extracted by twin neural network are effectively fused with high-level semantic features to improve the representation ability of features. e disturbance perception model based on color histogram feature is introduced into the algorithm. e target response score map is obtained by weighted fusion to estimate the target position, and the optimal target scale is estimated by using the adjacent frame scale adaptive strategy.
However, the target appearance model obtained by the above traditional target tracking methods is not accurate enough, resulting in the unsatisfactory anti-interference performance of trajectory tracking. Referring to the previous research results, this paper introduces data fusion and sparse representation model to realize the automatic tracking of basketball flight trajectory.

Problems in Basketball Flight Trajectory Tracking
In the research of basketball flight trajectory tracking, there are still many problems, such as the difficulty of shooting clear images when the basketball is moving at high speed, the distortion [7] phenomenon of camera imaging, and the air resistance when the ball is flying.

Motion Blur Problem.
Motion blur means that the relative motion speed of the basketball and camera is too fast, which will expose different scene points in the photosensitive device at the same time and at the same point, resulting in image quality degradation [8]. ere is a serious motion blur problem in the basketball at high speed, which will affect the accuracy of trajectory tracking.

Lens Distortion.
Lens distortion is actually the general term of the inherent perspective distortion of the optical lens, that is, the distortion caused by perspective, which is very unfavorable to the imaging quality of photos [9]. ere are some distortion factors in the camera lens in the real situation, which is difficult to be described by the ideal distortion model.

Air Resistance.
When flying at high speed in the air, the basketball will be disturbed by Magnus force, air resistance, and so on, which makes its real flight trajectory deviate from its ideal flight trajectory.

Data Fusion Technology
3.1.1. Overview of Data Fusion. Data fusion refers to the realization of estimation tasks and decision-making through multisource information and integrated multisensor, which specifically includes a variety of concepts such as information fusion and data fusion [10,11].

Data Fusion Classification.
Based on the abstraction level, data fusion can be divided into three categories: feature level, decision level, and pixel level.

Key Points of Data Fusion.
In data fusion, both traditional theories and new technologies are applied. e traditional theories include optimization theory and decision theory, while the new technologies include weighted average method and D.S. [12].

Fundamentals of Basketball Flight Trajectory Automatic
Tracking Algorithm 3.2.1. Target Feature Extraction. Target feature extraction algorithms mainly include local preserving mapping and independent component analysis.

Particle Filter
Algorithm. e particle filter algorithm is a Monte Carlo filtering method [13], which is mainly based on Bayesian theory. e basic idea is to express the posterior probability distribution corresponding to the system random variables through a group of random particles with weights, which can solve the non-Gaussian and nonlinear problems [14].

Sparse Representation eory.
e sparse representation model includes synthetic sparse model and analytical sparse model. e analytical sparse model is an expansion of the field of signal sparse modeling, which mainly emphasizes the position and number of nonzero elements in the sparse coefficient elements to characterize the spatial dimension of signal X. e synthetic sparse model uses the super complete redundant dictionary to sparse decompose the image signal.

Appearance Model Based on Sparse Representation.
In image target tracking, features such as contour, texture, and color are often used to describe the target. However, in some images, the target contour is not obvious and the background is complex. Tracking algorithms based on traditional observation models often lose the target [15]. erefore, a new appearance model of the flying basketball based on the sparse representation model is proposed in this paper. It is assumed that the target in the image sequence is located in a low dimensional subspace G � {g 1 , . . . , g n }; that is, the target can be sparse represented by this subspace: where the subspace is called target subspace a, which is composed of the eigenvectors of the target observation vector matrix in the previous B frame image; C stands for super complete dictionary; D represents the representation 2 Complexity error caused by noise and occlusion; and E represents sparsity [16]. e feature of basketball flying image is extracted by the target feature extraction algorithm, and the appearance model of the flying basketball is constructed based on the sparse representation model. When extracting the features of basketball flight image, the algorithm used is the local preserving mapping algorithm [17], that is, to reduce the dimension of basketball flight image data while retaining the features of the original data.
In the feature extraction of basketball flight image, the k-nearest neighbor method is used to construct the interclass adjacency graph and intraclass adjacency graph [18]. en, the weight on the edge is determined. e method used is as follows: In formula (2), S i,j represents the weight on the edge and i and j represent the edges of basketball flight image features, respectively.
Taking the edge weight as the weight matrix of the adjacency graph, it can be found that the matrix is sparse and symmetric. For the basketball flight image data set, it is transformed and projected through the weight matrix of the adjacency graph to obtain the basketball flight image features [19,20]. In projection, the objective function needs to be minimized to rationalize the projection criterion. e specific calculation formula of minimization objective function T is as follows: In equation (3), W ij represents the weight matrix of the adjacency graph; y i and y j represent two adjacent points in the basketball flight image data set; N represents the number of data in the basketball flight image data set; and T represents the minimization objective function.
en, the appearance model of the flying basketball is constructed based on the sparse representation model; that is, the appearance model of flying basketball is constructed by the sparse reconstruction algorithm. e specific construction process of the appearance model is as follows: (1) e basketball flight image features are input [21] and trained to obtain dictionary pairs with high resolution and low resolution, which are represented by D l and D h . vec In equation (3), X i represents the reconstructed highresolution basketball flight image of the reconstructed area. (6) e sparse reconstruction problem [23] is solved as follows: In equation (4), P represents the objective function of sparse reconstruction problem [24,25]; B T i represents sparse representation matrix; F stands for linear feature extraction operator; and λ is the fidelity balance parameter. (7) e image block of the high-resolution basketball flight appearance model is constructed, as shown in the following formula: In equation (7), X i represents the constructed highresolution basketball flight appearance model image block and T represents the sparsity balance parameter.
e high-resolution basketball flight appearance model [26] is constructed by repeated operations of partial weighted average on the image blocks of the highresolution basketball flight appearance model X 0 . Finally, the high-resolution basketball flight appearance model X 0 is output.

Establishment of Algorithm Model.
en, the model of the basketball flight trajectory automatic tracking algorithm is constructed by using data fusion technology and particle filter algorithm. Firstly, the data of the high-resolution basketball flight appearance model are processed by data e data fusion method used is D-S evidence theory [27], that is, divide the evidence set, use the divided part to make independent judgment on the identification framework, and then use the Dempster rule to recombine the previously divided parts. e combination rules are as follows: In formula (8), A i and B j , respectively, represent two independent sources of evidence; A represents proposition; m (Ø) represents the universe set of trust function; m represents trust function; and k stands for the number of propositions.
en, the automatic tracking algorithm model of basketball flight trajectory is constructed by the particle filter algorithm. In the model construction, the measurement covariance has an important impact on the output of the final filter. In order to avoid the influence of measurement covariance, dynamic correction is introduced, as shown in the following formula: In formula (9), R k represents the measurement covariance; f (·) represents the dynamic correction function; d k represents the distance between binocular camera and basketball at time k in three-dimensional space, that is, the automatic tracking algorithm model of basketball flight trajectory, as shown in the following formula: In equation (10), x c , y c , and z c , respectively, represent the midpoint position when the left and right cameras are connected with the two optical centers; x k , y k , and z k , respectively, represent the coordinate measurement values corresponding to basketball flight in the three-dimensional world coordinate system.

Two-Step Tracking.
e designed basketball flight trajectory automatic tracking algorithm determines the value range and increasing process of the dynamic correction function according to the actual calibration results of the camera.
In the initial tracking stage, the small measurement covariance difference is set, so that the algorithm can quickly follow the basketball flight. en, the size of the measured covariance difference is gradually increased so as to improve the output stability of the particle filter algorithm.
In the process of two-step tracking, the expression of measurement covariance is defined as the following formula: In equation (11), d 0 represents the initial distance value corresponding to the optical center of the basketball and the midpoint of the connecting line of the binocular camera and R 0 represents the initial measurement covariance.

Algorithm Steps.
e steps of the designed basketball flight trajectory automatic tracking algorithm are summarized. e steps of the algorithm are divided into three steps, as follows: (i) e most difficult problem of basketball target tracking is that the appearance model of the flying basketball is not accurate enough, which is still an unsolved problem in the traditional basketball flight trajectory tracking method. erefore, based on the feature extraction of basketball flight image features by target feature extraction algorithm, I construct the appearance model of sparse representation of flying basketball, which lays the foundation for high-precision target tracking of basketball targets. (ii) Using data fusion technology and particle filter algorithm, the model of the basketball flight trajectory automatic tracking algorithm is constructed. D-S evidence theory data fusion technology is used to complete the information processing of high-resolution basketball flight appearance model data. (iii) Finally, the basketball flight appearance model is tracked by using the constructed basketball flight trajectory automatic tracking algorithm model.

Case Tracking Test.
In the experiment, the binocular vision system is used to collect the basketball flight images in the robot basketball. Under the conditions of i5-7300hq processor and 10 GB memory, the moving image sequence is processed based on MATLAB 2020b for automatic tracking of basketball flight trajectory in the experiment. e experimental image is shown in Figure 1.
e visual results of basketball target tracking are shown in Figure 2.
In the experiment, the average value of M in Y i is 32, k is 6, and the initial value of T k is 10 mm. With the reduction of the distance between binocular camera and basketball at k time in three-dimensional space, R k gradually increases to 40 mm.

ree Axis Tracking Results.
Because the process of basketball flight is in three-dimensional space, the test of its tracking effect is divided into three directions: x-axis, yaxis, and z-axis. e basketball motion image is processed by MATLAB 2020b to obtain the trajectory coordinates of basketball flight. e basketball flight trajectory is tracked 4 Complexity by using the method proposed in this paper, and the tracking results are compared with the actual coordinates. If they are close, the tracking results of the proposed method are ideal.

X-Axis Tracking
Results. e designed basketball flight trajectory automatic tracking method based on data fusion and sparse representation model is used to track the trajectory of basketball thrown by the experimental basketball robot. e experimental results of x-axis basketball flight trajectory automatic tracking are shown in Figure 2.
From the experimental results of x-axis basketball flight trajectory automatic tracking in Figure 3 and Table 1, it can be seen that there is almost no obvious difference between the output of the basketball flight trajectory automatic tracking algorithm model and the actual basketball flight trajectory. In the 400 ms of the experiment, there is a small deviation between the original flight speed and the tracking speed, and the deviation value is 0.1 m/s, which shows that with the increase in experimental time, the tracking result of the design method is still relatively stable and the output noise is small, which proves that the automatic tracking effect of x-axis basketball flight trajectory of the design method is better.

Y-Axis Tracking Results.
en, the automatic tracking of y-axis basketball flight trajectory of the design method is tested, and the specific test results are shown in Figure 3.
According to the automatic tracking of y-axis basketball flight trajectory in Figure 4 and Table 2, when the experimental time is 300 ms and 350 ms, the proposed method has two tracking errors, 3 mm/MS and 2 mm/MS, respectively, but the error does not affect the overall tracking effect of y-axis. It can be seen that the automatic tracking method of basketball flight trajectory based on data fusion and sparse representation model can track the y-axis more accurately in the three-dimensional world coordinate system. at is, the output of the basketball flight trajectory automatic tracking algorithm model during y-axis tracking is very close to the reality, which proves that the design method can accurately track the y-axis trajectory.

Z-Axis Tracking
Results. Finally, the automatic tracking of z-axis basketball flight trajectory of the design method is tested, and the specific test results are shown in Figure 4.
It can be seen from the automatic tracking of z-axis basketball flight trajectory in Figure 5 and Table 3 that the automatic tracking accuracy of z-axis basketball flight trajectory of the design method is lower than that of x-axis and y-axis basketball flight trajectory. ere is a certain error in the overall tracking trajectory, but the error value is always less than 33 mm/MS, which shows that it still maintains a high accuracy.
Based on the three-axis tracking results, it can be found that the output of the basketball flight trajectory automatic tracking algorithm model is very close to the reality; that is, the designed basketball flight trajectory automatic tracking method based on data fusion and sparse representation model can track the basketball flight trajectory more accurately.  Complexity 5

Error and Deviation Correction Test.
After the test, the error and correction test of the designed basketball flight trajectory automatic tracking method based on data fusion and sparse representation model is carried out; that is, a certain noise is added during the tracking to test the antiinterference performance of the design method in the automatic tracking of basketball flight trajectory. For automatic flight trajectory tracking method, antiinterference performance is an important index to measure its tracking performance. Taking the automatic tracking performance test of x-axis basketball flight trajectory as an example, a certain noise is applied during the test, the automatic tracking of x-axis basketball flight trajectory is tested under the noise interference, and the test results are compared with the tracking results in Section 5.2.1 to observe the anti-interference of the automatic tracking method of basketball flight trajectory based on data fusion and sparse representation model.
In the test, the noise is mainly applied at 200 ms, and the applied noise is the measurement signal noise. e test results of x-axis basketball flight trajectory automatic tracking performance of the design method after noise are shown in Figure 5.
According to Figure 6 and Table 4, the comparison results of the x-axis basketball flight trajectory automatic tracking test at the place where the noise is added (200 ms) show that after the measurement signal noise is applied, the flight trajectory automatic tracking result at 200 ms is affected to a certain extent. However, the trajectory tracking is still successfully realized, which proves that the designed

Conclusion
In order to solve the problems of poor anti-interference and low tracking accuracy of traditional basketball flight trajectory tracking methods, a new trajectory automatic tracking method is proposed. Combined with the sparse representation model, data fusion, target feature extraction, and particle filter algorithm, basketball flight trajectory tracking is studied. To sum up, the following achievements have been made in this study: (1) e sparse representation model, data fusion, target feature extraction, and particle filter algorithm are deeply studied and comprehensively classified. (2) Taking basketball as the research object, through the comprehensive application of various algorithms, this paper constructs the basketball flight trajectory automatic tracking algorithm model, realizes the basketball flight trajectory automatic tracking with high precision and strong anti-interference, and has a broad application prospect. (3) In order to verify the effectiveness of the proposed method, simulation experiments are designed. rough the trajectory tracking of x-axis, y-axis, and z-axis, it is proved that the proposed method can track the basketball flight trajectory with high precision, and the tracking accuracy can be maintained above 95%. In order to verify its anti-interference performance, noise was added when the experimental time was 200 ms low. e experimental results show that the velocity tracking error of the proposed method is only 0.04 m·S −1 at the noise interference, which shows that the trajectory tracking accuracy can still maintain a high level under the noise interference.

Data Availability
We use simulation data, and our model and related hyperparameters are provided in our paper.

Conflicts of Interest
e authors declare that they have no conflicts of interest.