High-speed football recognition and video synthesis method
Through the YOLOV5 model and tracking algorithm, football detection and tracking of the stadium images is detected and tracked, key ball events in the stadium are identified, and the problem of time-consuming and inaccurate ball sports analysis in the existing technology is solved, and accurate ball sports are achieved. Analysis and video synthesis.
Patent Information
- Application Number
- CN202411253546.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-09
- Publication Date
- 2024-12-27
AI Technical Summary
In the prior art, tracking and analysis of sphere movements in ball movements relies on manually analyzing videos recorded by cameras, which are time-consuming and labor-intensive and difficult to accurately quantify key parameters such as the movement speed and rotation speed of the sphere. It lacks accurate identification of football and key balls. Method of event.
The football detection model is constructed using the YOLOV5 model, and the real-time field image is combined with the tracking algorithm to perform football detection and continuous frame tracking, predict the future position of the football, identify key ball events and generate videos. The method includes preprocessing the field image, using the SA-MobileNeXt network structure and improved spatial pyramid pooling module, combining SiLU activation function, determining the confidence of the tracking target through the fully convolutional neural network scoring mechanism, and performing continuous frames based on the DeepSORT algorithm track.
It realizes accurate identification of football and automatic analysis of key ball events, provides efficient and scientific data support, and improves the technical and tactical level of ball sports analysis.
Smart Images

Figure CN119206572A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of sports monitoring applications, and in particular to a high-speed football recognition and video synthesis method. Background Art
[0002] Football, a widely popular and beloved sport around the world, has long inspired public enthusiasm and widespread participation with its high-intensity physical requirements, superb technical display, fierce competition and irreplaceable team spirit. In the arena of competitive sports, as a typical team ball sport, how to accurately capture the movement trajectory and characteristics of the football in key actions such as dribbling, passing, heading, spiking and shooting through scientific means, and then implement efficient and scientific training strategies to optimize the team's technical and tactical level, has become one of the key technical ways to improve sports performance.
[0003] In the prior art, the tracking and analysis of ball motion in ball sports mainly relies on manual analysis after the camera records the video. This method is not only time-consuming and labor-intensive, but also difficult to accurately quantify key parameters such as the ball's motion speed and rotation speed.
[0004] Therefore, in the related art, there is an urgent need for a method that can accurately and real-time identify football and key ball events. Summary of the invention
[0005] Based on this, it is necessary to provide a high-speed football recognition and video synthesis method that can accurately and real-timely identify footballs and key ball events in response to the above technical problems.
[0006] In a first aspect, the present application provides a high-speed football recognition and video synthesis method. The method comprises:
[0007] Limit the scope of the court, obtain real-time court images, and perform preprocessing;
[0008] Build a football detection model based on the YOLOV5 model;
[0009] The football detection model is used to detect the football in the preprocessed real-time stadium image, and the football is tracked in consecutive frames based on the detection result and the tracking algorithm;
[0010] Predict the future position of the ball based on tracking data, identify key ball events, and generate key ball event videos.
[0011] Optionally, in one embodiment of the present application, the preprocessing includes:
[0012] The real-time court image is segmented to obtain a small-sized real-time court image.
[0013] Optionally, in one embodiment of the present application, constructing a football detection model based on the YOLOV5 model includes:
[0014] The backbone network adopts the SA-MobileNeXt network structure based on rearranged channels and spatial attention, and combines an improved spatial pyramid pooling module between the backbone network and the neck network, combined with the SiLU activation function.
[0015] Optionally, in one embodiment of the present application, the continuous frame tracking of the football based on the detection result combined with the tracking algorithm includes:
[0016] The confidence of the tracked target is determined based on the fully convolutional neural network scoring mechanism, and the candidate target is output.
[0017] Optionally, in one embodiment of the present application, the method further includes:
[0018] Zoom in and out based on the ball's current and future positions.
[0019] In a second aspect, the present application also provides a high-speed football recognition and video synthesis device. The device comprises:
[0020] The court image acquisition module is used to limit the court range, acquire real-time court images, and perform preprocessing;
[0021] The football detection model building module is used to build a football detection model based on the YOLOV5 model;
[0022] The football recognition and tracking module is used to detect the football in the preprocessed real-time stadium image using the football detection model, and to track the football in continuous frames based on the detection results combined with the tracking algorithm;
[0023] The video synthesis module is used to predict the future position of the football based on the tracking data, identify key ball events, and generate key ball event videos.
[0024] In a third aspect, the present application further provides a computer device, wherein the computer device comprises a memory and a processor, wherein the memory stores a computer program, and the processor executes the steps of the methods described in the above embodiments.
[0025] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the method described in each of the above embodiments are implemented.
[0026] The above-mentioned high-speed football recognition and video synthesis method first limits the scope of the stadium, obtains the real-time stadium image, and performs preprocessing; then, builds a football detection model based on the YOLOV5 model; then, uses the football detection model to detect the football on the preprocessed real-time stadium image, and performs continuous frame tracking of the football based on the detection result combined with the tracking algorithm; finally, predicts the future position of the football based on the tracking data, identifies key ball events, and generates key ball event videos. In other words, by performing football detection based on the improved and optimized YOLOV5 model, it is possible to identify football targets and perform target tracking in combination with the improved tracking algorithm, identify key ball events and synthesize event videos, and provide strong data support for ball sports analysis. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 A diagram of an application environment of a high-speed football recognition and video synthesis method in an embodiment;
[0028] Figure 2 A schematic flow chart of a high-speed football recognition and video synthesis method in one embodiment;
[0029] Figure 3 A schematic diagram of the structure of a backbone network SA-MobileNeXt in one embodiment;
[0030] Figure 4 It is a structural schematic diagram of an improved spatial pyramid pooling module in one embodiment;
[0031] Figure 5 It is a structural block diagram of a high-speed football recognition and video synthesis device in one embodiment;
[0032] Figure 6 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0033] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0034] The high-speed football recognition and video synthesis method provided in the embodiment of the present application can be applied to Figure 1In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other network servers. Among them, the terminal 102 can be but is not limited to various personal computers, laptops, smart phones, tablets, Internet of Things devices and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The server 104 can be implemented with an independent server or a server cluster consisting of multiple servers.
[0035] In one embodiment, Figure 2 As shown, a high-speed football recognition and video synthesis method is provided, which is applied to Figure 1 The server in the example is used to illustrate the following steps:
[0036] S201: Limit the scope of the court, obtain real-time court images, and perform preprocessing.
[0037] In an embodiment of the present application, first, the range of the court is limited in the initial camera image, the positions of the four corners of the court are calibrated, and a high-resolution real-time court image within the range of the court is obtained, and the image is preprocessed to be processed into an image that is convenient for target detection.
[0038] Specifically, in one embodiment of the present application, the preprocessing includes:
[0039] The real-time court image is segmented to obtain a small-sized real-time court image.
[0040] In one embodiment of the present application, a high-resolution real-time court image is segmented, including the image itself and the annotated data on it. Specifically, a large-size image (tens of thousands × tens of thousands) is segmented, and the size of each small image is not higher than 700. The maximum width or the maximum side of the height is used to calculate the number of times the segmentation is required, and then the width and height are segmented through a sliding window, that is, the number of segmentations, to obtain a small-size image. Similarly, the annotated data is also segmented according to the segmentation method of the image.
[0041] S203: Build a football detection model based on the YOLOV5 model.
[0042] In the embodiment of the present application, the YOLOV5 model is optimized based on the model to construct a football detection model.
[0043] Specifically, in one embodiment of the present application, the construction of a football detection model based on the YOLOV5 model includes:
[0044] The backbone network adopts the SA-MobileNeXt network structure based on rearranged channels and spatial attention, and combines an improved spatial pyramid pooling module between the backbone network and the neck network, combined with the SiLU activation function.
[0045] In one embodiment of the present application, a new backbone network is adopted, namely, the SA-MobileNeXt network structure based on rearranged channels and spatial attention, such as Figure 3 As shown in the figure, MobileNeXt consists of stacked SandGlass blocks (SGBlock), and the Shuffle Channel and Spatial Attention (SCSA) modules are applied to the SandGlass Block (SGBlock) module. This network enhances the feature representation of a specific channel by rearranging the channel attention mechanism, and uses the spatial attention mechanism to highlight the key areas in the image. This combination enables the network to pay more attention to the features that are critical to the detection of small objects, thereby reducing the consumption of computing resources without sacrificing performance.
[0046] At the same time, an improved spatial pyramid pooling (SPP) module is introduced at the end of the backbone network, such as Figure 4 Figure 1 shows the structure of the improved spatial pyramid pooling module. Through this multi-scale feature extraction, the model can more accurately identify and locate small targets, improve the detection accuracy of small targets, and effectively detect them even if these targets occupy fewer pixels in the image.
[0047] In addition, the SiLU activation function is used to optimize the SGBlock module to accelerate the convergence of the model; the SiLU activation function can provide a smoother gradient while maintaining nonlinear characteristics, which helps the model learn faster during training and improves the training efficiency and detection performance of the model. The specific formula of the SiLU activation function is shown below.
[0048] SiLU(x)=x·σ(βx)
[0049] Where x is the input and σ is the sigmoid function, defined as β is a learnable parameter or can be set to 1 in some variants, and σ(βx) is the sigmoid function applied to the scaled input βx. When β is set to 1, the SiLU activation function can be simplified to:
[0050]
[0051] In addition, the complete intersection over union (CIoU) is used to improve the loss function, which helps the model learn the location and size of the target more accurately during training, so as to improve the accuracy of small target detection.
[0052] The calculation formula of CIoU loss function is as follows:
[0053]
[0054] Among them, IoU is the ratio of the intersection and union of the predicted box and the real box, ρ(b,b gt ) is the center point b of the predicted box and the center point b of the real box gt The distance between them, c is the diagonal length of the smallest enclosing box containing the predicted box and the true box, and v is the inconsistency of the aspect ratio, which is calculated as Among them, w and h are the width and height of the prediction box respectively, w gt and h gt are the width and height of the real box respectively, and α is a weight factor dynamically adjusted according to the IoU value, calculated as
[0055] S205: Using the football detection model to perform football detection on the preprocessed real-time stadium image, and based on the detection result combined with the tracking algorithm, perform continuous frame tracking on the football.
[0056] In an embodiment of the present application, a constructed football detection model is used to perform football detection on a preprocessed real-time stadium image to obtain multiple small image outputs, and the multiple small image outputs detected are merged so that they can be displayed on a large image to obtain the final detection output, and the final output is input into a tracking network, and the tracking algorithm DeepSORT algorithm is used to track the football in continuous frames.
[0057] In one embodiment of the present application, the continuous frame tracking of the football based on the detection result combined with the tracking algorithm includes:
[0058] The confidence of the tracked target is determined based on the fully convolutional neural network scoring mechanism, and the candidate target is output.
[0059] In one embodiment of the present application, in order to reduce the long-term tracking drift phenomenon caused by intra-class occlusion, a trajectory scoring mechanism is introduced in the matching stage of the DeepSORT algorithm, that is, a unified standard confidence of the detection box and the prediction box is generated based on the fully convolutional neural network scoring mechanism, so that the longer the existence time, the higher the credibility of the trajectory. Specifically, based on the regionalized fully convolutional neural network (R-FCN) classifier, the detection results are classified according to space. Each classified candidate region is defined as a region of interest (Ro). In order to clearly embed spatial information into the score map, a Ro is divided into k*k units, each unit represents the spatial position information of the object, and each score map corresponds to this unit. During training, random sampling is performed from the ground truth as a positive sample, and the same number of Ro are taken from the background as negative samples. The classification probability of a Ro is defined as in, is the sigmoid function, B is the score map of the i-th block, for example, if k=3, there are 9 blocks. Kalman filtering is generally only applicable to short-term tracking problems. If the Kalman filter is not updated for a long time, its accuracy may decrease. The trajectory confidence is set to measure the time information of the filter's accuracy, so that the longer the trajectory, the higher the credibility. During the life cycle of the trajectory, the Kalman filter will be reinitialized each time the track is retrieved from the lost state. Therefore, only the information of the last trajectory is used to formulate the confidence of the track. Define Rdetection as the detection result value associated with the track, and Rtrack as the tracking prediction value after the last detection association is successful. The definition of tracking trajectory confidence is as follows: trk =max(1-log(1+α·R track ), 0)·(R detection ≥2)·μ combined with the obtained Ro classification probability, and finally fused to obtain the unified scoring function of the candidate region x: P = p(y|Bx)·(μ(x∈C det ))+con track μ(x∈C tracl ), where Cdet represents the detected candidate and Ctracl represents the candidate obtained from the tracking output. The range of contrack is between 0 and 1, indicating that the candidate is penalized in the uncertain trajectory. Finally, the reasonable candidate targets are screened out according to non-maximum suppression to obtain the updated confidence. A value of 8nms is used to limit the maximum intersection of IoU, and a threshold Yp is also set for the minimum score.
[0060] S207: Predict the future position of the football based on the tracking data, identify key ball events, and generate key ball event videos.
[0061] In the embodiment of the present application, by analyzing the tracking data, as well as the position and historical movement direction of the player, the position of the ball in the next frame is predicted, and the camera is moved in advance to obtain a complete detection video. If the ball is not within the range of the court, the camera is not moved. Specifically, from the beginning of the detection of the ball, the camera moves based on the ball. When the number of detection frames is less than 30, the relative position information of the ball and the player with respect to the previous frame is determined based on the ball detected in the current frame, thereby obtaining the position of the ball in the next frame. When it is greater than 30 frames, the current first 30 frames are used as a basis to determine the position of the ball in the next frame. When the ball has not moved for a long time or is at the edge of the court, the position of the ball in the next frame is mainly predicted based on the player's moving position.
[0062] At the same time, by presetting the range of key positions, analyzing tracking data, and predicting the position of the ball on the court, key ball events are identified, and the ball is edited at the current position before and after, thereby achieving key ball editing and ensuring that each key ball event lasts within 1 minute.
[0063] In one embodiment of the present application, the method further includes:
[0064] Zoom in and out based on the ball's current and future positions.
[0065] In one embodiment of the present application, based on the current position and predicted future position of the football, the relationship between the two and the camera is determined. If the two are moving away from the camera, the picture will slowly start to zoom in; if the two are approaching the camera, the picture will slowly start to zoom out.
[0066] In the above-mentioned high-speed football recognition and video synthesis method, first, the stadium range is limited, the real-time stadium image is obtained, and preprocessing is performed; then, a football detection model is constructed based on the YOLOV5 model; then, the football detection model is used to detect the football on the preprocessed real-time stadium image, and the football is tracked in continuous frames based on the detection results combined with the tracking algorithm; finally, the future position of the football is predicted based on the tracking data, key ball events are identified, and key ball event videos are generated. In other words, by performing football detection based on the improved and optimized YOLOV5 model, it is possible to identify football targets and perform target tracking in combination with the improved tracking algorithm, identify key ball events and synthesize event videos, and provide strong data support for ball sports analysis.
[0067] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0068] Based on the same inventive concept, the embodiment of the present application also provides a high-speed football recognition and video synthesis device for implementing the high-speed football recognition and video synthesis method mentioned above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more embodiments of the high-speed football recognition and video synthesis device provided below can refer to the limitations of the high-speed football recognition and video synthesis method above, and will not be repeated here.
[0069] In one embodiment, Figure 5 As shown, a high-speed football recognition and video synthesis device 500 is provided, including: a stadium image acquisition module 501, a football detection model building module 503, a football recognition and tracking module 505 and a video synthesis module 507, wherein:
[0070] The court image acquisition module 501 is used to limit the court range, acquire real-time court images, and perform preprocessing.
[0071] The football detection model building module 503 is used to build a football detection model based on the YOLOV5 model.
[0072] The football recognition and tracking module 505 is used to detect the football on the pre-processed real-time stadium image using the football detection model, and to track the football in consecutive frames based on the detection result and the tracking algorithm.
[0073] The video synthesis module 507 is used to predict the future position of the football based on the tracking data, identify key ball events, and generate key ball event videos.
[0074] In one embodiment of the present application, the stadium image acquisition module is further used to:
[0075] The real-time court image is segmented to obtain a small-sized real-time court image.
[0076] In one embodiment of the present application, the football detection model building module is also used to:
[0077] The backbone network adopts the SA-MobileNeXt network structure based on rearranged channels and spatial attention, and combines an improved spatial pyramid pooling module between the backbone network and the neck network, combined with the SiLU activation function.
[0078] In one embodiment of the present application, the football recognition and tracking module is further used for:
[0079] The confidence of the tracked target is determined based on the fully convolutional neural network scoring mechanism, and the candidate target is output.
[0080] In one embodiment of the present application, the football recognition and tracking module is further used for:
[0081] Zoom in and out based on the ball's current and future positions.
[0082] Each module in the above-mentioned high-speed football recognition and video synthesis device can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each module.
[0083] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 6 As shown. 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, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a high-speed football recognition and video synthesis method is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covered on the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse, etc.
[0084] Those skilled in the art will understand that Figure 6The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0085] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above-mentioned method embodiments when executing the computer program.
[0086] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above method embodiments are implemented.
[0087] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0088] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.
[0089] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0090] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0091] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A high-speed football recognition and video synthesis method, characterized in that: The method comprises: Limit the scope of the court, obtain real-time court images, and perform preprocessing; Build a football detection model based on the YOLOV5 model; The football detection model is used to detect the football in the preprocessed real-time stadium image, and the football is tracked in consecutive frames based on the detection result and the tracking algorithm; Predict the future position of the ball based on tracking data, identify key ball events, and generate key ball event videos.
2. A high-speed football recognition and video synthesis method according to claim 1, characterized in that: The pre-processing comprises: The real-time court image is segmented to obtain a small-sized real-time court image.
3. A high-speed football recognition and video synthesis method according to claim 1, characterized in that: The soccer ball detection model constructed based on the YOLOV5 model includes: The backbone network adopts the SA-MobileNeXt network structure based on rearranged channels and spatial attention, and combines an improved spatial pyramid pooling module between the backbone network and the neck network with the SiLU activation function.
4. A high-speed football recognition and video synthesis method according to claim 1, characterized in that: The continuous frame tracking of the football based on the detection result combined with the tracking algorithm includes: The confidence of the tracked target is determined based on the fully convolutional neural network scoring mechanism, and the candidate target is output.
5. A high-speed football recognition and video synthesis method according to claim 1, characterized in that: The method further comprises: Zoom in and out based on the ball's current and future positions.
6. A high-speed football recognition and video synthesis device, characterized in that: The device comprises: The court image acquisition module is used to limit the court range, acquire real-time court images, and perform preprocessing; The football detection model building module is used to build a football detection model based on the YOLOV5 model; A football recognition and tracking module is used to detect footballs in the preprocessed real-time stadium image using the football detection model, and to track the footballs in consecutive frames based on the detection results combined with the tracking algorithm; The video synthesis module is used to predict the future position of the football based on the tracking data, identify key ball events, and generate key ball event videos.
7. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.
8. 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 according to any one of claims 1 to 5 are implemented.
