Tracking shooting method, device and equipment for ball games and storage medium
By updating the ball track pool and predicting the competitive ball path in ball sports, the problem of inaccurate competitive ball tracking in the existing technology is solved, and accurate tracking of competitive balls is achieved, improving user experience.
Patent Information
- Application Number
- CN202510850267.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-24
- Publication Date
- 2025-07-25
- Estimated Expiration
- 2045-06-24
AI Technical Summary
The prior art is difficult to accurately track competitive balls in ball sports, resulting in missed important moments and affecting user experience.
By updating the ball track pool based on the real-time shooting screen, filtering out the trajectory with the real ball number exceeding the threshold, selecting the trajectory with the largest total displacement as the competitive ball trajectory, and predicting its path for tracking and shooting.
Accurate tracking of competitive balls has been achieved, the ability to track successful important competitive scenes has been improved, and the loss of key images has been avoided.
Smart Images

Figure CN120378750A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present application relate to the fields of computer vision technology and motion tracking shooting, and particularly to a tracking shooting method, device, equipment, and storage medium for ball games. Background Art
[0002] In the field of motion tracking shooting, the mainstream technology is to track the movement of specific athletes or a group of athletes. For example, in Chinese Patent CN114827478A, an intelligent system for automatically tracking and shooting sports games and its control method, the tracking target is determined and tracking is achieved by judging the posture and movement speed of the athletes. However, in actual game scenarios, especially in ball games on large venues such as basketball, football, and rugby, the focus of the whole-field core competition is the ball. The position of the ball does not necessarily coincide with a specific target or a crowd gathering place. For example, during mid- and long-distance shooting in a basketball game or long passes and shots in a football game, the competitive ball will move independently over a long distance away from the athletes, and such movements are mostly important scoring scenarios. If the tracking strategy for athletes is followed, wonderful moments may be missed during tracking, affecting the user experience. Summary of the Invention
[0003] In view of this, the present application provides a tracking shooting solution for ball games, aiming to improve the tracking success rate of key pictures in ball games.
[0004] To achieve the above object, the present application adopts the following technical solutions:
[0005] In a first aspect, a tracking shooting method for ball games is provided, including:
[0006] Updating a ball trajectory pool based on the current frame of the real-time shooting picture;
[0007] Screening out the trajectories with the number of real balls exceeding a first threshold from the ball trajectory pool to obtain an effective ball trajectory pool;
[0008] Selecting the trajectory with the largest total displacement from the effective ball trajectory pool as the competitive ball trajectory;
[0009] Predicting the competitive ball path based on the competitive ball trajectory to track and shoot the competitive ball in advance.
[0010] The step of updating the ball trajectory pool may include:
[0011] Identifying each ball target in the current frame based on an object recognition algorithm;
[0012] Matching each ball target with each trajectory in the ball trajectory pool;
[0013] If the match is successful, adding the ball target to the successfully matched trajectory, and at most one ball is added to each trajectory;
[0014] If the matching fails, a new trajectory is created.
[0015] Preferably, the step of matching each ball target with each trajectory in the ball trajectory pool includes:
[0016] Calculate the gap between the ball target to be matched and the last real ball in each trajectory. The gap includes the area gap and the distance gap;
[0017] Among all the last real balls with the area gap less than the second threshold, select the trajectory where the last real ball with the smallest distance gap is located as the trajectory that successfully matches the ball target to be matched.
[0018] In a possible design solution, after the step of matching each ball target with each trajectory in the ball trajectory pool, it may further include:
[0019] If there is a trajectory in the ball trajectory pool that has not been matched with a ball target, an empty ball is inserted after each trajectory that has not been matched with a ball target.
[0020] Preferably, if the length of the trajectory reaches the third threshold, when the trajectory is updated each time, the earliest ball in the trajectory is deleted.
[0021] In a possible design solution, predicting the path of the competitive ball trajectory includes:
[0022] Based on the geometric shape of the competitive ball trajectory, match the closest function model;
[0023] Based on the coordinates of each ball target in the competitive ball trajectory, calculate the change trend of the movement speed of the ball;
[0024] Based on the function model and the change trend of the movement speed, predict the position of the competitive ball after a preset number of future frames.
[0025] Preferably, screening out the trajectories with the number of real balls exceeding the first threshold from the ball trajectory pool includes:
[0026] If there is no trajectory in the ball trajectory pool with the number of real balls exceeding the first threshold, a fixed shot is taken of the last real ball in the last competitive ball trajectory.
[0027] In a second aspect, an automatic tracking and shooting device is provided, including a shooting module, an analysis module, and a rotation module. The shooting module is physically connected to the rotation module. The rotation module is adapted to rotate horizontally. The shooting module is adapted to continuously acquire real-time shooting images and send the real-time shooting images to the analysis module; the analysis module is adapted to execute the method of the first aspect of the present application to predict the path of the competitive ball and generate a rotation instruction, and send the rotation instruction to the rotation module: the rotation module is adapted to change the angle of the shooting module according to the rotation instruction.
[0028] In a third aspect, an electronic device is provided, including a memory and a processor. A computer program is stored on the memory, and when the processor executes the computer program, the method of the first aspect of the present application is implemented.
[0029] In a fourth aspect, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the method of the first aspect of the present application is implemented.
[0030] The tracking and shooting method for ball games provided by the embodiments of the present application detects the ball target in the real-time video image, constructs a trajectory pool by matching according to the continuity of the ball target in multiple frames, and selects the ball most likely to be the actual competitive ball from the trajectory pool according to the displacement amount of the ball for tracking, realizing a solution for accurately tracking the competitive ball in automatic tracking and shooting, and capable of improving the successful tracking ability for important competitive scenes. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] Combined with the drawings and referring to the following detailed description, the above and other features, advantages and aspects of the embodiments of the present application will become more obvious. In the drawings, the same or similar reference numerals represent the same or similar elements, where:
[0032] Figure 1 is a flowchart of a tracking and shooting method for a ball game according to an embodiment of the present application;
[0033] Figure 2 is a flowchart of a method for updating a ball trajectory pool according to an embodiment of the present application;
[0034] Figure 3 is a flowchart of another method for updating a ball trajectory pool according to an embodiment of the present application;
[0035] Figure 4 is a flowchart of a method for predicting the path of a competitive ball according to an embodiment of the present application;
[0036] Figure 5 is a flowchart of a tracking and shooting method for a ball game according to another embodiment of the present application;
[0037] Figure 6 is a block diagram of an automatic tracking and shooting device according to an embodiment of the present application;
[0038] Figure 7 is a schematic structural diagram of a terminal device or a server suitable for implementing the embodiments of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0039] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the following will clearly and completely describe the technical solutions in the embodiments of this application with reference to the accompanying drawings in the embodiments of this application. Apparently, the described embodiments are some, but not all, of the embodiments of this application. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in this application without creative efforts shall fall within the protection scope of this application.
[0040] In the field of computer vision analysis, it is usually default that the origin of the coordinate system is located at the upper left corner of the screen. In all embodiments of this application, unless otherwise stated, the upper left corner is used as the origin of the screen coordinate system. Those skilled in the art should be aware that such a coordinate system setting is not absolutely fixed. When the origin of the coordinate system is set at any position inside or outside the screen, the corresponding technical solutions obtained by making simple adjustments to this solution without creative efforts shall all fall within the protection scope of this application.
[0041] In addition, the term "and / or" in this article is merely a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent three situations: A exists alone, A and B exist simultaneously, and B exists alone. In addition, the character " / " in this article generally represents an "or" relationship between the associated objects before and after.
[0042] Figure 1 The flowchart of a tracking and shooting method for a ball game according to an embodiment of this application is shown as Figure 1 shown below:
[0043] S1: Update the ball trajectory pool based on the current frame of the real-time captured image.
[0044] The ball trajectory pool is a set of dynamically changing ball trajectories obtained based on several consecutive frames in the current shooting task. Each time a new video frame is obtained for analysis, the ball trajectory pool is updated. The frequency of obtaining a new video frame for analysis and updating the ball trajectory pool can be the default frequency (30 frames) of the real-time captured image (such as a 30-frame video), or the frequency after frame extraction (such as if the frame extraction ratio is 1:1, the frequency of obtaining a new video frame for analysis and updating the ball trajectory pool is 15 frames).
[0045] Since there may be multiple similar or identical balls in the captured images during a large number of formal or informal competitions, such as other competition venues captured in the image, players warming up with balls on the edge of the venue, spare balls or replacement balls. At this time, if only a single ball is tracked, it is very likely to switch to the wrong target ball during the tracking process, thus losing the correct tracking object and resulting in a large number of invalid captured images. Therefore, this application introduces a ball trajectory pool, analyzes all the balls captured in the real-time image into the pool, and then determines the most likely trajectory of the current competitive ball from the pool and conducts tracking. The current competitive ball is the only target ball for competition in the current venue. In a ball game, there is one and only one competitive ball at the same time.
[0046] Specifically, by analyzing the coordinates of all ball targets in the current frame and matching them with all the trajectories in the trajectory pool of the previous frame, an updated trajectory pool is obtained. Figure 2 The flowchart of a method for updating the ball trajectory pool according to an embodiment of the present application is as Figure 2 shown. The steps for updating the ball trajectory pool include:
[0047] S11: Based on the target recognition algorithm, identify each ball target in the current frame. In this application, there is no restriction on the specific selection of the target recognition algorithm: the YOLOv8 model can be used, or other recognition algorithms such as CNN (Convolutional Neural Network), ViT (Vision Transformer) can also be used. To achieve more accurate recognition results, a large number of labeled images can be used to train the algorithm model. The training of the algorithm and the model is a common technical means that those skilled in the art should know and does not belong to the content protected by this application, so it will not be elaborated here. The target recognition algorithm represents each recognized target with four parameters: the horizontal and vertical coordinates (x, y) of the center point of the target box and the width (abbreviated as W) and height (abbreviated as H) of the target box; the ball trajectory can use a queue as the data structure, where each element of the queue, that is, each real ball in the ball trajectory, is represented by the above four parameters.
[0048] S12: Match each of the ball targets with each trajectory in the ball trajectory pool. Specifically, the following matching methods can be adopted:
[0049] Matching method 1: For each trajectory in the ball trajectory pool, find the closest function in the plane rectangular coordinate system; sequentially obtain each ball target recognized in S11 as the ball target to be matched, and determine whether its coordinates fall on the function image of one of the trajectories; if it falls on the function image, the match is successful; otherwise, the match fails.
[0050] Matching method 2: Sequentially obtain each ball target recognized in S11 as the ball target to be matched, and calculate the area difference and distance difference between the ball target to be matched and the last real ball in each trajectory; among all the last real balls with the area difference less than the second threshold, select the trajectory where the last real ball with the smallest distance difference is located as the trajectory that successfully matches the ball target to be matched. Among them, a real ball refers to a ball actually recognized by the target recognition algorithm when updating the ball trajectory pool.
[0051] Matching method 2 achieves precise matching through dual judgments of position and area. Since the position of the ball target will not change significantly within just one frame or a few frames, and at the same time, the size of the ball target in the picture will not change significantly either. Therefore, the area of the target can be used for preliminary screening to exclude interfering balls and then perform position matching.
[0052] Specifically, the area difference is compared by the area of the target bounding box of the ball target to be matched and the real ball to be matched, that is, the product of the width and height of the target bounding box, and it is judged whether the ratio of the two target bounding boxes exceeds the second threshold. According to different analysis frame rates, the second threshold of the area difference is variable. According to the experimental results, when the analysis frame rate is 20 frames, it is more reasonable to set the second threshold of the area difference between 0.5 and 2. That is, when the area of the target bounding box of the ball target to be matched is less than twice the area of the target bounding box of the real ball to be matched, or greater than half of the area of the target bounding box of the real ball to be matched, it is considered that the area difference is within a reasonable range. The distance difference can be calculated by the Euclidean distance between the center points (x, y) of the target bounding boxes of the ball target to be matched and the real ball to be matched.
[0053] The working process of matching method 2 is to first exclude the interfering items with the area difference greater than the threshold, and then sort the remaining objects to be matched according to the distance size. Furthermore, it is considered that the ball target to be matched with the smallest distance from the real ball to be matched should belong to the trajectory where the real ball to be matched is located, that is, the matching is successful.
[0054] Obviously, when the trajectory pool is in the initialization state or is empty, each match in S12 fails, and a new trajectory is created based on the position of each ball target.
[0055] S13: If the match is successful, add the target ball to the successfully matched trajectory.
[0056] In a possible implementation, at most one successfully matched target ball is added to each trajectory; the successfully matched and updated trajectories will not participate in the subsequent matching process of the target balls.
[0057] S14: If the match fails, create a new trajectory.
[0058] When the ball target matching fails, it indicates that there is no suitable trajectory around the ball target in the current frame. At this time, it is considered that the ball target is a ball newly appearing in the real-time shooting screen. Therefore, a new trajectory queue is established for it.
[0059] Figure 3 The flowchart of another method for updating the ball trajectory pool according to an embodiment of the present application is shown. To more conveniently represent the length of the trajectory, after the steps of the Figure 2 shown method are completed, that is, after all matching is completed, it is also possible to:
[0060] S15: If there is a trajectory in the ball trajectory pool that fails to match the ball target, an empty ball is inserted after each trajectory that fails to match the ball target. Inserting an empty ball after the trajectory means inserting an empty element at the end of the trajectory queue, and the empty element can be represented by null.
[0061] In addition, to reduce the calculation amount, an upper limit on the length of the trajectory, that is, the third threshold, can be set. When the trajectory length has reached the third threshold:
[0062] S16: When updating the trajectory, the earliest ball in the trajectory is deleted.
[0063] According to the experimental results, it is most reasonable for the trajectory to contain the ball positions within 1.5 to 2 seconds, which can balance the calculation performance and calculation accuracy. According to the different analysis frame rates, the third threshold of the maximum length of the trajectory is variable. For example, if the analysis frame rate per second is 20 frames, the third threshold should be set to 30 - 40.
[0064] S2: Screen out the trajectories in the ball trajectory pool where the number of real balls exceeds the first threshold to obtain an effective ball trajectory pool.
[0065] If the number of real balls in a trajectory is too small, it is considered that the confidence level of this trajectory is low and the possibility of it being an off-field interference ball is very high. Therefore, by setting the first threshold, the trajectories with too few real balls in the ball trajectory pool are excluded. Specifically, according to the different lengths of the trajectories, the first threshold is variable and can usually be set to 1 / 3 - 1 / 2 of the current trajectory length.
[0066] S3: Select the trajectory with the largest total displacement from the effective ball trajectory pool as the competitive ball trajectory.
[0067] Among them, the total displacement refers to the displacement from the last ball to the last ball in the trajectory, that is, the distance between the center point coordinates of the head and tail elements in the trajectory queue. In the shooting of ball games, the displacement of the competitive ball is the most frequent. Therefore, it can be considered that the trajectory with the largest total displacement is the competitive ball trajectory.
[0068] S4: Predict the path of the competitive ball based on the trajectory of the competitive ball, so as to track and photograph the competitive ball in advance.
[0069] Figure 4 It is a flowchart of a method for predicting the path of a competitive ball according to an embodiment of the present application, as Figure 4 shown:
[0070] S41: Based on the geometric shape of the trajectory of the competitive ball, match the closest function model.
[0071] To achieve tracking and photographing of the competitive ball in advance, it is necessary to predict the future path of the competitive ball in advance based on the trajectory of the competitive ball. In one possible implementation, according to the differential principle, any curve can be approximately regarded as a straight line within a very small interval. Therefore, the future path of the ball can be approximately predicted by extending it in a straight line. In another possible implementation, for scenarios with extremely high accuracy requirements, since the movement trajectory of the ball is mainly a parabola, the position of the real ball in the trajectory can be polynomially fitted to obtain the function corresponding to the trajectory. The specific calculation method belongs to a conventional plane geometry problem and will not be elaborated here. It can be calculated through simple plane geometry calculations or directly using existing tools such as the Numpy.polyfit function.
[0072] S42: Based on the coordinates of each ball target in the trajectory of the competitive ball and the function model, calculate the movement trend of the competitive ball.
[0073] Specifically, the movement trend of the ball includes the predicted movement direction and the predicted movement speed. When predicting the future path of the ball in a straight line, the predicted movement direction is the same as the extension direction of the straight line. When predicting the future path of the ball in a parabola, the predicted movement direction is the same as the position of the tangent line of the parabola at the position of the last ball target.
[0074] The direction angle is the angle between the vector and the positive direction of the x-axis, and the value ranges from 0 to π. The judgment of the movement speed of the ball can be calculated according to the average value of the speeds of the last several real balls.
[0075] Since only the offset on the x-axis is concerned in the tracking and photographing, there is no need to consider the positive or negative value of the y value of the movement direction vector. The component value M of the movement speed vector on the x-axis is directly used, that is, M = v × cosα. Where v is the predicted movement speed; α is the direction angle of the predicted movement direction. It should be noted that the movement speed here is not the movement speed in the real scenario, but the movement speed with pixels as the length unit and frames as the time unit. For example, if the ball target moves 100 pixels in 10 frames, the movement speed v = 10 pixels / frame.
[0076] When M is positive, it indicates that the movement trend of the competitive ball is in the positive direction of the x-axis (to the right in the conventional coordinate system); when M is negative, it indicates that the movement trend of the competitive ball is in the negative direction of the X-axis (to the left in the conventional coordinate system). |M| represents the speed of the competitive ball moving in the horizontal direction.
[0077] S43: Determine the movement trend of the shooting angle based on the movement trend of the competitive ball.
[0078] If |M| is less than the fourth threshold, it indicates that the competitive ball will not exceed the tracking range in the foreseeable future in the horizontal direction, so there is no need to adjust the shooting angle; if |M| is greater than the fourth threshold, it indicates that the competitive ball is very likely to exceed the tracking range in the foreseeable future in the horizontal direction, and then the shooting angle needs to be adjusted in the corresponding direction according to the positive or negative of M. Specifically, the fourth threshold is related to the pixel length and frame rate of the real-time shooting screen, and can be calculated by the following formula: Fourth threshold = WI × D / dpi, where WI is the pixel length of the real-time shooting screen. For example, if the screen is 1080*720, then WI is 1080; D is the preset ratio for controlling the rotation accuracy of the pan-tilt, that is, when it is predicted that the movement length of the competitive ball within 1 second may exceed D of the screen length, the shooting angle needs to be adjusted, and it is usually set to 1 / 5 - 1 / 6; dpi is the frame rate value of the real-time shooting screen.
[0079] Preferably, when screening out the ball trajectories with the number of real balls exceeding the threshold from the ball trajectory pool, it further includes S21: If there is no trajectory with the number of real balls exceeding the first threshold in the ball trajectory pool, then fix the shooting of the last real ball in the last competitive ball trajectory, as Figure 5 shown.
[0080] When there is no trajectory with the number of real balls exceeding the first threshold in the ball trajectory pool, that is, the competitive ball trajectory cannot be found in the real-time shooting screen of the current frame. At this time, trace back the video frames in the historical records step by step forward until the video frame where the competitive ball trajectory was successfully found last time, that is, the last competitive ball trajectory.
[0081] In some types of competitions, there may be scenarios where the competitive ball is stationary for a short period of time, such as corner kicks, free kicks, penalty kicks in football, etc. This embodiment is to better achieve the tracking effect in the stationary ball scenario.
[0082] Figure 6 It is a block diagram of the automatic tracking shooting device 400 according to an embodiment of the present application. As Figure 6 shown, the automatic tracking shooting device 400 includes a shooting module 401, an analysis module 402, and a rotation module 403. The automatic tracking shooting device 400 is used to implement the foregoing automatic shooting tracking method.
[0083] Optionally, the automatic tracking shooting device 400 can be an independent device, a component included in an independent device, or a combination of multiple different independent devices. In a possible implementation, the shooting module 401 is implemented as an independent intelligent terminal or camera, the analysis module 402 is implemented as another independent intelligent terminal or intelligent hardware, and the rotation module 403 is implemented as a pan-tilt or rotatable bracket. In another possible implementation, the shooting module 401 is implemented as a camera module in an intelligent terminal, the analysis module 402 is implemented as a computing module in the same intelligent terminal, and the rotation module 403 is implemented as an intelligent pan-tilt or rotatable bracket. In yet another possible implementation, the shooting module 401 is implemented as a camera module in an integrated intelligent camera device, the analysis module 402 is implemented as a computing module in the same integrated intelligent camera device, and the rotation module 403 is implemented as a motion mechanism in the same integrated intelligent camera device.
[0084] Among them, the shooting module 401 is physically connected to the rotation module 403. The physical connection can be a fixed connection or a detachable connection. All connection methods that can ensure that the rotation module 403 can directly or indirectly affect the movement of the shooting module 401 physically are within the protection scope of this application. The shooting module 401 is adapted to continuously acquire real-time shooting images and send the real-time shooting images to the analysis module 402. Optionally, the shooting module 401 may not have an active information sending function, but the analysis module 402 actively obtains the real-time shooting images from the shooting module 401. The analysis module 402 is adapted to execute the Figure 1 or Figure 2 method in the embodiments of this application, perform real-time calculation and judgment on the tracking center position, and send a rotation instruction to the rotation module 403 according to the judgment condition. The rotation module 403 is adapted to rotate horizontally, that is, rotate around the vertical axis (z-axis). The rotation module 403 is adapted to change the angle of the shooting module 401 according to the rotation instruction.
[0085] Figure 7 The schematic structural diagram of the terminal device or server suitable for implementing the embodiments of this application is shown.
[0086] As Figure 7 shown, the terminal device or server includes a central processing unit (CPU) 501, which can execute various appropriate actions and processes according to the program stored in the read-only memory (ROM) 502 or the program loaded from the storage section 508 into the random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the terminal device or server are also stored. The CPU 501, ROM 502, and RAM 503 are connected to each other through a bus 504. The input / output (I / O) interface 505 is also connected to the bus 504.
[0087] The following components are connected to the I / O interface 505: an input section 506 including a keyboard, a mouse, etc.; an output section 507 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc. and speakers, etc.; a storage section 508 including a hard disk, etc.; and a communication section 509 including a network interface card such as a LAN card, a modem, etc. The communication section 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to the I / O interface 505 as required. A removable medium 511, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 510 as required so that a computer program read therefrom can be installed into the storage section 508 as required.
[0088] Specifically, according to an embodiment of the present application, the above method flow steps can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product including a computer program carried on a machine-readable medium, the computer program including program code for performing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through the communication section 509 and / or installed from the removable medium 511. When the computer program is executed by a central processing unit (CPU) 501, the above functions defined in the system of the present application are executed.
[0089] It should be noted that the computer-readable medium shown in this application can be a computer-readable signal medium, a computer-readable storage medium, or any combination of the two. A computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of a computer-readable storage medium can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this application, a computer-readable storage medium can be any tangible medium that contains or stores a program, and this program can be used by or in conjunction with an instruction execution system, apparatus, or device. In this application, a computer-readable signal medium can include a data signal propagated in a baseband or as part of a carrier wave, in which computer-readable program code is carried. Such a propagated data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium, and this computer-readable medium can send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on a computer-readable medium can be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0090] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram can represent a module, a program segment, or a part of code, and the aforementioned module, program segment, or part of code contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than that marked in the accompanying drawings. For example, two consecutively represented blocks can actually be executed substantially in parallel, and they can sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, and the combination of blocks in the block diagram and / or flowchart, can be implemented by a dedicated hardware-based system for performing the specified functions or operations, or can be implemented by a combination of dedicated hardware and computer instructions.
[0091] The units or modules involved in the embodiments described in this application can be implemented in software or in hardware. The described units or modules can also be provided in a processor. Among them, the names of these units or modules do not, in some cases, constitute a limitation on the units or modules themselves.
[0092] As another aspect, this application also provides a computer-readable storage medium. The computer-readable storage medium can be included in the electronic device described in the above embodiments; it can also exist alone without being assembled into the electronic device. The above computer-readable storage medium stores one or more programs, and when the foregoing programs are executed by one or more processors, they implement the methods described in this application.
[0093] The above description is only a preferred embodiment of this application and an explanation of the technical principles applied. Those skilled in the art should understand that the scope of the application involved in this application is not limited to the technical solutions formed by the specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the foregoing inventive concept. For example, the technical solutions formed by mutually replacing the above features with other technical features (but not limited to) having similar functions in this application.
Claims
1. A tracking shooting method for ball games, characterized in that, Including: Updating a ball trajectory pool based on a current frame of a real-time captured image; Filtering out trajectories in the ball trajectory pool where the number of real balls exceeds a first threshold to obtain a valid ball trajectory pool; Selecting the trajectory with the largest total displacement from the valid ball trajectory pool as the competitive ball trajectory; Predicting the motion trend of the shooting perspective based on the competitive ball trajectory to track and shoot the competitive ball in advance.
2. The method according to claim 1, wherein The updating of the ball trajectory pool includes: Identifying each ball target in the current frame based on an object recognition algorithm; Matching each ball target with each trajectory in the ball trajectory pool; If the match is successful, adding the ball target to the successfully matched trajectory; If the match fails, creating a new trajectory.
3. The method according to claim 2, wherein The matching of each ball target with each trajectory in the ball trajectory pool includes: Calculating the difference between the ball target to be matched and the last real ball in each trajectory, where the difference includes an area difference and a distance difference; Among all the last real balls where the area difference is less than a second threshold, selecting the trajectory where the last real ball with the smallest distance difference is located as the trajectory successfully matched with the ball target to be matched.
4. The method according to claim 2, wherein After the step of matching each ball target with each trajectory in the ball trajectory pool, it further includes: If there are trajectories in the ball trajectory pool that have not been matched with ball targets, inserting empty balls after each such trajectory.
5. The method according to claim 4, wherein If the length of the trajectory reaches a third threshold, when updating the trajectory each time, deleting the earliest ball in the trajectory.
6. The method according to any one of claims 1 to 5, characterized in that, The predicting of the motion trend of the shooting perspective based on the competitive ball trajectory includes: Matching the closest function model based on the geometric shape of the competitive ball trajectory; Calculating the motion trend of the competitive ball based on the coordinates of each ball target in the competitive ball trajectory and the function model; Determining the motion trend of the shooting perspective based on the motion trend of the competitive ball.
7. The method according to claim 1, wherein The filtering out of trajectories in the ball trajectory pool where the number of real balls exceeds a first threshold includes: If there are no trajectories in the ball trajectory pool where the number of real balls exceeds the first threshold, performing a fixed shooting on the last real ball in the last competitive ball trajectory.
8. An automatic tracking shooting device, characterized in that, Including a shooting module, an analysis module, and a rotation module. The shooting module is physically connected to the rotation module. The rotation module is adapted to rotate horizontally. The shooting module is adapted to continuously obtain a real-time captured image and send the real-time captured image to the analysis module; the analysis module is adapted to execute the method according to any one of claims 1-7 to predict the path of the competitive ball, generate a rotation instruction based on the path, and send the rotation instruction to the rotation module: the rotation module is adapted to change the angle of the shooting module according to the rotation instruction.
9. An electronic device, comprising a memory and a processor, wherein a computer program is stored on the memory, characterized in that, When the processor executes the computer program, it implements the method according to any one of claims 1-7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the method according to any one of claims 1-7.
Citation Information
Patent Citations
Intelligent system for automatically tracking and shooting athletic contest and control method thereof
CN114827478A
Tracing method based on motion track
CN101794451A
Method for detecting football rotating speed based on catching markers
CN106975207A
Table tennis ball drop point detection method and system based on improved color gamut recognition technology
CN114387354A
Picture acquisition method and device of moving ball, computer equipment and storage medium
CN116797961A
Cited By
Competition video editing method and system based on tracking holder data, and storage device
CN120916033A