Tracking shooting method, device, equipment and storage medium for ball sports
By constructing a ball trajectory pool and predicting the path of competitive balls, the problem of tracking the ball when it is separated from the player in ball sports is solved, accurate positioning and efficient tracking of the ball are achieved, and the success rate of ball sports shooting is improved.
Patent Information
- Application Number
- CN202510850267.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-24
- Publication Date
- 2025-09-23
- Estimated Expiration
- 2045-06-24
AI Technical Summary
In ball sports, existing technologies have difficulty accurately tracking the position of the ball, especially when the ball is separated from the players, resulting in failure to capture important scenes and affecting the user experience.
By constructing a ball trajectory pool, screening out the trajectories with the number of real balls exceeding the threshold, selecting the trajectory with the largest total displacement as the competitive ball trajectory, predicting its path and tracking it, and using target recognition algorithm and geometric shape matching to achieve accurate positioning of the ball.
It improves the tracking success rate of key scenes in ball sports, ensures accurate tracking of the competitive ball, and improves the shooting effect.
Smart Images

Figure CN120378750B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the fields of computer vision technology and motion tracking and shooting, and in particular to methods, devices, equipment, and storage media for tracking and shooting ball sports. Background Art
[0002] In the field of sports tracking and filming, the mainstream technology tracks the movement of specific athletes or groups of athletes. For example, Chinese patent CN114827478A discloses an intelligent system and control method for automatically tracking and filming sports games. This system uses the athletes' posture and movement speed to determine the tracking target and achieve tracking. However, in real-world game scenarios, especially in large-scale ball sports such as basketball, soccer, and rugby, the core focus of the entire game is the ball. The ball's position does not necessarily coincide with a specific target or crowd gathering area. For example, during mid-range and long-range shots in basketball or long passes and shots in soccer, the ball can break away from the athletes and move independently over long distances. These types of sports are often crucial for scoring. If a strategy based on athlete tracking is used, exciting moments may be missed, affecting the user experience. Summary of the Invention
[0003] In view of this, the present application provides a tracking and shooting solution for ball sports, aiming to improve the success rate of tracking key scenes of ball sports.
[0004] To achieve the above objectives, this application adopts the following technical solutions:
[0005] In a first aspect, a tracking shooting method for ball sports is provided, comprising:
[0006] Update the ball trajectory pool based on the current frame of the real-time shooting picture;
[0007] Screening out trajectories whose number of real balls exceeds a first threshold from the ball trajectory pool to obtain a valid ball trajectory pool;
[0008] Select the trajectory with the largest total displacement from the valid ball trajectory pool as the competition ball trajectory;
[0009] The path of the competitive ball is predicted based on the trajectory of the competitive ball so as to track and shoot the competitive ball in advance.
[0010] The steps for updating the ball trajectory pool may include:
[0011] Based on the target recognition algorithm, identify each ball target in the current frame;
[0012] Match each ball target with each trajectory in the ball trajectory pool;
[0013] If the match is successful, the ball target will be added to the matching trajectory, and at most one ball will be added to each trajectory;
[0014] If the matching fails, a new track is created.
[0015] Preferably, the step of matching each ball target with each trajectory in the ball trajectory pool comprises:
[0016] Calculate the gap between the target ball to be matched and the last real ball in each trajectory, including the area gap and distance gap;
[0017] Among all the last real balls whose area difference is less than the second threshold, the trajectory of the last real ball with the smallest distance difference is selected as the trajectory that successfully matches the ball target to be matched.
[0018] In one possible design, after the step of matching each ball target with each trajectory in the ball trajectory pool, the following steps may also be performed:
[0019] If there are trajectories in the ball trajectory pool that do not match the ball target, an empty ball is inserted after each trajectory that does not match the ball target.
[0020] Preferably, if the length of the trajectory reaches a third threshold, the earliest ball in the trajectory is deleted each time the trajectory is updated.
[0021] In one possible design, the path of the trajectory of the competitive ball is predicted, including:
[0022] Based on the geometry of the ball trajectory, the closest function model is matched;
[0023] Based on the coordinates of each ball target in the competitive ball trajectory, calculate the ball's movement speed change trend;
[0024] Based on the function model and the trend of motion speed change, the position of the competitive ball after the preset frame in the future is predicted.
[0025] Preferably, screening out trajectories with a number of real balls exceeding a first threshold from the ball trajectory pool comprises:
[0026] If there is no trajectory in the ball trajectory pool in which the number of real balls exceeds the first threshold, a fixed shot is taken of the last real ball in the last competitive ball trajectory.
[0027] In the second aspect, an automatic tracking 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 suitable for horizontal rotation, the shooting module is suitable for continuously acquiring real-time shooting images, and sending the real-time shooting images to the analysis module; the analysis module is suitable for executing the method of the first aspect of this 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 suitable for changing the angle of the shooting module according to the rotation instruction.
[0028] In a third aspect, an electronic device is provided, comprising a memory and a processor, wherein a computer program is stored in 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, and 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 sports provided in the embodiments of the present application detects ball targets in real-time video images, builds a trajectory pool based on the continuity of ball targets in multiple frames, and selects the ball that is most likely to be the actual competitive ball from the trajectory pool for tracking based on the displacement of the ball. This realizes a solution for accurately tracking competitive balls in automatic tracking shooting, which can improve the ability to successfully track important competitive scenes. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] The above and other features, advantages and aspects of the embodiments of the present application will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. In the accompanying drawings, the same or similar reference numerals represent the same or similar elements, wherein:
[0032] Figure 1 is a flow chart of a method for tracking and shooting ball sports 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 flow chart of a method for predicting a path of a competitive ball according to an embodiment of the present application;
[0036] Figure 5 is a flow chart of a tracking and shooting method for ball sports according to yet another embodiment of the present application;
[0037] Figure 6 is a block diagram of an automatic tracking shooting device according to an embodiment of the present application;
[0038] Figure 7 A schematic diagram of the structure of a terminal device or server suitable for implementing an embodiment of the present application. DETAILED DESCRIPTION
[0039] To make the purpose, technical solutions, and advantages of the embodiments of this application more clear, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0040] In the field of computer vision analysis, it is generally assumed that the origin of the coordinate system is located in the upper left corner of the screen. In the various embodiments of the present application, unless otherwise stated, the upper left corner is used as the origin of the coordinate system of the screen. Those skilled in the art should know 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 that can be obtained by simple adjustments to this solution without creative labor are all within the scope of protection of this application.
[0041] In this document, the term "and / or" simply describes a relationship between related objects, indicating that three possible relationships exist. For example, "A and / or B" can represent: A exists alone, A and B exist simultaneously, or B exists alone. Furthermore, the character " / " in this document generally indicates that the related objects are in an "or" relationship.
[0042] Figure 1 FIG. 1 shows a flow chart of a method for tracking and shooting ball sports according to an embodiment of the present application. Figure 1 As shown:
[0043] S1: Update the ball trajectory pool based on the current frame of the real-time shooting picture.
[0044] The ball trajectory pool is a collection of dynamically changing ball trajectories derived from several consecutive frames in the current capture task. The ball trajectory pool is updated each time a new video frame is acquired for analysis. The frequency of acquiring new video frames for analysis and updating the ball trajectory pool can be the default frequency (30 frames) of real-time capture (for example, a 30-frame video) or a frequency adjusted by frame extraction (for example, a 1:1 frame extraction frequency would result in a 15-frame frequency for acquiring new video frames for analysis and updating the ball trajectory pool).
[0045] Because in a large number of formal or informal matches, multiple similar or identical balls may appear in the shooting picture, such as other playing fields, other players warming up with the ball at the edge of the field, spare balls or replacement balls. At this time, if tracking is based on a single ball only, it is very likely to switch to the wrong target ball in the middle of the tracking, thereby losing the correct tracking object and causing a large number of invalid pictures to be shot. Therefore, this application introduces a ball trajectory pool, which analyzes all the balls captured in the real-time picture into the pool, and then determines from the pool the trajectory that is most likely to be the current competitive ball and tracks it. The current competitive ball is the only target ball that is being competed for in the current field. In ball games, there is 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 trajectories in the trajectory pool of the previous frame, an updated trajectory pool is obtained. Figure 2 Flowchart of a method for updating a ball track pool according to an embodiment of the present application. Figure 2 As shown, the steps of updating the ball trajectory pool include:
[0047] S11: Based on the target recognition algorithm, identify each ball target in the current frame. The specific choice of target recognition algorithm is not limited in this application: the YOLOv8 model can be used, or CNN (convolutional neural network), ViT (Vision Transformer) and other recognition algorithms can be used. In order to achieve more accurate recognition results, a large number of annotated pictures can be used to train the algorithm model. The training of algorithms and models is a common technical means that those skilled in the art should know. It does not belong to the content that needs to be protected in this application and will not be described here. The target recognition algorithm will use the horizontal and vertical coordinates (x, y) of the center point of the target box and the width (width, abbreviated as W) and height (height abbreviated as H) of the target box to represent each identified target; the ball trajectory can be a queue as a data structure, wherein 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 of the ball trajectory pools. Specifically, the following matching methods may be used:
[0049] Matching method 1: For each trajectory in the ball trajectory pool, find the closest function in the plane rectangular coordinate system; obtain each ball target identified in S11 in turn as the ball target to be matched, and determine whether its coordinates fall on the function image of one of the trajectories; if they fall on the function image, the match is successful; otherwise, the match fails.
[0050] Matching Method 2: Sequentially obtain each ball target identified in S11 as a target to be matched, and calculate the area difference and distance difference between the target to be matched and the last real ball in each trajectory. Among all the last real balls whose area difference is less than a second threshold, select the trajectory containing the last real ball with the smallest distance difference as the trajectory that successfully matches the target to be matched. The real ball refers to the ball actually identified by the target recognition algorithm when updating the ball trajectory pool.
[0051] The second matching method achieves precise matching through dual judgment of position and area. Since the position of the ball target will not change significantly in just one or a few frames, and the size of the ball target in the picture will not change significantly, the area of the target can be used as a preliminary screening to eliminate interfering balls before position matching.
[0052] Specifically, the area difference is compared by comparing the target frame area of the ball target to be matched with the target frame area of the real ball to be matched, that is, the product of the target frame width and height, to determine whether the ratio of the two target frames exceeds a second threshold. The second threshold for the area difference is variable depending on the analysis frame rate. According to experimental results, at an analysis frame rate of 20 frames, it is more reasonable to set the second threshold for the area difference between 0.5 and 2. That is, when the target frame area of the ball target to be matched is less than twice the target frame area of the real ball to be matched, or greater than half the target frame area of the real ball to be matched, the area difference is considered to be within a reasonable range. The distance difference can be calculated by the Euclidean distance between the center point (x, y) of the target frame of the ball target to be matched and the target frame of the real ball to be matched.
[0053] The working process of the second matching method is to first eliminate interference items with area differences greater than the threshold, then sort the remaining objects to be matched by distance, and then consider that the target ball to be matched with the smallest distance from the real ball to be matched should belong to the trajectory of the real ball to be matched, that is, the match is successful.
[0054] Obviously, when the trajectory pool is in the initialized state or is empty, each matching in S12 fails, and thus a new trajectory is created according to the position of each ball target.
[0055] S13: If the matching is successful, the target ball is added to the matching trajectory.
[0056] In a possible implementation, at most one successfully matched target ball is added to each trajectory; the successfully matched and updated trajectory will not participate in the subsequent target ball matching process.
[0057] S14: If the matching fails, a new trajectory is created.
[0058] When the ball target matching fails, it means that there is no suitable trajectory around the ball target in the current frame. At this time, the ball target is considered to be a new ball appearing in the real-time shooting picture, so a new trajectory queue is established for it.
[0059] Figure 3 FIG. 1 shows a flow chart of another method for updating the ball track pool according to an embodiment of the present application. In order to more conveniently represent the length of the track, Figure 2 After the steps of the method shown are completed, that is, after all matching is completed, you can also:
[0060] S15: If there are any trajectories in the ball trajectory pool that do not match the ball target, an empty ball is inserted after each of the trajectories that do not match the ball target. Inserting an empty ball after a trajectory means inserting an empty element at the end of the trajectory queue. The empty element can be represented by null.
[0061] In addition, in order to reduce the amount of calculation, an upper limit of the trajectory length can be set, that is, the third threshold. When the trajectory length has reached the third threshold:
[0062] S16: When updating the trajectory, delete the earliest ball in the trajectory.
[0063] Based on experimental results, a trajectory containing the ball's position within 1.5 to 2 seconds is the most reasonable, balancing both computational performance and accuracy. The third threshold for the maximum trajectory length is variable depending on the analysis frame rate. For example, if the analysis frame rate is 20 frames per second, the third threshold should be set to 30-40.
[0064] S2: Filtering out trajectories whose number of real balls exceeds a first threshold from the ball trajectory pool to obtain a valid ball trajectory pool.
[0065] If a trajectory contains too few real balls, the confidence level of that trajectory is low, indicating a high likelihood of off-field interference. Therefore, a first threshold is set to exclude trajectories with too few real balls from the ball trajectory pool. Specifically, the first threshold is variable, depending on the length of the trajectory, and is typically set to 1 / 3-1 / 2 the length of the current trajectory.
[0066] S3: Selecting the trajectory with the largest total displacement from the valid ball trajectory pool as the competition ball trajectory.
[0067] The total displacement is the distance between the first and last balls in a trajectory, or the distance between the center coordinates of the first and last elements in the trajectory. In ball game footage, the displacement of the competitive ball is the most frequent, so the trajectory with the largest total displacement is considered the competitive ball trajectory.
[0068] S4: predicting a path of the competition ball based on the trajectory of the competition ball, so as to track and shoot the competition ball in advance.
[0069] Figure 4 FIG. 1 is a flow chart of a method for predicting a path of a competitive ball according to an embodiment of the present application. Figure 4 As shown:
[0070] S41: Matching the closest function model based on the geometric shape of the trajectory of the competitive ball.
[0071] To track and film the ball in advance, it is necessary to predict the ball's future path based on its trajectory. 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 ball's future path can be approximately predicted by extending it along a straight line. In another possible implementation, for scenarios with extremely high precision requirements, since the ball's trajectory is mainly a parabola, a polynomial fit can be performed on the actual ball's position in the trajectory to obtain the function corresponding to the trajectory. The specific calculation method is a conventional plane geometry problem and will not be elaborated here. It can be implemented through simple plane geometry calculations or directly using existing tools such as the Numpy.polyfit function.
[0072] S42: Calculating the movement trend of the competitive ball based on the coordinates of each ball target in the competitive ball trajectory and the function model.
[0073] Specifically, the ball's motion trend includes its predicted direction and speed. When predicting the ball's future path along a straight line, the predicted direction coincides with the extension of the straight line. When predicting the ball's future path along a parabola, the predicted direction coincides with the position of the tangent of the parabola at the ball's final target location.
[0074] The direction angle is the angle between the vector and the positive direction of the x-axis, and its value ranges from 0 to π. The speed of the ball can be determined by calculating the average speed of the last several real balls.
[0075] Since tracking capture only focuses on the x-axis offset, the positive or negative value of the y-axis motion direction vector is not considered. Instead, the x-axis component M of the velocity vector is used directly: M = v × cosα. Here, v is the predicted velocity, and α is the predicted angle of motion. It's important to note that the velocity here is not the actual velocity in the scene, but rather the velocity measured in pixels and frames. For example, if the ball moves 100 pixels in 10 frames, the velocity v = 10 pixels / frame.
[0076] When M is positive, the ball is moving toward the positive x-axis (rightward in the conventional coordinate system). When M is negative, the ball is moving toward the negative x-axis (leftward in the conventional coordinate system). |M| represents the speed of the ball's horizontal motion.
[0077] S43: Determine the movement trend of the shooting angle of view based on the movement trend of the competition ball.
[0078] If |M| is less than the fourth threshold, it indicates that the ball will not exceed the tracking range horizontally in the foreseeable future, and therefore there is no need to adjust the shooting angle. If |M| is greater than the fourth threshold, it indicates that the ball is likely to exceed the tracking range horizontally in the foreseeable future, and the shooting angle needs to be adjusted in the corresponding direction based on the positive or negative value of M. Specifically, the fourth threshold is related to the pixel length and frame rate of the real-time capture image and can be calculated using the following formula: Fourth Threshold = WI × D / dpi, where WI is the pixel length of the real-time capture image. For example, if the image is 1080*720, WI is 1080; D is a preset ratio for controlling the gimbal rotation accuracy. That is, when the ball's movement length in 1 second is predicted to exceed D (the screen length), the shooting angle needs to be adjusted. It can usually be set to 1 / 5-1 / 6; dpi is the frame rate of the real-time capture image.
[0079] Preferably, when selecting the ball tracks with the number of real balls exceeding the threshold from the ball track pool, the method further includes S21: if there is no track with the number of real balls exceeding the first threshold in the ball track pool, then a fixed shot is taken of the last real ball in the last competitive ball track, such as Figure 5 shown.
[0080] If there is no trajectory in the ball trajectory pool with a number of real balls exceeding the first threshold, i.e., no competitive ball trajectory can be found in the real-time captured image of the current frame, then the video frames in the historical record are traced back step by step until the last video frame in which the competitive ball trajectory is successfully found, i.e., the last competitive ball trajectory.
[0081] In some types of games, the ball may be stationary for a short period of time, such as a corner kick, free kick, penalty kick, etc. in football. This embodiment is to better achieve the tracking effect in the stationary ball scenario.
[0082] Figure 6 FIG is a block diagram of an automatic tracking shooting device 400 according to an embodiment of the present application. Figure 6 As 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 aforementioned automatic shooting and 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 one possible implementation, the shooting module 401 is implemented as an independent smart terminal or camera, the analysis module 402 is implemented as another independent smart terminal or smart hardware, and the rotation module 403 is implemented as a pan-tilt head or a rotatable bracket. In another possible implementation, the shooting module 401 is implemented as a camera module in a smart terminal, the analysis module 402 is implemented as a computing module in the same smart terminal, and the rotation module 403 is implemented as an intelligent pan-tilt head or a 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, and 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 by physical means are within the protection scope of this application. The shooting module 401 is suitable for continuously acquiring real-time shooting pictures and sending the real-time shooting pictures to the analysis module 402. Optionally, the shooting module 401 may not have the active information sending function, but the analysis module 402 actively acquires the real-time shooting pictures from the shooting module 401. The analysis module 402 is suitable for executing the embodiments of this application based on the real-time shooting pictures. Figure 1 or Figure 2 The tracking center position is calculated and determined in real time using a method, and a rotation instruction is sent to the rotation module 403 based on the determination criteria. The rotation module 403 is configured to rotate horizontally, i.e., about a vertical axis (z-axis). The rotation module 403 is configured to change the angle of the camera module 401 based on the rotation instruction.
[0085] Figure 7 A schematic diagram of the structure of a terminal device or server suitable for implementing an embodiment of the present application is shown.
[0086] like Figure 7 As shown, the terminal device or server includes a central processing unit (CPU) 501, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 502 or the program loaded from the storage part 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 via a bus 504. An 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, and the like; an output section 507 including devices such as a cathode ray tube (CRT), a liquid crystal display (LCD), and a speaker; a storage section 508 including a hard disk; and a communication section 509 including a network interface card such as a LAN card or a modem. 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 needed. A removable medium 511, such as a magnetic disk, an optical disk, a magneto-optical disk, or a semiconductor memory, is installed in the drive 510 as needed, so that computer programs read therefrom can be installed into the storage section 508 as needed.
[0088] In particular, 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, which includes a computer program carried on a machine-readable medium, and the computer program includes program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network via the communication part 509, and / or installed from the removable medium 511. When the computer program is executed by the central processing unit (CPU) 501, the above-mentioned functions defined in the system of the present application are executed.
[0089] It should be noted that the computer-readable medium described in this application can be a computer-readable signal medium or 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, device, or component, or any combination of the above. More specific examples of computer-readable storage media 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 that can be used by or in conjunction with an instruction execution system, device, or device. In this application, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. This propagated data signal can take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device. Program code embodied on a computer-readable medium may be transmitted using any suitable medium, including but not limited to wireless, wireline, optical fiber cable, RF, or any suitable combination thereof.
[0090] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions and operations of the systems, methods and computer program products according to various embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, program segment or part of the code, and the aforementioned module, program segment or part of the code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart and the combination of boxes in the block diagram and / or flowchart can be implemented using a dedicated hardware-based system that performs the specified function or operation, or can be implemented using a combination of dedicated hardware and computer instructions.
[0091] The units or modules described in the embodiments of the present application may be implemented in software or hardware. The units or modules described may also be provided in a processor. The names of these units or modules do not, in certain circumstances, limit the units or modules themselves.
[0092] As another aspect, the present application further provides a computer-readable storage medium, which may be included in the electronic device described in the above embodiments, or may exist independently and not be incorporated into the electronic device. The computer-readable storage medium stores one or more programs, which, when used by one or more processors, execute the methods described in the present application.
[0093] The above description is merely a preferred embodiment of the present application and an illustration of the technical principles employed. Those skilled in the art should understand that the scope of application involved in this application is not limited to the technical solutions formed by a specific combination of the above-mentioned technical features, but should also cover other technical solutions formed by any combination of the above-mentioned technical features or their equivalents without departing from the aforementioned application concept. For example, a technical solution formed by replacing the above-mentioned features with (but not limited to) technical features with similar functions applied for in this application.
Claims
1. A tracking shooting method for ball sports, characterized in that: include: Based on the current frame of the real-time shooting picture, updating the ball trajectory pool, wherein each trajectory in the ball trajectory pool is represented by a queue, and the queue includes empty elements and non-empty elements; Screening out trajectories whose number of real balls exceeds a first threshold from the ball trajectory pool to obtain a valid ball trajectory pool, wherein the real balls are represented as non-empty elements in the trajectory queue; Selecting the trajectory with the largest total displacement from the valid ball trajectory pool as the competitive ball trajectory, wherein the total displacement is the distance between the center point coordinates of the first and last elements in the trajectory queue; Predicting the movement trend of the shooting angle of view based on the trajectory of the competitive ball, so as to track and shoot the only competitive ball among the multiple balls in the shooting picture in advance; The updating of the ball trajectory pool based on the current frame of the real-time shooting picture includes: Based on a target recognition algorithm, identifying each ball target in the current frame; Matching each of the ball targets with each trajectory in the ball trajectory pool; If the match is successful, the ball target is added to the track of the successful match; If the matching fails, a new trajectory is created; After the matching is completed, if there are trajectories in the ball trajectory pool that are not matched to the ball target, an empty ball is inserted after each trajectory that is not matched to the ball target.
2. The method according to claim 1, wherein Matching each of the ball targets with each trajectory in the ball trajectory pool includes: Calculate the gap between the ball target to be matched and the last real ball in each trajectory, wherein the gap includes the area gap and the distance gap; Among all the last real balls whose area differences are smaller than a second threshold, the trajectory of the last real ball with the smallest distance difference is selected as the trajectory that successfully matches the ball target to be matched.
3. The method according to claim 1, wherein If the length of the trajectory reaches a third threshold, the earliest ball in the trajectory is deleted each time the trajectory is updated.
4. The method according to any one of claims 1 to 3, characterized in that The predicting of the motion trend of the shooting angle of view based on the trajectory of the competitive ball includes: Matching the closest functional model based on the geometry of the trajectory of the competitive ball; Calculating a movement trend of the competitive ball based on the coordinates of each ball target in the competitive ball trajectory and the function model; The movement trend of the shooting angle of view is determined based on the movement trend of the competition ball.
5. The method according to claim 1, wherein The step of screening out trajectories with a number of real balls exceeding a first threshold from the ball trajectory pool includes: If there is no trajectory in the ball trajectory pool in which the number of real balls exceeds the first threshold, a fixed shot is taken of the last real ball in the last competitive ball trajectory.
6. An automatic tracking shooting device, characterized in that: The invention comprises a shooting module, an analysis module and a rotation module, wherein the shooting module is physically connected to the rotation module, the rotation module is suitable for horizontal rotation, the shooting module is suitable for continuously acquiring real-time shooting images and sending the real-time shooting images to the analysis module; the analysis module is suitable for executing the method according to any one of claims 1 to 5 to predict the path of a competitive ball, generating a rotation instruction according to the path, and sending the rotation instruction to the rotation module; the rotation module is suitable for changing the angle of the shooting module according to the rotation instruction.
7. An electronic device comprising a memory and a processor, wherein a computer program is stored in the memory, wherein: When the processor executes the computer program, the method according to any one of claims 1 to 5 is 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 method according to any one of claims 1 to 5 is implemented.
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