Gimbal control methods and electronic equipment for ball-shooting video.

By utilizing the head orientation categories and their quantity relationships among the participating players in the match video frames, combined with search enable flags and generation management, the gimbal accurately locates and resumes tracking the ball after it disappears, solving the problem of finding the ball in existing technologies.

CN123123726APending Publication Date: 2026-11-17MALANSHAN AUDIO & VIDEO LABORATORY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611484427.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-22
Publication Date
2026-11-17

AI Technical Summary

Technical Problem

Existing gimbal-based ball-finding control methods struggle to accurately and actively locate and restore tracking of the ball after it disappears from the frame. Furthermore, relying on complex personnel analysis or expanding the field of view increases the difficulty of recognition and computational load.

Method used

The search direction is determined by the direction category and quantity relationship of the head frames of the participating players in the current game video frame, and the pan-tilt unit is controlled to rotate or hold at a preset fixed search angular velocity. At the same time, the switching between normal tracking and ball-finding states is managed by the search enable flag and search generation.

Benefits of technology

Without relying on complex personnel analysis or expanding the field of view, the gimbal can accurately and actively locate the ball used in the game and resume tracking in a timely manner after the ball is recovered, reducing unnecessary calculations and camera movements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123123726A_ABST
    Figure CN123123726A_ABST
Patent Text Reader

Abstract

This application proposes a gimbal-based ball-finding control method and electronic device for filming ball games, relating to the field of gimbal control technology. The method includes: acquiring the current game video frame and detecting the ball in each control cycle to obtain candidate ball positions and detection confidence; when the search enable flag is invalid, if the detection confidence meets preset tracking requirements, controlling the gimbal movement according to the candidate ball position; otherwise, enabling the search flag and updating the search generation; when the search enable flag is valid, if the detection confidence meets the recovery condition, invalidating the search flag, updating the search generation, and controlling the gimbal movement according to the candidate ball position; otherwise, detecting and classifying the heads and directions of participating players in the current game video frame to obtain player head frames and direction categories, determining the ball-finding instruction based on the number of player head frames in each direction category, and controlling the gimbal to rotate or remain stationary accordingly. This scheme enables the gimbal to actively search for the ball in a relatively accurate direction with low computational load.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of gimbal control technology, and more specifically, to a gimbal ball-finding control method and electronic equipment for shooting ball games. Background Technology

[0002] In television broadcasts or automated filming of ball games, pan-tilt-zoom (PTZ) cameras need to be continuously aimed at the ball to ensure viewers can always clearly see its movement. These devices typically acquire video frames from a game image capture unit, and the PTZ adjusts its shooting direction based on the ball's position in the frame—a process known as PTZ ball-finding control.

[0003] One existing gimbal-based ball-finding control method expands the acquisition field of view according to a preset field-of-view expansion rule when no ball target is detected, thus detecting the ball within a larger search area. However, expanding the field of view reduces the spatial resolution per unit pixel. The ball in a distant scene appears smaller after the field of view is expanded, which actually increases the difficulty of re-identification.

[0004] To address this, some solutions do not expand the field of view for acquisition. Instead, they control the pan-tilt unit (PTZ) based on the ball's position when the ball is detected. If the ball is obstructed, quickly goes out of frame, or cannot be detected due to motion blur, the PTG remains in place and pushes outward according to the historical movement direction, or scans left and right in a fixed sequence. However, both keeping the position in place and pushing out the historical movement direction lack active searching capabilities, and the ball may not be captured for a long time if it has already left the current area. The direction of the fixed-sequence scanning is unrelated to the actual direction of the ball, and it may rotate in the wrong direction first, prolonging the time it takes for the ball to re-enter the frame. Introducing complex personnel analysis to avoid directional misjudgment would increase the computational load and the difficulty of engineering deployment.

[0005] Therefore, how to enable the gimbal to actively search for the ball with relatively accurate direction after the ball disappears from the frame, without relying on complex personnel analysis and expanding the field of view, has become an urgent technical problem to be solved. Summary of the Invention

[0006] The purpose of this application is to provide a gimbal control method and electronic device for shooting ball games, which can enable the gimbal to actively search for the ball in a relatively accurate direction without relying on complex personnel analysis and expanding the field of view.

[0007] This application is implemented as follows: In a first aspect, this application provides a gimbal control method for finding the ball during a ball game, comprising the following steps: in each control cycle, acquiring the current game video frame and detecting the ball to obtain the candidate ball position and detection confidence; when the search enable flag is invalid, if the detection confidence meets the preset tracking requirements, controlling the gimbal action according to the candidate ball position; otherwise, enabling the search flag and updating the search generation; when the search enable flag is valid, determining whether the detection confidence meets the recovery conditions, and obtaining the determination result; if the determination result is yes, invalidating the search enable flag and updating the search generation to control the gimbal action according to the candidate ball position; if the determination result is no, performing head detection and direction classification on the current game video frame to obtain the player head frame and the direction category of the player head frame, wherein the direction category is one of left, center, or right; determining the ball finding instruction for the current game video frame based on the number relationship of player head frames in each direction category, and controlling the gimbal to rotate or hold according to the ball finding instruction, wherein the ball finding instruction carries the search direction and a preset fixed search angular velocity.

[0008] In some implementations, if the judgment result is yes, the search enable flag is set to invalid and the search generation is updated to control the gimbal movement according to the ball candidate position. This includes: if the detection confidence reaches the recovery condition, the search enable flag is set to invalid and the current search generation is updated within the current control period, causing the ball-finding instructions that have not yet been executed or are delayed in the previous search generation to become invalid, and the ball-finding instructions of the invalid search generation to be rejected; the match ball corresponding to the ball candidate position is set as the tracking target, and a normal tracking instruction is generated according to the ball candidate position; within the current control period, the currently executing ball-finding instruction is canceled or replaced with the normal tracking instruction, and the gimbal movement is controlled according to the normal tracking instruction; wherein, if the detection confidence reaches the recovery condition and it is determined from the relationship between the number of head frames of participating players in each direction category that the ball-finding instruction occurred in the same control period, the steps of setting the search enable flag to invalid, updating the current search generation, rejecting the ball-finding instructions of the invalid search generation, canceling or replacing the currently executing ball-finding instructions, and controlling the gimbal movement according to the ball candidate position are executed first.

[0009] In some implementations, when a recovery event (where the detection confidence level reaches the recovery condition) and a determination result of a ball-finding instruction occur simultaneously within the same control cycle, the recovery event has higher priority than the determination result of the ball-finding instruction.

[0010] In some implementations, the current match video frame is used for player head detection and orientation classification. This includes: inputting the current match video frame into an integrated object detection model, which outputs the player head bounding box, the orientation category of the player head bounding box, and the head and classification detection confidence; or, inputting the current match video frame into a head detection model, which outputs the player head bounding box and head detection confidence, and then inputting the head image within the player head bounding box into an orientation classification model, which outputs the orientation category of the player head bounding box and the classification confidence.

[0011] In some implementations, the head frame of a participating player is a head frame that simultaneously meets the following conditions: the detection and classification results indicate that it belongs to one of the left, center, and right directions, and the confidence information corresponding to the head frame meets the preset threshold condition; the detection and classification results are the results obtained when detecting and classifying the head of the participating player; the head frame is retained after deduplication; and when a preset effective playing area corresponding to the current view is configured, the center of the head frame is located within the preset effective playing area.

[0012] In some implementations, the step of determining the ball-finding instruction for the current match video frame based on the number of head frames of participating players in each direction category includes: counting the number of head frames of participating players in each direction category to obtain the left-hand number of head frames of participating players in the left-hand direction category, the center-hand number of head frames of participating players in the center-hand direction category, and the right-hand number of head frames of participating players in the right-hand direction category; determining the search direction as left when the total number of head frames of participating players reaches a preset minimum number and the left-hand number is greater than both the center-hand and right-hand numbers; determining the search direction as right when the total number of head frames of participating players reaches a preset minimum number and the right-hand number is greater than both the left-hand and center-hand numbers; and determining the search direction as "stay" when any of the following conditions are met: the center-hand number is greater than both the left-hand and right-hand numbers, there is a tie among the highest numbers of left-hand, right-hand, and center-hand numbers, or the total number of head frames of participating players is less than a preset minimum number.

[0013] In some implementations, the preset fixed search angular velocity is pre-selected based on the minimum horizontal field of view of the gimbal under permissible operating conditions, the maximum time interval between two adjacent ball detections, and the preset minimum horizontal field of view overlap rate, and satisfies the following: oh s × T b ≤ F h × (1 r min );in, oh sTo fix the absolute value of the search angular velocity, T b For the maximum time interval, F h For the minimum horizontal field of view, r min The minimum horizontal field of view overlap is preset; and the absolute value of the fixed search angular velocity remains constant during the same ball search process.

[0014] In some implementations, the ball-finding command also carries the search generation bound when the command is generated and the image frame number of the current match video frame on which the command is based. The PTZ maintains the current search generation, which is the generation identifier of the currently active search process. The steps of controlling the PTZ to rotate or hold according to the ball-finding command include: maintaining the maximum executed image frame number within the current search generation, which is updated each time the PTZ is controlled to execute a ball-finding command and monotonically increases within the same search generation; if the search generation carried by the ball-finding command is the current search generation and the image frame number carried by the command is newer than the maximum executed image frame number of the current search generation, the PTZ is controlled to execute the ball-finding command, and the maximum executed image frame number of the current search generation is updated to the image frame number carried by the executed command; if the search generation carried by the command is not the current search generation, or the image frame number carried by the command is not newer than the maximum executed image frame number of the current search generation, the ball-finding command is discarded.

[0015] In some implementations, the gimbal control method for finding the ball during the game also includes: if the preset maximum search angle or preset search timeout is reached during the period when the search enable flag is valid, the gimbal is controlled to stop rotating and maintain the current position.

[0016] In a second aspect, this application provides an electronic device including a memory for storing one or more programs; a processor; and, when the one or more programs are executed by the processor, implementing the method as described in any one of the first aspects above.

[0017] Compared with the prior art, this application has at least the following advantages or beneficial effects: This application proposes a gimbal control method for finding the ball during a ball game. After the ball disappears from the frame, the method determines the search direction by using the directional categories and quantity relationships of the head frames of the participating players in the current video frame. The gimbal is then controlled to rotate or remain stationary using a preset fixed search angular velocity. Simultaneously, a search enable flag and search generation are used to manage the switching between normal tracking and ball-finding states. This allows the gimbal to actively search for the ball with relatively accurate direction without relying on complex personnel analysis or expanding the field of view. Once the ball is recovered, tracking based on the candidate ball position is resumed promptly. Attached Figure Description

[0018] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0019] Figure 1 This is a flowchart illustrating an embodiment of a gimbal-based ball-finding control method for filming a ball game, as described in this application. Figure 2 This is a structural block diagram of a gimbal-based ball-finding control system for filming a ball game, as described in one embodiment of this application. Figure 3 This is a schematic diagram of the main process of finding the ball triggered by the disappearance of the ball in one embodiment of this application; Figure 4 This is a schematic diagram of the arrangement of a gimbal camera device at the edge of a football field in one embodiment of this application; Figure 5 This is a structural block diagram of an electronic device provided in an embodiment of this application.

[0020] Icons: 201, Processor; 202, Memory; 203, Communication Interface. Detailed Implementation

[0021] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. It should be understood that this application is not limited to the exemplary embodiments described herein.

[0022] In this document, relational terms such as first and second are used only to distinguish one entity or operation from another entity or operation, without necessarily requiring or implying any such actual relationship or order between these entities or operations.

[0023] In existing gimbal-based ball-finding control methods, a common approach is to expand the acquisition field of view according to a preset field-of-view expansion rule when no ball target is detected, in order to detect the ball within a larger search area. In other words, this approach attempts to compensate for "not being able to find the ball" by "seeing more." However, this reduces the spatial resolution per pixel because expanding the field of view makes the ball in distant scenes appear smaller after the field of view is expanded, thus increasing the difficulty of re-identification.

[0024] To address this, some solutions do not expand the acquisition field of view. Instead, they control the gimbal based on the ball's position when the ball is detected. When the ball is obstructed, quickly goes out of frame, or cannot be detected due to motion blur, the gimbal remains in place and pushes outward according to the historical movement direction, or scans left and right in a fixed sequence. While this avoids the increased difficulty of re-identification compared to expanding the acquisition field of view, it is prone to directional misjudgments. To avoid directional misjudgments, complex human analysis is required, which also increases the computational load and engineering deployment complexity.

[0025] In the process of realizing this application, the inventors further analyzed and found that the reason why these existing technologies are caught in a dilemma between "expanding the field of view" and "not expanding the field of view" is that they always limit the basis for finding the ball to the ball itself or the preset scanning order, without effectively utilizing other information that already exists in the current game video frame and can indicate the general direction of the ball.

[0026] Based on the above analysis, this application provides a gimbal control method for finding the ball during game filming. When the ball is visible, it tracks the ball normally according to its position. After the ball disappears from the frame, it uses directional clues from the heads of participating players in the current video frame to determine the direction the gimbal should rotate based on the majority orientation of multiple players' heads, and controls the gimbal to rotate or remain stationary at a preset fixed search angular velocity. Simultaneously, a search enable flag and search generation manage the switching between normal tracking and ball-finding states, ensuring that tracking returns to the ball's position promptly after the ball is recovered. Therefore, this application can actively search for the ball with relatively accurate direction after it disappears from the frame, without relying on complex personnel analysis or expanding the field of view.

[0027] After introducing the basic principles of this application, various non-limiting embodiments of this application will be described in detail below with reference to the accompanying drawings. Unless otherwise specified, the various embodiments and features described below can be combined with each other.

[0028] Please see Figure 1 The gimbal control method for finding the ball during the filming of this game includes the following steps: Step S101: In each control cycle, acquire the current match video frame and detect the match ball to obtain the ball candidate position and detection confidence.

[0029] It should be noted that the method in this application is executed continuously in control cycles. At the start of each control cycle, the current match video frame is first acquired; this frame represents the most recently captured match footage within that cycle. Then, ball detection is performed on the current match video frame to identify targets that may belong to the match ball. The detection results are output in two forms: ball candidate position and detection confidence. The ball candidate position represents the location of the detected candidate target (which may be the match ball) within the current match video frame; this position can be its coordinates, region, or bounding box. The detection confidence represents the degree of certainty that the candidate target is indeed the match ball; a higher confidence indicates a greater likelihood that the candidate target is indeed the match ball. If no ball candidate is detected (including no ball candidate position is obtained, or the obtained ball candidate position has a low detection confidence), it is determined that the preset tracking requirements or recovery conditions are not met, and the ball candidate position is not used to control the pan-tilt unit. For example, the ball used in this application can be any ball that needs to be continuously tracked by a gimbal during the filming of ball games, such as a football, basketball, volleyball, table tennis, badminton, or tennis ball.

[0030] Step S101 is executed in every control cycle. Therefore, whether during normal tracking of the ball candidate position or during the ball search, the ball candidate position and detection confidence are continuously updated. Subsequent steps can obtain the latest ball candidate position and detection confidence in each control cycle, instead of using old data from previous control cycles. That is, by continuously acquiring the ball candidate position and detection confidence in each control cycle, the system can detect the ball as soon as it reappears in the current match video frame. This provides a basis for step S103 to determine whether the detection confidence has met the recovery conditions, preventing the gimbal from continuing to perform the ball search action after the ball has been recovered.

[0031] Please continue reading. Figure 1 Step S102: When the search enable flag is invalid, if the detection confidence meets the preset tracking requirements, the gimbal action is controlled according to the ball candidate position; otherwise, the search enable flag is set to valid and the search generation is updated.

[0032] An invalid search enable flag indicates that the current tracking is in normal mode based on the candidate ball position, meaning the gimbal control is based on the position of the ball in the current video frame. In step S102, when the search enable flag is invalid, the method further checks the detection confidence obtained in step S101. If the detection confidence meets the preset tracking requirements, it means the ball in the current video frame can be reliably tracked. The gimbal is then controlled based on the candidate ball position to continue aiming at the ball, and the search enable flag remains invalid, continuing the normal tracking state. If the detection confidence does not meet the preset tracking requirements, it means the ball cannot be reliably tracked in the current video frame, for example, if the ball is obscured, quickly goes out of frame, or cannot be reliably detected due to motion blur. In this case, the search enable flag is set to valid, and the search generation is updated. Updating the search generation means that this ball-finding process is assigned a new generation identifier, which is used to distinguish it from previous ball-finding processes and also to carry the search generation in the subsequent ball-finding command generated in step S105. Detection confidence is a numerical value given for the obtained candidate ball positions when detecting the ball in a game, indicating the reliability of those candidate positions. Detection confidence meeting the preset tracking requirements means that the detection confidence reaches a pre-set threshold sufficient to determine that the candidate ball position can be reliably tracked; detection confidence not meeting the preset tracking requirements means that the detection confidence does not reach that threshold, which may include not obtaining a candidate ball position or obtaining a candidate ball position with a detection confidence level that is too low.

[0033] It should be noted that step S102, by setting the search enable flag to active, only indicates that the method of this application has transitioned from the normal tracking state to the ball-finding state. This setting action occurs within the current control cycle. Only when the next control cycle arrives will the system, based on step S103 (assuming the search enable flag is active), determine whether the detection confidence level meets the recovery conditions, and proceed to steps S104 and S105 accordingly. In other words, after step S102 completes the setting within the current control cycle, steps S103 to S105 are not executed in the current cycle; the ball-finding related judgments and gimbal ball-finding control begin from the next control cycle.

[0034] In other words, step S102 uses "detection confidence not meeting preset tracking requirements" as the trigger condition for entering the ball-finding state. This ensures that the gimbal only switches to ball-finding mode when the game ball cannot be reliably tracked, avoiding accidental entry into ball-finding mode and unnecessary gimbal rotation when the game ball can still be tracked. Simultaneously, the setting of the search enable flag and the updating of the search generation provide the prerequisite for step S103 in the next control cycle to perform a judgment when the search enable flag is valid, and for the ball-finding command generated in step S105 to carry the search generation.

[0035] Please continue reading. Figure 1Step S103: When the search enable flag is valid, determine whether the detection confidence level meets the recovery condition and obtain the judgment result.

[0036] Step S103 is executed when the search enable flag is valid, meaning the current state is ball-finding. This means the gimbal is not tracking the candidate ball position normally, but rather searching for the match ball. At this point, based on the detection confidence obtained in step S101, it is determined whether the detection confidence meets the recovery condition, resulting in a judgment. This judgment is a binary result: recovery condition met, or recovery condition not met. Meeting the recovery condition means the match ball has reappeared in the current match video frame, and its detection confidence is high enough to be used as a tracking target again; not meeting the recovery condition means the match ball has not yet reappeared, or although it has appeared, its detection confidence is insufficient to be used as a tracking target again. In the ball-finding state, step S103 takes precedence over player head detection and direction classification. That is, after entering the ball-finding state in each control cycle, it first determines whether the match ball has been recovered, and then decides whether player head detection and direction classification are necessary.

[0037] In other words, once the detection confidence level meets the recovery condition, the method of this application no longer needs to perform the player head detection and direction classification in step S105, but directly proceeds to step S104 to exit the ball search and resume normal tracking. This allows the ball search to stop promptly once the ball has been recovered, reducing unnecessary calculations and gimbal rotation. Simultaneously, step S103 re-evaluates whether the detection confidence level meets the recovery condition in each control cycle. Therefore, once the ball is recovered, it can be detected within the current control cycle, without waiting for the ball search to be completed, thus improving the timeliness of resuming normal tracking.

[0038] Please continue reading. Figure 1 Step S104: If the judgment result is yes, then the search enable flag is set to invalid and the search generation is updated to control the gimbal action according to the ball candidate position.

[0039] Step S104 is executed when the judgment result obtained in step S103 is yes, that is, the detection confidence has reached the recovery condition and the match ball has reappeared. At this time, the search enable flag is set to invalid, indicating that the ball-finding state is exited; and the search generation is updated so that the ball-finding instructions in the previous search generation no longer correspond to the current search generation; the PTZ control terminal refuses to execute the ball-finding instructions of the invalid search generation; then, a normal tracking instruction is generated according to the ball candidate position obtained in step S101, the currently executing ball-finding instruction is canceled or replaced with the normal tracking instruction, and the PTZ action is controlled according to the normal tracking instruction so that the PTZ resumes tracking according to the position of the match ball in the current match video frame. In other words, step S104 completes the following processing within the current control cycle of confirming recovery: exiting the ball-finding state, invalidating the old ball-finding instructions of this ball-finding process, canceling or replacing the currently executing ball-finding instructions, and resuming normal tracking according to the ball candidate position.

[0040] In other words, step S104 invalidates the search enable flag and updates the search generation, causing the method of this application to definitively exit the ball-finding state. This also invalidates any ball-finding instructions that have not yet been executed or are delayed in arriving within the previous search generation because the search generation no longer corresponds to them, preventing the gimbal from continuing to execute old ball-finding instructions after the game ball has been restored. Simultaneously, the gimbal's movement is controlled according to the ball candidate position, ensuring that the gimbal promptly returns to normal tracking based on the ball candidate position after the game ball is restored.

[0041] Please continue reading. Figure 1 Step S105: If the judgment result is negative, perform head detection and direction classification of the participating players in the current match video frame to obtain the head frame of the participating players and the direction category of the head frame of the participating players. The direction category is one of left, center or right. According to the number relationship of the head frames of the participating players in each direction category, determine the ball-finding command for the current match video frame, and control the pan-tilt unit to rotate or hold according to the ball-finding command. The ball-finding command carries the search direction and the preset fixed search angular velocity.

[0042] Step S105 is executed when the judgment result obtained in step S103 is negative, that is, no ball candidate is detected, or the detection confidence of the ball candidate does not reach the recovery condition. At this time, step S105 is executed in the following three steps.

[0043] The first step is player head detection and orientation classification. The current match video frame is used to detect and classify player heads, resulting in player head bounding boxes and their orientation categories. The orientation category is either left-handed, center-handed, or right-handed. The player head bounding box represents the area in the current match video frame that is detected as a player's head; the orientation category represents the horizontal direction of the player's head corresponding to that bounding box: left-handed indicates the horizontal direction points to the left side of the screen, center-handed indicates no obvious left or right component, and right-handed indicates the horizontal direction points to the right side of the screen. Since there is only one of the three orientation categories (left-handed, center-handed, or right-handed), each player head bounding box corresponds to a specific orientation category.

[0044] The second step is to determine the ball-finding command for the current match video frame based on the number of head frames of participating players in each direction category. The number of head frames for each direction category is counted to obtain the number of head frames for left-facing, center-facing, and right-facing players. This count reflects the orientation of most players' heads in the current match video frame, thus indicating the approximate direction of the ball: a relatively higher number of left-facing head frames suggests the ball is likely on the left side of the frame; a relatively higher number of right-facing head frames suggests it's likely on the right side; and a relatively higher number of center-facing head frames suggests it's likely still in the center of the frame. Based on this, the ball-finding command is determined. This command carries the search direction and a preset fixed search angular velocity. The search direction indicates the direction the gimbal should rotate or remain stationary, and the preset fixed search angular velocity indicates the rotation speed the gimbal should use when rotation is required.

[0045] The third step is to control the gimbal to rotate or remain stationary according to the ball-finding command. If the search direction indicates left, the gimbal will rotate to the left at a preset fixed search angular velocity; if the search direction indicates right, the gimbal will rotate to the right at a preset fixed search angular velocity; if the search direction indicates remain stationary, the gimbal will remain stationary.

[0046] In other words, step S105 no longer relies on expanding the acquisition field of view, nor on the historical movement direction of the match ball or fixed-sequence scanning. Instead, it uses the direction category and quantity relationship of the player's head frame in the current match video frame as the basis for determining the search direction. Since the direction category of the player's head frame reflects the player's orientation, and the player's orientation is usually related to the approximate direction of the match ball, this step can provide the gimbal with a relatively accurate search direction after the match ball disappears from the screen, using the existing directional clues in the current match video frame. Furthermore, since step S105 is based on the direction category and quantity relationship of the player's head frame, rather than relying on facial details or fine angle calculations, even if the player's head is small in a distant shot, direction classification and quantity statistics can still be completed, avoiding the computational burden and engineering deployment difficulties brought about by complex personnel analysis. In addition, the ball-finding command carries a preset fixed search angular velocity, making the gimbal's rotation amplitude controllable during ball-finding, avoiding the impact of uncertain rotation amplitude on subsequent detection. In addition, step S105 is re-executed in each control cycle when the result is negative, so the search direction can be updated in real time according to the number of head frames of participating players in the current match video frame, instead of remaining fixed after entering the ball-finding state.

[0047] In summary, this application utilizes a search enable flag and search generation management to manage both normal tracking and ball-finding states. After the ball disappears, it switches to using the head orientation category of the participating players to determine the ball-finding direction. Specifically, after the match ball disappears from the frame, this application determines the search direction using the orientation category and quantity relationship of the participating players' head frames in the current match video frame. It then controls the pan-tilt unit (PTZ) to rotate or remain stationary at a preset fixed search angular velocity. Simultaneously, it switches between the normal tracking and ball-finding states using the search enable flag and search generation management. This allows the PTG to actively search for the match ball with relatively accurate direction without relying on complex personnel analysis or expanding the field of view. Furthermore, it promptly resumes tracking by ball candidate position after the match ball reappears.

[0048] Based on the aforementioned scheme, in some implementations of this application, if the judgment result is yes, the step of setting the search enable flag to invalid and updating the search generation to control the gimbal action according to the ball candidate position includes: when the detection confidence reaches the recovery condition, setting the search enable flag to invalid and updating the current search generation within the current control cycle, invalidating the ball-finding instructions that have not yet been executed or are delayed in arriving within the search generation before the update, and refusing to execute the ball-finding instructions of the invalid search generation; setting the match ball corresponding to the ball candidate position as the tracking target, generating a normal tracking instruction according to the ball candidate position, and canceling the currently executing ball-finding instruction or using the ball-finding instruction within the current control cycle. The normal tracking command replaces the ball-finding command, and the gimbal movement is controlled according to the normal tracking command. Specifically, if the detection confidence reaches the recovery condition and it is determined from the relationship between the number of head frames of participating players in each direction category that the ball-finding command occurred in the same control cycle, priority is given to executing the following actions: invalidating the search enable flag, updating the current search generation, rejecting the execution of the ball-finding command in the invalid search generation, canceling or replacing the currently executing ball-finding command, and controlling the gimbal movement according to the candidate ball position. In other words, even if the ball-finding command has been calculated according to the head direction within the same control cycle, the gimbal will no longer be controlled by that ball-finding command, but by the normal tracking command after the ball is recovered.

[0049] Understandably, this implementation responds to the event that the detection confidence of the ball candidate position reaches the recovery condition. Within the current control cycle that confirms recovery, it completes the following: clearing the search enable flag, updating the current search generation, rejecting the execution of the failed search generation instruction, generating the normal tracking instruction, and canceling or replacing the currently executing ball-finding instruction. When the ball recovery and the ball-finding instruction are determined to occur in the same control cycle, the recovery processing is given priority, thereby definitively pulling the PTZ back from the ball-finding state to the normal tracking state based on the ball candidate position.

[0050] In this way, once the ball is restored, the gimbal can promptly exit the ball-finding state and return to the ball-selection position for normal tracking. Ball-finding commands that were not yet executed or were delayed in the previous search cycle will not continue to be executed due to asynchronous delays, and currently executing ball-finding commands will be canceled or replaced, preventing the gimbal from mistakenly turning in the old ball-finding direction after the ball has been restored. Simultaneously, since the ball restoration and ball-finding command determination occur within the same control cycle, the restoration process takes priority. Therefore, there will be no situation where the ball has been restored but the gimbal continues to turn according to the ball-finding command within the same control cycle, ensuring that the gimbal's movement after the ball reappears is consistent with the actual position of the ball.

[0051] Based on the aforementioned scheme, in some implementations of this application, when a recovery event with a detection confidence level reaching the recovery condition and the determination result of a ball-finding instruction occur simultaneously within the same control cycle, the priority of the recovery event is higher than that of the determination result of the ball-finding instruction.

[0052] It should be noted that this implementation method is designed for situations where the recovery event and the ball-finding command result overlap when they arrive at the PTZ control terminal under asynchronous implementation. By prioritizing the recovery event over the ball-finding command result, the recovery event will be used as the determining factor when the two overlap.

[0053] Specifically, the event that the detection confidence level has reached the recovery condition is determined in the ball detection stage based on the current game video frame; while the determination of the ball-finding command is determined in the head detection stage based on the current game video frame. In an asynchronous implementation, these two stages may process the same frame or adjacent frames in parallel. When the ball detection stage has determined that the detection confidence level has reached the recovery condition and should exit the ball-finding stage and resume normal tracking, the head detection stage may still be processing the same frame or an earlier frame and subsequently output the ball-finding command. At this point, from the control flow perspective, the recovery event has already occurred, and the determination of the ball-finding command has subsequently arrived at the PTZ control end. Both may exist simultaneously at the control end before the PTZ actually executes the action, resulting in a conflict that requires priority determination. This implementation method is designed to handle this situation accordingly.

[0054] Based on the aforementioned scheme, in some implementations of this application, the detection and orientation classification of the participating players' heads on the current match video frame includes: inputting the current match video frame into an integrated object detection model, which outputs the participating player's head bounding box, the orientation category of the participating player's head bounding box, and the head and classification detection confidence; or, inputting the current match video frame into a head detection model, which outputs the participating player's head bounding box and head detection confidence, and then inputting the head image within the participating player's head bounding box into an orientation classification model, which outputs the orientation category of the participating player's head bounding box and classification confidence.

[0055] Understandably, this implementation provides two alternative paths for detecting player heads and classifying orientations in the current match video frame. The integrated object detection model (e.g., using the YOLO object detection network) involves fewer processing steps, making it suitable for scenarios with limited computing power or high processing speed requirements. The cascaded head detection and orientation classification model separates head bounding box localization and orientation category determination, facilitating individual adjustments and optimizations. Neither method relies on facial details and can obtain player head bounding boxes and orientation categories even from distant match footage, thus providing a basis for determining ball-finding instructions based on the quantity relationship of player head bounding boxes for each orientation category.

[0056] It should be noted that the integrated object detection model in this implementation refers to a detection model that can simultaneously complete object localization and object classification in a single processing step, such as the YOLO (You Only Look Once) series of models. The head detection model refers to a detection model used to locate objects in an image and output the bounding box and its detection confidence score, such as the YOLO (You Only Look Once) series of models. The orientation classification model refers to a classification model used to determine the category of an input image region, such as the ResNet (Residual Network) series of models.

[0057] Based on the aforementioned scheme, in some implementations of this application, the head frame of the participating player is a head frame that simultaneously satisfies the following conditions: the detection and classification results indicate that it belongs to one of the left, center, and right directions, and the confidence information corresponding to the head frame satisfies the preset threshold condition; the detection and classification results are the results obtained when performing head detection and direction classification of the participating player; it is retained after head frame deduplication; and when a preset effective competition area corresponding to the current view is configured, the center of the head frame is located within the preset effective competition area.

[0058] Understandably, this implementation method uses a triple screening process—category and confidence information conditions, headbox deduplication conditions, and preset valid match area conditions—to determine the headboxes of participating players from the headboxes obtained during the head detection and direction classification of participating players, thus ensuring that the headboxes participating in subsequent quantity statistics have a clear source and valid range.

[0059] Specifically, by using category and confidence information conditions, head frames with unclear or insufficient confidence in their direction category can be filtered out. Here, the confidence information corresponding to the head frame meets the preset threshold condition, which means that the detection confidence data and / or classification confidence data corresponding to the head frame reach a preset threshold sufficient to determine that the head frame belongs to the head of a participating player and that its direction category is reliable. The confidence information data is only used to filter out unreliable head frame candidates and does not participate in the vote weighting. The head frame deduplication condition can prevent the same head from being counted repeatedly. The preset effective match area condition can exclude head frames whose center is located outside the preset effective match area (for example, head frames located in the stands, substitute seats, etc. can be excluded), so that the participating player head frames participating in the subsequent count can better reflect the actual head orientation of the participating players in the current match video frame, providing a more reliable basis for determining the ball-finding instructions based on the number of participating player head frames of each direction category.

[0060] Based on the aforementioned scheme, in some implementations of this application, the step of determining the ball-finding instruction for the current match video frame according to the relationship between the number of head frames of participating players in each direction category includes: counting the number of head frames of participating players in each direction category to obtain the left-hand number of head frames of participating players in the left-hand direction category, the center-hand number of head frames of participating players in the center-hand direction category, and the right-hand number of head frames of participating players in the right-hand direction category; when the total number of head frames of participating players reaches a preset minimum number, and the left-hand number is greater than both the center-hand and right-hand numbers, the search direction is determined to be left; when the total number of head frames of participating players reaches a preset minimum number, and the right-hand number is greater than both the left-hand and center-hand numbers, the search direction is determined to be right; in any of the following cases, the search direction is determined to be kept: the center-hand number is greater than both the left-hand and right-hand numbers, there is a tie among the highest numbers of the left-hand, right-hand, and center-hand numbers, or the total number of head frames of participating players is less than a preset minimum number.

[0061] Understandably, this implementation method calculates the number of left-hand, center-hand, and right-hand items and compares their relative sizes one by one. It then determines the search direction as left, right, or hold according to the single majority rule. This transforms the quantity relationship of the head frames of participating players in each direction category into a ball-finding instruction for the current game video frame, giving the gimbal a clear decision on whether to rotate or hold after the ball disappears from the screen.

[0062] In other words, this implementation only rotates in a given direction when the total number of player head frames reaches a preset minimum, and the number of player head frames in the left- or right-facing categories is strictly greater than the other two categories. Here, "the total number of player head frames reaching the preset minimum" means that the total number of player head frames included in the counting process is not less than the preset minimum. This is to avoid making rotation decisions based on unreliable numerical relationships when the number of player head frames is too small. Remaining stationary when the direction is unclear or the total number of player head frames is insufficient reduces the possibility of rotating in the wrong direction due to misjudgment. This allows the gimbal to actively search for the ball in a more accurate direction after it disappears from the frame, avoiding unnecessary camera movement and preventing rotation decisions based on unreliable numerical relationships when the number of player head frames is too small.

[0063] Based on the aforementioned scheme, in some implementations of this application, the preset fixed search angular velocity is pre-selected according to the minimum horizontal field of view of the game image acquisition device under the allowed working conditions, the maximum time interval between two adjacent ball detection judgments, and the preset minimum horizontal field of view overlap rate, and satisfies: oh s × T b ≤ F h × (1 r min );in, oh s To fix the absolute value of the search angular velocity, T b For the maximum time interval, F h For the minimum horizontal field of view, r min The minimum horizontal field of view overlap is preset; and the absolute value of the fixed search angular velocity remains constant during the same ball search process.

[0064] It should be noted that the so-called minimum horizontal field of view angle refers to the minimum horizontal field of view range that the image acquisition device can capture under the allowed working conditions, the maximum time interval refers to the maximum possible time interval between two adjacent ball detection judgments, and the preset minimum horizontal field of view overlap rate refers to the minimum allowable overlap ratio of the corresponding images of two adjacent ball detection judgments in the horizontal angular domain.

[0065] This implementation pre-constrains a fixed search angular velocity by using three factors: the minimum horizontal field of view, the maximum time interval between two adjacent ball detections, and a preset minimum horizontal field of view overlap rate. This ensures that the gimbal rotates at a fixed speed during the ball search process, and that the images from two adjacent ball detections maintain a preset overlap. Therefore, even after the ball disappears from the frame, the implementation can actively search for the ball while continuously covering the area where it might appear. In other words, these two constraints reduce the possibility of the ball passing through detection gaps due to excessive rotation angles, allowing the gimbal to actively search for the ball in a relatively smooth and continuous manner after it disappears from the frame.

[0066] Based on the aforementioned scheme, in some implementations of this application, the ball-finding instruction also carries the search generation bound when the ball-finding instruction is generated (usually corresponding to the creation of the header processing task for generating the ball-finding instruction) and the image frame number of the current match video frame on which the ball-finding instruction is based; the PTZ maintains the current search generation, which is the generation identifier of the search process that is currently in an active state. The steps for controlling the pan-tilt unit to rotate or hold according to the ball-finding command include: maintaining the maximum executed image frame number within the current search generation, which is updated each time the pan-tilt unit executes the ball-finding command and monotonically increases within the same search generation; if the search generation carried by the ball-finding command is the current search generation and the image frame number carried by the ball-finding command is newer than the maximum executed image frame number of the current search generation, controlling the pan-tilt unit to execute the ball-finding command and updating the maximum executed image frame number of the current search generation to the image frame number carried by the executed ball-finding command; if the search generation carried by the ball-finding command is not the current search generation, or the image frame number carried by the ball-finding command is not newer than the maximum executed image frame number of the current search generation, discarding the ball-finding command.

[0067] It should be noted that in this implementation, the detection of player heads and orientation classification for the current match video frame can be performed as a single head processing task. Each head processing task is bound to its respective search generation during processing, and generates a ball-finding instruction based on the number of player head bounding boxes for each orientation category. Therefore, the search generation carried by the ball-finding instruction is the same search generation bound to the head processing task that generated it. When the search generation is updated, the ball-finding instruction generated by the head processing task bound to the old search generation will have a different search generation than the current one, thus failing the pre-execution check.

[0068] Understandably, this implementation aims to ensure accurate control of the gimbal's rotation or hold, even when image acquisition, ball detection, head detection, and gimbal execution may occur asynchronously. Specifically, this implementation ensures that ball-finding commands are executed only if both the search generation and image frame number are updated. If a newer frame command has already been executed, ball-finding commands from earlier images, even if delayed due to asynchronous processing, will be discarded because their frame number is not newer than the largest executed image frame number. Similarly, ball-finding commands from different search processes, even if delayed, will be discarded because their search generation is not the current search generation, preventing the gimbal from continuing to rotate incorrectly or for old directions to overwrite new ones.

[0069] Based on the aforementioned scheme, in some implementations of this application, the gimbal control method for finding the ball during the game shooting also includes: during the period when the search enable flag is valid, if the preset maximum search angle or the preset search timeout period is reached, the gimbal is controlled to stop rotating and maintain the current position.

[0070] In this implementation, while the search enable flag is active, i.e., during the ball-finding state, the gimbal rotates or remains stationary according to the ball-finding command. If the preset maximum search angle is reached, meaning the gimbal has rotated a cumulative angle since entering the ball-finding state to the preset upper limit, the gimbal is controlled to stop rotating and maintain its current position. If the preset search timeout period is reached, meaning the duration since entering the ball-finding state has reached the preset time limit, the gimbal is controlled to stop rotating and maintain its current position. The earlier either condition is met triggers the stop-rotation and position-maintaining mechanism, thus preventing the gimbal from continuously rotating when the ball has not appeared for an extended period.

[0071] In this way, when the ball for the game does not reappear for a long time, the gimbal will not keep rotating due to the continuous execution of the ball-finding command. Instead, it will stay in the current position and wait for manual operation or other system processing. This can reduce unnecessary lens movement and mechanical wear, and also prevent the gimbal from rotating in a direction that is beyond the shooting needs.

[0072] To enable those skilled in the art to more intuitively understand this application, a specific example will be provided below. This example is an exemplary demonstration combining the overall technical paradigm of this application with some optional implementation details. It should be noted that the following demonstration is intended to aid understanding and does not constitute an exhaustive list of all embodiments of this application, nor does it imply that this application must include all the details described below in its specific implementation.

[0073] This example first provides a gimbal-based ball-finding control system for filming ball games. This system is built upon the gimbal-based ball-finding control method for filming ball games provided in this application. Among other things, such as... Figure 2 As shown, the system includes a match image acquisition module, a ball detection and tracking module, a search state control module, a search parameter configuration module, a participating player head detection and direction classification module, a participating player head count module, a majority direction determination module, a ball-finding instruction generation module, an instruction validity verification module, a PTZ control module, and a PTZ drive module.

[0074] Among them, the ball detection and tracking module continuously processes the current game video frame during normal tracking and when most of the players' heads are facing the ball; the search state control module maintains the search enable flag and search generation; the search parameter configuration module selects a fixed search angular velocity based on the minimum horizontal field of view, the maximum time interval of ball detection, and the minimum horizontal field of view overlap rate; and the command validity verification module verifies the search generation and image frame sequence number before the gimbal actually applies the ball-finding command.

[0075] The module functions and relationships of each module in the gimbal-based ball-finding control system used for filming this game are as follows: The game image acquisition module provides the same current game video frame to the ball detection and tracking module and the player head detection and orientation classification module (i.e., Figure 2 The current match image (frame) in F The ball detection and tracking module remains operational throughout the control process, outputting the candidate ball position, detection confidence level, and normal tracking instructions derived from the candidate ball position.

[0076] The search state control module maintains the binary search enable flag. E search and search generation G cur The initial search enable flag is invalid. E search =0); when the ball detection result does not meet the tracking requirements and a new ball search begins, the search generation is updated. G cur And set the search enable flag to be active. E search =1); when the search enable flag is valid ( E search =1) and when the detection confidence reaches the recovery condition, first set the search enable flag to invalid ( E search =0) and update the search generation again. Search enable flag is active ( E search When =1), enable player head detection and direction classification, player head frame count statistics, and majority direction determination, or adopt the output of the corresponding branch; the search enable flag is invalid ( E search When =0), the ball-finding command generated by the player's head direction is not used as a gimbal control input. Therefore, the loss of the game ball is a setting event to enter a new search generation, and the reappearance of the game ball is a reset and invalidation event to exit the current search generation. They are not two parallel and simultaneously effective control states.

[0077] The search parameter configuration module obtains the minimum horizontal field of view under the allowed working conditions. F h The maximum time interval for adjacent ball detection and judgment T b and minimum horizontal field of view overlap rate r min And pre-select the satisfaction oh s × T b ≤ Fh × (1 - r min The fixed search angular velocity oh s This constraint is only applied to selecting a fixed search angular velocity and does not incorporate the number of headshots of participating players or confidence information into the velocity calculation.

[0078] The ball-finding instruction generation module recalculates the majority of directions based on the new image in each control cycle and outputs the result. C =( G cmd , F cmd , D ),in G cmd For the search generation, F cmd Image frame number, D The search direction is specified. The instruction validity verification module stores the current search generation and the maximum image frame number executed in this generation; only the search enable flag is valid. E search =1) Search generation in the ball-finding command G cmd Equal to the current search generation and the image frame number in the ball-finding command ( F cmd The ball-finding command is only allowed to enter the PTZ control module if the frame number is greater than the maximum image frame number executed in this generation. Therefore, ball-finding commands from older frames caused by network latency or out-of-order inference will not overwrite newer current ball-finding commands.

[0079] The PTZ control module searches for the enable flag ( E search Select control command source: Search enable flag is valid ( E search =1) No ball recovery event occurred and the ball-finding command passed the search generation. G cmd and image frame number F cmd During verification, fixed low-speed left turn, fixed low-speed right turn, or hold commands corresponding to most directions are used; when a ball recovery event occurs, the search generation is updated first. G cur It invalidates the ball-finding commands within the old search generation. Within the current control cycle after confirmation of recovery, it either cancels the currently executing ball-finding command or replaces it with the normal tracking command corresponding to the current ball candidate position, and then controls the gimbal movement according to the normal tracking command. The ball recovery event has higher priority than the majority head direction commands of the participating players generated in the same control cycle.

[0080] Further, please refer to Figure 3 The main process of the gimbal-based ball-finding control system for shooting a ball game in this example is as follows: Figure 3 As shown. Among them, Figure 3 The search enable flag in the file is invalid. E search =0) indicates normal ball tracking, and the search enable flag is valid. E search =1) indicates that most of the players' heads are facing towards the ball. Each ball-finding control cycle acquires a new image frame number. F The current match video frame is selected, and ball recovery is prioritized. Only if the match ball has not yet met the recovery conditions will the player head detection, orientation classification, quantity statistics, and left, right, or hold mapping be re-executed. If the match ball has not been recovered, a search generation carrying the head processing task bound at the time of task creation is generated. G cur and image frame number F The current ball-finding instruction is executed, and the map is retrieved again and the judgment is repeated in the next control cycle; when the match ball is restored, the search enable flag is set to invalid first. E search =0) and update the search generation. G cur This invalidates pending or delayed ball-finding commands from the previous search iteration before restoration, and the PTZ control refuses to execute them. Simultaneously, it cancels or replaces the currently executing ball-finding command within the current control cycle, and then controls the PTZ movement again using normal tracking commands. The highest number of tied votes, insufficient head frames for valid participating players, no head frames for valid participating players, and the highest number of mid-range votes all enter the hold branch.

[0081] For details, please continue reading. Figure 3 The specific implementation details of the gimbal-based ball-finding control system for this example of ball game filming include: 1. Head training data and three-directional category labeling of participating players Training data is preferably derived from match camera footage that is the same as or similar to the actual installation location, to cover different framing ranges, common focal lengths, shooting heights, match attire, lighting, and player scales.

[0082] Only mark the heads of players currently participating in the match and whose horizontal orientation can be determined with a rectangle that covers their entire head, and assign one of the following orientation categories to this rectangle: (1) player_head_left: The horizontal orientation component of the player's head points to the left side of the image.

[0083] (2) player_head_center: The overall direction of the player's head is not clearly defined to the left or right, and is approximately neutral.

[0084] (3) player_head_right: The horizontal orientation component of the player's head points to the right side of the image.

[0085] The labeling is based on the overall appearance of the player's head, not facial features or specific organs. The heads of referees, coaches, substitutes not on the field, staff, and spectators are not considered positive samples of player heads and are instead used as background, difficult negative samples, or separate non-voting categories in training. If the model misidentifies any of these non-players, the misidentified sample can be re-injected as a difficult negative sample for further training. Samples where it is impossible to reliably determine if the player belongs to a player, where the direction cannot be reliably determined, where the head is severely obscured, or where only a very small portion of the head is visible are not considered valid positive samples. The detection and orientation classification of participating players' heads can be implemented using any of the following methods: The first is a unified object detection method, where the same model directly outputs the bounding boxes of the participating players' heads, orientation categories, and corresponding detection confidence scores. YOLO (You Only Look Once, a single-stage object detection network) is preferred, with player_head_left, player_head_center, and player_head_right directly set as the target categories. The second is a cascaded detection and classification method, where the head detection model first outputs the bounding boxes of the participating players' heads, and then the orientation classification model outputs the left, center, or right orientation categories and classification confidence scores for the head images within each player's bounding box. In the cascaded method, the head detection confidence score and the orientation classification confidence score can each reach a preset threshold. i d and i c Both methods ultimately form a candidate set containing the head frames of participating players, orientation categories, and corresponding confidence information. Neither method requires identifying player names, numbers, or facial identities, nor does it require creating cross-screen identities for the same player.

[0086] 2. Acquisition of the head-up frame by currently active players The search enable flag is active. E search When =1), the system reads the current match video frame and the participating player head detection and orientation classification module outputs a candidate set. Each candidate contains at least the participating player's head bounding box, left-direction, center-direction, or right-direction category, and corresponding confidence information. For integrated models such as YOLO, the confidence information can be the detection confidence score of a single inference output; for cascaded models, the confidence information can include head detection confidence and orientation classification confidence.

[0087] The system determines whether a candidate belongs to the head of a participating player based on the detection and classification results. It can also set a preset valid playing area corresponding to the current view to help exclude stands, benches, advertising screens, and off-field areas. A candidate is recorded as a valid participating player head frame if it meets the following conditions: (1) The detection and classification results show that the candidate belongs to one of player_head_left, player_head_center or player_head_right, and the corresponding confidence information meets the preset threshold condition; (2) They are retained after duplicate candidate box suppression or other equivalent deduplication processes; (3) When configuring the preset effective playing area, the center of the head frame of the participating player is located within the area.

[0088] Even if the head of a referee, coach, non-playing substitute, staff member, or spectator appears in the frame, it will not be counted unless it is detected and classified as one of the three types of participating player heads mentioned above. Confidence information is only used to determine whether a participating player's head frame is valid and does not affect the vote count. Each valid participating player's head frame, regardless of its size or confidence level, is counted as only one vote. To further enhance the exclusion capability, the participating player's body frame or competition attire category can be used for in-frame spatial filtering, but this filtering still does not identify the specific player's identity.

[0089] 3. Counting left, center, and right numbers and determining the majority. In a single ball-finding judgment, the number of currently valid player_head_left, player_head_center, and player_head_right head frames of the participating players are recorded as follows: N L , N C and N R Each valid player's headshot is counted only once, without being weighted repeatedly based on headshot size or confidence level.

[0090] Among them, if the total number of valid participating players' head rims reaches the preset minimum number, and the current technical relationship is: N L At the same time greater than N C and N R The judgment result is: look for the ball to the left; if the total number of valid participating players' head frames reaches the preset minimum number, and the current technical relationship is: N R At the same time greater than N L and NC The judgment result is: look for the ball to the right; if the current technical relationship is: N C At the same time greater than N L and N R If the current technical relationship is: the highest number of tied votes, the result is: remain unchanged; if the current technical relationship is: the number of valid participating players in the head frame is insufficient or zero, the result is: remain unchanged.

[0091] The majority here is a unique majority, meaning that the number of one category must be strictly greater than the other two categories. A minimum number of valid player heads can be set. N min The total number of head frames for currently active players is less than [number missing]. N min It does not output left or right rotation commands at times.

[0092] 4. Fixed search speed for field-of-view overlap constraints The correspondence between the search direction and the PTZ control remains fixed: when searching for the ball to the left, a preset low-speed left turn command is output; when searching for the ball to the right, a preset low-speed right turn command is output; and when holding the position, zero horizontal speed is output. In actual equipment, it is only necessary to ensure that the configuration relationship between the left side of the image corresponding to the PTZ turning left and the right side of the image corresponding to the PTZ turning right is consistent.

[0093] The minimum horizontal field of view of the game image acquisition device under the allowed ball-finding working condition is denoted as . F h The maximum time interval between two consecutive ball detections during the ball-finding period is denoted as . T b The preset minimum horizontal overlap rate of the adjacent sphere detection field of view is denoted as... r min , where 0≤ r min <1, the absolute value of the fixed search angular velocity is denoted as oh s The fixed search angular velocity is pre-selected according to the following formula: oh s × T b ≤ F h × (1 - r min ) Under the horizontal angular domain approximation, the gimbal rotates at most [number] times between two consecutive ball detection judgments. oh s × T bTherefore, the horizontal field of view overlap angle corresponding to the two detections is not less than 1. F h oh s × T b The overlap rate is not less than r min This constraint is designed to reduce the possibility of angular gaps caused by excessively large gimbal scanning steps. It does not ignore the movement of the game ball itself between two detections, nor does it absolutely guarantee that the game ball can be detected under all circumstances.

[0094] F h The minimum horizontal field of view of the image acquisition device within the allowed search focal length can be selected. This applies when the product maintains a constant zoom state during the same ball-finding process. F h Alternatively, you can take the current horizontal field of view when entering the ball-finding state. T b The maximum adjacent judgment interval that can be guaranteed after acquisition, transmission, ball detection, and control scheduling should be used, rather than the average interval; if it exceeds... T b Abnormal delays can result in the direct invalidation of the corresponding expired instructions. r min The allowed search coverage continuity is preset.

[0095] The oh s Selected during equipment deployment or before entering a ball-finding state, and remains unchanged during the same ball-finding process. The relationship between the number of head frames for participating players only determines whether the speed symbol is zero: when the total number of valid head frames reaches the preset minimum, the left-hand maximum number is the only one that is maximum. oh s The maximum number of right-hand items is + oh s The remaining cases remain unchanged at 0. The vote difference, the confidence information for the top candidates among the participating players, and the majority percentage all remain unchanged. oh s The absolute value of the value indicates that the constraint is still a fixed speed control, rather than a real-time speed change based on the number of players' head-on shots.

[0096] 5. Reassessment, ball recovery, and invalidation of old commands are performed every cycle. The search enable flag is set to active. E search After =1), the system does not continue to use the majority of directions obtained the first time when the ball was lost, but instead uses the control period. k Reprocess the current match video frames per unitI k At the start of each control cycle, the ball detection and tracking module first determines... I k If the candidate ball meets the recovery criteria, the head detection and orientation classification module of the participating players will then check whether the ball meets the recovery criteria; if not, the ball will be re-evaluated. I k Re-detect, filter, and count to generate current search directions. D k Therefore, when the overall orientation of the participating players changes from left to center or right, the next effective control cycle can be switched accordingly to maintain or turn right, without waiting for the preset scan to end.

[0097] To handle the asynchronous latency of image reasoning, task queuing, and instruction transmission, the search generation is updated each time the search state is entered or exited. G cur The image acquisition end sets a monotonically increasing image frame number for the image. F The head processing task is created by binding the search generation and source image frame number, and the task results and ball-finding instructions use the bound identifiers. Each ball-finding instruction is represented as follows: C =( G cmd , F cmd , D The PTZ control terminal saves the current search generation. G cur And the maximum image frame number of the generation that has executed the ball-finding command. F last The ball-finding command will only be executed if the following conditions are met simultaneously: E search =1, and G cmd = G cur ,and F cmd > F last Once a ball-finding command passes verification and is executed by the control terminal... F last Update the image frame number to the one specified in the "Find Ball" command. F cmd In this way, older frame ball-finding instructions that arrive late within the same search generation will not overwrite newer direction results; when re-entering the ball-finding state after exiting, any late ball-finding instructions from the previous search will not be valid again because the search generation has changed. G and F A monotonically increasing integer with a sufficient bit width can be used without relying on absolute clock synchronization of multiple devices.

[0098] When the detection confidence of the ball candidate reaches the recovery condition, it is considered that the match ball has reappeared. The search state control module first sets the search enable flag to invalid ( E search (Reset) and update search generation G cur The current ball candidate is then handed over to the normal ball tracking module. The PTZ control module therefore rejects ball-finding commands that have not yet been executed or are delayed in the old search cycle, and selects the normal tracking command generated from the ball candidate position. For fixed search angular velocity commands already applied to the PTZ, the control unit stops the search velocity or replaces it with a normal ball tracking command upon receiving a recovery event.

[0099] The "stop search" here refers to canceling the fixed low-speed or hold command generated by the majority orientation of the player's head; it does not mean the gimbal must maintain a constant zero speed. If the normal ball tracking module has already generated a new normal tracking command based on the candidate ball position within the same control cycle, the gimbal control module can immediately select that normal tracking command. The ball recovery event takes precedence over the majority orientation result of the player's head within the same control cycle; even if the player's head detection result for that control cycle returns later, it carries the old search generation. G cmd It also cannot pass the pre-execution verification.

[0100] The recovery condition of this scheme is that the detection confidence of the current ball candidate reaches the recovery threshold, without requiring the ball candidate to appear in multiple consecutive frames.

[0101] 6. Default settings and optional security options The following situations are assumed to remain unchanged: a tie among the highest numbers of left-hand, center-hand, and right-hand votes; or the total number of valid participating players' head frames is less than [a certain value]. N min There are currently no valid players in the head-frame; the number of players in the center is the highest.

[0102] To prevent the gimbal from continuously rotating when the ball is not present for an extended period, a maximum search angle or search timeout can be configured. Once either of these safety conditions is met, the gimbal stops rotating and maintains its current position, awaiting manual intervention or other system processing. The maximum search angle and search timeout are not necessary steps in determining the majority orientation of a player's head, nor do they alter the basic control rules for left, right, center, and tie-breaker shots.

[0103] 7. Take a football match as an example. A football shooting system acquires current match video frames through a match image acquisition device whose shooting direction is controlled by a pan-tilt unit. For example... Figure 4As shown, this example elevates the pan-tilt camera to a position outside the sideline of a football field, near the center line, with the lens looking down at the field. When training the YOLO network, only the complete head outlines of the players currently participating in the match are labeled as player_head_left, player_head_center, and player_head_right, respectively. The heads of referees, substitutes not on the field, sideline personnel, and spectators are treated as non-voting samples.

[0104] Before the start of the match, the image acquisition device allows for the minimum horizontal field of view within the ball-finding focal length. F h Set to 12 degrees, the maximum time interval for detecting and judging adjacent balls during the ball-finding process. T b Set to 0.25 seconds, minimum horizontal field of view overlap rate r min Set it to 0.90. (By...) oh s × T b ≤ F h ×(1 r min ) can be obtained oh s The speed is no greater than 4.8 degrees per second, and the system pre-selects 2 degrees per second as a fixed search angular velocity. The gimbal rotates a maximum of 0.5 degrees between adjacent judgments, corresponding to a horizontal field-of-view overlap rate of no less than approximately 95.8%.

[0105] If the ball detection and tracking module fails to detect a ball meeting the tracking requirements in the current match video frame, the system updates the search generation and enters a lost-ball state. If the recovery conditions are still not met in the next control cycle, YOLO will update the image frame sequence number. F In the current match video frame with frame count = 1050, 7 valid player head frames are output, including 5 for player_head_left, 1 for player_head_center, and 1 for player_head_right. Since the total number of valid head frames has reached the preset minimum, and... N L =5 strictly greater than N C =1 and N R =1, the system generates a search generation that carries the header and is bound to the task creation process. G cur and F After receiving a fixed-speed left turn command of 1050, the PTZ control module will rotate to the left at 2 degrees per second after verification.

[0106] Regain control in the next cycle F =1051 of the current game video frame and reassess. If the head-frame count of the participating players in the current period becomes the only one with the highest number of center-oriented players, then a hold instruction is generated to replace the left-turn instruction of the previous period. Subsequently, the ball detection and tracking module... F A soccer ball was detected in the current match video frame (frame 1052), with a ball detection confidence of 0.78. The example recovery threshold is 0.60, therefore the system first invalidates the search enable flag (resets it to zero). E search And update the search generation. G cur ,make F =1050、 F =1051 The ball-finding instructions that have not yet been executed or have been delayed in the old search generation are invalidated, and normal tracking based on the position of the football image is resumed.

[0107] In another example, the left and right counts are both 3, and the center count is 1. Since the highest count is even, the gimbal remains stationary.

[0108] The values ​​of 12 degrees, 0.25 seconds, 0.90, 2 degrees per second, and 0.60 mentioned above are only used to illustrate a set of feasible parameters and do not constitute a limitation on the scope of protection.

[0109] 8. Device and Software Implementation The method described above can be executed by a camera's built-in processor, a PTZ controller, an edge computing device, or a broadcast server. The corresponding devices include a match image acquisition unit, a ball detection and tracking unit, a search state control unit, a search parameter configuration unit, a player head detection and direction classification unit, a player head count unit, a majority direction determination unit, a ball-finding instruction generation unit, an instruction validity verification unit, a PTZ control unit, and a PTZ drive unit. The search state control unit uses the setting and clearing of the search enable flag to uniformly trigger ball loss and switch ball recovery, and maintains the search generation; the ball-finding instruction generation unit adds the search generation and image frame sequence number to the ball-finding instruction; the instruction validity verification unit completes the verification of the search enable flag, search generation, and image frame sequence number before the PTZ actually applies the ball-finding instruction.

[0110] The processor can perform the above method when executing program instructions in memory. Therefore, this solution can also be implemented as an electronic device, a pan-tilt camera device, and a computer-readable storage medium storing the corresponding program instructions.

[0111] 9. Key Technical Parameters The parameter names, symbols, functions, examples, or ranges of the technical parameters involved in this example are as follows: Parameter name: Threshold for the validity of head candidates among participating players; Symbol: i h ,or i d and i c Function: Removes low-confidence head candidates among participating players; In cascade mode, detection threshold and orientation classification threshold can be set separately; Example or range: between 0 and 1.

[0112] Parameter name: Minimum number of valid player heads; Symbol: N min Function: Players are prohibited from rotating their heads when they are not tall enough; Example or range: positive integers.

[0113] Parameter name: Fixed search angular velocity; Symbol: oh s Function: The fixed absolute value of the velocity when searching for the ball left and right; Example or range: greater than 0, and satisfying the field of view overlap constraint.

[0114] Parameter name: Minimum horizontal field of view; Symbol: F h Function: Calculates the horizontal overlap constraint of the detection field of adjacent spheres; Example or range: greater than 0; Takes the lower limit of the allowed search state.

[0115] Parameter name: Maximum time interval for ball detection; Symbol: T b Function: Limits the maximum angle between adjacent ball recovery judgments; Example or range: Greater than 0, in seconds.

[0116] Parameter name: Minimum horizontal field of view overlap rate; Symbol: r min Function: Limits the corner gaps in the adjacent ball detection screen; Example or range: between 0 and 1, and does not take 1.

[0117] Parameter name: Maximum horizontal rotation angle between adjacent ball detection judgments; Symbol: Δ i Function: Represents the maximum field-of-view center displacement between adjacent ball detection judgments; Example or range: Δ i = oh s × T b .

[0118] Parameter name: Ball recovery confidence threshold; Symbol: i b Function: Determines whether the ball reappears; Example or range: 0 to 1.

[0119] Parameter name: Search generation identifier; Symbol: GFunction: Distinguish between different ball-finding attempts and discard old instructions; Example or range: Monotonically updated integers.

[0120] Parameter name: Image frame number; Symbol: F Function: Distinguish between new and old instructions within the same search generation; Example or range: Monotonically increasing integers.

[0121] Parameter name: Maximum search angle; Nature: Optional parameter; Function: Limits the search range in a single operation; Example or range: Set according to the current framing range and mechanical range.

[0122] Parameter name: Search timeout; Nature: Optional parameter; Function: Limits the duration of a single search; Example or range: Set according to event requirements.

[0123] Please see Figure 5 This application provides an electronic device, which includes at least one processor 201 and at least one memory 202. The processor 201 and the memory 202 are directly connected to each other, or communicate with each other through a communication interface 203, or are electrically connected through one or more communication buses or signal lines to realize data transmission or interaction. The memory 202 stores program instructions that can be executed by the processor 201. The processor 201 can call the program instructions to execute the program instructions to implement any of the ball-finding control methods for shooting ball games provided by the above-described various implementation methods.

[0124] The memory 202 may be, but is not limited to, random access memory (RAM), read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), etc.

[0125] The processor 201 can be an integrated circuit chip with signal processing capabilities. The processor 201 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0126] Understandable. Figure 5 The structure shown is for illustrative purposes only; the electronic device may also include components that are more advanced than those shown. Figure 5 The more or fewer components shown, or having the same Figure 5 The different configurations shown. Figure 5 The components shown can be implemented using hardware, software, or a combination thereof.

[0127] It will be apparent to those skilled in the art that this application is not limited to the details of the exemplary embodiments described above, and that this application can be implemented in other specific forms without departing from the spirit or essential characteristics of this application. Therefore, the embodiments should be considered illustrative and non-limiting in all respects, and the scope of this application is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of equivalents of the claims are intended to be included within this application. No reference numerals in the claims should be construed as limiting the scope of the claims.

Claims

1. A gimbal control method for finding the ball in ball game photography, characterized in that, Includes the following steps: In each control cycle, the current match video frame is acquired and the match ball is detected to obtain the candidate ball position and detection confidence. When the search enable flag is invalid, if the detection confidence meets the preset tracking requirements, the gimbal is controlled to move according to the candidate ball position; otherwise, the search enable flag is set to be valid and the search generation is updated. When the search enable flag is valid, determine whether the detection confidence level meets the recovery condition and obtain the judgment result; If the judgment result is yes, then the search enable flag is set to invalid and the search generation is updated, so as to control the gimbal action according to the ball candidate position; If the judgment result is negative, then the current match video frame is subjected to player head detection and direction classification to obtain the player head frame and the direction category of the player head frame. The direction category is one of left, center or right. According to the number relationship of player head frames in each direction category, the ball-finding command for the current match video frame is determined, and the gimbal is controlled to rotate or hold according to the ball-finding command. The ball-finding command carries the search direction and a preset fixed search angular velocity.

2. The gimbal-based ball-finding control method for shooting ball games according to claim 1, characterized in that, The step of setting the search enable flag to invalid and updating the search generation if the determination result is yes, in order to control the gimbal action according to the candidate ball position, includes: If the detection confidence reaches the recovery condition, the search enable flag is set to invalid and the current search generation is updated within the current control cycle, so that the ball-finding instructions that have not been executed or are delayed in the previous search generation are invalidated, and the ball-finding instructions of the invalid search generation are refused to be executed. Set the match ball corresponding to the candidate ball position as the tracking target, generate a normal tracking command based on the candidate ball position, cancel the currently executing ball-finding command or replace the ball-finding command with the normal tracking command within the current control cycle, and control the gimbal movement according to the normal tracking command. Specifically, when the detection confidence reaches the recovery condition and the ball-finding instruction is determined to occur in the same control cycle based on the relationship between the number of head frames of participating players in each direction category, the following actions are prioritized: invalidating the search enable flag, updating the current search generation, rejecting the ball-finding instruction of the invalid search generation, canceling or replacing the currently executing ball-finding instruction, and controlling the gimbal action based on the ball candidate position.

3. The gimbal-based ball-finding control method for shooting ball games according to claim 1, characterized in that, If a recovery event that reaches the recovery condition and the determination result of the ball-finding instruction occur simultaneously within the same control cycle, the priority of the recovery event is higher than that of the determination result of the ball-finding instruction.

4. The gimbal-based ball-finding control method for shooting ball games according to claim 1, characterized in that, The process of detecting and classifying the heads and orientations of participating players in the current match video frame includes: The current match video frame is input into the integrated object detection model, which outputs the head bounding box of the participating player, the orientation category of the head bounding box, and the head and classification detection confidence. Alternatively, the current match video frame can be input into a head detection model, which outputs the head bounding boxes of the participating players and the head detection confidence score. Then, the head image within the head bounding box of the participating player can be input into a direction classification model, which outputs the direction category of the head bounding box of the participating player and the classification confidence score.

5. The gimbal-based ball-finding control method for shooting ball games according to claim 1, characterized in that, The head frame of the participating player is a head frame that simultaneously meets the following conditions: The detection and classification results indicate that the head belongs to one of the left, center, and right directions, and the confidence information corresponding to the head box meets the preset threshold condition. The detection and classification results are the results obtained when detecting and classifying the head of the participating players. It was retained after deduplication of the header frame; When a preset valid competition area corresponding to the current viewfinder is configured, the center of the head frame is located within the preset valid competition area.

6. The gimbal-based ball-finding control method for shooting ball games according to claim 1, characterized in that, The step of determining the ball-finding instruction for the current match video frame based on the number of head frames of participating players in each direction category includes: Count the number of head frames of participating players in each direction category to obtain the left-hand number of head frames of participating players in the left-hand direction category, the center-hand number of head frames of participating players in the center-hand direction category, and the right-hand number of head frames of participating players in the right-hand direction category. When the total number of head frames of participating players reaches the preset minimum number, and the number of left-direction frames is greater than the number of center-direction frames and the number of right-direction frames, the search direction is determined to be to the left. When the total number of head frames of participating players reaches the preset minimum number, and the number to the right is greater than the number to the left and the number to the center at the same time, the search direction is determined to be to the right. The search direction is determined to remain unchanged if any of the following conditions are met: the number of votes in the center direction is greater than both the number of votes in the left direction and the number of votes in the right direction; the number of votes in the left direction, the number of votes in the right direction, and the number of votes in the center direction are tied; or the total number of head frames of participating players is less than a preset minimum number.

7. The gimbal-based ball-finding control method for shooting ball games according to claim 1, characterized in that, The preset fixed search angular velocity is pre-selected based on the minimum horizontal field of view of the gimbal under permissible operating conditions, the maximum time interval between two adjacent ball detections, and the preset minimum horizontal field of view overlap rate, and satisfies the following: ω s × T b ≤ Φ h × (1 ρ min ); in, ω s The absolute value of the fixed search angular velocity. T b The maximum time interval, Φ h The minimum horizontal field of view, ρ min The preset minimum horizontal field of view overlap rate; And the absolute value of the fixed search angular velocity remains constant during the same ball-finding process.

8. The gimbal-based ball-finding control method for shooting ball games according to claim 1, characterized in that, The ball-finding command also carries the search generation bound when the ball-finding command is generated and the image frame number of the current match video frame on which the ball-finding command is based; the PTZ maintains the current search generation, which is the generation identifier of the search process that is currently in an active state. The step of controlling the gimbal to rotate or hold according to the ball-finding command includes: The maximum image frame number executed is maintained within the current search generation. The maximum image frame number executed is updated each time the gimbal is controlled to execute the ball-finding command, and it monotonically increases within the same search generation. If the search generation carried by the ball-finding instruction is the current search generation, and the image frame number carried by the ball-finding instruction is newer than the maximum image frame number executed in the current search generation, the gimbal is controlled to execute the ball-finding instruction, and the maximum image frame number executed in the current search generation is updated to the image frame number carried by the executed ball-finding instruction. If the search generation carried by the ball-finding instruction is not the current search generation, or if the image frame number carried by the ball-finding instruction is not newer than the largest image frame number executed in the current search generation, the ball-finding instruction shall be discarded.

9. The gimbal-based ball-finding control method for shooting ball games according to claim 1, characterized in that, The method further includes: If the preset maximum search angle or preset search timeout is reached while the search enable flag is active, the gimbal will stop rotating and maintain its current position.

10. An electronic device, characterized in that, include: Memory, used to store one or more programs; processor; When the one or more programs are executed by the processor, the method as described in any one of claims 1-9 is implemented.