Using Camshift and Kalman Algorithm to Trajectory Characteristic Matching of Basketball Players

Because of its unique charm, sports video is widely welcomed by the public in today’s society. +erefore, the analysis and research of sports game video data have high practical significance and commercial value. Taking a basketball game video as an example, this paper studies the tracking feature matching of basketball players’ detection, recognition, and prediction in the game video. +is paper is divided into four parts to improve the application of the interactive multimodel algorithm to track characteristic matching: moving object detection, recognition, basketball track characteristic matching, and player track characteristic matching. +e main work and research results of each part are as follows: firstly, the improved K-means clustering algorithm is used to segment the golf field area; then, HSV is combined with the RGB Fujian value method to eliminate the field area; at last, straight field lines were extracted by Hough transform, and elliptical field lines were extracted by curve fitting, and the field lines were eliminated to realize the detection of moving objects. Seven normalized Hu invariant moments are used as the target features to realize the recognition of moving targets. By obtaining the feature distance between the sample and the template, the category of the sample is judged, which has a good robustness. +e Kalman filter is used to match the characteristics of the basketball trajectory. Aiming at the occlusion of basketball, the least square method was used to fit the basketball trajectory, and the basketball position was predicted at the occlusion moment, which realized the occlusion trajectory matching. +e matching of players’ track characteristics is realized by the CamShift algorithm based on the color model, which makes full use of players’ color information and realizes real-time performance. In order to solve the problem of occlusion between players in the track feature matching, CamShift and Kalman algorithms were used to determine the occlusion factor through the search window and then weighted Kalman and CamShift according to the occlusion degree to get the track feature matching result. +e experimental results show that the detection time is greatly shortened, the memory space occupied is small, and the effect is very ideal.


Introduction
Sports video is a kind of important media data, which has a large audience and a huge application prospect and is widely concerned by the academic and industrial circles. In terms of the demand for sports video, users can be divided into two categories: ordinary users and professionals. Among them, ordinary users generally refer to the audience; professional users include athletes, coaches, and sports critics. ey need to accurately extract certain information about teams and players in order to make game plans, evaluate performance, or analyze game strategies. ese users are interested in target detection, track feature matching, motion track extraction, and semantic analysis on top of that. So the focus of the video is on the object of the sport, the ball, or the player.
In the training video of athletes, coaches can obtain human motion parameters by adopting relevant processing methods such as segmentation and track characteristic matching. By collecting high-level athletes in training and competition at ordinary times a large number of video image data and analyzing the data information effectively, through the real-time trajectory feature matching of athletes, the analysis of the athletes' movement can change the coaches with only the technique of artificial observation and experience for athletes' action guide way of training and improve the standardization of the action. Compared with the traditional method of installing sensors on athletes to obtain the relevant parameters, the new method can obtain the sports parameters of athletes better because of the interference of sensors on athletes' technical movements [1,2]. Sports video analysis is driven by different requirements to produce a lot of valuable applications, including the sections in extraction and transmission, video, video browsing and retrieval, detection and track of the ball, athletes' feature matching, behavior and action analysis and index, tactical statistics and strategy analysis, virtual content inserted, and virtual scene structure. ese applications are often related to target detection and track feature matching, so it is the basis of subsequent video image analysis to quickly and effectively segment the objects in the video and realize track feature matching of interested targets. With the advent of the Olympic Games, more and more attention has been paid to the sports meeting, and the development of more and more advanced sports video processing technology has become a top priority. Among the numerous sports games, basketball has the largest number of spectators and the highest degree of attention.
erefore, it is of great practical value and significance to detect, extract, locate, and match the trajectory characteristics of moving objects in a basketball game video. is paper is based on this background environment to carry on the research [3][4][5].
Li proposed a method of field color adaptive detection of the playing field area [6]. is method finds the main area in the histogram and then estimates the mean value and variance of this area. In detection, two color spaces are used to complement each other, the former as the control space and the latter as the basic space. Ahmed et al. used the Gaussian mixture model and EM algorithm to automatically obtain the color of the field in the sports video [7]. e automatic modeling and detection of the jersey color of players from both sides are tentatively tested in player recognition. Song et al. used the ground segmentation image as a mask [8][9][10][11]. In the AdaBoost test, the performance method has been greatly improved than before. It also collects samples through automatic detection, uses unsupervised clustering to learn colors, and then classifies players.
is method realizes automatic classification of players and provides high performance for players and referees.
In the early stage of ball detection, color template matching technology was basically adopted. Mo et al. proposed a new idea: firstly, the size of the ball area was inferred according to the size of the player area, and then, the nonball area was filtered out [12]. Finally, the Kalman filter was used to track and find the area containing the ball. Ahmed et al. used two stages to detect and identify the ball [13]. First, the Hough detection algorithm was used to detect the area that might contain the ball, and then, the neural network classifier was used to find the area that really contained the ball. In order to improve the speed, background subtraction method and ball tracking technology are introduced. e work done in this paper is as follows: (1) the improved K-means clustering algorithm is adopted to segment the course. For the K-means clustering algorithm can automatically select the number of clustering and clustering results depending on the initial clustering points' shortcomings, this paper proposes a K-means clustering algorithm based on fuzzy set theory, according to the original image histogram to determine the clustering number and initial clustering points, realizes the clustering number and the automatic selection of the initial clustering points, and has obtained the good segmentation effect. (2) In the aspect of extracting court lines, Hough's detection ellipse has the disadvantages of occupying large memory and consuming long time. According to the actual characteristics of basketball ellipse court lines, this paper adopts a curve fitting method to achieve the extraction of ellipse court lines, thus greatly reducing the time required by rough transformation to extract the ellipse. (3) In the aspect of target recognition, 7 Hu invariant moments were used to identify players and balls, which improved the shortcomings of the original identification method that could not correctly identify objects with rotation and size changes. e 7 Hu characteristic moments are proved to be invariants for scaling, rotation, and reflection of the image, so the Hu invariant moments are robust for the recognition of players and balls, as well as for occluded players [14][15][16][17]. (4) Using the Kalman filter to achieve the basketball track characteristics matching. e Kalman filter is an algorithm for linear minimum variance error estimation of the state sequence of the dynamic system, which is calculated by the recursive filtering method. It has the characteristics of small computation amount and realtime computation and has quite good track characteristic matching effect for objects with approximately uniform speed motion. Aiming at the occlusion of basketball, the least square method was used to fit the basketball trajectory, and the position of the occlusion frame was deduced from the trajectory to achieve the matching of the trajectory characteristics of the occlusion. (5) Match players with CamShift trajectory characteristics. Aiming at the disadvantage that CamShift is easily disturbed by the surrounding environment, a weighted background histogram is adopted to reduce the interference. In addition, CamShift and Kalman algorithms are used to deal with the occlusion, and the occlusion factor is determined by searching the window size to achieve the occlusion processing. e structure of this paper is shown in Figure 1.
is paper is divided into four sections, the content and organization of each section is as follows: Section 1 introduces the purpose and significance of this research, the problems in this field, and the research status at home and abroad and gives the main work of this paper. Section 2 discusses moving target detection. Taking basketball as an example, this paper introduces the idea of moving object detection. First, the improved K-means clustering was used to separate the course area; then, the HSV combined with the RGB boundary value method was used to eliminate the field, and the moving target and the field line were obtained. en, the straight field line was extracted by Hough, and the elliptical field line was 2 Complexity extracted by curve fitting, and the extracted field line was eliminated, so as to realize the detection of moving target. Section 3 discusses target recognition based on Hu invariant moment. By discriminating 7 Hu invariant moments, the recognition of players and balls is realized. In addition, a method of segmentation and discrimination of multiple human adhesions is proposed. Section 4 discusses the summary and prospect. is paper summarizes the work of the whole paper and points out the existing problems and the next research direction.

Trajectories Matching of Basketball Players under the Color
Model. In the existing basketball segmentation literature, most of the methods are based on the min value segmentation, such as the main color method; the first min value segmentation, after the segmentation of the court area, can be extracted to get the player area [18][19][20][21]. But this method reverses the order, because in the basketball video image, the audience and players, including the field, will be affected by the increase in the audience color when the entire image histogram is divided and counted to determine the closed distribution, resulting in deviations in the calculation of the minimum offset value. is results in the minimum value found for the segmentation of the entire image, not for the pitch region. erefore, a more ideal method is to first segment the court area and then calculate the color histogram of the court area to find the closed value of the segmentation. In this way, the influence of the noncourt area on the dividing stop value is reduced. In addition, the presence of the audience will also have an impact on the subsequent target recognition. erefore, this paper uses the method of dividing the field area first and then dividing the players by the min value.
In general, the algorithm of closed value segmentation will involve the conversion of the color model [22][23][24]. Let us introduce the color model first. According to the computer color theory, for each color, there are different ways of expression in various theories, which forms a variety of different color spaces; the common color spaces are as follows: RGB, CMYK, YCRCB (YUV), and HSV. Each color space has its own background or application field, so different color spaces should be used according to the specific situation. Here is a brief introduction of the two color spaces often used in the study of video image processing: RGB space and HSV space. e RGB space is formed according to the spectral theory. In the RGB color space, all colors are realized by mixing the three components of red (R), green (G), and blue (B) in a certain proportion. Red (R), green (G), and blue (B) are the three primary colors that constitute all colors, and each component is called a color channel.
In the RGB model, the chromaticity of light is proportional as follows: HSV space: e HSV space reflects the way people perceive colors. HSV separates Value from Hue and Saturation, two parameters that reflect the essential characteristics of colors. When we analyze the color image, the direct use of the color and saturation can reflect the nature of the color that will get better results. e following CamShift algorithm mainly uses Hue information in the HSV space, as shown in Figure 2.
e algorithm for converting RGB to HSV is shown as follows: Complexity

Trajectional Characteristic Matching of Basketball Players under Court Segmentation.
Generally speaking, the color characteristics of the pitch area are quite obvious, most of the pitch color is single and almost all is red. erefore, we can segment the playing area according to the color characteristics. e K-means clustering algorithm has the characteristics of simple operation, good real-time performance, and stable segmentation, so this paper selects the K-means clustering algorithm to segment the golf field area. Before Kmeans clustering segmentation, it is necessary to preprocess the image and use image equalization to enhance the contrast of the image. e K-means algorithm, first proposed by Maceen, is a classic pattern recognition algorithm to solve clustering problems. K-means clustering has the advantages of simple calculation, fast calculation, effective processing of large amounts of data, dynamic clustering, and strong adaptability. It has a wide range of application fields, especially when solving the problem that the pattern distribution presents the agglomeration within the class, the algorithm can achieve good clustering results. is algorithm is one of the most common algorithms for iteratively adjusting the centroid of K clusters.
Although this algorithm has been widely used, it also has some unavoidable problems: (1) like many clustering methods, the K-means algorithm is carried out under the premise of assuming the number of clusters in the data participating in clustering, which may not be consistent with the actual number of categories. (2) In terms of iterative technique, the K-means algorithm is particularly sensitive to initial clustering conditions. (3) e K-means algorithm may cause local minimum solution.
e algorithm provides a unique one-to-one mapping relationship between the initial clustering center and the final clustering result. e determination of clustering number K directly affects the results of image clustering. If the clustering number K is too small, the classification results are not accurate, resulting in many backgrounds being segmented into foreground targets. If the number of clustering K is too large, it will be seriously interfered by noise, and it is not easy to see the change of clustering center value rule, and the overhead of the algorithm will also increase. erefore, it is necessary to determine the classification number according to the image statistical characteristics.
Regarding the selection of K, this paper adopts the fuzzy set theory and estimates K by means of the maximum value of the probability histogram of the H component. e probability histogram of the H component of a basketball image composed of pixels is generally distributed in the shape of valley and peak, with several maximum and minimum values. Let the extreme points be H-ex, D < I < t, where t is the number of extreme points. e maximum point H-ex, corresponding to the maximum value p, is the probability that the pixel brightness value is H-ex, as shown in Figure 3.
After segmentation by the K-means clustering method proposed in this paper, the original image will be segmented into K parts, including the court, players, and audience seats. In this paper, each part is represented in different colors. However, K-means clustering will merge the pixels of other areas (such as the color areas of the audience and the court) into the court area, which will lead to inaccurate segmentation of the court area. erefore, it is necessary to conduct image processing in the later period to segment a complete and accurate court area.
e golf course has the following characteristics: (1) the area of the golf course in this image is generally the largest or relatively large area; (2) the edge line of the court is straight; (3) the color of the pitch area is usually green or similar, while the color of the auditorium is mixed; (4) the texture comparison rules of the course.
We can judge whether the segmented area belongs to the court area according to the above characteristics because the judgment of court texture is relatively complex, and the 4 Complexity court area can be judged by the previous several rules, so here we use the first three criteria to judge the court area.
Here is the extraction of the golf course area after clustering above, and the extraction effect is shown in Figure 4. In video image processing, mathematical morphology is often used in the subsequent processing of various video images because of its features such as smooth contour, filling holes, and connecting split areas. Mathematical morphology represents a mathematical tool for video image analysis based on morphology. e basic idea of this method is to measure or extract the corresponding shapes of video images with certain structural elements in order to achieve the purpose of video image processing. It has four basic operations, namely, expansion, corrosion, open operation, and closed operation [25][26][27]. ey are usually defined in terms of proper names and operate on images by defining specialized structural elements. Among them, the most commonly used structural elements are composed of 4 connected 3 × 3 neighborhoods (5 points) or 8 connected 3 × 3 neighborhoods (9 points). At the same time, other practical mathematical morphology algorithms can be combined based on these basic operations. In OpenCV, the mathematical morphology filtering algorithm has been encapsulated into several library functions, which are very convenient to use.

An Improved Interactive Multimodel
Algorithm Is Applied to Basketball Player Track Feature Matching 3.1. e Improved Interactive Multimodel Algorithm Is Applied to the Trajectory Characteristics. Moments are used in statistics to represent the distribution of random quantities and in mechanics to represent the spatial distribution of matter [28][29][30]. If the binary image or gray image is regarded as the distribution function of two-dimensional density, the moment technique can be applied to video image analysis. In this way, moments can be used to represent the features of a binary or grayscale image and extracted into features similar to those in statistics and mechanics. In recent years, the invariant property of moment values obtained from 2D and 3D shapes has attracted great attention in the field of image. Moment technology has been widely used in many aspects of image classification and recognition processing, such as scene matching, histogram matching, image reconstruction, object recognition, and image retrieval. In this section, on the basis of introducing the basic concepts of moment and invariant moment, Hu moment invariant is selected to identify the target, and the conclusion is drawn through the discussion of the experimental results. e basic idea of the moment invariant target recognition algorithm is to search all possible target regions in the preprocessed binary image, calculate the seven Hu moment invariant features of the region, and consider the region with a higher degree of matching with the template as the same type of target. e similarity is the characteristic distance. e characteristic distance between the template vector Y and sample X is defined as But in practice, since the goal of image segmentation after sometimes is not whole, it can be divided into several parts as well as a target is divided into every phase close to the independent area; how to put these few areas as a whole for target recognition is worth studying; this article creates a copy of the segmented image and takes multiple t(2). If several areas are put together as a whole after the expansion of t time, these areas are recognized as a whole, and this area is marked as a whole area on the original image to be detected. e expansion method sometimes connects some close distance targets into a whole to identify them. e identification process is shown in Figure 5.
e recognition algorithm steps are as follows: Step 1. Initialize the current scanning point {x, y) as the starting point of the image {0, 0); Step 2. Scan the image. When a region to be detected is encountered, obtain 7 Hu moment invariant feature vectors of the current region, and calculate the characteristic distance D between this vector and each template vector; Step 3. If D is less than the given threshold value L, we take L � 0.7 in the experiment to determine that the corresponding target candidate region is found. Draw the rectangular box with the minimum connection of the target as the recognition box. e red box can be drawn for basketball, while the green box for human. e above methods will distinguish the player from the ball, but there is no way to distinguish a single body from an attached body, there is no way to separate two or more attached bodies into a single body, and there is no way to tell whether the same team is attached or the other team is attached. e following is to take the adhesion of two players as an example to explain the distinction and segmentation of the adhesion human body and the discrimination method of adhesion properties in this paper. Because even in the case of occlusion, the head of the human body still has obvious characteristics, multiple human bodies can be fitted or bitten into one human body, according to the characteristics of the human head. It can be seen that the position of the head corresponds to the maximum value of the image projection (the two largest peaks and the two human adhesion parts correspond to the valley bottom of the projection curve between the two peaks). erefore, the image segmentation points can be determined to separate the adhesion bodies according to this feature.
e Hough transform is also applicable to the curve detection with known equations. A known curve equation in the image coordinate space can also establish its corresponding parameter space. us, a point in the image coordinate space can be mapped to the corresponding trajectory curve or surface in the parameter space. If the curves or surfaces corresponding to each discontinuous point in the parameter space can intersect, the maximum value of the parameter space and the corresponding parameters can be found. If the curves or surfaces corresponding to each discontinuity point in the parameter space cannot intersect, it means that the discontinuity point does not conform to a given curve. When Hough transform does curve detection, the most important thing is to write the transformation formula from the image coordinate space to the parameter space. e method of segmenting the human body with adhesion by judging whether there is a lower bottom between two maxima is also applicable to the situation of multiple human bodies. After the rectangular representation window of foreground target is obtained by background extraction, the brightness of the target in the window is projected vertically, and the multibody images can be segmented into a series of single body images by the above method. Since the pixel distribution in the lower part of the human body is sparse, in order to avoid its influence on the image projection curve, we only use the part of the upper part of the image 112 for projection in practice.

New technology production Diagram
The golf course has the following characteristics We can judge whether the segmented area belongs to the court area according to the above characteristics.
(4) The texture comparison rules of the course.

Mark
Step A shown this Step B shown this Step C shown this Step D shown this Milestone overview. All additional information can be put here. This includes details such as sources, initial situation, research motivation, and background information

Simulation Calculation of Basketball Player's Trajectory Characteristics Based on the Improved Interactive Multimodel
Algorithm. e adaptive interactive multimodel algorithm based on the angular rate is a further extension of the classical multimodel algorithm. e classical interactive multimodel algorithm does filtering in a stable Cartesian coordinate system and does not need to transform the measurement and target state. However, the algorithm proposed in this paper advances in an adaptive coordinate system. Line Filter. e adaptive coordinate system is an imaginary coordinate system which builds the target acceleration model along each coordinate axis of the radar antenna (line of sight coordinate system). It is assumed that the antenna frame is instantaneous fixed (i.e., does not rotate relative to the space during the measurement interval) and the coordinate system does not always correspond to the line of sight coordinate system.
Only in the case of new measurement inputs (trajectory characteristics matching radar and rate gyro), the adaptive coordinate system is transformed and completely coincidences with the line of sight coordinate system, while the adaptive coordinate system is fixed in space at other times. e position and velocity of the target are measured by the interactive multimodel algorithm, just as the coordinate system of the line of sight is fixed at the moment when the target measurement is finally obtained. e target state estimator calculates the target position, velocity, and acceleration relative to the adaptive coordinate system. After each filtering process of the interactive multimodel, the current state estimation and error covariance of the target should be converted to the next corresponding new direction.
For the basketball player's short-range defense, the target short-range movement is usually a straight line movement. It is reasonable to choose the CV model, CA model, and CS model as the main linear motion model. In this paper, the combination of the CV model and CA model is used to introduce the adaptive interactive multimodel algorithm based on the angular rate. Model 1 is the CV model, and Model 2 is the CA model.
is part mainly interacts with the output of the multimodel filter. In the adaptive interactive filtering model, the filtering output after interaction is the filtering output value in the adaptive coordinate system at the corresponding time, which is ready to be input into the interactive filtering and enter into the next cycle. In this process, it should be noted that the filter value before interaction should have two flow directions, which are used for the interactive output of the multimodel filter at the corresponding moment and converted to the interactive input of the multimodel filter in the adaptive coordinate system at the next moment. e above transformation is to transform the state output of the Model 1 filter to the next time adaptive coordinate system. Similarly, the state output of the Model 2 filter can be converted to an adaptive coordinate system at the next moment, which will not be detailed here. e filtered error covariance converted to the adaptive coordinate system at the next moment is only used as the input interaction of the filter at the next moment, and the error covariance of the filter at that moment should be used in the output interaction process of the filter error covariance at that moment.
e Model 1 filter is taken as an example to introduce the error covariance transformation. Model 2's error covariance transformation is similar to Simulation 1's.
If there is a large difference between the target and background gray levels in a given image, there are two peaks of gray distribution on the histogram. e gray value corresponding to the bottom position is selected as the threshold value of the binary image to achieve the segmentation of target and background. e threshold selection of this method is relatively intuitive and simple, but it is not applicable to complex background images, as shown in Figure 6. e experimental material here is culled from video of the 2019 World Cup basketball game between Brazil and the United States. From the 23rd minute, the track characteristic matches a Brazilian team member, as shown in Figure 7. In this video, occlusion occurs at frame 24, the target is completely occluded at frame 33 to 37, and the occlusion ends at frame 39. e matching effect of trajectory characteristics shown in Figure 8 shows the curves of the search window and occlusion factor.

Complexity
Result Analysis. Starting from the first frame, the upper body of the player was selected as the trajectory matching object, and the Kalman parameter was initialized. In the 12th frame, the search window day would not become larger when it was close to a team member, but there was no connection. e trajectory matching results were mainly CamShift trajectory matching results. In frame 24, players begin to be partially occluded, and the search window becomes smaller but the change is not large. erefore, the occlusion coefficient is small at this time, and the track feature matching result is still dominated by the CamShift track feature matching result, as shown in Figure 9.
Set Target Route Parameters. e initial distance from the target to the observation point is about 10 000 m, the altitude is 50 m, the route shortcut is 300 m, and the sampling period is T � 0.02 s. e target flies in a straight line at a constant speed of 300 m/s along N600 by E for 15 s and then flies in a straight line at an acceleration of 20 m/s to measure the noise. In the case of known theoretical values, the filtering convergence time and filtering error between the proposed algorithm and the standard single model Kalman filter algorithm are calculated. e horizontal axis represents the time, unit is s; the vertical axis represents the position, unit is m. Figure 9 shows the position filtering effect of the two algorithms in the ship's geographic coordinate system on Xaxis and Y-axis. As can be seen from Figure 9, the convergence time of the single model Kalman filter algorithm in this paper is significantly faster than that of the former, and the filtering accuracy of the latter algorithm is better than that of the former. Figure 10 is the filtering effect diagram of the two algorithms in the target maneuvering process. As can be seen from Figure 10, the former algorithm has begun to filter divergence after the target s maneuvers, while the latter maintains stable filtering of the maneuvering target. According to the comparison between Figures 9 and 10, in the process of maneuvering target tracking, the filtering effect of the proposed algorithm is obviously better than that of the single model Kalman filtering algorithm.
We use the color histogram with weighted distance as the target feature to reduce the influence of target background pixels and increase the robustness of CamShift algorithm to partial occlusion. For blocking players, this section proposes a target tracking algorithm based on CamShift and Kalman filter. In the process of target tracking, CamShift algorithm does not consider the actual macromotion of the target, that is, it does not use the direction and speed information of the target in space. In the case of serious interference, it is easy to fail in tracking. In this section, the Kalman filter is reasonably combined with the color-based CamShift algorithm to predict the direction and speed of the target. For different interference conditions, the tracking results of the two algorithms are weighted by different scaling factors to get the final position of the target. In the case of weak interference, the tracking results of the CamShift algorithm account for a  large proportion, while in the case of strong interference, the results of the Kalman filter account for a large proportion, so as to ensure the stability and robustness of the tracking effect.

Conclusion
In this paper, the segmentation and track characteristic matching of the interested object-player in the basketball game, which is the most widely watched sports video, are studied, which lays a foundation for the further analysis of the sports video. Firstly, this paper discusses the method of moving object detection and recognition on a single picture of the basketball match. en, we discuss the matching problem of basketball and players' track characteristics and combine the two parts, that is, the target and position parameters obtained by segmentation, instead of the parameters passed manually so that the track characteristics matching can be automated. e main work of this paper includes the following parts. (1) In this paper, the improved K-means clustering algorithm is adopted to segment the golf field area, and the color histogram is used to verify the results. e clustering number K and the initial clustering point are fixed, which solves the shortcoming that the clustering number and the initial clustering point cannot be selected automatically in the K-means clustering. en, according to the color characteristics of the field, a complementary color model based on HSV and RGB is adopted to eliminate the field and realize the segmentation of the ball, players, and field line. (2) e elliptical court line in the basketball video is basically a fixed shape, so this paper uses a specific curve to fit the square. e ellipse field line was extracted by the method. e experimental results show that the detection time is greatly shortened, the memory space occupied is small, and the effect is very ideal. e Hough transform method provided in 4Pencv is still used for straight line detection. (3) In the aspect of target recognition, 7 Hu invariant moments with good robustness are selected to identify different targets. According to the characteristics of normalization of Hu moments, a discriminant formula is proposed in this paper to combine 7 Hu moments to determine the type of the detection region. Experiments show that this method is effective in distinguishing basketball from players. (4) Match players with CamShift trajectory characteristics. e movement speed of the players is a little slower, but the color features are rich. Besides, the players are a nonrigid body movement, which is suitable for the trajectory characteristic matching of the CamShift algorithm. e background weighted histogram was used to improve the CamShift algorithm to solve the defect that CamShift trajectory matching was easily disturbed by the surrounding environment. In addition, the method of CamShift combined with the Kalman filter is used to deal with player occlusion. A method of determining the occlusion factor based on search window and weighting Kalman and CamShift results by the occlusion factor is proposed, and some results are obtained.

Data Availability
e data used to support the findings of this study are available from the corresponding author upon request.

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