Basketball goal number calculation method based on computer vision

Through multi-view coordinated control and neural network analysis, the problem of inaccurate fusion and synchronization of multi-view image data in the calculation of basketball goals is solved, and efficient and accurate shooting action analysis and prediction are achieved, improving the accuracy of calculation and reliance Great.

CN119228850AInactive Publication Date: 2024-12-31RONGMENGYUESHI (SHANGHAI) SPORTS TECHNOLOGY CO LTD

Patent Information

Application Number
CN202411730602.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-29
Publication Date
2024-12-31
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Existing computer vision technology has shortcomings in the efficient fusion and precise synchronization of multi-view image data in the calculation of basketball goals, resulting in low accuracy of the calculation of the number of goals, especially in the case of complex occlusion and perspective deviation. Misjudgment.

Method used

The basketball scene is captured simultaneously through multiple high-resolution PTZ cameras, and the multi-view collaborative control model and adaptive frame synchronization algorithm are used for time calibration and image data alignment, combining stereo vision algorithms and neural networks (convolutional neural networks and recursive neural networks) The spatial and temporal characteristics of the shooting action were extracted, and the space-time mixed attention mechanism and Bayesian recurrent neural network were used to analyze and predict shooting action.

Benefits of technology

Significantly improves the accuracy and reliability of the number of goals scored in basketball, reduces calculation errors due to camera position differences and time deviations, accurately captures key elements in shooting actions, and improves robustness in complex scenarios and Adaptability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119228850A_ABST
    Figure CN119228850A_ABST
Patent Text Reader

Abstract

The invention discloses a basketball goal number calculation method based on computer vision, which relates to the technical field of computer vision, and comprises the following steps: synchronously capturing match pictures in a basketball court through a plurality of high-resolution PTZ (Pan / Tilt / Zoom) cameras, carrying out time calibration on data of different PTZ cameras, and generating a multi-view synchronous image data stream; tracking the flight path of the basketball in real time according to a time sequence analysis result, judging whether the basketball successfully enters the basket or not, and recording a shooting result; and performing comprehensive analysis on the shooting result, the three-dimensional action model and the time sequence analysis data, and generating a shooting success rate, shooting action evaluation and technical improvement suggestions. According to the method, multi-view image data are efficiently fused and accurately synchronized, so that the accuracy and reliability of basketball goal number calculation are remarkably improved, and the problem of misjudgment under complex shielding and view angle deviation in a traditional method is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of computer vision, and in particular to a method for calculating the number of basketball goals based on computer vision. Background Art

[0002] With the rapid development of computer vision technology, its application in the field of sports is becoming more and more extensive, especially in the statistical analysis and training assistance of basketball games. Traditional basketball game statistics mainly rely on manual observation and recording. This method is not only time-consuming and laborious, but also easily affected by subjective factors, resulting in low data accuracy and consistency. In recent years, with the advancement of high-definition camera equipment and high-speed image processing technology, basketball game analysis technology based on computer vision has gradually become a research hotspot. This type of technology can realize the automated recording and analysis of the game process, providing valuable decision-making support for coaches and athletes. However, when the existing computer vision technology is applied to the calculation of basketball goals, there are still some key problems, especially in the efficient fusion and precise synchronization of multi-view image data.

[0003] Although the existing computer vision-based basketball goal counting methods can realize automated goal statistics to a certain extent, they have obvious deficiencies in the efficient fusion and precise synchronization of multi-view image data. Specifically, most methods rely on image data from a single perspective, which may lead to misjudgment of the number of goals in complex occlusion situations in basketball games. Even though some methods try to use multi-view image data, the lack of effective multi-view collaborative control and time calibration technology leads to significant time delays and perspective deviations between image data from different perspectives, which seriously affects the accuracy of goal calculation. Therefore, how to efficiently fuse multi-view image data and achieve precise time synchronization has become a core issue that needs to be solved urgently. Summary of the invention

[0004] In view of the above existing problems, the present invention is proposed.

[0005] Therefore, the present invention provides a method for calculating the number of basketball goals based on computer vision to solve the problems of multi-view image data fusion and inaccurate time synchronization in the prior art.

[0006] In order to solve the above technical problems, the present invention provides the following technical solutions: In a first aspect, an embodiment of the present invention provides a method for calculating the number of basketball goals based on computer vision, which includes synchronously capturing game images in a basketball court through multiple high-resolution PTZ cameras, and performing time calibration on data from different PTZ cameras to generate a multi-view synchronous image data stream; Perform multi-view fusion on the synchronized image data stream, extract key feature points of the shooting action through stereo vision algorithm, and convert the two-dimensional image data into a three-dimensional shooting action model; The 3D shooting action model is input into the convolutional neural network to extract the spatial features of the player's posture, shooting angle and basketball shooting position in the shooting action; Input the spatial features into the recurrent neural network to perform time series analysis of the shooting action, capture the time dependency of the shooting action, and output the probability evaluation result of the shooting success; According to the time series analysis results, the flight trajectory of the basketball is tracked in real time to determine whether the basketball successfully enters the basket and record the shooting results; Comprehensive analysis is performed on shooting results, three-dimensional motion models, and time series analysis data to generate shooting success rates, shooting motion evaluations, and technical improvement suggestions.

[0007] As a preferred solution of the method for calculating the number of basketball goals based on computer vision of the present invention, the method of generating a synchronous image data stream of multiple perspectives includes: Choose an intelligent industrial PTZ camera array with high frame rate and high resolution, and place it in every corner of the court, above the basket, and in the center of the court; Using a multi-view collaborative control model, the optimal capture angle and focal length of each PTZ camera are calculated in real time based on the relative positions of the PTZ cameras, the difference in viewing angles, and the depth information of objects in the scene. The expression of multi-view collaborative control model is: ; in, Indicates PTZ cameras at a certain time The optimal parameters of viewing angle, focal length and posture adjustment, is the posture angle of the PTZ camera, is the focal length, An index variable representing the number of PTZ cameras. Indicates The index variable of the number of PTZ cameras to compare. Indicates and The spatial distance between the PTZ cameras, Indicates and The viewing angle difference matrix of the PTZ cameras, a scoring matrix representing the spatial coverage captured by the image; Each PTZ camera is equipped with a depth sensor to capture the three-dimensional spatial position of objects in the venue in real time; Based on the three-dimensional spatial position, the auto-focus algorithm is used to further dynamically adjust the rotation and tilt angles; Based on the time synchronization algorithm of visual features, the common feature points in the images collected by the PTZ camera are time-calibrated; Perform edge pre-processing of images in the edge processing unit of each PTZ camera, connect to local nodes through a distributed edge computing architecture, and transmit key feature data to the central processing unit in real time; An adaptive frame synchronization algorithm is used in the central processing unit to perform frame-level alignment processing on the image data streams of all PTZ cameras; The synchronized multi-view image data stream is stored in a distributed storage system, and color correction and distortion correction are performed; The synchronization accuracy of the corrected stored data is verified, and a multi-view synchronized image data stream is output.

[0008] As a preferred solution of the method for calculating the number of basketball goals based on computer vision of the present invention, the specific steps of extracting the spatial features of the player's posture, shooting angle and basketball shooting position in the shooting action are as follows: Use the Min-Max normalization method to scale the three-dimensional joint point coordinates to a uniform range; Using tensor quantization processing, the standardized three-dimensional coordinate data is converted into a three-dimensional tensor format for convolutional neural network processing; In the first convolution layer, a 3D convolution kernel is used to perform convolution operations along the joint points, 3D space, and time dimensions; After the first convolutional layer, a MaxPooling3D pooling layer is added to each convolutional layer, and the number of convolution kernels is increased; After convolution and pooling operations, a fully connected layer is used for global feature integration; After the global features are integrated, the output layer is responsible for generating three important shooting space features: player posture, shooting angle and basketball shooting position.

[0009] As a preferred solution of the method for calculating the number of basketball goals based on computer vision of the present invention, the output of the evaluation result of the possibility of successful shooting includes: Based on the spatial features output by the output layer of the convolutional neural network, the expression of the multi-scale spatiotemporal feature vector is constructed as follows: ; in, Indicates time The next multi-scale spatiotemporal feature vectors, Index variables representing spatial features; The multi-scale spatiotemporal feature vector Input into the adaptive spatiotemporal convolutional network, perform temporal convolution and pooling operations, and the output will construct a time series feature tensor , the expression is: ; in, Represents the convolution and pooling operations of ASTCNN, Indicates the size of the time window; Combine the temporal attention mechanism and the spatial attention mechanism to dynamically adjust the importance of each time point and its corresponding spatial features; By learning each time point The importance of time is dynamically adjusted to generate the attention weight of time ; The spatial features of each frame are weighted to capture the key spatial information of the player’s posture, the position of the ball, and the relative position of the player and the basket, generating the attention weight of the spatial dimension. ; The attention weight of time and the attention weights of the spatial dimension Combined to form a spatiotemporal hybrid attention model , the expression is: ; The spatiotemporal features weighted by the spatiotemporal hybrid attention mechanism Input to Bayesian Recurrent Neural Network In , time series analysis is performed to output the hidden state of the Bayesian RNN The expression is: ; The hidden state of the Bayesian recurrent neural network output Combining spatiotemporal hybrid attention models , calculate the probability of a successful shot The expression is: ; in, represents the Sigmoid activation function, Represents a time window.

[0010] As a preferred solution of the method for calculating the number of basketball goals based on computer vision of the present invention, the flight trajectory of the basketball is tracked in real time according to the time series analysis result, and the specific steps are as follows: From hidden state , extract each time point The corresponding spatial position characteristics of the basketball; Combine the spatial position characteristics of the basketball with the parabolic motion model to preliminarily predict the short-term flight trajectory of the basketball; Based on the preliminary prediction results, the flight trajectory of the basketball is continuously updated in combination with the new hidden states generated in real time by the recurrent neural network. Correct and iterate the short-term flight trajectory prediction and continuously updated flight trajectory.

[0011] As a preferred solution of the method for calculating the number of basketball goals based on computer vision described in the present invention, the specific steps of determining whether the basketball successfully enters the basket and recording the shooting result are as follows: Specify the three-dimensional position and radius of the basket as the criteria for determining whether the basketball enters the basket; The current position of the basketball predicted by the recurrent neural network at each time point Determine whether the basketball meets the spatial range requirements of the basket; If at the time point In the process, if the position of the basketball meets the spatial range conditions of the basket, the shot is judged to be successful. If it does not meet the spatial range conditions of the basket at all time points, the shot is judged to be unsuccessful.

[0012] As a preferred solution of the method for calculating the number of basketball goals based on computer vision described in the present invention, the specific steps of generating the shooting success rate, shooting action evaluation and technical improvement suggestions are as follows: Based on the shooting success probability and the shooting judgment results, historical shooting data is formed; Based on the spatial features extracted by the convolutional neural network and the time series information processed by the recurrent neural network, a feature vector of the shooting action is constructed; Compare the player's current action feature vector with the feature vector of historical shooting actions and calculate the action difference score; By analyzing the changes in action characteristics in historical shooting data, the action consistency score is calculated; Based on the action difference score and action consistency score, the characteristics of the player that differ most from the ideal action are identified and technical improvement suggestions are generated.

[0013] As a preferred solution of the method for calculating the number of basketball goals based on computer vision of the present invention, the step of converting the two-dimensional image data into a three-dimensional shooting action model includes: Adopt non-local mean filtering algorithm to eliminate noise in the synchronous image data stream of multiple perspectives; Introducing the attention mechanism to automatically identify and enhance key areas of the multi-view image data stream after noise processing; Use the FLANN algorithm to match key points between images from different perspectives; Based on the matched feature points, the 3D point cloud is reconstructed using the triangulation method in stereo vision; The key feature points of the shooting action are extracted from the generated point cloud, and the three-dimensional shooting action space model expression is constructed as follows: ; in, A spatial model representing the shooting action, For players The three-dimensional coordinates of the joint points, is the three-dimensional coordinate of the basketball, is the angle between the joint point and the basketball, is the number of player joint points, An index variable that is the player's joint point number, is the key point weight calculated based on the attention mechanism, Indicates the basketball at the time point speed.

[0014] In a second aspect, the present invention provides a basketball goal number calculation system based on computer vision, including: a synchronous capture module for synchronously capturing game images in a basketball court through multiple high-resolution PTZ cameras, and performing time calibration on data from different PTZ cameras to generate a multi-view synchronous image data stream; The multi-view fusion module is used to perform multi-view fusion on the synchronized image data stream, extract key feature points of the shooting action through the stereo vision algorithm, and convert the two-dimensional image data into a three-dimensional shooting action model; The spatial feature extraction module is used to input the three-dimensional shooting action model into the convolutional neural network to extract the spatial features of the player's posture, shooting angle and basketball shooting position in the shooting action; The time series analysis module is used to input spatial features into the recurrent neural network to perform time series analysis of the shooting action, capture the time dependency of the shooting action, and output the probability evaluation result of the shooting success; The trajectory tracking module is used to track the flight trajectory of the basketball in real time according to the time series analysis results, determine whether the basketball successfully enters the basket and record the shooting results; The result evaluation module is used to conduct a comprehensive analysis of the shooting results, three-dimensional motion models and time series analysis data to generate shooting success rates, shooting action evaluations and technical improvement suggestions.

[0015] In a third aspect, an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein: when the computer program is executed by a processor, it implements any step of the method for calculating the number of basketball goals based on computer vision as described in the first aspect of the present invention.

[0016] The beneficial effects of the present invention are as follows: the present invention significantly improves the accuracy and reliability of basketball goal calculation by efficiently fusing multi-view image data and accurately synchronizing it, overcoming the misjudgment problem of traditional methods under complex occlusion and perspective deviation. By introducing a multi-view collaborative control model and an adaptive frame synchronization algorithm, the image data captured by each camera is accurately aligned in space and time, effectively reducing the calculation error caused by camera position differences and time deviations. At the same time, the spatial and temporal characteristics of the shooting action are deeply analyzed by combining convolutional neural networks and recurrent neural networks, which can accurately capture the key elements in the shooting action, such as player posture, shooting angle, and basketball position, and further improve the prediction accuracy of the shooting trajectory and results. In addition, by combining the spatiotemporal hybrid attention mechanism with the Bayesian recurrent neural network, the system can dynamically adjust the weights of key features in the shooting action, thereby improving the robustness and adaptability in complex scenarios. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.

[0018] Figure 1 This is a flowchart of the method for calculating the number of basketball goals based on computer vision in Example 1.

[0019] Figure 2 This is a flow chart of determining whether the basketball successfully enters the basket and recording the shooting result in Example 1. DETAILED DESCRIPTION

[0020] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are described in detail below in conjunction with the accompanying drawings.

[0021] In the following description, many specific details are set forth to facilitate a full understanding of the present invention, but the present invention may also be implemented in other ways different from those described herein, and those skilled in the art may make similar generalizations without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.

[0022] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The term "in one embodiment" that appears in different places in this specification does not necessarily refer to the same embodiment, nor does it refer to a separate or selective embodiment that is mutually exclusive with other embodiments.

[0023] Example 1, reference Figure 1 and Figure 2 , which is the first embodiment of the present invention, provides a method for calculating the number of basketball goals based on computer vision, comprising the following steps: S1. Use multiple high-resolution PTZ cameras to synchronously capture the game scenes in the basketball court, and perform time calibration on the data of different PTZ cameras to generate a multi-view synchronous image data stream.

[0024] Going a step further, choose an intelligent industrial PTZ camera array with high frame rate and high resolution, and place it in every corner of the court, above the basket, and in the center of the court; Using a multi-view collaborative control model, the optimal capture angle and focal length of each PTZ camera are calculated in real time based on the relative positions of the PTZ cameras, the difference in viewing angles, and the depth information of objects in the scene. The expression of multi-view collaborative control model is: ; in, Indicates PTZ cameras at a certain time The optimal parameters of viewing angle, focal length and posture adjustment, is the posture angle of the PTZ camera, is the focal length, An index variable representing the number of PTZ cameras. Indicates The index variable of the number of PTZ cameras to compare. Indicates and The spatial distance between the PTZ cameras, Indicates and The viewing angle difference matrix of the PTZ cameras, Represents the spatial coverage scoring matrix of image capture, which is used to evaluate the view overlap and ensure that enough multi-view information is captured to avoid view blind spots; Each PTZ camera is equipped with a depth sensor to capture the three-dimensional spatial position of objects in the venue (such as players, basketballs, baskets, etc.) in real time; Based on the 3D spatial position, the autofocus algorithm (such as phase detection or contrast detection) is used to further dynamically adjust the rotation and tilt angles to ensure that the object is always in the best capture range; Based on the time synchronization algorithm of visual features, the common feature points in the images collected by the PTZ camera are time-calibrated to ensure that the images collected from different cameras are consistent on the time axis; Perform edge preprocessing of images in the edge processing unit of each PTZ camera, including operations such as noise filtering, feature extraction, and image compression; Connect to local nodes through a distributed edge computing architecture, and transmit key feature data to the central processing unit in real time, reducing bandwidth consumption and transmission delays; An adaptive frame synchronization algorithm is used in the central processing unit to perform frame-level alignment processing on the image data streams of all PTZ cameras to ensure that the images captured by each camera are synchronized at the same time point; The synchronized multi-view image data stream is stored in a distributed storage system, and color correction (such as white balance adjustment) and distortion correction (such as fisheye correction or perspective correction) algorithms are performed to ensure that the images from different cameras are consistent in color and geometry; The synchronization accuracy of the corrected stored data is verified to ensure the consistency of the image in time and space. After the verification is passed, a multi-view synchronized image data stream is output to provide high-quality image data for subsequent analysis, display or archiving.

[0025] S2. Perform multi-view fusion on the synchronized image data stream, extract key feature points of the shooting action through a stereo vision algorithm, and convert the two-dimensional image data into a three-dimensional shooting action model.

[0026] Furthermore, the Non-Local Means (NLM) filtering algorithm is used to eliminate noise in the multi-view synchronous image data stream and further enhance the image quality; Preferably, unlike the traditional mean filtering method, a non-local mean filtering algorithm is used to perform weighted averaging of pixel blocks with similar textures in the image, thereby better preserving edge and texture information during noise processing. This is crucial for detail preservation in multi-view synchronous image data streams, ensuring that subsequent feature extraction (such as SIFT algorithm) is performed on the basis of high-quality images, thereby improving the accuracy of overall 3D reconstruction.

[0027] Introducing the attention mechanism to automatically identify and enhance key areas of the multi-view image data stream after noise processing; Preferably, an attention mechanism is introduced to automatically identify and enhance key areas of the multi-view image data stream after noise processing, so that the SIFT algorithm can more accurately extract key points with scale and rotation invariance from the image of each view, highlight the key areas, and improve the accuracy and robustness of key point extraction.

[0028] Use the FLANN algorithm to match key points between images from different perspectives. During the matching process, the weights assigned by the attention mechanism are combined to prioritize key points that are considered more important, thereby improving the accuracy and efficiency of matching. Furthermore, based on the matched feature points, the three-dimensional point cloud is reconstructed using the triangulation method in stereo vision. The specific steps are as follows: Through Zhang Zhengyou calibration method, the internal and external parameters of each PTZ camera are obtained, where the internal parameters include focal length , and the optical center point , the external parameters include the rotation matrix and displacement vector, used to transform the PTZ camera coordinates to the world coordinate system; For each pair of matched feature points, calculate their disparity in different PTZ camera images; Among them, disparity is the difference in horizontal coordinates of corresponding points in the left and right images, and the formula is: ; in, and are the horizontal coordinates of the matched feature points in the left and right PTZ camera images, respectively; According to parallax , the baseline distance of the PTZ camera (physical distance between two PTZ cameras) and focal length , calculate the depth value of the matching feature point The expression is: ; in, is the depth value, which indicates the distance from the PTZ camera to the object point. is the focal length of the PTZ camera, in pixels. is the baseline distance of the PTZ camera, in millimeters. is the disparity, in pixels; Based on depth value The two-dimensional coordinates of the image points are converted into coordinates in three-dimensional space by the back-projection formula; Let the pixel coordinates of the image point be , then the corresponding three-dimensional coordinates The calculation expression is:

[0029] in, is a point in three-dimensional space, Represents the inverse matrix of the PTZ camera's intrinsic parameter matrix, which is used to convert pixel coordinates into standardized device coordinates. represents the homogeneous coordinates of the image points, and They are the optical centers of the PTZ cameras. Represents the vertical pixel coordinate of the image point; By calculating each matching feature point, the coordinates of the point in three-dimensional space are obtained. This process is repeated to perform triangulation on all matching feature points in turn, and finally the corresponding three-dimensional point cloud is generated.

[0030] It should be noted that a 3D point cloud is a collection of a large number of 3D coordinate points, representing the 3D structure of objects in the scene. These point cloud data can be used for subsequent action recognition and modeling.

[0031] The key feature points of the shooting action are extracted from the generated point cloud, and a three-dimensional shooting action spatial model is constructed to quantify the position of the player's joint points, the position of the basketball, the angle between the joint points and the basketball, and the speed of the basketball, which fully describes the dynamic characteristics of the shooting action. The expression of the three-dimensional shooting action space model is: ; in, For players The three-dimensional coordinates of the joint points, is the three-dimensional coordinate of the basketball, is the angle between the joint point and the basketball, is the number of player joint points, The index variable for the player's joint point number is used to traverse the joint points of the player's body. The key point weights calculated based on the attention mechanism can be adjusted according to actual conditions, making the model more flexible and adaptable. Indicates the basketball at the time point speed.

[0032] It should be noted that by introducing the attention mechanism, the key areas of the multi-view image data stream after noise processing are automatically identified and enhanced, so that the SIFT algorithm can more accurately extract key points with scale and rotation invariance from the image of each view, highlight the key areas, and improve the accuracy and robustness of key point extraction. Therefore, in the subsequent processing, when the FLANN algorithm is used to match key points between images of different viewpoints, the weights assigned by the attention mechanism are combined to give priority to matching those key points that are considered more important, thereby improving the accuracy and efficiency of matching and ensuring that the final generated three-dimensional shooting action model is more accurate and reliable.

[0033] S3. Input the three-dimensional shooting action model into the convolutional neural network to extract the spatial features of the player's posture, shooting angle and basketball shooting position in the shooting action.

[0034] Furthermore, the Min-Max normalization method is used to scale the coordinates of the three-dimensional joint points within a uniform range (e.g., 0 to 1) to eliminate the impact of player size differences on the model and ensure that the relative positions between the joint points can accurately reflect the spatial structure of the shooting action during feature extraction. Using tensor quantization, the standardized three-dimensional coordinate data is converted into a three-dimensional tensor format for convolutional neural network (CNN) processing; It should be noted that for each frame of image data, the dimension of the tensor is n×3×T, where n is the number of joint points, 3 is the three-dimensional space coordinate, and T is the length of the entire time series. Specifically, frameworks such as NumPy or PyTorch can be used for data preprocessing.

[0035] In the first convolutional layer, a 3D convolution kernel (such as The convolution kernel of ( ) performs convolution operations along the joint points, three-dimensional space, and time dimensions; It should be noted that the convolution kernel helps to extract spatial features between local joint points, such as the relative position changes between the shoulder, elbow, and wrist. The convolution operation can be implemented using PyTorch or TensorFlow.

[0036] After the first convolutional layer, a MaxPooling3D pooling layer is added after each convolutional layer to select the maximum value in each local area, thereby retaining the most significant spatial features. At the same time, the number of convolution kernels is increased (for example, the number of convolution kernels is increased to 128) to extract more complex spatial relationships between joint points. For example, continuous motion from the arm to the shoulder, or coordinated motion from the legs to the upper body. Through multiple layers of convolution, the network is able to gradually capture the high-level features of the action.

[0037] After convolution and pooling operations, a fully connected layer is used to perform global feature integration. It should be noted that this layer integrates the local spatial features extracted by the convolutional layer into a high-dimensional feature vector, which represents the spatial features of the entire shooting action. The output dimension of the fully connected layer is 512, which is processed by the ReLU activation function to generate features for the final output layer.

[0038] After the global features are integrated, the output layer is responsible for generating three important shooting space features: player posture, shooting angle, and basketball shooting position; It should be noted that for the three important shooting space features, when implemented specifically, they can be designed to have three output nodes, each node representing a feature. At the same time, since these features are continuous numerical data, the activation function of the output layer should use a linear function to accurately reflect these continuous features.

[0039] It should also be noted that in the convolutional neural network, the player posture extraction, shooting angle extraction and shooting position extraction are more specific as follows: for player posture extraction, the local spatial features extracted by the convolutional network can be used to infer the position change of each joint point, and thus the overall posture change of the player can be inferred. The core of this step is to analyze the relative position and angle changes between the joint points. The specific method is to automatically capture the key posture changes in the shooting action through the features learned by the network, such as the changes in the player's body posture from preparing to shoot to shooting; for shooting angle extraction, the network analyzes the relative angle changes between the arm, shoulder and basketball to extract. Through the first few layers of convolution operations, the network has been able to identify the movement trajectory between these key parts. The final output layer converts these spatial relationships into shooting angle values, reflecting the arm angle of the player when shooting, which is crucial to the accuracy of the shot; for shooting position extraction, the convolutional network can track the relative position changes between the basketball and the wrist to ensure that the shooting position of the basketball can be accurately judged at the moment of shooting. By learning the relative distance between the wrist joint and the basketball during shooting, the network can identify the timing of the shot and give the exact shooting position of the basketball through the output layer. This information is crucial for analyzing the player's shooting timing and technical movements.

[0040] S4. Input the spatial features into the recursive neural network to perform time series analysis of the shooting action, capture the time dependency of the shooting action, and output the probability evaluation result of the shooting success.

[0041] Furthermore, based on the spatial features output by the output layer of the convolutional neural network, the multi-scale spatiotemporal feature vector expression is constructed as follows: ; in, Indicates time The next multi-scale spatiotemporal feature vectors, Index variables representing spatial features; The multi-scale spatiotemporal feature vector Input into the adaptive spatiotemporal convolutional network, perform temporal convolution and pooling operations, and the output will construct a time series feature tensor , the expression is: ; in, Represents the convolution and pooling operations of ASTCNN, Indicates the size of the time window, ensuring that not only the information at the current time point is considered, but also the features of several frames before and after; It should be noted that by constructing multi-scale spatiotemporal feature vectors, we can fully capture spatial features at different scales, provide richer feature representations, and improve the robustness and generalization of the model. Next, the adaptive spatiotemporal convolutional network (ASTCNN) efficiently extracts time series features by performing temporal convolution and pooling operations on multi-scale spatiotemporal features, thereby enhancing the ability to understand the dynamic changes of actions.

[0042] Combining the temporal attention mechanism and the spatial attention mechanism, the importance of each time point and its corresponding spatial features is dynamically adjusted to ensure that key moments and spatial locations are given priority attention. By learning each time point The importance of time is dynamically adjusted to generate the attention weight of time , the expression is: ; in, Indicates time Key moments with shooting The correlation degree, Represents any time point within the time window, used to traverse the time window All time points, Indicates that in the time window Any time point within ; The spatial features of each frame are weighted to capture the key spatial information of the player’s posture, the position of the ball, and the relative position of the player and the basket, generating the attention weight of the spatial dimension. The expression is: ; in, Indicates time The attention scores of different spatial features are as follows: Represents the number of spatial features; Preferably, the introduction of temporal attention mechanism and spatial attention mechanism enables the model to automatically identify and strengthen key moments and key areas, reduce the interference of irrelevant information, and improve the detection accuracy of important features. The spatiotemporal hybrid attention model further comprehensively considers the information of the two dimensions of time and space, provides a more comprehensive feature representation, and significantly improves the recognition accuracy of the model for complex action sequences.

[0043] The attention weight of time and the attention weights of the spatial dimension Combined to form a spatiotemporal hybrid attention model , dynamically adjust the weight of each time point and its corresponding spatial features; Spatiotemporal Hybrid Attention Model , the expression is: ; The spatiotemporal features weighted by the spatiotemporal hybrid attention mechanism Input to Bayesian Recurrent Neural Network In , time series analysis is performed to output the hidden state of the Bayesian RNN The expression is: ; It should be noted that Bayesian RNN can be used for each time point Generate a hidden state These hidden states capture the temporal dependencies of the shooting action and provide input for the subsequent calculation of the probability of successful shooting.

[0044] It should also be noted that by inputting the weighted features of the spatiotemporal hybrid attention mechanism into the Bayesian recurrent neural network (Bayesin RNN), the model can capture long-term dependencies and model the uncertainty of the output, providing more reliable prediction results. Finally, the probability of a successful shot is calculated by combining the spatiotemporal hybrid attention model and the output of the Bayesian recurrent neural network, providing a scientific basis and real-time feedback for athletes' training and coaches' guidance, significantly improving training results and game performance.

[0045] The hidden state of the Bayesian recurrent neural network output Combining spatiotemporal hybrid attention models , calculate the probability of a successful shot The expression is: ; in, represents the Sigmoid activation function, Represents a time window.

[0046] S5. Track the flight trajectory of the basketball in real time according to the time series analysis results, determine whether the basketball successfully enters the basket and record the shooting result.

[0047] Furthermore, from the hidden state , extract each time point The corresponding spatial position characteristics of the basketball; It should be noted that the spatial position features of the basketball are obtained by adding a fully connected layer to the hidden state of the recurrent neural network to extract the physical motion features (position, speed, acceleration) of the basketball. These extracted features constitute the spatial position features of the basketball.

[0048] Combine the spatial position characteristics of the basketball with the parabolic motion model to preliminarily predict the short-term flight trajectory of the basketball; Preferably, the parabolic motion model is based on the classical kinematic formula in physics, describing the trajectory of an object under the action of gravity. For the flight of a basketball in a shooting scenario, the parabolic motion model can provide a preliminary estimate of the short-term trajectory.

[0049] Based on the preliminary prediction results, the flight trajectory of the basketball is continuously updated in combination with the new hidden states generated in real time by the recurrent neural network. It should be noted that the short-term prediction based on the parabolic model is based on the current hidden state The extracted physical quantities provide a more reliable trajectory prediction in the short term; at the same time, As time goes by, the recurrent neural network generates new hidden states These hidden states can reflect the movement changes of the basketball in subsequent time steps. By combining new hidden states with new physical motion features, the flight trajectory of the basketball can be continuously corrected to form a more accurate trajectory prediction. Each time the recursive neural network generates a new hidden state, it will update the trajectory based on the new physical quantity and parabola model. By comparing the short-term predicted trajectory with the updated trajectory, the recursive neural network can make corrections when the trajectory deviates to ensure a more accurate prediction.

[0050] Correct and iterate the short-term flight trajectory prediction and continuously updated flight trajectory.

[0051] Going a step further, clarify the three-dimensional position of the basket and its radius , as the criterion for judging whether the basketball enters the basket, Indicates the height of the corresponding basket, Indicates the center position of the basket on the corresponding horizontal plane; It should be noted that during the entire shooting process, the position of the basket is known and relatively fixed, and the height of the basket is usually fixed (for example, in NBA games, the height of the basket is 3.05 meters).

[0052] Prediction of the current position of a basketball based on a recurrent neural network , at each time point Determine whether the basketball meets the spatial range requirements of the basket; Among them, the key to judging whether the basketball enters the basket is when the basketball meets the height of the basket's spatial range condition (i.e. ), while comparing the horizontal position of the basketball Is it within the horizontal range of the basket? If at the time point In the example, if the position of the basketball meets the spatial range conditions of the basket, the shot is considered successful, otherwise it is considered a failure. If the basket's spatial range conditions are not met at all time points, the shot is deemed a failure.

[0053] It should be noted that the space range conditions of the basket specifically refer to the situation when the basketball Coordinates close to the height of the basket When , check whether its horizontal distance is within the range of the basket. The expression is: ; If the horizontal distance of the basketball meets this condition and its height Height close to the basket , it can be considered that the basketball is within the range of the basket and meets the spatial range conditions of the basket; It should be noted that when the basketball is within the basket, different situations need to be considered. For movement within the basket, if the basketball has passed the vertical detection and entered the basket height range, its movement inside the basket can be further detected, such as determining whether it passes under the basket and confirming whether it has completely entered the basket. For basket collision and rolling, in some cases, the basketball may hit the edge of the basket or roll inside the basket. Further basketball trajectory tracking can be used to determine whether it finally enters the basket.

[0054] It should also be noted that if the shot is judged to be successful, the result of the shot should be recorded and marked as "successful", and the time of successful shot should also be recorded. , the player's shooting position , the three-dimensional coordinates when the shot is successful , shooting speed, shooting angle and other information; if in all time steps If the conditions for the basketball to enter the basket are not detected, or the basketball deviates from the basket, the shooting result is recorded as "failure".

[0055] S6. Comprehensively analyze the shooting results, three-dimensional motion model and time series analysis data to generate shooting success rate, shooting action evaluation and technical improvement suggestions.

[0056] Furthermore, based on the probability of successful shooting and the result of shooting determination, historical shooting data is formed; Based on the spatial features extracted by the convolutional neural network and the time series information processed by the recurrent neural network, a feature vector of the shooting action is constructed; Preferably, using multi-scale convolution kernels in convolutional neural networks can capture spatial features at different scales, which is particularly important for processing complex posture changes; introducing an attention mechanism in recurrent neural networks allows the model to dynamically focus on changes in joints at specific time points based on the importance of actions at different time points in the time series, which helps to enhance feature extraction at key moments (such as action features at the moment of shooting).

[0057] Compare the player's current action feature vector with the feature vector of historical shooting actions and calculate the action difference score; First, extract the feature vector of the current shooting action , and the corresponding feature vector of the historical standard shooting action ; Among them, these feature vectors are extracted after processing the three-dimensional shooting action model through convolutional neural network (CNN) and recurrent neural network (RNN), which include multi-dimensional features such as player posture, shooting angle, and basketball shooting position.

[0058] Min-Max normalization is used to scale the eigenvalues ​​to The range of the standardized expression is: ; in, Represents the standardized eigenvalues, represents the original eigenvalue, and They are The minimum and maximum values ​​of the features; calculate the Euclidean distance between the normalized current feature vector and the historical feature vector , the expression is: ; in, is the dimension of the feature vector, and Respectively represent the standardized eigenvalues; based on Euclidean distance Defining the Action Difference Score The expression is: ; It should be noted that this formula ensures that when the Euclidean distance is close to 0, the difference score is close to 1 (indicating that the current action is very close to the historical action); and when the Euclidean distance increases, the difference score is close to 0 (indicating a large difference).

[0059] Action Difference Score Between 0 and 1, the closer the value is to 1, the closer the current shooting action is to the historical standard shooting action, and the closer the value is to 0, the greater the difference; A specific example of calculating the Euclidean distance and action difference score is as follows: Assuming there are three action features (e.g., player posture, shooting angle, basketball release position), the normalized current action feature vector is , the historical action feature vector is ; The expression for calculating Euclidean distance is: ; The expression for calculating the action difference score is: ; Among them, the difference score indicates that the current shooting action is relatively close to the historical standard action; through the Euclidean distance and standardization processing, the action difference score is calculated, which can be used to evaluate the similarity between the current shooting action and the historical standard action. The higher the difference score, the closer the action is to the standard, and the lower the difference score, the more the action deviates from the standard.

[0060] It should be noted that different weights can be assigned to different dimensions in the feature vector, considering the different contributions of different features to the success of a shot. For example, the arm angle when shooting may be more important than the foot position. By combining the weights learned by expert experience or the model, a weighted difference score is constructed.

[0061] It should also be noted that in the process of calculating the action difference score, the scoring threshold needs to be dynamically adjusted according to the success rate in historical data. For example, the range of successful action features of some players may fluctuate to a certain extent (action personalization), so the standard threshold of the action difference score can be adjusted according to the player's historical performance to avoid overly strict scoring.

[0062] By analyzing the changes in action characteristics in historical shooting data, the action consistency score is calculated; First, we extract the feature vectors of multiple shooting actions from the historical shooting data, and set The feature vector of the shooting action is recorded as , each feature vector contains feature dimensions (e.g., player posture, shooting angle, basketball release position, etc.); Calculate the average of all historical action feature vectors , that is, the mean of the action features in each dimension, the mean vector The calculation expression is: ; in, Indicates a dimensional vector, each element Indicates The historical average of the characteristics; For each shooting action feature vector , calculate its difference with the mean vector The difference (residual) vector expression is: ; in, It's a shooting motion The residual vector represents the deviation between the action feature and the average action feature; Calculate the mean square error (MSE) of all shooting action residuals. The mean square error is a common method to measure the volatility of action features. The calculation expression of MSE is: ; in, Indicates The mean of the features; The action consistency score should be inversely proportional to the volatility of the action feature. The smaller the volatility, the higher the consistency and the higher the score should be. Therefore, the consistency score can be defined using the following expression: The expression is: ; It should be noted that the consistency score The expression should ensure that when the mean square error MSE approaches 0, the action consistency score is close to 1 (indicating very consistent actions); and when the MSE is large, the action consistency score is close to 0 (indicating unstable actions).

[0063] The consistency score is used to measure the stability of a player's movements over multiple shots. A higher score means a more stable movement with less fluctuation, while a lower score means an unstable movement.

[0064] For example, introducing a time window (such as the last 10 shots) for consistency analysis instead of evaluating based on all historical shooting data can capture the player's recent state changes and help coaches and players identify short-term instability.

[0065] When the difference is high and the consistency is low, it means that the player's movements are not only far from the ideal movements, but also unstable, and need to be improved; when the difference is high but the consistency is high, it means that the player's movements are far from the ideal movements, but stable. At this time, it is recommended to retain stability and fine-tune specific movement details; when the difference is low but the consistency is low, it means that the player's movements are close to the ideal movements, but the stability is poor, and it is recommended to strengthen the training of movement stability; when the difference is low and the consistency is high, it means that the player's movements are close to the ideal and stable, and it is recommended to maintain the existing training method.

[0066] It should also be noted that when performing consistency analysis, not only global consistency but also local consistency of shooting movements can be analyzed, such as consistency evaluation of hand movements and shoulder movements only. This can help identify unstable movement problems in specific parts.

[0067] Based on the action difference score and action consistency score, identify the characteristics of the player that are most different from the ideal action and generate technical improvement suggestions; when When the difference is small, the overall action is very close to the ideal standard and no major adjustments are needed. You can optimize the details, such as paying attention to the hands, shooting angles, and other minor adjustments; Technical improvement suggestions: The consistency of the movements is very good, maintain the current training rhythm, and continue to maintain the stability of the movements; Training plan: Conduct high-intensity training, maintain stability, and at the same time further increase the difficulty to enhance performance under pressure.

[0068] when When , it means the difference is moderate, and the action is significantly different from the ideal action, especially in specific features (such as shooting angle or shooting position). It is recommended to focus on adjusting the features with the largest difference; Technical improvement suggestions: The movements have some fluctuations and need to be more consistent. Focus on the ability to maintain consistent movements in different situations; Training plan: Conduct repetitive training and simulated competition scene training to improve the consistency of movements under different stress and fatigue conditions.

[0069] when When , it indicates that the difference is large, the action is very different from the ideal action, and there may be multiple features that need to be adjusted. It is recommended to conduct a comprehensive action analysis and reconstruction; Technical improvement suggestions: The consistency of the action is poor, and the focus should be on the stability of the action to avoid too much difference in each shooting action; Training plan: Conduct low-intensity, repetitive basic training, reduce external interference factors, ensure the consistency of each shooting action, and gradually improve the stability of the action. and When the player's movements are different from the ideal movements, and the movements are unstable. Basic training and movement reconstruction are needed; Technical improvement suggestions: Start with basic movement training, such as posture correction and shooting jump training, to improve the consistency and accuracy of movements.

[0070] when When the player's movements are very close to the ideal movement and stable, it is recommended to conduct high-intensity training to maintain the existing movement pattern.

[0071] Technical improvement suggestions: Increase the difficulty of training, for example, increase physical confrontation or training under stressful situations to further enhance the expressiveness of the movements.

[0072] Going further, for example, suggestions for improvements based on wrist angles: such as strengthening wrist flexibility and control, through repeated practice of wrist bending and extension, to ensure that the wrist has sufficient strength and stability when shooting; through shooting arc training, focus on wrist force to ensure that the wrist produces appropriate topspin and height when shooting; combined with real-time video feedback, observe the wrist angle at the moment of shooting, and compare it with the ideal angle, and gradually adjust it.

[0073] Suggestions for improvement based on elbow position: Use a fixed device (such as a wall or cushion) to force the elbow to maintain vertical alignment, and practice shooting to ensure that the elbow remains in the shooting line; use dumbbells, elastic bands, etc. to strengthen the strength and control of the upper arm muscles to ensure that the elbow does not deviate when shooting; break down the elbow movement and practice empty-handed shooting without a basketball first, focus on the alignment of the elbow position, and gradually add a basketball.

[0074] Suggestions for improvements based on shoulder posture: For example, use a balance ball, yoga ball, etc. to perform shoulder stability training to enhance shoulder control; perform rotational flexibility training on the shoulder joint to ensure that the shoulder can exert force flexibly and stably when shooting; continuously perform shooting training in simulated game scenarios, and enhance shoulder stability through high-frequency actual combat training.

[0075] Suggestions for improvements based on lower limb movements: For example, by marking the ground position or using footwork training equipment, ensure that players maintain the correct footstep position when shooting; through exercises such as standing on one leg and using a balance board, enhance the player's balance ability and ensure that the body's center of gravity is stable when shooting; through squats, jump training, etc., improve the explosiveness and stability of the jump, and ensure that the body can maintain verticality when jumping.

[0076] Suggestions for improvements based on shooting speed: For example, using a timer or timing device to train players to complete the shooting action within a fixed time to ensure the control of shooting speed; through rhythm training (such as using a metronome), help players find the appropriate shooting rhythm to avoid shooting too slowly or too quickly; through defensive simulation, train players to maintain appropriate shooting speed and rhythm under pressure.

[0077] This embodiment also provides a computer device, which is suitable for the case of a basketball goal number calculation method based on computer vision, including: a memory and a processor; the memory is used to store computer executable instructions, and the processor is used to execute computer executable instructions to implement the basketball goal number calculation method based on computer vision as proposed in the above embodiment.

[0078] The computer device may be a terminal, and the computer device includes a processor, a memory, a communication interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, an operator network, NFC (near field communication) or other technologies. The display screen of the computer device may be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device may be a touch layer covered on the display screen, or a key, trackball or touchpad provided on the housing of the computer device, or an external keyboard, touchpad or mouse, etc.

[0079] This embodiment also provides a storage medium on which a computer program is stored. When the program is executed by a processor, the method for calculating the number of basketball goals based on computer vision as proposed in the above embodiment is implemented; the storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, disk or optical disk.

[0080] In summary, the present invention significantly improves the accuracy and reliability of basketball goal calculation by efficiently fusing multi-view image data and accurately synchronizing them, overcoming the misjudgment problem of traditional methods under complex occlusion and perspective deviation. By introducing a multi-view collaborative control model and an adaptive frame synchronization algorithm, the image data captured by each camera is accurately aligned in space and time, effectively reducing the calculation error caused by camera position differences and time deviations. At the same time, the spatial and temporal characteristics of the shooting action are deeply analyzed by combining convolutional neural networks and recurrent neural networks, which can accurately capture the key elements in the shooting action, such as player posture, shooting angle, and basketball position, and further improve the prediction accuracy of the shooting trajectory and results. In addition, by combining the spatiotemporal hybrid attention mechanism with the Bayesian recurrent neural network, the system can dynamically adjust the weights of key features in the shooting action, thereby improving the robustness and adaptability in complex scenarios.

[0081] Example 2, referring to Table 1, is the second example of the present invention. To further verify the technical solution of the present invention, experimental simulation data of a basketball goal number calculation method based on computer vision is provided.

[0082] The experimental site is a standard basketball court, where five high-resolution PTZ (Pan-Tilt-Zoom) cameras are arranged, located above the basket, in the center of the court and in the four corners. Each camera is equipped with a depth sensor to capture three-dimensional spatial information. The experimental subjects are 10 basketball players, and their shooting actions include jump shots, hook shots and other common shooting forms.

[0083] First, the experiment optimized the multi-view collaborative control model of the camera to ensure that the viewing angle, focal length and posture angle of each camera can be adjusted in real time to capture clear shooting movements. The key points of the multi-view images were matched using the FLANN algorithm, and the three-dimensional point cloud model was reconstructed using the triangulation method in stereo vision to obtain key spatial features such as player posture, shooting angle and basketball release position.

[0084] During the image acquisition process, the time synchronization algorithm of visual features is used to calibrate the frame data of each PTZ camera to ensure the time accuracy of multi-view data fusion. After color and distortion correction, the multi-view image data is stored in a distributed storage system for subsequent convolutional neural network (CNN) to extract spatial features.

[0085] For the spatial feature extraction of shooting actions, all 3D point cloud data were standardized and converted into 3D tensors, which were then input into CNN for convolution and pooling operations. A 3D MaxPooling pooling layer was used after each convolution layer to reduce the amount of calculation, and the player's posture, shooting angle, and basketball release position in the shooting action were integrated through the fully connected layer. Then, these spatial features were input into the recurrent neural network (RNN) for time series analysis to capture the temporal dependency of the shooting action.

[0086] During the experiment, the Bayesian recurrent neural network (BRNN) was used to predict the probability of a successful shot in real time, and the spatial features of each time point were weighted in combination with the spatiotemporal hybrid attention mechanism. At the same time, the system tracked the flight trajectory of the basketball in real time and predicted and corrected the flight trajectory of the basketball through a parabolic motion model. Finally, the experiment recorded the shooting success rate, shooting action evaluation results and corresponding technical improvement suggestions.

[0087] The details are shown in Table 1 below: Table 1 Basketball goal calculation method experimental comparison data table Shooting method Spatial feature extraction accuracy (percentage) Time sync delay (ms) Shooting success rate (percentage) Flight trajectory prediction error (cm) Traditional Technique Jump Shot 85 120 65 15 Traditional technique hook shot 80 110 60 20 The present invention jump shot 95 30 88 5 Hook shot of the present invention 93 25 85 7 It can be clearly seen from the experimental data that the present invention has shown significant advantages over traditional technologies in multiple key performance indicators. First, in terms of spatial feature extraction accuracy, the present invention achieves higher accuracy through multi-perspective collaborative control and FLANN algorithm optimization. For jump shots, the spatial feature extraction accuracy of the present invention reaches 95%, which is 10 percentage points higher than the 85% of traditional technology; for hook shots, the accuracy is improved by 13 percentage points to 93%. This is because the present invention uses stereo vision and three-dimensional point cloud reconstruction technology, which can accurately capture the key feature points of shooting actions, especially in complex multi-perspective situations, effectively reducing feature point matching errors.

[0088] Secondly, in terms of time synchronization delay, the present invention introduces a time synchronization algorithm of visual features, which significantly reduces the time error between multi-view image data. Experimental results show that the time synchronization delay of traditional technology is between 110-120ms, while the time synchronization delay of the present invention is greatly reduced to only 25-30ms. This improvement ensures the accurate synchronization of multi-view data, which is conducive to improving the system's ability to understand the timing of shooting actions and avoiding misjudgment of shooting actions due to time errors.

[0089] Furthermore, in terms of shooting success rate, the shooting success rate of the present invention is greatly improved. For jump shots, the success rate of the present invention is 88%, which is 23 percentage points higher than the 65% of the traditional technology; for hook shots, the success rate of the present invention is 85%, which is also significantly higher than the 60% of the traditional technology. This improvement is attributed to the introduction of the spatiotemporal hybrid attention mechanism in the present invention, which effectively captures the key moments in the shooting process by dynamically adjusting the spatial feature weights of each time point, thereby improving the evaluation accuracy of the shooting success rate.

[0090] Finally, the present invention also shows significant advantages in terms of flight trajectory prediction error. The flight trajectory prediction error of the traditional technology is 15-20cm, while the error of the present invention is only 5-7cm. This is due to the combination of the Bayesian recursive neural network and the parabolic motion model, which ensures the accurate prediction of the flight trajectory of the basketball and improves the trajectory correction capability through recursive updating.

[0091] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention, which should all be included in the scope of the claims of the present invention.

Claims

1. A method for calculating the number of basketball goals based on computer vision, characterized in that: include, Use multiple high-resolution PTZ cameras to synchronously capture the game scenes in the basketball court, and perform time calibration on the data of different PTZ cameras to generate a multi-view synchronous image data stream; Perform multi-view fusion on the synchronized image data stream, extract key feature points of the shooting action through stereo vision algorithm, and convert the two-dimensional image data into a three-dimensional shooting action model; The 3D shooting action model is input into the convolutional neural network to extract the spatial features of the player's posture, shooting angle and basketball shooting position in the shooting action; Input the spatial features into the recurrent neural network to perform time series analysis of the shooting action, capture the time dependency of the shooting action, and output the probability evaluation result of the shooting success; According to the time series analysis results, the flight trajectory of the basketball is tracked in real time to determine whether the basketball successfully enters the basket and record the shooting results; Comprehensive analysis is performed on shooting results, three-dimensional motion models, and time series analysis data to generate shooting success rates, shooting motion evaluations, and technical improvement suggestions.

2. The method for calculating the number of basketball goals based on computer vision as claimed in claim 1, characterized in that: The generating of a multi-view synchronous image data stream comprises: Choose an intelligent industrial PTZ camera array with high frame rate and high resolution, and place it in every corner of the court, above the basket, and in the center of the court; Using a multi-view collaborative control model, the optimal capture angle and focal length of each PTZ camera are calculated in real time based on the relative positions of the PTZ cameras, the difference in viewing angles, and the depth information of objects in the scene. The expression of multi-view collaborative control model is: ; in, Indicates PTZ cameras at a certain time The optimal parameters of viewing angle, focal length and posture adjustment, is the posture angle of the PTZ camera, is the focal length, An index variable representing the number of PTZ cameras. Indicates The index variable of the number of PTZ cameras to compare. Indicates and The spatial distance between the PTZ cameras, Indicates and The viewing angle difference matrix of the PTZ cameras, a scoring matrix representing the spatial coverage captured by the image; Each PTZ camera is equipped with a depth sensor to capture the three-dimensional spatial position of objects in the venue in real time; Based on the three-dimensional spatial position, the auto-focus algorithm is used to further dynamically adjust the rotation and tilt angles; Based on the time synchronization algorithm of visual features, the common feature points in the images collected by the PTZ camera are time-calibrated; Perform edge pre-processing of images in the edge processing unit of each PTZ camera, connect to local nodes through a distributed edge computing architecture, and transmit key feature data to the central processing unit in real time; An adaptive frame synchronization algorithm is used in the central processing unit to perform frame-level alignment processing on the image data streams of all PTZ cameras; The synchronized multi-view image data stream is stored in a distributed storage system, and color correction and distortion correction are performed; The synchronization accuracy of the corrected stored data is verified, and a multi-view synchronized image data stream is output.

3. The method for calculating the number of basketball goals based on computer vision as claimed in claim 1, characterized in that: The extraction of spatial features of the player's posture, shooting angle and basketball shooting position in the shooting action includes: Use the Min-Max normalization method to scale the three-dimensional joint point coordinates to a uniform range; Using tensor quantization processing, the standardized three-dimensional coordinate data is converted into a three-dimensional tensor format for convolutional neural network processing; In the first convolutional layer, a 3D convolution kernel is used to perform convolution operations along the joint points, 3D space, and time dimensions; After the first convolutional layer, a MaxPooling3D pooling layer is added to each convolutional layer, and the number of convolution kernels is increased; After the convolution and pooling operations, a fully connected layer is used for global feature integration; After the global features are integrated, the output layer is responsible for generating three important shooting space features: player posture, shooting angle and basketball shooting position.

4. The method for calculating the number of basketball goals based on computer vision as claimed in claim 1, characterized in that: The outputting of the evaluation result of the probability of successful shooting includes: Based on the spatial features output by the output layer of the convolutional neural network, the expression of the multi-scale spatiotemporal feature vector is constructed as follows: ; in, Indicates time The next multi-scale spatiotemporal feature vectors, Index variables representing spatial features; The multi-scale spatiotemporal feature vector Input into the adaptive spatiotemporal convolutional network, perform temporal convolution and pooling operations, and the output will construct a time series feature tensor , the expression is: ; in, Represents the convolution and pooling operations of ASTCNN, Indicates the size of the time window; Combine the temporal attention mechanism and the spatial attention mechanism to dynamically adjust the importance of each time point and its corresponding spatial features; By learning every time point The importance of time is dynamically adjusted to generate the attention weight of time ; The spatial features of each frame are weighted to capture the key spatial information of the player’s posture, the position of the ball, and the relative position of the player and the basket, generating the attention weight of the spatial dimension. ; The attention weight of time and the attention weights of the spatial dimension Combined to form a spatiotemporal hybrid attention model , the expression is: ; The spatiotemporal features weighted by the spatiotemporal hybrid attention mechanism Input to Bayesian Recurrent Neural Network In , time series analysis is performed to output the hidden state of the Bayesian RNN The expression is: ; The hidden state of the Bayesian recurrent neural network output Combining spatiotemporal hybrid attention models , calculate the probability of a successful shot The expression is: ; in, represents the Sigmoid activation function, Represents a time window.

5. The method for calculating the number of basketball goals based on computer vision as claimed in claim 4, characterized in that: The real-time tracking of the flight trajectory of the basketball according to the time series analysis result includes: From hidden state , extract each time point The corresponding spatial position characteristics of the basketball; Combine the spatial position characteristics of the basketball with the parabolic motion model to preliminarily predict the short-term flight trajectory of the basketball; Based on the preliminary prediction results, the flight trajectory of the basketball is continuously updated in combination with the new hidden states generated in real time by the recurrent neural network. Correct and iterate the short-term flight trajectory prediction and continuously updated flight trajectory.

6. The method for calculating the number of basketball goals based on computer vision as claimed in claim 1, characterized in that: The step of judging whether the basketball successfully enters the basket and recording the shooting result includes: Specify the three-dimensional position and radius of the basket as the criteria for determining whether the basketball enters the basket; The current position of the basketball predicted by the recurrent neural network at each time point Determine whether the basketball meets the spatial range requirements of the basket; If at the time point In the process, if the position of the basketball meets the spatial range conditions of the basket, the shot is judged to be successful. If it does not meet the spatial range conditions of the basket at all time points, the shot is judged to be unsuccessful.

7. The method for calculating the number of basketball goals based on computer vision as claimed in claim 1, characterized in that: The generation of shooting success rate, shooting action evaluation and technical improvement suggestions includes: Based on the shooting success probability and the shooting judgment results, historical shooting data is formed; Based on the spatial features extracted by the convolutional neural network and the time series information processed by the recurrent neural network, a feature vector of the shooting action is constructed; Compare the player's current action feature vector with the feature vector of historical shooting actions and calculate the action difference score; By analyzing the changes in action characteristics in historical shooting data, the action consistency score is calculated; Based on the action difference score and action consistency score, the characteristics of the player that differ most from the ideal action are identified and technical improvement suggestions are generated.

8. The method for calculating the number of basketball goals based on computer vision as claimed in claim 1, characterized in that: The step of converting the two-dimensional image data into a three-dimensional shooting action model comprises: Adopt non-local mean filtering algorithm to eliminate noise in the synchronous image data stream of multiple perspectives; Introducing the attention mechanism to automatically identify and enhance key areas of the multi-view image data stream after noise processing; Use the FLANN algorithm to match key points between images from different perspectives; Based on the matched feature points, the 3D point cloud is reconstructed using the triangulation method in stereo vision; The key feature points of the shooting action are extracted from the generated point cloud, and the three-dimensional shooting action space model expression is constructed as follows: ; in, A spatial model representing the shooting action, For players The three-dimensional coordinates of the joint points, is the three-dimensional coordinate of the basketball, is the angle between the joint point and the basketball, is the number of player joint points, An index variable that is the player's joint point number, is the key point weight calculated based on the attention mechanism, Indicates the time point of the basketball speed.

9. A basketball goal number calculation system based on computer vision, comprising: Synchronous capture module, used to synchronously capture the game screen in the basketball court through multiple high-resolution PTZ cameras, and time-calibrate the data of different PTZ cameras to generate multi-view synchronous image data streams; The multi-view fusion module is used to perform multi-view fusion on the synchronized image data stream, extract key feature points of the shooting action through the stereo vision algorithm, and convert the two-dimensional image data into a three-dimensional shooting action model; The spatial feature extraction module is used to input the three-dimensional shooting action model into the convolutional neural network to extract the spatial features of the player's posture, shooting angle and basketball shooting position in the shooting action; The time series analysis module is used to input spatial features into the recurrent neural network to perform time series analysis of the shooting action, capture the time dependency of the shooting action, and output the probability evaluation result of the shooting success; The trajectory tracking module is used to track the flight trajectory of the basketball in real time according to the time series analysis results, determine whether the basketball successfully enters the basket and record the shooting results; The result evaluation module is used to conduct a comprehensive analysis of the shooting results, three-dimensional motion models and time series analysis data to generate shooting success rates, shooting action evaluations and technical improvement suggestions.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method for calculating the number of basketball goals based on computer vision according to any one of claims 1 to 8 are implemented.

Citation Information

Patent Citations

  • Video-based basketball goal detection method and device

    CN105701460A

  • Shooting training system and method based on smart phone and artificial intelligence

    CN110929596A

  • Basketball game goal event prediction method based on graph convolution network and long-short-term memory network

    CN111488815A

Cited By

  • Shooting effect evaluation method based on human body analysis

    CN119941038A

  • Sports event real-time score statistical method and system based on AI visual identification

    CN120298950A

  • Motion feature prediction method, model training method, task execution device and medium

    CN120461406A

  • Multi-view-angle-based multi-dimensional monitoring method and system for basketball pole-around motion

    CN121708549A

  • Hand rehabilitation evaluation method, system and equipment based on gesture score

    CN121768082A