A method and device for recognizing and controlling continuous scoring of billiards
By receiving the ball-hitting signal from the cue device and the ball-scoring signal from the pocket sensor at the billiard table terminal, and performing ball-scoring event statistics within the target time window, the problem of large computational load and inaccurate recognition in the existing technology is solved. This achieves real-time and accurate ball-scoring recognition and audio-visual control, thus improving the user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHENZHEN MOTERN TECH CO LTD
- Filing Date
- 2026-05-18
- Publication Date
- 2026-07-24
AI Technical Summary
Existing technologies for shot recognition in billiards based on video image processing suffer from problems such as high computational load, high processing latency, and inaccurate identification of the shotr. In particular, in multi-user scenarios, it is difficult to achieve real-time and accurate shot statistics and acoustic-optical-electric control.
The system receives ball-hitting signals from the cue stick device via the billiard table terminal, combines them with ball-scoring signals from the pocket sensor, and performs ball-scoring event statistics within the target time window. It then generates control signals based on historical consecutive ball-scoring counts to drive the audio-visual equipment. By using ball-hitting events as the time reference, it reduces the need for analyzing continuous video frames and directly correlates ball-hitting behavior with ball-scoring results.
It significantly reduces computational complexity and system response latency, improves the accuracy of goal recognition and the reliability of recognition in multi-user scenarios, and realizes real-time response of audio-visual equipment and interactivity of billiard table terminals.
Smart Images

Figure CN122449990A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent data processing and billiard table control technology in billiards, specifically to a method and device for continuous ball shot recognition and control. Background Technology
[0002] To enhance the competitive atmosphere of billiards, audio-visual equipment is often used to provide feedback on the user's shot results, thereby enhancing the user's interactive experience.
[0003] Existing technologies mostly employ video image analysis to continuously capture images of the billiard table and perform target detection, trajectory tracking, and pocketing determination on consecutive video frames to identify the target ball's movement path and the outcome of a shot. However, this type of technology has the following problems in practical applications: First, the computational load is large and the processing chain is long because it requires processing continuous video frames and performing operations such as target recognition, trajectory calculation and path matching. This results in high processing latency, making it difficult to output the goal recognition results in a timely manner, which in turn affects the real-time response of the audio-visual equipment. Second, in billiards scenarios with multiple users, the image acquisition device is usually set above the billiard table, with the acquisition perspective mainly from a top-down view. There are situations where users are obstructed or their positions overlap. Relying solely on image data makes it difficult to accurately distinguish the specific person hitting the ball, thus affecting the accuracy of goal statistics and the audio-visual control effect based on the goal results. Summary of the Invention
[0004] In view of the aforementioned problems, the present invention is proposed to provide a method and apparatus for continuous ball shot recognition and control in billiards, which overcomes or at least partially solves the aforementioned problems, comprising: A method for recognizing and controlling continuous shots in billiards, relating to a billiards table terminal, the method comprising: The receiving device outputs a shot signal, which includes at least a shot timestamp and a target club identifier; The corresponding consecutive historical goals are determined from the historical goal database based on the target cue marker. Starting from the timestamp of the shot, and ending at the timestamp of receiving the next shot signal or a preset timeout period, a target time window and corresponding image data are determined. When a goal signal is received from any pocket sensor within the target time window, the current goal count corresponding to the shot signal is determined based on the analysis results of the image data and the number of all goal signals. The image data includes a pre-shot image sequence, a post-shot image sequence, and a pre-goal image sequence. The current consecutive goal count is determined based on the historical consecutive goal count and the current goal count. The current consecutive goal count is associated with the target stick identifier and stored in the historical goal database. The target control signal is determined in the preset control strategy based on the current consecutive goal count, and the corresponding audio-visual equipment is controlled to perform the response based on the target control signal.
[0005] Preferably, before receiving the shot signal output by the cue device, the process includes: The system establishes an association with at least one cue device, obtains the cue device's cue identifier, and sends it to a cloud server. The cloud server determines the corresponding user terminal identifier based on the cue identifier and provides the corresponding user terminal with an edit list of control strategies. The user terminal generates a target control strategy and uploads it to the cloud server in response to the user's selection or editing operation on the edit list. The cloud server sends the target control strategy to the billiard table terminal. The default control policy for local storage is updated based on the target control policy.
[0006] Preferably, determining the corresponding consecutive historical goals in the historical goal database based on the target cue marker includes: Based on the target club identifier, the most recent historical goal record before the shot timestamp is retrieved from the historical goal database. If the historical goal record is found, the number of consecutive historical goals stored in that record is obtained; if the historical goal record is not found, the number of consecutive historical goals is set to a preset initial value. The historical goal record includes at least the club identifier, the historical shot timestamp, and the number of consecutive historical goals.
[0007] Preferably, determining the current number of goals corresponding to the strike signal based on the total number of all goal signals includes: The time window before the shot is determined based on the shot timestamp, and the image sequence before the shot corresponding to the time window before the shot is obtained from the cached video stream; Feature extraction is performed on each frame of the pre-hit image sequence to determine the pixel coordinates of each ball in each frame of the pre-hit image. Based on the pixel coordinates of each ball in the image before each shot, determine whether each ball has shifted before the shot timestamp. If so, determine that the shot corresponding to the shot signal is an invalid shot, and reset the current number of shots and the current consecutive number of shots to the preset initial values.
[0008] Preferably, determining the current number of goals corresponding to the strike signal based on the total number of all goal signals further includes: The post-hit time window is determined based on the hit timestamp, and the post-hit image sequence is acquired in real time within the post-hit time window; Feature extraction is performed on the post-hit images in the post-hit image sequence to determine the pixel coordinates of the cue ball, the target ball, and the non-target ball in the post-hit images; Based on the pixel coordinates of the cue ball, the pixel coordinates of the target ball, and the pixel coordinates of the non-target ball, determine the first pixel distance between the cue ball and the target ball, and the second pixel distance between the cue ball and the non-target ball in the image after the shot. If the second pixel distance is earlier than the first pixel distance in the time sequence of the time window after the shot and satisfies the preset first closest contact distance, then determine that the target ball that the cue ball first collides with is the non-target ball, determine that the shot action corresponding to the shot signal is an invalid shot, and reset the current number of goals and the current number of consecutive goals to the preset initial value.
[0009] Preferably, the goal signal includes at least a goal timestamp, a pocket marker, and a target ball marker; determining the current goal count corresponding to the shot signal based on the total number of goal signals further includes: The time window before the goal is determined based on the goal timestamp, and the image sequence before the goal corresponding to the time window before the goal is obtained from the cached video stream; Based on the preset pocket-coordinate mapping table, the target pocket pixel coordinates corresponding to the pocket identifier in the pre-goal image sequence are determined, and each frame of the pre-goal image is cropped according to the preset area range with the target pocket pixel coordinates as the center, resulting in multiple target goal analysis screenshots arranged in time sequence. The features of the billiard table area, the target ball, and non-spherical objects in each frame of the target goal analysis screenshot are extracted sequentially along the time window before the goal is scored. The pixel coordinate range of the billiard table area and the pixel coordinates of the target ball corresponding to the target ball identifier are determined. If the target ball's pixel coordinates appear outside the range of pixel coordinates on the billiard table before overlapping with the pocket's pixel coordinates, then all goal signals are determined to be invalid goals, and the current goal count and the current consecutive goal count are reset to the preset initial values. If non-spherical object features are extracted, the pixel coordinates of the non-spherical object are determined. The third pixel distance between the pixel coordinates of the target ball and the pixel coordinates of the non-spherical object in each frame of the target goal analysis screenshot is determined sequentially along the time sequence before the goal. If the third pixel distance satisfies the second closest contact distance, all goal signals are determined to be invalid goals, and the current goal count and the current consecutive goal count are reset to the preset initial values.
[0010] Preferably, the step of determining a target control signal based on the current consecutive goal count within a preset control strategy, and controlling the corresponding audio-visual equipment to execute a response based on the target control signal, includes: The target control signal is parsed to generate corresponding device control instructions. The target control signal includes at least a lighting parameter field, an audio parameter field, and a display parameter field. Based on the equipment control commands, control the lighting equipment, audio equipment and display equipment to execute responses respectively.
[0011] A continuous shot recognition and control device for billiards, relating to a billiard table terminal, the device comprising: A receiving module is used to receive the ball-hitting signal output by the cue device, wherein the ball-hitting signal includes at least a ball-hitting timestamp and a target cue identifier; The first determination module is used to determine the corresponding number of consecutive historical goals in the historical goal database based on the target stick identifier; The second determining module is used to determine a target time window and corresponding image data, starting from the timestamp of the shot and ending at the timestamp of receiving the next shot signal or a preset timeout period. When a goal signal is received from any pocket sensor within the target time window, the current goal number corresponding to the shot signal is determined based on the analysis results of the image data and the number of all goal signals. The image data includes a pre-shot image sequence, a post-shot image sequence, and a pre-goal image sequence. The control module is used to determine the current consecutive goal count based on the historical consecutive goal count and the current goal count, associate the current consecutive goal count with the target stick identifier and store it in the historical goal database, determine the target control signal in the preset control strategy based on the current consecutive goal count, and control the corresponding audio-visual equipment to perform the response based on the target control signal.
[0012] A computer electronic device includes a processor, a memory, and a computer program stored in the memory and capable of running on the processor. When executed by the processor, the computer program implements the steps of a continuous billiards shot recognition and control method as described above.
[0013] A computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of a method for continuous ball shot recognition and control as described above.
[0014] The present invention has the following advantages: In this embodiment of the invention, addressing the problems of long processing links, high latency, and inaccurate identification of the ball striker in the prior art based on video image processing for billiards shot recognition and analysis, a method for continuous shot recognition and control in billiards is proposed. The billiard table terminal receives the shot signal from the cue device, uses the shot timestamp as a time reference, and combines it with the shot signal output from the pocket sensor. Within a target time window, shot events are statistically analyzed to establish a direct correlation between the shot action and the shot result. Simultaneously, the current consecutive shot count is determined by combining historical consecutive shot counts, and a control signal is generated based on the current consecutive shot count to drive the audio-visual equipment. Specifically: receiving the shot signal output from the cue device, the shot signal includes at least a shot timestamp and a target cue identifier; and determining the corresponding cue in the historical shot database based on the target cue identifier. The historical consecutive goal count; starting from the shot timestamp and ending at the timestamp of receiving the next shot signal or a preset timeout period, a target time window and corresponding image data are determined. When a shot signal is received from any pocket sensor within the target time window, the current goal count corresponding to the shot signal is determined based on the analysis results of the image data and the number of all shot signals. The image data includes a pre-shot image sequence, a post-shot image sequence, and a pre-goal image sequence. The current consecutive goal count is determined based on the historical consecutive goal count and the current goal count. The current consecutive goal count is associated with the target cue identifier and stored in the historical goal database. The target control signal is determined in the preset control strategy based on the current consecutive goal count, and the corresponding audio-visual equipment is controlled to perform a response based on the target control signal. Through the above scheme, the billiard table terminal adopts an event-triggered mechanism from shot to goal, reducing the need for continuous analysis of consecutive video frames, significantly reducing computational complexity, shortening processing links, and thus reducing system response latency. Using the shot signal as a time reference, the number of consecutive goals in a goal-scoring event is limited to a target time window for statistical analysis, achieving a direct correlation between shot action and goal result, and improving the accuracy of consecutive goal recognition. The player making the shot is directly identified through cue stick identification, avoiding misjudgments caused by relying solely on image recognition, and improving recognition reliability in multi-user scenarios. By updating historical consecutive goal counts in a timely manner, the current consecutive goal count is automatically analyzed, and based on the consecutive goal count control strategy, real-time response of audio-visual equipment is achieved, improving the interactivity and user experience of the billiard table terminal. Attached Figure Description
[0015] To more clearly illustrate the technical solution of the present invention, the accompanying drawings used in the description of the present invention will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0016] Figure 1 This is a flowchart of the steps of a method for continuous ball shot recognition and control according to an embodiment of the present invention; Figure 2 This is a structural block diagram of a billiards continuous shot recognition and control device according to an embodiment of the present invention; Figure 3 This is a schematic diagram of the structure of a computer electronic device provided in an embodiment of the present invention; 1. Computer electronic device; 2. External device; 3. Processing unit; 4. Bus; 5. Network adapter; 6. I / O interface; 7. Display; 8. Memory; 9. Random access memory; 10. Cache memory; 11. Storage system; 12. Program / utility; 13. Program module. Detailed Implementation
[0017] To make the objectives, features, and advantages of this invention more apparent and understandable, the invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without inventive effort are within the scope of protection of this invention.
[0018] A method for continuous shot recognition and control in billiards, relating to a billiard table terminal, including: S110, receiving the ball-hitting signal output by the cue device, the ball-hitting signal including at least a ball-hitting timestamp and a target cue identifier; S120 determines the corresponding consecutive historical goals in the historical goal database based on the target club identifier; S130: Starting from the timestamp of the shot, and ending at the timestamp of receiving the next shot signal or a preset timeout period, a target time window and corresponding image data are determined. When a goal signal is received from any pocket sensor within the target time window, the current goal count corresponding to the shot signal is determined based on the analysis results of the image data and the number of all goal signals. The image data includes a pre-shot image sequence, a post-shot image sequence, and a pre-goal image sequence. S140: Determine the current consecutive goal count based on the historical consecutive goal count and the current goal count; associate the current consecutive goal count with the target stick identifier and store it in the historical goal database; determine the target control signal in the preset control strategy based on the current consecutive goal count; and control the corresponding audio-visual equipment to perform the response based on the target control signal.
[0019] In this embodiment of the invention, to address the problems of long processing links, high latency, and inaccurate identification of the player in continuous billiard shot recognition and analysis based on video image processing, a method for continuous billiard shot recognition and control is proposed. This method receives shot signals from the cue device at the billiard table terminal, uses the shot timestamp as a time reference, and combines this with the shot signal output from the pocket sensor to statistically analyze shot events within a target time window, thereby establishing a direct correlation between shot behavior and shot result. Simultaneously, it determines the current consecutive shot count based on historical consecutive shot counts and determines a target control signal based on the current consecutive shot count to drive the audio-visual equipment. Specifically: receiving the shot signal output from the cue device, the shot signal including at least a shot timestamp and a target cue identifier; determining the target cue identifier in the historical shot database... The corresponding historical consecutive goal count; taking the shot timestamp as the starting point and the timestamp of receiving the next shot signal or the preset timeout period as the ending point, a target time window and corresponding image data are determined. When a shot signal is received from any pocket sensor within the target time window, the current goal count corresponding to the shot signal is determined based on the analysis results of the image data and the number of all shot signals; wherein, the image data includes a pre-shot image sequence, a post-shot image sequence, and a pre-goal image sequence; the current consecutive goal count is determined based on the historical consecutive goal count and the current goal count, the current consecutive goal count is associated with the target cue identifier and stored in the historical goal database, the target control signal is determined in the preset control strategy based on the current consecutive goal count, and the corresponding audio-visual equipment is controlled to perform a response based on the target control signal. Through the above scheme, the billiard table terminal adopts an event-triggered mechanism from shot to goal, reducing the need for continuous analysis of consecutive video frames, significantly reducing computational complexity, shortening processing links, and thus reducing system response latency. Using the shot signal as a time reference, the number of consecutive goals in a goal-scoring event is limited to a target time window for statistical analysis, achieving a direct correlation between shot action and goal result, and improving the accuracy of consecutive goal recognition. The player making the shot is directly identified through cue stick identification, avoiding misjudgments caused by relying solely on image recognition, and improving recognition reliability in multi-user scenarios. By updating historical consecutive goal counts in a timely manner, the current consecutive goal count is automatically analyzed, and based on the consecutive goal count control strategy, real-time response of audio-visual equipment is achieved, improving the interactivity and user experience of the billiard table terminal.
[0020] The following will further describe a method for continuous ball-scoring recognition and control in this exemplary embodiment.
[0021] In one embodiment of the present invention, the specific process of "receiving the ball-hitting signal output by the cue device, wherein the ball-hitting signal includes at least a ball-hitting timestamp and a target cue identifier" in step S110 can be further described in conjunction with the following description.
[0022] In this embodiment, each pool table is equipped with a pool table terminal to receive the ball-hitting signal from the corresponding cue device, thereby identifying the player hitting the ball and providing the necessary input data for subsequent steps. The key is to capture the ball-hitting signal and accurately identify the corresponding cue icon to ensure that the user's hitting behavior is correctly linked to the calculation of consecutive shots.
[0023] For example, the cue device generates a striking signal through a built-in sensor. This signal is triggered by the sensor when the cue tip contacts the cue ball. Specifically, the striking signal mainly includes two pieces of information: a striking timestamp and a cue identifier. The cue identifier is a unique identifier for each cue, used to distinguish the striking behavior of different users. It is understood that in billiards, typically one cue is assigned to one user, and cues are generally not shared; therefore, this invention does not address cue-sharing scenarios.
[0024] It should be noted that each golf club assembly includes the club body and sensors housed within the club body. These sensors include inertial sensors and pressure sensors. The inertial sensors, which may include accelerometers and gyroscopes, detect the club's motion state to obtain the angle and force of the shot. The pressure sensors detect the contact pressure between the club and the ball. Through the combined action of multiple sensors, the club's motion information is captured in real time, thereby generating a shot signal.
[0025] Specifically, an inertial sensor can be embedded in the rear end of the cue stick, an accelerometer monitors changes in the cue stick's acceleration, and a gyroscope records the cue stick's rotation angle. A pressure sensor can be installed on the cue tip to detect the pressure of the tip contacting the cue ball. Combining the signals from the inertial and pressure sensors, it can be determined whether a valid shot has been made, thus generating a complete shot signal including a shot timestamp and cue stick identification. In practice, each cue stick contains a built-in processing chip, electrically connected to the inertial and pressure sensors respectively, to process the collected sensor data to identify the shot action and generate a shot signal including a timestamp and cue stick identification, which is then sent to the billiard table terminal via the embedded communication module.
[0026] To avoid signal interference between cue devices on different billiard tables, a wireless connection can be established between the billiard table terminal and the cue device before the game begins. The billiard table terminal will only receive the striking signal corresponding to the associated cue identifier. Simultaneously, by filtering the cue identifiers, signals from unbound cue devices are ignored, thus achieving signal isolation. In some implementations, distance to the cue device can be determined based on communication signal strength or spatial positioning information, receiving only signals from cue devices within a preset distance range.
[0027] Furthermore, for the billiard table terminal, its communication partners include not only the cue device but also the cloud server (hereinafter referred to as "the cloud"). Once the cue device establishes a binding relationship with the billiard table terminal, the terminal sends the acquired cue identifier to the cloud. The cloud then searches for the associated user terminal based on the cue identifier (the user has pre-bound the cue identifier to the user terminal). If a corresponding user terminal is found, it indicates that the user terminal and the user indicated by the cue identifier are registered users; otherwise, it indicates an unregistered user. For unregistered users, the corresponding preset control policy is the billiard table terminal's local default control policy, which can be understood as the factory-configured default control policy and control signals.
[0028] To extend the control strategy to a user-customizable and dynamically updated mode, meeting the differentiated needs of different registered users for interactive effects (such as light rhythm, sound effect type, reward mechanism, etc.), before receiving the shot signal output by the cue device, the process includes: establishing an association with at least one cue device, obtaining the cue device's cue identifier and sending it to a cloud server. The cloud server is used to determine the corresponding user terminal identifier based on the cue identifier and provide the corresponding user terminal with an editable list of control strategies. The user terminal is used to generate a target control strategy and upload it to the cloud server in response to the user's selection or editing operation on the editable list. The cloud server is used to send the target control strategy to the billiard table terminal. The billiard table terminal updates its locally stored default control strategy based on the target control strategy.
[0029] It should be noted that in this embodiment, the preset control strategy mentioned in step S140 is the aforementioned target control strategy, which corresponds to a registered user. For example, both user A and user B are registered users. Exemplarily, each registered user is matched with a target control strategy, that is, both user A and user B upload their pre-set target control strategies. The billiard table terminal can call the corresponding target control strategy during the shot rounds of different registered users. As another mode, control strategies can be deployed for specific users who initiate the game. For example, user A, as the user who initiates the game (the initiator or payer, usually one billiard table terminal is associated with one user who initiates the game), has the right to configure strategies. That is, the cloud automatically confirms the user terminal corresponding to the user who initiates the game among multiple user terminals associated with the billiard table terminal, and sends the target control strategy corresponding to the user terminal corresponding to the user who initiates the game to the associated billiard table terminal.
[0030] Specifically, from the user's perspective, the user can access the control strategy editing interface provided by the cloud through a user terminal (such as a mobile terminal application). This interface can include various preset control strategy templates and configurable parameters (such as light color, flashing frequency, sound effect type, and corresponding consecutive shot count, etc.). Users can select or customize configurations according to their preferences to generate a control strategy table containing various different configurations. Based on the user's selection results in the control strategy table, the target control strategy is determined and uploaded to the cloud. Subsequently, the cloud stores the target control strategy associated with the corresponding user terminal and sends it to the bound billiard table terminal. After receiving the strategy, the billiard table terminal updates and replaces the locally stored default control strategy, so that during subsequent binding with the user terminal, it can respond to the user-defined control signal matched from the strategy based on the consecutive shot count. It should be noted that this embodiment does not involve the use scenario of simultaneously binding the same cue device to multiple billiard table terminals.
[0031] The above-described embodiments significantly enhance the personalization and interactive experience of the system by allowing users to participate in the configuration process of control strategies through the user terminal; centralized cloud-based management of control strategies reduces system maintenance costs and supports remote updates and rapid deployment of strategies; furthermore, the binding relationship between the cue stick identifier and the user terminal identifier enables a precise association between the ball-striking behavior, user identity, and control strategy, thereby further improving the relevance and accuracy of the audio-visual response.
[0032] In one embodiment of the present invention, the specific process of "determining the corresponding number of consecutive historical goals in the historical goal database based on the target cue identifier" in step S120 can be further explained in conjunction with the following description.
[0033] In this embodiment, the historical consecutive shot count corresponding to the target cue identifier is determined. That is, based on the target cue identifier of the current shot signal, the baseline value of consecutive shots that the target cue has formed before the current shot is quickly retrieved from the historical shot database of the billiard table terminal, thereby providing a preliminary basis for the calculation of the current consecutive shot count in the subsequent step S140.
[0034] The historical goal database can be dynamically generated and continuously updated by the billiard table terminal during the execution of steps S130 and S140. Specifically, each time the process from a shot event, through a goal event within the target time window, to the calculation of consecutive goals is completed, the billiard table terminal generates a goal record and writes it into the historical goal database. This historical goal database can adopt a chronological storage structure and be implemented based on a local cache or a lightweight database (such as a relational database).
[0035] Furthermore, the above-mentioned determination of the corresponding historical consecutive goal count in the historical goal database based on the target club identifier includes: querying the historical goal database for the most recent historical goal record before the shot timestamp based on the target club identifier; if the historical goal record is found, obtaining the historical consecutive goal count stored in the record; if the historical goal record is not found, setting the historical consecutive goal count to a preset initial value; wherein, the historical goal record includes at least the club identifier, the historical shot timestamp, and the historical consecutive goal count.
[0036] In one scenario, if the pocket sensor does not detect a goal within the target time window, a goal signal cannot be generated. If the billiard table terminal does not receive a goal signal within the target time window, the consecutive goal count is interrupted, and the current consecutive goal count is directly set to a preset initial value. Understandably, the preset initial value can be set to 0.
[0037] Specifically, the historical goal database can be recorded in a structured format. Each historical goal record includes at least the following fields: cue identifier, historical shot timestamp, number of goals scored, and historical consecutive goal count. To determine the historical consecutive goal count, the billiard table terminal retrieves the historical goal record corresponding to the target cue identifier from the historical goal database and searches for the most recent record chronologically. The reason for using the cue identifier for indexing, rather than directly indexing the most recent record by shot timestamp, is to avoid finding a record that does not correspond to the target cue identifier, thus shortening the data retrieval steps.
[0038] Assume users A and B take turns hitting the ball, with their corresponding cue identifiers being Cue-A and Cue-B respectively. The historical shot database records the shots in chronological order, as follows: First record (Cue-A, 10:02:08, 1, 1), Second record (Cue-A, 10:03:18, 2, 3), Third record (Cue-A, 10:04:28, 0, 0). Normally, if user A fails to score within the target time window of their third shot, both the shot count and the historical consecutive shot count are 0, indicating that user A did not score. According to the rules of billiards, the next shot will be transferred to user B, therefore the fourth record is related to Cue-B. Alternatively, if the fourth record is still taken by Cue-A, because the most recent record shows a historical consecutive shot count of 0, even if Cue-A scores 2 shots this time, adding the current shot count of 2 to the historical consecutive shot count of 0 will only result in a current consecutive shot count of 2.
[0039] Through the above implementation method, step S120 can quickly and accurately determine the number of consecutive historical goals without the need for complex trajectory analysis, relying only on structured event data. The number of consecutive historical goals can be obtained directly through database retrieval and field reading operations, which significantly reduces the computational complexity and improves the response speed, thereby providing reliable data support for the real-time execution of subsequent control strategies.
[0040] In one embodiment of the present invention, the specific process of step S130, which involves "starting from the timestamp of the shot and ending at the timestamp of receiving the next shot signal or a preset timeout period, determining a target time window and corresponding image data; when a goal signal is received from any pocket sensor within the target time window, determining the current number of goals corresponding to the shot signal based on the analysis results of the image data and the number of all goal signals; wherein the image data includes a pre-shot image sequence, a post-shot image sequence, and a pre-goal image sequence," can be further explained in conjunction with the following description.
[0041] In this embodiment, the billiard table terminal uses the time stamp of the current shot signal and the time stamp of the next shot signal, or a preset timeout period, as the target time window to continuously receive the ball-scoring signals output by the pocket sensors. Each time a ball is detected, a ball-scoring signal is generated. The number of ball-scoring signals accumulated within the target time window is equal to the current number of balls.
[0042] For example, the goal signal output by the pocket sensor can adopt a relatively mature solution, which is to embed a passive RFID tag or NFC tag in the center of each billiard ball, and each tag has a unique identifier; correspondingly, an RFID or NFC reader is set in each pocket area as a goal detection sensor. When the ball completely enters the pocket area, the RFID or NFC reader in the pocket detects the tag embedded in the ball, and the reader generates a goal signal containing a goal timestamp, ball identifier and pocket identifier.
[0043] Furthermore, according to the different competitive rules of billiards, in determining the current number of shots, it is also necessary to determine the validity of the shot. In certain situations, such as when the user pockets the billiard ball instead of it moving through the table, when the user interferes with the ball's movement through the table, or when the user has violated the rules when striking the ball, the shot signal triggered by these situations should be considered an invalid shot. To further improve the determination of the current number of shots in accordance with the competitive rules, the following embodiments also propose to use local image analysis to assist in the verification, so as to realize the validity determination of all shot signals.
[0044] Specifically, determining the validity of a goal mainly involves two dimensions: whether it was a valid shot and whether it was a valid goal. Understandably, whether it was a valid shot is a prerequisite for whether it was a valid goal; that is, if the prerequisite is an invalid shot, then there is no need to further determine whether it was a valid goal. In this embodiment, regardless of whether it was an invalid shot or a invalid goal, the billiard table terminal records the number of goals as a preset initial value in this record.
[0045] In one of the shot phases, determining the current number of goals corresponding to the shot signal based on the number of all goal signals includes: determining the pre-shot time window based on the shot timestamp; obtaining the pre-shot image sequence corresponding to the pre-shot time window from the buffered video stream; extracting features from each frame of the pre-shot image sequence; determining the pixel coordinates of each ball in each frame of the pre-shot image; determining whether each ball has shifted before the shot timestamp based on the pixel coordinates of each ball in each frame of the pre-shot image; if so, determining that the shot corresponding to the shot signal is an invalid shot; and resetting the current number of goals and the current consecutive number of goals to a preset initial value.
[0046] Specifically, an image acquisition device continuously captures images of the billiard table surface above the table, using a loop storage method to cache the acquired video images. Upon receiving a shot signal, the billiard table terminal extracts a short video image sequence from the cached video stream, from the shot timestamp to a previously preset time period (e.g., 100ms). This time period constitutes the aforementioned pre-shot time window. Subsequent analysis only considers the image sequence within this pre-shot time window, saving significant computational resources and time compared to previous real-time frame-by-frame analysis. Next, features of circular regions are extracted from each frame in the pre-shot image sequence, and the color information corresponding to each circular region is determined. This color information is used to identify the cue ball and other billiard balls. Simultaneously, the pixel coordinates of each billiard ball are determined by identifying the pixel coordinates of the center point of each circular region in each image. Then, the changes in the pixel coordinates of each billiard ball in each image are compared to determine whether each billiard ball has shifted before the shot timestamp. Understandably, according to the rules of billiards, before the shot signal is triggered, no ball on the billiard table can be moved in any way (such as by the user illegally touching the ball while aiming with the cue stick). Otherwise, it is considered a foul before the shot, and even if the ball is pocketed, it should be considered an invalid shot.
[0047] In another striking phase, determining the current number of goals corresponding to the striking signal based on the number of all goal signals further includes: determining a post-striking time window based on the striking timestamp, and acquiring a post-striking image sequence in real time within the post-striking time window; extracting features from the post-striking images in the post-striking image sequence to determine the pixel coordinates of the cue ball, the target ball, and the non-target ball in the post-striking images; determining the first pixel distance between the cue ball and the target ball, and the second pixel distance between the cue ball and the non-target ball in the post-striking images based on the pixel coordinates of the cue ball, the target ball, and the non-target ball; if the second pixel distance precedes the first pixel distance along the time sequence of the post-striking time window and satisfies a preset first closest contact distance, then the target ball that the cue ball first collides with is determined to be a non-target ball, the striking behavior corresponding to the striking signal is determined to be an invalid strike, and the current number of goals and the current consecutive number of goals are both reset to preset initial values.
[0048] Specifically, taking the Chinese eight-ball rule as an example, User A hits balls 1-7 (solid-colored), User B hits balls 9-15 (striped), and the black ball 8 is the final winning ball. During the game, User A can only be considered compliant if they directly hit a solid-colored target ball with the cue ball. If they hit a striped non-target ball with the cue ball and then indirectly collide with a solid-colored target ball, it is considered a foul, and the ball is invalid. In this embodiment, a real-time synchronous analysis of the post-hit image sequence is used to promptly identify whether the cue ball's first collision with the target ball complies with the rules. The compliance analysis of the images during the hitting phase is controlled as much as possible before the goal signal is triggered, thereby reducing latency. By analyzing the post-hit images in real time, the cue ball, target ball, and non-target ball can be quickly identified through color information. Even better, the image analysis area of the post-hit image is limited with the cue ball as the center. Thus, only the pixel coordinates of the cue ball, target ball, and non-target ball in this image analysis area need to be determined, without the need for global statistics and calculation of the pixel coordinates of all balls, reducing the amount of calculation and the calculation time. Understandably, the billiard table terminal can also be equipped with an interactive interface for user interaction. If it is a Chinese eight-ball game, at the beginning of each game, the user can input the color category that different cue devices should hit in this game, so that the billiard table terminal can identify the target ball and non-target ball through image recognition within the target time window.
[0049] Next, the pixel distances between the cue ball and the object ball and non-object ball in each frame are determined sequentially. If the pixel distance between the cue ball and the non-object ball is greater than the pixel distance between the cue ball and the object ball and satisfies a preset first nearest contact distance, it can be determined that the cue ball first collides with the non-object ball, which is considered a foul after the shot, and then image analysis is stopped and the shot is determined to be invalid. Understandably, by determining the distance sequentially, when the pixel distance between the center points of the cue ball and other billiard balls is less than or equal to the first nearest contact distance, it is determined that contact has occurred between them.
[0050] Therefore, during the shot, only after both the pre-shot and / or post-shot time windows are determined to be valid shots can the number of shot signals be used as the basis for accumulating the current shot count. In practice, the shot process can be roughly divided into three steps: rest, movement, and shot. Rest involves determining the position of the cue stick to provide fixed support for the subsequent movement; during this step, the cue stick must not touch any ball. Movement involves placing the cue tip on the rest and adjusting the cue stick to align with a specific point on the cue ball; during this step, the cue stick must also not touch any ball, otherwise it is considered a shot. Shot is the step where the cue stick strikes the cue ball, causing it to move towards the object ball; during this step, the cue ball must not touch any other balls besides the object ball between them. The first two steps occur within the pre-shot time window, and the shot occurs within the post-shot time window.
[0051] It should be noted that the image analysis described above does not involve complex deep learning or global inference. Instead, it employs rule-based lightweight feature computation to ensure that processing latency remains within a controllable range. Furthermore, an edge computing chip (such as an embedded AI module) can be deployed locally on the billiard table terminal to perform rapid local processing of the image sequences, enabling the analysis of the shot phase to be completed before the shot signal is generated.
[0052] In conjunction with the above embodiments, it is also necessary to determine the validity of the goal-scoring phase. In this embodiment, the goal signal includes at least a goal timestamp, a pocket identifier, and a target ball identifier; determining the current number of goals corresponding to the shot signal based on the number of all goal signals further includes: determining the pre-goal time window based on the goal timestamp, obtaining the pre-goal image sequence corresponding to the pre-goal time window from the cached video stream; determining the target pocket pixel coordinates corresponding to the pocket identifier in the pre-goal image sequence based on a preset pocket-coordinate mapping table, and cropping each frame of the pre-goal image with the target pocket pixel coordinates as the center according to a preset area range to obtain multiple target goal analysis screenshots arranged in chronological order; sequentially extracting the billiard table area features, target ball features, and non-spherical object features from each frame of the target goal analysis screenshot along the chronological order of the pre-goal time window, determining the range of pixel coordinates of the billiard table area, and the target ball pixel coordinates corresponding to the target ball identifier; If the target ball's pixel coordinates appear outside the range of pixel coordinates on the billiard table before overlapping with the pocket's pixel coordinates, then all goal signals are determined to be invalid goals, and the current goal count and the current consecutive goal count are reset to the preset initial values. If non-spherical object features are extracted, the pixel coordinates of the non-spherical object are determined. The third pixel distance between the pixel coordinates of the target ball and the pixel coordinates of the non-spherical object in each frame of the target goal analysis screenshot is determined sequentially along the time sequence before the goal. If the third pixel distance satisfies the second closest contact distance, all goal signals are determined to be invalid goals, and the current goal count and the current consecutive goal count are reset to the preset initial values.
[0053] In the above embodiments, even if a shot is deemed valid during the initial strike, if a subsequent shot is deemed invalid, the number of shot signals cannot be used as the basis for accumulating the current number of shots. It should be noted that a typical billiard table has six pockets, each with a corresponding pocket sensor. The pocket identifier can be identified by the sensor's number or label. Specifically, when the billiard table terminal receives a shot signal, it first extracts the corresponding pre-shot time window image sequence from the buffered video stream based on the shot timestamp. This sequence is typically several consecutive frames (e.g., 10-30 frames), forming the basic sample for shot behavior analysis. Subsequently, based on the pocket identifier, the target pocket object and its corresponding pixel coordinates are determined in the pre-shot image sequence. This can be achieved by establishing a pocket-coordinate mapping table between each pocket sensor identifier and the pocket pixel coordinates in the billiard table image during the billiard table terminal initialization phase. The target pocket pixel coordinates can be found in the pocket-coordinate mapping table using the pocket identifier in the shot signal.
[0054] After obtaining the pixel coordinates of the pocket opening, each frame of the image is cropped around these coordinates according to a preset area range (such as a fixed-size ROI region) to obtain a target goal analysis screenshot. This narrows the analysis scope from the entire table surface to a local area around the pocket opening, significantly reducing the computational load of subsequent image processing and minimizing irrelevant interference. Furthermore, three core features need to be extracted from each frame of the target goal analysis screenshot. The first is the "billiard table area feature," used to determine the pixel range of the effective area of the table. This feature can be obtained through color segmentation (such as the green bowling area), texture recognition, or simple threshold segmentation, thus forming a table area mask. The second is the target ball feature, which locates the corresponding ball in the image based on the target ball identifier. This can be done by combining ball color features, number recognition, etc., ultimately obtaining the target ball's pixel coordinates (usually the ball's center coordinates). The third is non-spherical object features, mainly used to identify external objects that may interfere with the goal-scoring process, such as hands, cues, clothing, etc. These features can be identified through morphological features (non-circular), color distribution, or lightweight object detection models. Next, the aforementioned features are processed frame by frame along the time window before the goal. If, in any frame before the target ball overlaps with the pocket area, the target ball's pixel coordinates are detected to be outside the pixel range of the billiard table area and appear in an area outside the pixel range of the billiard table area in the target goal analysis screenshot, it indicates that the ball did not roll naturally from the table into the pocket, but may have been placed or thrown directly into the pocket, an abnormal behavior. In this case, the goal is directly determined to be invalid, and the current goal count and the current consecutive goal count are reset to the preset initial values. Secondly, if a non-spherical object feature is detected in any frame, the third pixel distance between the target ball and the non-spherical object is further calculated. The change of this distance is analyzed along the time series. When this distance is less than or equal to the preset second closest contact distance, it is determined that the target ball has made contact with an external object or has been interfered with at very close range (e.g., pushed into the pocket by hand, or the cue stick is pushed into the pocket), and the goal is determined to be invalid. Similarly, the current goal count and the consecutive goal count are set to the preset initial values.
[0055] Under normal circumstances, the target ball should always remain within the table area and gradually approach the pocket along a continuous trajectory, without contacting any non-spherical objects throughout the process. This embodiment can accurately determine whether a shot conforms to the rules by using only local image sequences and simple feature calculations, without requiring complex trajectory reconstruction. Combined with an event triggering mechanism, short image sequences are only reviewed at the moment of impact and the shot, avoiding full processing of the continuous video stream, solving the high latency problem, and achieving tight coupling between rule determination and control strategy, thereby ensuring the correctness and fairness of the acoustic, electrical, and electronic responses.
[0056] In one embodiment of the present invention, the specific process of step S140, which involves "determining the current consecutive goal count based on the historical consecutive goal count and the current goal count, associating the current consecutive goal count with the target stick identifier and storing it in the historical goal database, determining the target control signal in the preset control strategy based on the current consecutive goal count, and controlling the corresponding audio-visual equipment to perform the response based on the target control signal", can be further explained in conjunction with the following description.
[0057] In this embodiment, the billiard table terminal reads the historical consecutive shot count corresponding to the target cue identifier and obtains the current shot count. As described in the previous embodiment, the current shot count is only accumulated when it is a valid shot. In cases of no shot, invalid shot, or invalid shot, it is processed according to a preset initial value, thus ensuring that the consecutive shot statistics are consistent with the actual shot results. Next, after obtaining the current consecutive shot count, the billiard table terminal generates a new historical shot record and appends it to the end of the data sequence corresponding to the target cue identifier in the historical shot database. After writing, the billiard table terminal uses the current consecutive shot count in this historical shot record as the source of the historical consecutive shot count in subsequent shots, thus completing the update of the historical consecutive shot count. Simultaneously, the billiard table terminal performs matching processing according to the current consecutive shot count within a preset control strategy. The preset control strategy is a structured mapping table, which predefines multiple correspondences between consecutive shot counts and corresponding control signals. Each mapping rule includes at least the consecutive shot count value or value range and the corresponding target control signal identifier. The billiard table terminal uses the current consecutive number of balls as an index parameter to perform interval matching in the mapping table to determine the unique corresponding target control signal.
[0058] In one embodiment, the step of determining a target control signal based on the current consecutive goal count in a preset control strategy, and controlling the corresponding audio-visual equipment to perform a response based on the target control signal, includes: parsing the target control signal to generate corresponding device control instructions, wherein the target control signal includes at least a lighting parameter field, an audio parameter field, and a display parameter field; and controlling the lighting equipment, audio equipment, and display equipment to perform a response based on the device control instructions.
[0059] After determining the target control signal, the billiard table terminal generates specific device control instructions based on the content of the target control signal and sends them to the audio-visual equipment control module. The control instructions include at least one of lighting control instructions, sound effect control instructions, and display control instructions. The lighting control instructions control the color, brightness, and flashing frequency of the light strips or indicator lights; the sound effect control instructions trigger the playback of a preset audio file or adjust audio parameters; and the display control instructions control the display screen to output corresponding text or animation content. Upon receiving the control instructions, the audio-visual equipment control module drives the corresponding hardware to perform response actions according to the instructions, thereby achieving a real-time feedback effect based on the number of consecutive shots.
[0060] Reference Figure 2 This illustration shows a continuous ball-popping recognition and control device according to an embodiment of the present invention, which relates to a billiard table terminal and specifically includes the following modules: Specifically, it includes: The receiving module 110 is used to receive the ball-hitting signal output by the cue device, the ball-hitting signal including at least a ball-hitting timestamp and a target cue identifier; The first determining module 120 is used to determine the corresponding number of consecutive historical goals in the historical goal database based on the target stick identifier; The second determining module 130 is used to determine a target time window and corresponding image data, starting from the timestamp of the shot and ending at the timestamp of receiving the next shot signal or a preset timeout period. When a goal signal is received from any pocket sensor within the target time window, the current goal number corresponding to the shot signal is determined based on the analysis results of the image data and the number of all goal signals. The image data includes a pre-shot image sequence, a post-shot image sequence, and a pre-goal image sequence. The control module 140 is used to determine the current consecutive goal count based on the historical consecutive goal count and the current goal count, associate the current consecutive goal count with the target stick identifier and store it in the historical goal database, determine the target control signal in the preset control strategy based on the current consecutive goal count, and control the corresponding audio-visual equipment to perform the response based on the target control signal.
[0061] Reference Figure 3 The illustration shows a computer electronic device for implementing a method for continuous ball shot recognition and control according to the present invention, which may specifically include the following: The aforementioned computer electronic device 1 is manifested in the form of a general-purpose computing device. The components of the computer electronic device 1 may include, but are not limited to: one or more processors or processing units 3, memory 8, and a bus 4 connecting different system components (including memory 8 and processing unit 3).
[0062] Bus 4 represents one or more of several bus architectures, including memory buses or memory controllers, peripheral buses, graphics acceleration ports, processors, or local buses using any of the various bus architectures. For example, these architectures include, but are not limited to, the Industry Standard Architecture (ISA) bus, the Micro Channel Architecture (MAC) bus, the Enhanced ISA bus, the Audio / Video Electronics Standards Association (VESA) local bus, and the Peripheral Component Interconnect (PCI) bus.
[0063] Computer electronic device 1 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by computer electronic device 1, including volatile and non-volatile media, removable and non-removable media.
[0064] Memory 8 may include computer system readable media in the form of volatile memory, such as random access memory 9 and / or cache memory 10. Computer electronic device 1 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, storage system 11 may be used to read and write non-removable, non-volatile magnetic media (commonly referred to as a "hard disk drive"). Although Figure 3 Not shown, a disk drive for reading and writing to removable non-volatile disks (such as "floppy disks") and an optical disk drive for reading and writing to removable non-volatile optical discs (such as CD-ROMs, DVD-ROMs, or other optical media) may be provided. In these cases, each drive may be connected to bus 4 via one or more data media interfaces. The memory may include at least one program product having a set (e.g., at least one) of program modules 13 configured to perform the functions of the embodiments of the present invention.
[0065] A program / utility 12 having a set (at least one) of program modules 13 may be stored, for example, in memory. Such program modules 13 include—but are not limited to—an operating system, one or more application programs, other program modules 13, and program data. Each or some combination of these examples may include an implementation of a network environment. Program modules 13 typically perform the functions and / or methods described in the embodiments of the present invention.
[0066] The computer electronic device 1 can also communicate with one or more external devices 2 (e.g., keyboard, pointing device, display 7, camera, etc.), and with one or more devices that enable an operator to interact with the computer electronic device 1, and / or with any device that enables the computer electronic device 1 to communicate with one or more other computing devices (e.g., network card, modem, etc.). This communication can be performed through the I / O interface 6. Furthermore, the computer electronic device 1 can also communicate with one or more networks (e.g., local area network (LAN)), wide area network (WAN), and / or public networks (e.g., the Internet) through the network adapter 5. Figure 3 As shown, network adapter 5 communicates with other modules of computer electronic device 1 via bus 4. It should be understood that, although... Figure 3 Not shown, it may be combined with other hardware and / or software modules, including but not limited to: microcode, device drivers, redundant processing unit 3, external disk drive array, RAID system, tape drive and data backup storage system 11, etc.
[0067] The processing unit 3 executes various functional applications and data processing by running programs stored in memory 8, such as implementing a method for continuous ball shot recognition and control provided in this embodiment of the invention.
[0068] That is, when the processing unit 3 executes the above program, it performs the following: receiving the ball-hitting signal output by the cue device, the ball-hitting signal including at least a ball-hitting timestamp and a target cue identifier; determining the corresponding historical consecutive ball-hitting number in the historical ball-hitting database based on the target cue identifier; determining a target time window and corresponding image data, starting from the ball-hitting timestamp and ending at the timestamp of receiving the next ball-hitting signal or a preset timeout period; when a ball-hitting signal is received from any pocket sensor within the target time window, determining the current ball-hitting number corresponding to the ball-hitting signal based on the analysis results of the image data and the number of all ball-hitting signals; wherein, the image data includes a pre-ball-hitting image sequence, a post-ball-hitting image sequence, and a pre-ball-hitting image sequence; determining the current consecutive ball-hitting number based on the historical consecutive ball-hitting number and the current ball-hitting number; associating the current consecutive ball-hitting number with the target cue identifier and storing it in the historical ball-hitting database; determining a target control signal in a preset control strategy based on the current consecutive ball-hitting number; and controlling the corresponding audio-visual equipment to perform a response based on the target control signal.
[0069] In this embodiment of the invention, a computer-readable storage medium is also provided, on which a computer program is stored, which, when executed by a processor, implements a method for continuous billiard ball shot recognition and control as provided in all embodiments of the invention.
[0070] That is, when the program is executed by the processor, it implements the following: receiving the shot signal output by the cue device, the shot signal including at least a shot timestamp and a target cue identifier; determining the corresponding historical consecutive shot count in the historical shot database based on the target cue identifier; determining a target time window and corresponding image data, starting from the shot timestamp and ending at the timestamp of receiving the next shot signal or a preset timeout period; when a shot signal is received from any pocket sensor within the target time window, determining the current shot count corresponding to the shot signal based on the analysis results of the image data and the number of all shot signals; wherein, the image data includes a pre-shot image sequence, a post-shot image sequence, and a pre-shot image sequence; determining the current consecutive shot count based on the historical consecutive shot count and the current shot count, associating the current consecutive shot count with the target cue identifier and storing it in the historical shot database, determining a target control signal in a preset control strategy based on the current consecutive shot count, and controlling the corresponding audio-visual equipment to perform a response based on the target control signal.
[0071] Any combination of one or more computer-readable media may be used. A computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. A computer-readable storage medium can be, for example—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this document, a computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in connection with an instruction execution system, apparatus, or device.
[0072] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals may take various forms, including—but not limited to—electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, capable of transmitting, propagating, or transmitting programs for use by or in connection with an instruction execution system, apparatus, or device.
[0073] Computer program code for performing the operations of this invention can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, and conventional procedural programming languages such as C or similar languages. The program code can be executed entirely on the operator's computer, partially on the operator's computer, as a standalone software package, partially on the operator's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the operator's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider). The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments; similar or identical parts between embodiments can be referred to interchangeably.
[0074] Although preferred embodiments of the present invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the embodiments of the present invention.
[0075] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal device. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal device that includes said element.
[0076] The present invention has provided a detailed description of a method and apparatus for continuous ball shot recognition and control. Specific examples have been used to illustrate the principle and implementation of the present invention. The description of the above embodiments is only for the purpose of helping to understand the method and core idea of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation and application scope based on the idea of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.
Claims
1. A method for continuous ball-popping recognition and control, relating to a billiard table terminal, characterized in that, The method includes: The receiving device outputs a shot signal, which includes at least a shot timestamp and a target club identifier; The corresponding consecutive historical goals are determined from the historical goal database based on the target cue marker. Starting from the timestamp of the shot, and ending at the timestamp of receiving the next shot signal or a preset timeout period, a target time window and corresponding image data are determined. When a goal signal is received from any pocket sensor within the target time window, the current goal count corresponding to the shot signal is determined based on the analysis results of the image data and the number of all goal signals. The image data includes a pre-shot image sequence, a post-shot image sequence, and a pre-goal image sequence. The current consecutive goal count is determined based on the historical consecutive goal count and the current goal count. The current consecutive goal count is associated with the target stick identifier and stored in the historical goal database. The target control signal is determined in the preset control strategy based on the current consecutive goal count, and the corresponding audio-visual equipment is controlled to perform the response based on the target control signal.
2. The method according to claim 1, characterized in that, Before receiving the shot signal from the cue device, the process includes: The system establishes an association with at least one cue device, obtains the cue device's cue identifier, and sends it to a cloud server. The cloud server determines the corresponding user terminal identifier based on the cue identifier and provides the corresponding user terminal with an editable list of control strategies. The user terminal generates a target control strategy and uploads it to the cloud server in response to the user's selection or editing operation on the editable list. The cloud server sends the target control strategy to the billiard table terminal. The default control policy for local storage is updated based on the target control policy.
3. The method according to claim 1, characterized in that, Based on the target club identifier, determine the corresponding consecutive historical goal count in the historical goal database, including: Based on the target cue identifier, retrieve the most recent historical goal record from the historical goal database, prior to the shot timestamp. If the historical goal record is found, the number of consecutive historical goals stored in that record is obtained; If no historical goal record is found, the historical consecutive goal count will be set to a preset initial value. The historical goal record includes at least the club mark, historical shot timestamp, and historical consecutive goal count.
4. The method according to claim 1, characterized in that, Determining the current goal count corresponding to the shot signal based on the total number of all goal signals includes: The time window before the shot is determined based on the shot timestamp, and the image sequence before the shot corresponding to the time window before the shot is obtained from the cached video stream; Feature extraction is performed on each frame of the pre-hit image sequence to determine the pixel coordinates of each ball in each frame of the pre-hit image. Based on the pixel coordinates of each ball in the image before each shot, determine whether each ball has shifted before the shot timestamp. If so, determine that the shot corresponding to the shot signal is an invalid shot, and reset the current number of shots and the current consecutive number of shots to the preset initial values.
5. The method according to claim 1, characterized in that, The step of determining the current number of goals corresponding to the shot signal based on the total number of all goal signals also includes: The post-hit time window is determined based on the hit timestamp, and the post-hit image sequence is acquired in real time within the post-hit time window; Feature extraction is performed on the post-hit images in the post-hit image sequence to determine the pixel coordinates of the cue ball, the target ball, and the non-target ball in the post-hit images; Based on the pixel coordinates of the cue ball, the pixel coordinates of the target ball, and the pixel coordinates of the non-target ball, determine the first pixel distance between the cue ball and the target ball, and the second pixel distance between the cue ball and the non-target ball in the image after the shot. If the second pixel distance is earlier than the first pixel distance in the time sequence of the time window after the shot and satisfies the preset first closest contact distance, then determine that the target ball that the cue ball first collides with is the non-target ball, determine that the shot action corresponding to the shot signal is an invalid shot, and reset the current number of goals and the current number of consecutive goals to the preset initial value.
6. The method according to claim 1, characterized in that, The goal signal includes at least a goal timestamp, a pocket indicator, and a target ball indicator; determining the current goal count corresponding to the shot signal based on the total number of goal signals further includes: The time window before the goal is determined based on the goal timestamp, and the image sequence before the goal corresponding to the time window before the goal is obtained from the cached video stream; Based on the preset pocket-coordinate mapping table, the target pocket pixel coordinates corresponding to the pocket identifier in the pre-goal image sequence are determined, and each frame of the pre-goal image is cropped according to the preset area range with the target pocket pixel coordinates as the center, resulting in multiple target goal analysis screenshots arranged in time sequence. The features of the billiard table area, the target ball, and non-spherical objects in each frame of the target goal analysis screenshot are extracted sequentially along the time window before the goal is scored. The pixel coordinate range of the billiard table area and the pixel coordinates of the target ball corresponding to the target ball identifier are determined. If the target ball's pixel coordinates appear outside the range of pixel coordinates on the billiard table before overlapping with the pocket's pixel coordinates, then all goal signals are determined to be invalid goals, and the current goal count and the current consecutive goal count are reset to the preset initial values. If non-spherical object features are extracted, the pixel coordinates of the non-spherical object are determined. The third pixel distance between the pixel coordinates of the target ball and the pixel coordinates of the non-spherical object in each frame of the target goal analysis screenshot is determined sequentially along the time sequence before the goal. If the third pixel distance satisfies the second closest contact distance, all goal signals are determined to be invalid goals, and the current goal count and the current consecutive goal count are reset to the preset initial values.
7. The method according to claim 1, characterized in that, The step of determining a target control signal based on the current consecutive goal count within a preset control strategy, and controlling the corresponding audio-visual equipment to execute a response based on the target control signal, includes: The target control signal is parsed to generate corresponding device control instructions. The target control signal includes at least a lighting parameter field, an audio parameter field, and a display parameter field. Based on the equipment control commands, control the lighting equipment, audio equipment and display equipment to execute responses respectively.
8. A device for continuous ball-popping recognition and control in billiards, relating to a billiards table terminal, characterized in that, The device includes: A receiving module is used to receive the ball-hitting signal output by the cue device, wherein the ball-hitting signal includes at least a ball-hitting timestamp and a target cue identifier; The first determination module is used to determine the corresponding number of consecutive historical goals in the historical goal database based on the target stick identifier; The second determining module is used to determine a target time window and corresponding image data, starting from the timestamp of the shot and ending at the timestamp of receiving the next shot signal or a preset timeout period. When a goal signal is received from any pocket sensor within the target time window, the current goal number corresponding to the shot signal is determined based on the analysis results of the image data and the number of all goal signals. The image data includes a pre-shot image sequence, a post-shot image sequence, and a pre-goal image sequence. The control module is used to determine the current consecutive goal count based on the historical consecutive goal count and the current goal count, associate the current consecutive goal count with the target stick identifier and store it in the historical goal database, determine the target control signal in the preset control strategy based on the current consecutive goal count, and control the corresponding audio-visual equipment to perform the response based on the target control signal.
9. A computer electronic device, characterized in that, The method includes a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein the computer program, when executed by the processor, implements the steps of a method for continuous ball shot recognition and control as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, A computer program is stored on the computer-readable storage medium, and when executed by a processor, the computer program implements the steps of a method for continuous ball shot recognition and control as described in any one of claims 1 to 7.