Golf data detection method and system based on four-eye camera and storage medium
By using a quad-camera system and image processing algorithms, the problem of insufficient 3D coordinate accuracy in existing golf training systems has been solved, enabling high-frequency and high-precision detection of golf ball and club motion parameters, and enhancing the coverage and accuracy of 3D reconstruction.
Patent Information
- Application Number
- CN202510833061.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-20
- Publication Date
- 2025-11-21
AI Technical Summary
In existing golf training systems, traditional radar, mono/dual-lens camera systems, or laser sensors struggle to accurately identify the complex motion parameters of golf balls and clubs. In particular, their three-dimensional coordinate accuracy is insufficient during high-speed motion, and they are susceptible to obstruction and environmental interference, making it impossible to achieve high-frequency, high-precision multi-parameter analysis.
A four-camera system, including two binocular cameras (Group A and Group B), is used. These cameras are tilted at different angles on the target ground. The system acquires and processes images under computer control. By combining image processing algorithms and 3D reconstruction technology, the system identifies the 3D motion trajectory of the golf ball and club.
It improves the measurement accuracy and reliability of golf ball and club motion parameters, enhances stereo parallax and image coverage, realizes high-frequency, high-precision 3D reconstruction, and improves the integrity and accuracy of data detection.
Smart Images

Figure CN120997377A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of golf training equipment, and particularly relates to a golf data detection method and system based on a four-camera and a storage medium. BACKGROUND
[0002] 1. With the popularity of golf and the development of virtual simulation training systems, the demand for data collection and analysis of player's swing is growing. In existing indoor golf systems, radar speedometers, single / dual-camera systems or laser sensors are often used to collect golf movement information and provide path simulation or training feedback. However, these traditional solutions have the following shortcomings: Most existing image collection devices usually only capture from one angle (such as from above or from the side), resulting in partial obstruction of the ball or club, loss of the target, or insufficient spatial positioning accuracy, making it difficult to restore the complete movement trajectory. Since the dual-camera vision system can only provide single-direction depth information, especially during high-speed movement, the close camera angles can result in a short stereo baseline, affecting the accuracy of three-dimensional coordinates. Most systems only output ball speed or initial speed direction, lacking detailed modeling and calculation support for complex motion parameters such as club speed, acceleration, angular velocity, hitting angle, and ball rotation.
[0003] 2. Existing radar, laser, single / dual-camera vision technologies have their own limitations, such as the need for specific installation of radar, susceptibility to obstruction, inability of single-camera vision to perform three-dimensional reconstruction, and limited angle and depth information provided by ordinary dual-camera systems, making it difficult to accurately identify the fine trajectory and dynamic changes of high-speed moving targets in three-dimensional space.
[0004] 3. Currently, common ball speed and club speed measurement methods in golf training and competition rely on radar modules, laser devices or magnetic field sensors. These methods have their own application scope, but overall have limitations in functionality, low accuracy and weak anti-interference ability. For example, radar systems usually need to be installed at a specific position behind the ball, making it difficult to adapt to low fairway shots and susceptible to interference from foreign objects in outdoor complex backgrounds. Laser systems mostly calculate ball speed based on image changes and cannot directly measure club head speed, requiring estimation through empirical formulas, which lacks accuracy. Magnetic sensors require multiple sensing units to be deployed in the hitting area and have strong dependence on club head path, resulting in high actual deployment cost and poor flexibility.
[0005] 4、In addition, although some low baseline binocular vision systems can obtain three-dimensional position information under certain conditions, they are limited by sampling frequency and occlusion problems under high-speed motion, and cannot provide complete and continuous spatial trajectories. Therefore, existing measurement schemes are still difficult to achieve high-frequency, high-precision, multi-parameter joint analysis of the motion state of the ball and the club, and there is an urgent need for a visual system with multi-view coverage, high-frame-rate imaging and stable tracking capability to improve the overall measurement effect and practicality.
[0006] 5、Because when hitting the ball, the person will not run to the right side of the golf ball, the person stands on the left side of the target ground, and the person stands on the left side of the golf ball, the group of binocular cameras is slightly left, the person is moving, and some people will stand close to the golf ball. During the time of hitting the ball, the head or the right hand or the right side of the body may block a part, which may block the golf ball in a stationary state, or may block a certain trajectory route of the golf ball in flight after hitting the ball, which will cause the group of binocular cameras to be unable to shoot a plurality of frames of images with high density and continuity from the golf ball in a stationary state to the flight process within the spatial range of the shooting area, resulting in that the group of binocular cameras cannot shoot a plurality of frames of images with high density and continuity, the subsequent extraction of data from the golf ball in a stationary state to the flight process within the spatial range of the shooting area is not accurate enough, and the deviation of the complete trajectory from the golf ball in a stationary state to the dynamic flight occurs during the subsequent three-dimensional reconstruction, which is not accurate enough. For example 1: the group of binocular cameras is far away from the golf ball on the target ground, and the pixels of the camera are limited, so it is difficult to shoot the surface texture of the golf ball clearly, and the data deviation of the golf ball rotation value in the take-off state occurs. For example 2: the group of binocular cameras is far away from the golf ball on the target ground, and the pixels and angles of the camera are limited, so it is difficult or impossible to shoot the contact point space between the club face and the golf ball when hitting the ball, and it is difficult or impossible to extract the included angle value between the club face and the golf ball, the take-off angle of the ball, and the tilt angle value of the club face. SUMMARY
[0007] To solve the above technical problems, the application provides a golf data detection method based on a four-camera camera for realizing accurate identification and analysis of golf and club motion parameters.
[0008] The solution to the above technical problems is:
[0009] A kind of golf data detection method based on four cameras, including computer, group A binocular camera, group B binocular camera, group A binocular camera, group B binocular camera are connected computer by data line respectively, group A binocular camera includes first camera and second camera, group B binocular camera includes third camera and fourth camera;Group A binocular camera is obliquely arranged in the upper rear of target ground, group B binocular camera is obliquely arranged in the upper right of target ground, and two groups of binocular cameras are obliquely directed to regional space and target ground;The distance of group B binocular camera to target ground is shorter than that of group A binocular camera;
[0010] Detection steps are as follows:
[0011] Step 1: start working detection;Through computer control group A binocular camera, group B binocular camera starts activation detection work, group A binocular camera is obliquely photographed from rear to front direction regional space and target ground, group B binocular camera is obliquely photographed from right to left direction regional space and target ground, four cameras are photographed respectively, two groups of binocular cameras are photographed simultaneously or alternately each time, and a total of 4 target ground images are photographed, and a small amount of images photographed by group A binocular camera and group B binocular camera are respectively cached in the FIFO memory of computer as initial images;
[0012] Step 2: the image processor of computer continuously detects the image cached in FIFO memory by image processing algorithm, and analyzes whether the image is consistent;When golf ball is placed in the specified position area of target ground, group A binocular camera and group B binocular camera each photograph a small amount of images with golf ball, and the images are respectively cached in the FIFO memory of computer by group A binocular camera and group B binocular camera;The image processor of computer compares the initial image by image processing algorithm, identifies the position of circular target in image by image processing algorithm, thereby determines that the circular target is golf ball in stationary state, and then records the coordinate position of golf ball in image photographed by two groups of cameras respectively, as the judgment reference of whether subsequent displacement occurs;
[0013] Step 3: golf ball displacement: in the process of caching image in FIFO memory, the image cached by group A binocular camera and group B binocular camera is continuously analyzed by image processing algorithm of image processor;
[0014] Whether golf ball is displaced from original coordinate position is analyzed by comparing the image photographed by group A binocular camera with the reference image in original stationary state by image processing algorithm of image processor, whether golf ball is consistent with original coordinate position is detected;
[0015] The image processing algorithm of the image processor compares the image taken by the B group binocular camera with the reference image in the original static state to analyze whether the golf ball has displacement from the original coordinate position, and detects whether the golf ball is consistent with the original coordinate position;
[0016] When a club enters the shooting range of the A group binocular camera and the B group binocular camera, the A group binocular camera and the B group binocular camera will also shoot the club, and the FIFO memory of the computer will cache the image including the golf ball and the club;
[0017] When the face of the club hits the golf ball, the golf ball flies dynamically and the club rotates dynamically; the image processor detects the displacement of the golf ball and the club through its image processing algorithm, and the computer controls the A group binocular camera and the B group binocular camera to continuously and respectively shoot the region space and the target ground at high frequency, and the FIFO memory of the computer caches 40-80 images of the golf ball and the club taken by the A group binocular camera before and after hitting the ball, in which the positions of the golf ball and the club change; the FIFO memory of the computer caches 40-80 images of the golf ball and the club taken by the B group binocular camera before and after hitting the ball, in which the positions of the golf ball and the club change; the FIFO memory caches 80-160 images of the golf ball and the club taken by the two groups of cameras, in which the positions of the golf ball and the club change;
[0018] Step 4: Data calling: the data manager of the computer continuously calls the images of the golf ball and the club taken by the A group binocular camera and the B group binocular camera respectively in time sequence;
[0019] Step 5: Three-dimensional reconstruction: the data manager sends all the images of the golf ball and the club cached in time sequence to the three-dimensional reconstruction software of the computer, the three-dimensional reconstruction software uses its own stereo vision technology and a lightweight target detection algorithm to identify the positions of the golf ball and the club in the images, converts the real object coordinates of the two-dimensional images into world coordinates, and reconstructs the three-dimensional motion trajectory of the golf ball and the club based on the position changes of the golf ball and the club in the time sequence images.
[0020] Step 7: Data extraction: the data acquisition processor of the computer acquires one or more data of the golf ball, such as ball speed, ball horizontal deviation angle, ball acceleration, ball take-off angle, ball rotation value, and ball direction; the data acquisition processor of the computer acquires the data of the club head, such as club speed, club horizontal deviation angle, club face hitting point, and club face angle.
[0021] Step 8: Data Encapsulation: The data acquisition processor merges the acquired golf ball and club data and forms data packets through an encapsulation protocol, thereby completing the acquisition of golf ball and club data.
[0022] The beneficial effects of the golf data detection method based on a four-camera system of the present invention are as follows: 1. A total of four cameras are used, consisting of a group A of binocular cameras and a group B of binocular cameras. The group A of binocular cameras is tilted and positioned above and behind the target ground, while the group B of binocular cameras is tilted and positioned above and to the right of the target ground. Both groups of binocular cameras are tilted and facing the area and the target ground, forming multi-view image acquisition. Through multi-view image acquisition, multi-dimensional target capture is formed for three-dimensional reconstruction, accurately extracting the actual three-dimensional coordinate positions of the ball and clubhead in space. The computer system continuously tracks the positional changes of the golf ball. When the ball is detected to have changed from a stationary state to a state of obvious movement, it is determined that it is in the hitting state, and thus the hitting event information is generated. 2. Because two groups of binocular cameras are used to collect data from different angles, the spatial positioning accuracy under different postures and angles is improved, thereby making the measurement of motion parameters more accurate and reliable. 3. This method utilizes two sets of binocular cameras, positioned above and to the right of the hitting area, respectively, to acquire image information from the main viewpoint and the side viewpoint, thereby enhancing stereo parallax, optimizing image coverage, and improving spatial reconstruction accuracy; it captures the complete trajectory of the ball and stick from different angles, improving the coverage and accuracy of 3D reconstruction. Attached Figure Description
[0023] Figure 1 This is a three-dimensional schematic diagram of the product of the present invention;
[0024] Figure 2 This is a three-dimensional schematic diagram of the product of the present invention with a golf ball attached;
[0025] Figure 3 This is a schematic diagram of the flight state of the golf ball after it has been hit, showing a three-dimensional schematic diagram with the flight direction of the golf ball.
[0026] Figure 4 This is a schematic diagram showing the automatic golf ball tee machine and its connection to the target surface according to the present invention.
[0027] Figure 5 This is a three-dimensional schematic diagram of the product of the present invention, which includes an automatic golf ball tee machine, a hitting screen, and a target surface.
[0028] Figure 6 This is a top-down view diagram;
[0029] Figures 7 to 11 This is a schematic diagram illustrating the process of simulating a golf swing in this invention; wherein... Figure 7It is a layout diagram including group A binocular cameras, group B binocular cameras, people, golf clubs, and golf balls;
[0030] Figures 12 to 14 This is a schematic diagram of the process of the present invention.
[0031] Group A: Binocular camera 1, First camera 101, Second camera 102; Group B: Binocular camera 2, Third camera 201, Fourth camera 202; Target ground 3, Designated position 31, Automatic golf ball tee machine 5, Ball release top club 51. Detailed Implementation
[0032] like Figures 1 to 13 As shown: A golf data detection method based on four cameras, including a computer, a group of A stereo cameras 1, and a group of B stereo cameras 2; the computer is a PC; the time is based on the computer system clock;
[0033] Group A (binocular cameras 1) and Group B (binocular cameras 2) are connected to a computer via data cables. Group A (binocular cameras 1) includes a first camera 101 and a second camera 102, which are horizontally positioned side-by-side with a spacing of 5-20 cm between them. A suitable placement and layout are chosen to maximize the area of the captured golf ball. Group B (binocular cameras 2) includes a third camera 201 and a fourth camera 202, which are also horizontally positioned side-by-side with a spacing of 5-20 cm between them. A suitable placement and layout are chosen to maximize the area of the captured golf ball. The first camera 101, the second camera... Cameras 102, 201, and 202 form a quad-camera system. Group A (camera 1) is tilted and positioned above and behind the target ground 3, while Group B (camera 2) is tilted and positioned above and to the right of the target ground 3. Both cameras are tilted towards the area and the target ground 3, with Group B (camera 2) positioned closer to the target ground 3 than Group A (camera 1). The angle between Group A (camera 1) and Group B (camera 2) is 90 degrees. Both cameras can capture the entire circular surface of the golf ball, excluding the bottom point. Their coverage area is extensive, covering over 85% of the ball's surface, essentially forming the characteristics of a circular object. This provides more precise target acquisition for subsequent image processing to locate circular targets. Group A (camera 1) is fixedly suspended from the ceiling, while Group B (camera 2) is fixedly installed on the right wall or erected using a floor bracket.
[0034] The color of the golf ball is different from and not similar to the color of the target ground 3; the color of the golf ball is white, and the color of the target ground 3 is green, and the color difference is large, and after shooting, the boundary contour line of the golf ball on the target ground 3 is clearer, and more accurate detection and judgment are provided for subsequent image processing; the target ground 3 is laid flat by a green artificial turf mat; preferably, a designated position area for hitting a golf ball is arranged at a rear left side of the artificial turf mat, and the golf ball is placed on the designated position area for hitting each time, so that a user can easily identify the golf ball placement area. Preferably, a golf ball automatic launching machine 5 is embedded and fixedly installed at the bottom of the target ground 3, and a ball outlet hole 301 is formed at the designated hitting position of the artificial turf mat, and a ball launching top rod 51 of the golf ball automatic launching machine 5 is vertically arranged at the ball outlet hole 301; when in use, the golf ball automatic launching machine 5 launches the ball from the ball outlet hole 301 through the ball launching top rod 51 thereof, and after hitting, the ball launching top rod 51 of the golf ball automatic launching machine 5 is retracted and then launches the next ball from the ball outlet hole 301 through the ball launching top rod 51 thereof, so that the ball is automatically launched in a cycle, the position of the ball launched each time is standard and consistent, manual placement of the ball on the designated hitting position is not required, automatic launching of the ball is achieved, and the ball outlet hole 301 serves as a designated position 31 area of the target ground 3.
[0035] The golf data detection method further comprises a light sensor and a light supplement device. The light sensor and the light supplement device are connected to the computer through wires. When the computer detects that the environment is below a set threshold (for example, ISO 200) through the light sensor, the computer starts the light supplement device to supplement light to reach the specified environmental brightness. The light supplement device is an LED lamp or an infrared light supplement lamp. The infrared light supplement lamp mainly uses infrared technology for lighting. Infrared is an electromagnetic wave with a longer wavelength than visible light, which cannot be directly seen by the human eye. The infrared light supplement lamp emits infrared light waves to provide lighting for the monitoring camera in night or low-light environments. ISO greater than 200 is suitable for indoor or overcast outdoor shooting, and can obtain better lighting and clear images to ensure that the subsequent images captured by the camera are clear, shadow-free, and overexposure-free. When in use, the threshold of the light sensitivity is set in the computer system, and the light intensity in the environment is obtained by monitoring the light intensity in the ball hitting space area in real time through the light sensor to determine whether the brightness is below the threshold so as to determine whether the light needs to be supplemented. The computer system compares the collected environmental brightness with the preset light sensitivity threshold. If the brightness is below the threshold, the light supplement device is automatically started by the computer to provide additional light to ensure the clarity of the image acquisition. If the brightness is below the set threshold, the computer will not start the A group binocular camera 1 and the B group binocular camera 2 to capture images to ensure that the collected images are clear and visible, so as to ensure that high-quality images can be obtained in low-light environments. After the image capture and collection of the camera are completed, the computer controls the light supplement device to be turned off to save power and prepare for the next collection. If the environmental brightness is not below the brightness threshold, the camera can directly capture images without additional light supplement measures, and the image capture and collection can be normally performed. By comparing the environmental light intensity with the preset light supplement standard, if the environmental light intensity does not reach the light supplement standard, a light supplement instruction is generated to supplement light to the shooting environment. The light supplement device is installed above the A group binocular camera 1, which can effectively resist the interference of external environmental light, thereby facilitating clear imaging of the camera. This makes the marks of the golf ball and the head of the club more clearly visible in the images captured by the camera, thereby improving the measurement accuracy. The light supplement method makes the measurement results less affected by the complex background and changes in natural light conditions indoors and outdoors, thereby ensuring that the ball speed and club speed data of the golf ball can be accurately obtained.
[0036] The detection steps are as follows:
[0037] Step 1: After being ready, start the work detection; start the activation detection work by computer control A group binocular camera 1, B group binocular camera 2, A group binocular camera 1 is tilted from back to front to shoot the space of the region and the target ground 3, B group binocular camera 2 is tilted from right to left to shoot the space of the region and the target ground 3, four cameras shoot respectively, two groups of binocular cameras shoot 4 target ground 3 images at the same time or alternately each time, the FIFO memory of the computer respectively caches a small amount of images shot by A group binocular camera 1 and B group binocular camera 2 as initial images;
[0038] Further of the preferred technical solution: the FIFO memory of the computer respectively caches 3-6 small amount of images shot by each camera, four cameras totally cache 12-24 images as original images (initial images) without golf balls, so that the FIFO memory fast forwards and fast exits the images to improve the operation efficiency; preferably: this step is that the FIFO memory respectively caches 4 images shot by each camera, four cameras totally cache 16 images.
[0039] Step 2: the image processor of the computer continuously detects and judges the images cached by the FIFO memory through image processing algorithm, analyzes whether the images in and out are consistent; when the golf ball is placed in the designated position 31 area of the target ground 3 (preferably: when the golf ball is placed or enters or is sent out in the designated position 31 area of the target ground 3), A group binocular camera 1 and B group binocular camera 2 each shoot the images with golf balls, and the FIFO memory of the computer respectively caches a small amount of images with golf balls shot by A group binocular camera 1 and B group binocular camera 2; the image processor of the computer compares the initial images through image processing algorithm, identifies the position of the circular target in the image through image processing algorithm, thereby determines that the circular target is the golf ball in the static state, and then the image processor records the coordinate position of the golf ball in the image shot by each camera of the two groups respectively as the judgment basis of whether the displacement of the golf ball occurs subsequently, and continuously tracks and judges the position of the golf ball;
[0040] Further of the preferred technical solution: a designated position 31 area for setting the golf ball is defined on the right side of the target ground 3, for example: a circular or square line frame is drawn. Preferably: the image processor of the computer system sets a virtual area matching the designated position 31 of the target ground 3, so that the golf ball is placed in the area of the designated position 31 each time, that is, in the virtual area, so as to improve the accuracy of detection.
[0041] Further of the preferred technical solutions: the A group binocular camera 1 is obliquely arranged above the back of the golf ball, the B group binocular camera 2 is obliquely arranged above the right side of the golf ball, both groups of binocular cameras are obliquely facing the golf ball, the distance of the B group binocular camera 2 to the golf ball is shorter than that of the A group binocular camera 1; the distance between the A group binocular camera 1 and the golf ball is 1.5-3 meters, preferably 2.5 meters, the higher the shooting area space is, the more extensive the space is, and the longer golf ball flight trajectory can be shot, which is more accurate for subsequent measurement and extraction of golf ball flight data; the oblique angle between the A group binocular camera 1 and the golf ball is 45-70 degrees, preferably 60 degrees; the distance between the B group binocular camera 2 and the golf ball is 30-80 centimeters, preferably 50 centimeters; the oblique angle between the B group binocular camera 2 and the golf ball is 30-60 degrees, preferably 45 degrees; the A group binocular camera 1 and the B group binocular camera 2 are fixed in position and do not move, the range of the area space and the target ground 3 is consistent every time; the two groups of binocular cameras form a non-coplanar collection angle, which enhances the three-dimensional reconstruction accuracy.
[0042] The A group binocular camera 1 is used to shoot the area space and the target ground 3 from back to front, and collect the still and motion displacement data of the golf ball from the back.
[0043] The B group binocular camera 2 is used to obliquely shoot the area space and the target ground 3 from right to left, and collect the still and motion displacement data of the golf ball from the right.
[0044] The A group binocular camera 1 and the B group binocular camera 2 have four cameras in common; the FIFO memory of the computer buffers 3-6 small images shot by each camera respectively, and 12-24 images are buffered by the four cameras in total; the images shot by each camera are identified by an image processing algorithm to identify the golf ball in the image, and the initial position of the golf ball in the image in a still state is recorded.
[0045] The image processing algorithm is a Hough circle algorithm, which detects and identifies the position of the circular target in the image through the Hough circle algorithm, and the circular target is the golf ball.
[0046] The Hough circle algorithm is an image processing algorithm based on parameter space voting mechanism, which is used to detect the circular contour in the image, and its core principle is to map the circular boundary in the image space to a three-dimensional parameter space (circle center coordinates a, b and radius r), and locate the circle center and radius by accumulator statistics; the following is the algorithm principle:
[0047] Parameter space mapping:
[0048] Standard equation of a circle: (x-a) 2 +(y-b) 2 =r2 Each edge (x,y) in image space corresponds to a three-dimensional cone in parameter space, and the intersection of all cones is the potential center (a,b,r).
[0049] Algorithm flow:
[0050] Edge detection: use Canny, Sobel operator to extract edge binary;
[0051] Gradient calculation: the gradient direction of edge points points to the center, narrowing the search range of the center;
[0052] Parameter space voting:
[0053] Traverse edge points, draw a straight line along the gradient direction;
[0054] Count all (a,b) coordinates on the straight line in the accumulator;
[0055] Peak detection: (a,b) with high votes in the accumulator as the candidate center;
[0056] Radius determination: count the distance histogram of candidate centers to edge points, and the peak is the radius r.
[0057] Step 3: Golf ball displacement: during the image caching process in the FIFO memory, the image processing algorithm of the image processor continuously analyzes the images cached by the A group binocular camera 1 and the B group binocular camera 2 respectively;
[0058] Through the image processing algorithm of the image processor, compare the images taken by the A group binocular camera 1 with the reference image in the original static state to analyze whether the golf ball has changed from the original coordinate position, and detect whether the golf ball is consistent with the original coordinate position;
[0059] Through the image processing algorithm of the image processor, compare the images taken by the B group binocular camera 2 with the reference image in the original static state to analyze whether the golf ball has changed from the original coordinate position, and detect whether the golf ball is consistent with the original coordinate position;
[0060] When a club enters the shooting area of the A group binocular camera 1 and the B group binocular camera 2, the A group binocular camera 1 and the B group binocular camera 2 will also take the club respectively, and the FIFO memory of the computer will cache the images including the golf ball and the club;
[0061] When the clubface strikes the golf ball, the golf ball undergoes dynamic flight, and the club rotates dynamically during the swing. The golf ball itself also rotates during its dynamic flight. The flight path of the golf ball is from back to front along the impact screen 4, which is made of flexible fibers and provides cushioning upon impact. The image processor, through its image processing algorithm, detects the displacement of the golf ball and club. If the golf ball leaves its original designated position 31, it is considered to have exceeded a preset threshold, indicating a strike event has occurred. The image processor then feeds this dynamic information back to the computer system, which in turn controls Group A. B-group binocular camera 1 and B-group binocular camera 2 continuously capture high-frequency images of the spatial area and the target ground 3, respectively. The computer's FIFO memory caches 40-80 images of the golf ball before and after impact, as well as multiple frames showing changes in the club's swing position, captured by B-group binocular camera 1. The computer's FIFO memory caches 40-80 images of the golf ball before and after impact, as well as multiple frames showing changes in the club's swing position, captured by B-group binocular camera 2. The FIFO memory will cache a total of 80-160 images of the golf ball and multiple frames showing changes in the club's swing position captured by both groups of cameras. That is, the FIFO memory will cache 20 images captured by each camera.
[0062] This means that there are approximately 40 images, and the four cameras collectively buffer 80 to 160 images. Each camera captures one image every 2 milliseconds, resulting in 500 images per minute.
[0063] Further optimization of the preferred technical solution: High-frequency shooting refers to increasing the number of shots within the same time period, which is more than the number of shots taken when the golf ball is stationary. The time interval between two images is shorter, and the time interval between dynamic and continuous shots of the golf ball and club in the image is also shorter. This makes it more accurate to reconstruct the three-dimensional motion trajectory of the golf ball and club and to calculate the data values of the golf ball and club more accurate. The FIFO memory continuously caches multiple frames of images, covering the entire process from when the golf ball starts moving until it leaves the shooting and monitoring area, ensuring that the golf ball and club are completely recorded in motion.
[0064] Further optimization of the preferred technical solution: Group A binocular camera 1 and Group B binocular camera 2 together have four cameras; the image processor uses image processing algorithms to analyze and compare the first image captured by each camera and the previous images that have been entered into the FIFO memory. When the position of the golf ball is no longer at the designated target ground 3 position in the previous images, it is considered that the golf ball has been hit and thus the displacement of the golf ball is detected and determined.
[0065] The FIFO memory of the computer respectively buffers 20-40 multi-frame images of each camera, and four cameras buffer 80-160 multi-frame images in total.
[0066] Preferably: Of course, the criteria for the computer system to determine the "ball hitting event" can also include: ball position movement threshold, club approach path, impact time window overlap, and other criteria to improve the intelligent detection level.
[0067] Step 4: Data calling: The data manager of the computer continuously calls the multi-frame images of the golf ball and club position changes respectively buffered by the aforementioned A group binocular camera 1 and B group binocular camera 2 in time sequence;
[0068] Further preferred technical solutions: A group binocular camera 1 and B group binocular camera 2 have four cameras in total; the data manager of the computer continuously calls the multi-frame images of the golf ball and club position changes respectively buffered by the aforementioned four cameras in time sequence.
[0069] Step 5: Three-dimensional reconstruction: The data manager sends all the multi-frame images of the golf ball and club position changes buffered in time sequence to the three-dimensional reconstruction software of the computer, which uses its own stereo vision technology, uses a lightweight target detection algorithm to identify the positions of the golf ball and club in the images, and then converts the real object coordinates of the two-dimensional images into world coordinates according to the three-dimensional reconstruction formula, and reconstructs the three-dimensional motion trajectory of the golf ball and club based on the position changes of the golf ball and club in the time sequence images.
[0070] Further preferred technical solutions: The three-dimensional reconstruction software calculates whether the image meets the required quality or preset benchmark through the image enhancement algorithm of its image enhancement software. If it meets, no adjustment is needed; if it does not meet, the image is adjusted in brightness, contrast, saturation, hue, etc. through the image enhancement software (such as VisualSFM) to increase its clarity, reduce noise, improve the contrast and brightness of the image, etc., so that the golf ball and club are more prominent, the lightweight target detection algorithm can identify the positions of the golf ball and club in the image more accurately, and the three-dimensional motion trajectory of the golf ball and club can be reconstructed more accurately.
[0071] Further preferred technical solutions: The three-dimensional reconstruction can also fit the ball and club in the image with the spatial trajectory based on the stereo vision principle of each group of binocular cameras and the basic parameters set by the three-dimensional reconstruction software system to reconstruct a more complete motion path.
[0072] Further of the preferred technical solutions: In the process of three-dimensional reconstruction software for golf ball and club parameter extraction, a two-stage parameter modeling is adopted: in the first stage, the preliminary speed is calculated based on the difference between direct images, and in the second stage, the three-dimensional trajectory is reconstructed combined with the preliminary speed, and then physical modeling correction is performed, including motion trend fitting, sliding window filtering, angle curve fitting, etc., so that the result is smoother and the anti-interference ability is stronger.
[0073] Further of the preferred technical solutions: To improve the stability of target detection and recognition, a multi-modal target fusion recognition mechanism can also be introduced in this step, combining the color features, shape boundaries, ball texture, and club head marker patterns of golf balls and clubs, for multi-channel fusion recognition, significantly reducing the false recognition rate and missing detection rate.
[0074] Further of the preferred technical solutions: The three-dimensional reconstruction software is COLMAP or Blender or Meshroom or 3DFZephyr or Agisoft Metashape or Pix4Dmapper.
[0075] Further of the preferred technical solutions: A lightweight ai target detection algorithm YOLOv8 is used to track the images stored in the FIFO memory based on time series, to realize real-time recognition and tracking of golf balls and clubs, and through the ai target detection algorithm YOLOv8, the shape features of golf balls and clubs are respectively identified and located in the image.
[0076] The high-efficiency processing capability of the ai target detection algorithm YOLOv8 ensures that even in high dynamic and complex backgrounds, the positions of golf balls and clubs can be quickly and accurately recognized and tracked, improving the real-time performance and reliability of subsequent measurements; through the ai target detection algorithm YOLOv8 and image processing algorithms, real-time monitoring and accurate analysis of the motion state of the ball and the motion state of the club are realized.
[0077] The ai target detection algorithm YOLOv8 can maintain high detection accuracy while having a small model size and low computational complexity, making it particularly suitable for devices that have clear shape and edge boundaries between green targets and white golf balls.
[0078] The AI target detection algorithm YOLOv8 refers to locating and recognizing targets of interest in images or videos, outputting the bounding box and class label of the target. The core tasks of the target detection algorithm include locating the bounding box of the target, classifying the target class, and calculating the confidence of the target existence.
[0079] AI Target Detection Algorithm YOLOv8 (You Only Look Once version 8) is a deep learning model based on Convolutional Neural Network (CNN), specifically designed for target detection tasks. Compared to traditional CNN classification models, YOLOv8 can simultaneously complete target positioning (Bounding Box) and classification (Classification), making it particularly suitable for computer vision tasks such as golf ball and club recognition. This article will detail how to use YOLOv8 to achieve golf club and ball recognition, covering the complete process of data collection, preprocessing, model training, optimization, and deployment.
[0080] I. Golf Club Recognition:
[0081] 1. Data Collection
[0082] 1.1 Data Sources
[0083] Golf Club Image Collection: Use high-resolution cameras (cameras) or smartphones to take pictures of different types of golf clubs (such as wood clubs, iron clubs, putters, etc.), collect images from different angles (front, side, top), and different lighting conditions (indoor, outdoor, shade), to improve model generalization ability. If swing motion analysis is involved, use high-speed cameras to record videos and extract key frames as training data.
[0084] Background Images (Negative Samples): Collect images of application scenarios that do not contain golf clubs (such as golf courses, grasslands, golf bags, etc.) to enhance model discrimination ability and reduce false positives.
[0085] 1.2 Data Scale
[0086] It is recommended to collect at least 1000-5000 golf club images, generally 3500 images, to ensure data diversity. If the data is insufficient, data augmentation or transfer learning can be used to improve model performance.
[0087] 2. Data Preprocessing
[0088] 2.1 Data Filtering
[0089] Remove blurred, low-resolution, and severely occluded images.
[0090] Ensure that each image contains at least one complete golf club (clearly visible club head or shaft).
[0091] 2.2 Data Annotation
[0092] Bounding Box annotation and class label assignment for golf clubs using annotation tools such as LabelImg, CVAT, or Roboflow. The annotation format is typically in YOLO format (.txt file) containing:
[0093] <class_id><x_center><y_center> <width> <height>
[0094] where (x_center, y_center) is the bounding box center coordinate, (width, height) is the width and height of the box, both normalized to the [0, 1] interval.
[0095] 2.3 Data Augmentation
[0096] To improve model robustness, the following augmentation strategies can be used:
[0097] Geometric Transformations: Random rotation (±15°), horizontal / vertical flip, scaling (80% ~ 120%).
[0098] Color Adjustment: Brightness, contrast, saturation changes to simulate different lighting conditions.
[0099] Occlusion Simulation: Randomly add mosaic or blur areas to enhance the model's ability to resist occlusion.
[0100] 2.4 Data Normalization
[0101] Scale image pixel values to [0, 1] or normalize to [-1, 1] to accelerate model convergence. Use Z-Score normalization or Min-Max normalization to process data distribution.
[0102] 2.5 Dataset Division
[0103] Training Set (60% ~ 70%): Used for model training.
[0104] Validation Set (15% ~ 20%): Used for parameter tuning and preventing overfitting.
[0105] Test Set (15% ~ 20%): Used for final model evaluation.
[0106] 3. Train Model
[0107] 3.1 Loss Function
[0108] Use the labeled dataset to train the CNN. In this process, through the cross-entropy loss function, optimize the classification or segmentation task, and constantly adjust the network weights to minimize the loss function:
[0109]
[0110] where N is the number of samples, M is the number of categories, yic is the true label, and pic is the predicted probability.
[0111] 3.2 Model Evaluation and Adjustment
[0112] Use the validation set to evaluate model performance, and adjust model parameters or architecture according to the results, such as adding regularization to prevent overfitting, adjusting learning rate, etc.
[0113] 3.3 Testing and Validation
[0114] Finally, evaluate the model's final performance on an independent test set. If satisfied, deploy the model into real-world applications, such as integrating into a golf club recognition system or assisting coaches in analyzing the types of clubs used by players. Otherwise, add more data for training or filter out images that cannot recognize golf clubs, re-label and re-train.
[0115] II. Golf Club Recognition
[0116] 1. Data Collection
[0117] 1.1 Data Sources
[0118] Golf Ball Image Collection: Use high-resolution cameras (cameras) or smartphones to take pictures of golf balls, collect images under different angles, different lighting conditions (indoor, outdoor, shadow), to improve the generalization ability of the model. If it involves golf ball flight analysis, use high-speed cameras to record videos and extract key frames as training data.
[0119] Background Images (Negative Samples): Collect application scenarios that do not contain golf balls (such as golf courses, lawns, golf bags, etc.), to enhance the model's discrimination ability and reduce false positives.
[0120] 1.2 Data Scale
[0121] It is recommended to collect at least 100-500 golf club images, generally 300, to ensure data diversity. If the data is insufficient, data augmentation or transfer learning can be used to improve model performance.
[0122] 2. Data Preprocessing
[0123] 2.1 Data Filtering
[0124] Remove images that are blurry, low-resolution, or severely occluded.
[0125] Ensure that each image contains at least one complete and clear golf ball.
[0126] 2.2 Data Annotation
[0127] Use annotation tools (such as LabelImg, CVAT, Roboflow) to annotate the golf ball with bounding boxes (Bounding Boxes) and assign class labels (such as driver, iron, putter). The annotation format is usually YOLO format (.txt file), which includes:
[0128] <class_id> <x_center> <y_center> <width> <height>
[0129] where (x_center, y_center) is the bounding box center coordinate, (width, height) is the width and height of the box, both normalized to the [0, 1] interval.
[0130] 2.3 Data Augmentation
[0131] To improve model robustness, the following augmentation strategies can be used:
[0132] Geometric Transformations: Random rotation (±15°), horizontal / vertical flipping, scaling (80% ~ 120%).
[0133] Color Adjustment: Brightness, contrast, saturation changes to simulate different lighting conditions.
[0134] Occlusion Simulation: Randomly add mosaic or blur areas to enhance the model's ability to resist occlusion.
[0135] 2.4 Data Normalization
[0136] Scale image pixel values to [0, 1] or normalize to [-1, 1] to speed up model convergence. Use Z-Score normalization or Min-Max normalization to process data distribution.
[0137] 2.5 Dataset Division
[0138] Training Set (60% ~ 70%): Used for model training.
[0139] Validation Set (15% ~ 20%): Used for parameter tuning and preventing overfitting.
[0140] Test Set (15% ~ 20%): Used for final model evaluation.
[0141] 4. Train Model
[0142] 3.1 Loss Function
[0143] Use the labeled dataset to train the CNN. In this process, through the cross-entropy loss function, optimize the classification or segmentation task, and constantly adjust the network weights to minimize the loss function:
[0144]
[0145] where N is the number of samples, M is the number of categories, yic is the true label, and pic is the predicted probability.
[0146] 3.2 Model Evaluation and Adjustment
[0147] Use the validation set to evaluate the model performance, and adjust the model parameters or architecture according to the results, such as adding regularization to prevent overfitting, adjusting learning rate, etc.
[0148] 3.3 Testing and Validation
[0149] Finally, the final performance of the model is evaluated on a separate test set. If satisfied, the model can be deployed to real-world applications, such as integrating into a golf club recognition system or assisting coaches in analyzing the types of balls used by players. Otherwise, more data can be added for training, or images that cannot identify golf balls can be filtered out for relabeling and retraining.
[0150] Three, the specifications of golf balls mainly include diameter and weight, and the standard sizes are determined by the Royal and Ancient Golf Club of St Andrews (R&A) and the United States Golf Association (USGA).
[0151] 1. Size Standards
[0152] Diameter: The diameter of a golf ball must not be less than 42.67 mm (1.68 inches), usually within the range of 42.67 mm ± 0.02 mm.
[0153] Weight: The upper limit of the weight of the ball is 45.93 grams (1.62 ounces).
[0154] 2. Impact of Size on Performance
[0155] Aerodynamic Performance: Golf balls that meet the standards perform more smoothly in the air. The diameter of 42.67 mm and the design of surface grooves complement each other, allowing the ball to reduce air resistance and increase flight distance.
[0156] Feeling of hitting: The weight and diameter together determine the feeling of hitting the ball. Smaller diameter may be more suitable for controlled play, while larger diameter is more suitable for improving hitting stability.
[0157] Distance and accuracy: The size and weight of the ball will affect the balance between distance and accuracy. Slightly heavier balls are more stable in the wind, while lightweight balls are suitable for a more relaxed hitting feel.
[0158] 3. Material and Design
[0159] Groove design: The surface of a golf ball usually has 300 to 500 grooves, which can reduce air resistance and bring "lift" during the flight of the ball, helping players hit more stable and farther balls.
[0160] Material selection: Golf balls are usually divided into two or more layers. The inner core is usually made of rubber material, and the outer shell is made of tough plastic or other materials. Different material combinations will affect the rotation speed, hardness and feel of the ball, suitable for different types of players.
[0161] Further preferred technical solutions: through the images taken by the two cameras of the A group binocular camera 1, and combining the parallax Z between the images taken by the two cameras c , according to the three-dimensional reconstruction formula, convert the pixel coordinates into camera coordinates, and then according to the rotation matrix and translation matrix calibrated by the golf ball and club taken by the two cameras, convert the camera coordinates into world coordinates;
[0162] through the images taken by the two cameras of the B group binocular camera 2, and combining the parallax Z between the images taken by the two cameras c , according to the three-dimensional reconstruction formula, convert the pixel coordinates into camera coordinates, and then according to the rotation matrix and translation matrix calibrated by the golf ball and club taken by the two cameras, convert the camera coordinates into world coordinates;
[0163] Use a stereo matching algorithm to estimate the parallax between adjacent images; the parallax refers to the difference in pixel position of the same object (the object is a golf ball and a club) in two images, and the parallax can be used to calculate the angle, distance, etc. of the object; in this step, not only the parallax between the lenses of each group of binocular cameras can be calculated, but also the parallax between the two groups of binocular cameras can be measured; and according to any two of the four camera lenses, triangulation can be performed to accurately obtain the angle, distance, etc. of the object in space, and the physical information of the object, and further collect more data and physical information for coordinate conversion, and use the parallax information to convert the position of the ball and the club in the image coordinate system to a three-dimensional point in the world coordinate system, and output the converted three-dimensional point according to the time sequence, which is used for subsequent motion analysis and data collection; that is: output the time sequence trajectory points for motion analysis, which can be used to calculate the speed, acceleration, etc. of the ball and the club, and provide data support for motion analysis.
[0164] Preferably, the stereo matching algorithm of the present application adopts SGBM semi-global algorithm; SGBM (Semi-Global Block Matching) is a semi-global matching algorithm for calculating disparity in binocular vision, and the implementation in OpenCV is semi-global block matching (SGBM), which can guarantee the quality of the disparity map and reduce the computational complexity.
[0165] The principle of SGBM can be divided into the following steps:
[0166] 1. Preprocessing: use a horizontal Sobel operator to perform edge detection on the left and right images to obtain gradient images.
[0167] 2. Cost computation: For each pixel, compute its cost with the corresponding pixel under different disparities, usually using absolute difference or squared difference as the cost function.
[0168] 3. Energy function minimization: For each pixel, define an energy function including a data term and a smoothness term. The data term represents the cost, and the smoothness term represents the disparity continuity of neighboring pixels. Using dynamic programming, compute the cumulative cost along multiple directions (usually 8 or 16) and take the minimum as the final cost.
[0169] 4. Disparity map generation: For each pixel, select the best disparity according to the final cost and generate the disparity map.
[0170] 5. Disparity map post-processing: For outliers or holes in the disparity map, use some post-processing methods to fix or fill, such as median filtering, WLS filtering, etc.
[0171] Parameters of SGBM:
[0172] The parameters of SGBM are as follows:
[0173] • minDisparity: The minimum disparity value, default is 0.
[0174] • numDisparities: The disparity range, default is 16. Must be an integer multiple of 16.
[0175] • blockSize: The matching block size, default is 3. Must be an odd number and greater than 1.
[0176] • P1: The first parameter controlling the disparity smoothness, default is 8blockSizeblockSize. The larger P1, the more likely to generate a continuous disparity map.
[0177] • P2: The second parameter controlling the disparity smoothness, default is 32blockSizeblockSize. The larger P2, the more likely to eliminate small disparity changes. P2 must be greater than P1.
[0178] • disp12MaxDiff: The maximum disparity difference allowed for left-right consistency check, default is -1, indicating no check.
[0179] • preFilterCap: The upper limit of the gradient value when pre-processing, default is 63.
[0180] • uniquenessRatio: The threshold for uniqueness check, default is 10. Indicates that the ratio between the best disparity value and the second-best disparity value must be greater than the threshold to be considered valid.
[0181] • speckleWindowSize: Window size where speckle noise is considered for elimination. Default is 0, which means no elimination.
[0182] • speckleRange: Maximum disparity variance considered for elimination of speckle noise. Default is 0, which means no elimination.
[0183] • mode: SGBM algorithm selection mode. Default is StereoSGBM::MODE_SGBM. Possible values are StereoSGBM::MODE_SGBM_3WAY (fast),
[0184] StereoSGBM::MODE_HH4 (slow), StereoSGBM::MODE_SGBM (medium), StereoSGBM::MODE_HH (slow).
[0185] The coordinate detailed conversion process is as follows (three-dimensional reconstruction formula is as follows):
[0186] 5.1: Calculate normalized coordinates from pixel coordinates (u, v):
[0187]
[0188] 5.2: Calculate camera coordinates from normalized coordinates:
[0189]
[0190] 5.3: Calculate world coordinates from normalized coordinates:
[0191]
[0192] Step 6: Data extraction: The computer's data acquisition processor acquires one or more of the following data from the three-dimensional motion trajectory of the golf ball: ball speed, ball horizontal deviation angle, ball acceleration, ball launch angle, ball rotation value, and ball direction; the computer's data acquisition processor acquires one or more of the following data from the three-dimensional motion trajectory of the club head: club speed, club horizontal deviation angle, club face impact point, and club face angle; the above multiple data indicators can meet the high-dimensional data requirements of professional training and motion simulation analysis;
[0193] The motion parameters of the golf ball are obtained by calculating the position difference between multiple frames of images combined with time stamps, and are optimized by interpolation and filtering methods to improve stability and robustness.
[0194] The motion parameters of the club head are obtained by calculating the position difference between multiple frames of images combined with time stamps, and are optimized by interpolation and filtering methods to improve stability and robustness.
[0195] Interpolation is mainly used for data fitting, which estimates the value at unknown position by known data points, used to handle missing data or estimate the value of unknown data points; interpolation is a method of constructing new data points from known data points to estimate the value of intermediate points, interpolation methods include linear interpolation, polynomial interpolation (such as Lagrange interpolation, Newton interpolation), piecewise linear interpolation, spline interpolation (such as cubic spline) and nearest neighbor interpolation, this step adopts linear interpolation.
[0196] Filtering method is mainly used to reduce noise interference in data.
[0197] Three-dimensional motion trajectory includes three-dimensional trajectory point sequence and timestamp information;
[0198] The data acquisition processor acquires data of ball speed, ball horizontal deviation angle, ball acceleration, ball launch angle, ball rotation value, ball direction, club speed, club horizontal deviation angle, club face impact point and club face tilt angle through sliding window algorithm and filtering algorithm;
[0199] The ball speed is calculated based on the position change of the golf ball in the world coordinate system in adjacent frame images and the time interval; preferably, the estimation is made by time series interpolation method.
[0200] The club head speed is calculated based on the position change of the club head in the world coordinate system in adjacent frame images and the time interval; preferably, the estimation is made by time series interpolation method.
[0201] The acceleration of the golf ball is calculated according to the rate of change of speed in consecutive multiple frame images;
[0202] The angular velocity of the club horizontal deviation angle is calculated according to the angle change of the club shaft posture marker in consecutive images and combined with the timestamp;
[0203] The angle is calculated based on the included angle formed by the spatial posture and the direction of motion when the club face and the golf ball are in contact;
[0204] The club face impact point is calculated based on the spatial posture and the direction of motion when the club face and the golf ball are in contact;
[0205] The ball horizontal deviation angle is calculated based on the included angle between the golf ball launch and the target line in the horizontal plane;
[0206] The club face tilt angle is calculated based on the included angle between the center line of the club face and the vertical line of the ground;
[0207] The ball launch angle is calculated based on the included angle between the launch direction of the golf ball and the ground;
[0208] According to the trajectory fitting of the position change of the golf ball from the static state to the initial motion, the vector of the initial velocity direction is obtained, and the flight direction of the golf ball is obtained.
[0209] By analyzing the change of the golf ball surface texture in the continuous image, the spin axis direction and the rotation speed of the golf ball are estimated, and the rotation value of the ball is obtained.
[0210] The principle of the sliding window algorithm is a kind of sliding window data processing on time series data, and its core idea is to define a fixed size time window, the data in the window is used for certain calculation or processing, with the passage of time, the window slides forward continuously, each time contains the latest data point, and discards the earliest data point, so that the sliding window algorithm can dynamically process the information in the data stream. The sliding window algorithm belongs to the existing algorithm commonly used for image processing.
[0211] The basic steps of the sliding window algorithm are as follows: 1. Initialize the window: set the left pointer left and the right pointer right, both of which point to the beginning of the sequence at the beginning. 2. Expand the window: move the right pointer right to the right to expand the window range until the window meets certain conditions (for example, the sum of the elements in the window reaches a certain threshold). 3. Shrink the window: if the window meets the conditions, try to shrink the window by moving the left pointer left, and update the results. 4. Repeat steps 2 and 3: continue to move the right pointer to expand the window until the right pointer reaches the end of the sequence.
[0212] Filtering algorithm is used to reduce noise interference in data and extract useful signal components. Common filtering algorithms include mean filtering, median filtering and exponential weighted moving average (EWMA); mean filtering smooths the signal by calculating the average of all data points in the window; median filtering selects the median of data points in the window, which is suitable for removing impulse noise; EWMA gives higher weight to the latest data points, which is suitable for applications that need to quickly adapt to new trends.
[0208] Preferably: the application adopts median filtering; median filtering is a nonlinear digital image processing technique, mainly used to remove noise (especially salt and pepper noise), while retaining edge information well, avoiding the edge blurring problem caused by linear filter (such as mean filtering, Gaussian filtering). The formula of filtering algorithm: for image I(x,y), the output I'(x,y) of median filtering is: I'(x,y) = median{I(i,j) | (i,j) ∈ W(x,y)} where W(x,y) is the window centered at (x,y).
[0214] Step 7: data encapsulation: the data acquisition processor merges the collected golf ball and club data, and forms a data packet through encapsulation protocol, so as to complete the data acquisition of golf ball and club.
[0215] The application realizes accurate measurement of golf ball and club motion parameters by fusing two sets of binocular vision technology, image recognition and three-dimensional reconstruction algorithm, has the significant advantages of reasonable structure, accurate detection, stable operation and flexible deployment, and is suitable for various application scenarios such as golf teaching, training, entertainment and simulation system.
[0216] In the image acquisition process of the method, the images can be independently acquired by the binocular cameras from different angles and cached into frame sequences, time synchronization and space registration are performed in the subsequent three-dimensional reconstruction stage, the precision loss caused by different synchronization between frames is effectively reduced, and the method is especially suitable for high-speed motion scenes under high frame rate.
[0217] Next step: After forming the data packet, upload it to the golf simulation practice system terminal or mobile phone App terminal system through the communication module (such as WiFi, Bluetooth, etc.) of the computer system to realize parameter display or comparison with historical data or training feedback, so that users can view the data of this shot in real time and make shot decisions.
[0218] A golf data detection system based on a four-camera camera includes:
[0219] An image acquisition module is configured to acquire image sequences from different angles and distances by two sets of binocular cameras.
[0220] An image processing module is configured to recognize and locate the golf ball and club based on the acquired images.
[0221] A trajectory reconstruction module is configured to reconstruct the three-dimensional motion trajectory of the ball and club based on the image sequences.
[0222] A parameter calculation module is configured to calculate the motion parameters of the ball and club based on the three-dimensional trajectory.
[0223] A data upload module is configured to upload the motion parameters to a terminal device or a remote server.
[0224] The two sets of binocular cameras include a group A binocular camera and a group B binocular camera, the group A binocular camera includes a first camera 101 and a second camera 102, and the group B binocular camera includes a third camera 201 and a fourth camera 202.
[0225] The detection system can be flexibly deployed in different application scenarios, such as a family training environment, a simulation teaching system, a golf business hall, a mobile teaching vehicle and the like; and is also compatible with various output modes, including but not limited to: a local display device, a mobile App, a Web front end, a cloud server interface and the like, supports comparison and analysis with historical hitting data of a player, and forms a personalized hitting model and a training feedback mechanism based on visual data.
[0226] A computer readable storage medium stores computer executable instructions for causing a computer to perform the golf data detection method based on the four-camera camera. The medium is, for example, a readable storage hard disk or a readable storage U disk.< / height> < / width> < / height> < / width>
Claims
1. A four-camera-based golf data detection method, comprising a computer, a group A binocular camera, and a group B binocular camera, the group A binocular camera and the group B binocular camera being connected to the computer through data lines, the group A binocular camera comprising a first camera and a second camera, and the group B binocular camera comprising a third camera and a fourth camera; characterized in that: The A group binocular camera is obliquely arranged above the back of the target ground, and the B group binocular camera is obliquely arranged above the right side of the target ground, and the two groups of binocular cameras are obliquely arranged towards the region space and the target ground; the distance of the B group binocular camera to the target ground is shorter than that of the A group binocular camera; The detection steps are as follows: Step 1: starting the work detection; the A group binocular camera and the B group binocular camera are started and activated for detection work under the control of the computer, the A group binocular camera is obliquely arranged from the back to the front to shoot the region space and the target ground, the B group binocular camera is obliquely arranged from the right to the left to shoot the region space and the target ground, the four cameras are shot respectively, and the two groups of binocular cameras are shot simultaneously or alternately each time, and a total of four target ground images are shot, a small amount of images shot by the A group binocular camera and the B group binocular camera are respectively cached in the FIFO memory of the computer as initial images; Step 2: the image processor of the computer continuously detects and judges the images cached in the FIFO memory through the image processing algorithm, and analyzes whether the images are consistent; when the golf ball is placed at the specified position region of the target ground, the A group binocular camera and the B group binocular camera each shoot a small amount of images with the golf ball, and the images are respectively cached in the FIFO memory of the computer; the image processor of the computer compares and analyzes the images with the initial images through the image processing algorithm, identifies the position of the circular target in the images through the image processing algorithm, thereby determining that the circular target is the golf ball in the static state, and then records the coordinate positions of the golf ball shot by the two groups of cameras in the images respectively as the judgment reference of whether the displacement of the golf ball occurs subsequently; Step 3: displacement of the golf ball: in the process of caching the images in the FIFO memory, the images shot and cached by the A group binocular camera and the B group binocular camera are continuously analyzed by the image processor; whether the golf ball is displaced from the original coordinate position is analyzed by comparing and analyzing the images shot by the A group binocular camera with the reference images in the original static state through the image processing algorithm of the image processor, and whether the golf ball is consistent with the original coordinate position is detected; whether the golf ball is displaced from the original coordinate position is analyzed by comparing and analyzing the images shot by the B group binocular camera with the reference images in the original static state through the image processing algorithm of the image processor, and whether the golf ball is consistent with the original coordinate position is detected; When the club enters the shooting range of the A group binocular camera and the B group binocular camera, the A group binocular camera and the B group binocular camera will also shoot the club respectively, and the FIFO memory of the computer will cache the images including the golf ball and the club; When the club hits the golf ball, the golf ball flies dynamically and the club rotates dynamically. The image processor analyzes the displacement of the golf ball and the club through its image processing algorithm. The computer controls the A group of binocular cameras and the B group of binocular cameras to continuously and respectively shoot the target ground and the region space at high frequency. The FIFO memory of the computer caches 40-80 images of the golf ball and the club position changes before and after the shot taken by the A group of binocular cameras. The FIFO memory of the computer caches 40-80 images of the golf ball and the club position changes before and after the shot taken by the B group of binocular cameras. The FIFO memory caches 80-160 images of the golf ball and the club position changes taken by the two groups of cameras. Step 4: Data calling: The computer's data manager continuously calls the golf ball and club position change images cached by the A group of binocular cameras and the B group of binocular cameras respectively in time sequence. Step 5: Three-dimensional reconstruction: The data manager sends all the time sequence cached golf ball and club position change image data to the three-dimensional reconstruction software of the computer. The three-dimensional reconstruction software uses its own stereo vision technology and lightweight target detection algorithm to identify the position of the golf ball and the club in the image. Then, according to the three-dimensional reconstruction formula, the real object coordinates of the two-dimensional image are converted into world coordinates. Based on the position changes of the golf ball and the club in the time sequence image, the three-dimensional motion trajectory of the golf ball and the club is reconstructed. Step 6: Data extraction: The data acquisition processor of the computer collects the ball speed, ball horizontal offset angle, ball acceleration, ball take-off angle, ball rotation value, and ball direction data according to the three-dimensional motion trajectory of the golf ball. The data acquisition processor of the computer collects the club speed, club horizontal offset angle, club face hitting point, and club face angle data according to the three-dimensional motion trajectory of the club head. Step 7: Data packaging: The data acquisition processor merges the collected golf ball and club data and forms a data packet through the packaging protocol, thereby completing the golf ball and club data acquisition.
2. The golf data detection method based on four cameras according to claim 1, wherein: the color of the golf ball is different from and not similar to the color of the target ground; the color of the golf ball is white; the color of the target ground is green; and the target ground is flatly laid through a green artificial turf mat, and a designated hitting position of the golf ball is set on the artificial turf mat, and the golf ball is placed on the designated hitting position each time.
3. The golf data detection method based on four cameras according to claim 1, wherein: Step 1: The FIFO memory of the computer respectively caches 3-6 small images taken by each camera, and a total of 12-24 images are cached by the four cameras as original images without a golf ball, and the FIFO memory fast forwards and fast forwards the images to improve the operation efficiency. 4. The golf data detection method based on four cameras according to claim 1, characterized in that: Step 2: A group of binocular cameras are obliquely arranged above the back of the golf ball, and a group of binocular cameras are obliquely arranged above the right side of the golf ball, both groups of binocular cameras are obliquely arranged towards the golf ball, and the distance between the golf ball and the group B binocular cameras is shorter than that between the golf ball and the group A binocular cameras.
5. The golf data detection method based on four cameras according to claim 4, characterized in that: Step 2: The distance between the group A binocular cameras and the golf ball is 1.5-3 meters, the oblique angle between the group A binocular cameras and the golf ball is 45-70 degrees, the distance between the group B binocular cameras and the golf ball is 30-80 centimeters, the oblique angle between the group B binocular cameras and the golf ball is 30-60 degrees, and the group A binocular cameras and the group B binocular cameras are fixed in position and do not move, the area space and the target ground range for each shooting are consistent; The group A binocular cameras are used to shoot the area space and the target ground from back to front, and collect the static and motion displacement data of the golf ball from the back; The group B binocular cameras are used to obliquely shoot the area space and the target ground from right to left, and collect the static and motion displacement data of the golf ball from the right.
6. The golf data detection method based on four cameras according to any one of claims 1-5, characterized in that: Step 2: The group A binocular cameras and the group B binocular cameras have four cameras in total; the FIFO memory of the computer respectively buffers 3-6 images taken by each camera, and 12-24 images are buffered by the four cameras in total; the images taken by each camera are respectively identified by an image processing algorithm, and the initial position of the golf ball in the images is recorded when the golf ball is in a static state; The image processing algorithm is a Hough circle algorithm, which can detect and identify the position of a circular target in the images, and the circular target is the golf ball.
7. The golf data detection method based on four cameras according to claim 1, characterized in that: Step 3: The group A binocular cameras and the group B binocular cameras have four cameras in total; the image processor respectively analyzes and compares the first image and the previous images of each camera that have entered the FIFO memory through the image processing algorithm, and when the position of the golf ball is not at the specified target ground position in the previous images, it is considered that the golf ball has been hit away, so as to detect and determine that the golf ball has been displaced; The FIFO memory of the computer respectively buffers 20-40 images taken by each camera, and 80-160 images are buffered by the four cameras in total.
8. The golf data detection method based on four cameras according to claim 1, characterized in that: Step 4: The A group binocular camera and the B group binocular camera have four cameras in common; the computer's data manager continuously calls the high-resolution golf ball and club position change multi-frame images in the camera's self-shooting buffer in time sequence respectively.
9. The golf data detection method based on four cameras according to claim 1, characterized in that: Step 5: The three-dimensional reconstruction software is COLMAP or Blender or Meshroom or 3DF Zephyr or Agisoft Metashape or Pix4Dmapper; Using the lightweight ai target detection algorithm YOLOv8 based on time series tracking FIFO memory cache images, the real-time recognition and tracking of golf balls and clubs are realized, and the shape features of golf balls and clubs are identified and located in images through the ai target detection algorithm YOLOv8; The images taken by two cameras of the binocular camera of group A are combined with the parallax Z of the images taken by the two cameras c The pixel coordinates are converted into camera coordinates according to a three-dimensional reconstruction formula, the rotation matrix and the translation matrix are calibrated according to the golf ball and the club taken by the two cameras, and the camera coordinates are converted into world coordinates. The images taken by two cameras of the binocular camera of group B are combined with the parallax Z of the images taken by the two cameras c The pixel coordinates are converted into camera coordinates according to a three-dimensional reconstruction formula, the rotation matrix and the translation matrix are calibrated according to the golf ball and the club taken by the two cameras, and the camera coordinates are converted into world coordinates. The detailed conversion process is as follows (three-dimensional reconstruction formula is as follows): 5.1: Calculate the normalized coordinates from the pixel coordinates (u, v): 5.2: Calculate the camera coordinates from the normalized coordinates: 5.3: Calculate the world coordinates from the normalized coordinates:
10. The golf data detection method based on four cameras according to claim 1, characterized in that: Step 7: The three-dimensional motion trajectory includes a three-dimensional trajectory point sequence and timestamp information; The data acquisition processor acquires the data of ball speed, ball horizontal offset angle, ball acceleration, ball launch angle, ball rotation value, ball direction, club speed, club horizontal offset angle, club face impact point, and club face tilt angle through sliding window and filtering algorithm; Based on the position change of the golf ball in the world coordinate system and the time interval in the adjacent frame images, the ball speed is calculated and obtained; Based on the position change of the golf ball in the world coordinate system and the time interval in the adjacent frame images, the ball speed is calculated and obtained; According to the change rate of speed in continuous multi-frame images, the acceleration of the golf ball is calculated and obtained; According to the angle change of the club shaft posture marked in continuous images, and combined with the timestamp, the angular velocity of the club horizontal offset angle is calculated and obtained; Based on the included angle formed by the spatial posture and the motion direction when the club face and the golf ball are in contact, the angle is calculated and obtained; Based on the included angle formed by the spatial posture and the motion direction when the club face and the golf ball are in contact, the club face impact point is obtained; Based on the included angle between the golf ball launch and the target line in the horizontal plane, the ball horizontal offset angle is obtained; Based on the included angle between the club face center line and the vertical line of the ground, the club face tilt angle is obtained; Based on the included angle between the golf ball launch direction and the ground, the ball launch angle is obtained; According to the position change trajectory of the golf ball from static to initial motion, the flight direction of the golf ball is obtained by fitting the initial speed direction vector; By analyzing the change of the golf ball surface texture in continuous images, the spin axis direction and rotation speed of the golf ball are estimated, and the ball rotation value is obtained.