## 2 Materials and Methods  
### The Architecture of the System and Ball Detection  
In table tennis training, ball landing accuracy and hitting pose analysis are the key factors for beginners and intermediate-level players. Therefore, we build a system based on computer vision and user interface systems. The general architecture of the system is illustrated in Figure 1. The hardware of the table tennis training system comprises cameras, a computer, a monitor, and a projector. Since the goal of this study is to build a system with an affordable cost of <USD 800, we choose two low-cost, high-speed industrial cameras (0.9 megapixels with a 3 min exposure time at 120 frames per second) to capture the table tennis balls and a webcam to capture the player's hitting pose. The computer (core i5-10400F (Intel, Santa Clara, CA, USA) with GTX 2060S (Nvidia, Santa Clara, CA, USA)) runs the system's software, processes the captured images, and outputs information and interactive content. The monitor and projector display this processed information, including three-dimensional animations of the table tennis ball and projections of its drop points. The software for the intelligent table tennis training system includes table tennis motion state analysis, human motion analysis, and an interactive interface. The motion state analysis uses images captured by the stereo vision system to identify the table tennis ball through deep learning methods and to calculate its three-dimensional position. The athlete motion analysis utilizes the video stream from the webcam to detect the athlete's body posture, analyze their movements, and score their actions. The interactive interface then displays information such as three-dimensional animations of the table tennis ball and the drop point positions on the table. Ball recognition is achieved through binocular vision. Specifically, we use the stereo rectification algorithm for binocular images to obtain two images with parallel imaging surfaces. In this setup, T is the horizontal distance between the two cameras, x1 is the horizontal coordinate of point P on the left camera image, xr is the horizontal coordinate of  
Figure 1: General architecture of the system based on computer vision. The hardware of the table tennis training system comprises cameras, a computer, a monitor, and a projector. point P on the right camera image, Z is the depth of point P, and f is the focal length of the camera. To observe the depth Z, we can use the principle of similar triangles:  
\[\frac{\mathrm{T-(x_{l}-x_{r})}}{\mathrm{Z-f}}=\frac{\mathrm{T}}{\mathrm{Z}} \tag{1}\]  
In Equation (1), \(x_{l}-x_{r}\) is the disparity d. Therefore, for objects for which depth needs to be estimated, the core issue is to find the pixel points that belong to the object on the left and right camera images, match these pixel points one by one, and calculate the disparity of their horizontal image coordinates [21]. In designing the table tennis tracking and position estimation algorithms, our system employs a lightweight yet high-performance object detection neural network. This is combined with classical computer vision and camera imaging algorithms, enabling us to achieve highly accurate measurements while adhering to cost constraints [22]. Leveraging efficient optimization algorithms and advanced software architecture, our system achieves the real-time calculation of table tennis trajectories in less than 10 min, even on platforms with limited computational capabilities, surpassing the human eye's capture rate by a factor of two. In summary, our system delivers robust, efficient, and sub-centimeter-level table tennis positioning in actual table tennis rooms where different light settings, various background colors, and multiple players playing could all interfere with table tennis ball recognition. The following section presents an overview of the principles and algorithms utilized in the design of the table tennis tracking and position estimation system.