This project developed an affordable virtual referee system for amateur tennis players to determine whether shots are in or out. Professional systems like Hawk-Eye are prohibitively expensive, leading the team to create a cost-effective alternative using computer vision techniques.
Project Goals
Accuracy: At least 80% accuracy in call decisions
Affordability: Significantly less expensive than professional systems
Ease of Setup: Simple installation process for casual players
Non-intrusive: No interference with gameplay
Educational Value: Apply academic knowledge to a real-world problem
Implementation
The system uses three main components:
Line Detection: After exploring various approaches (Harris corner detection, Hough transform), the team implemented template matching to identify court lines by matching court corner templates to video frames.
Ball Detection: A contour-based detection system was developed, which:
Uses background subtraction to isolate moving objects
Applies morphological operations to clean the image
Scores contours based on circularity and position consistency
Filters out static objects and those of incorrect size
Selects the highest-scoring contour as the ball
Bounce Detection: Integrated a CatBoost machine learning model to identify frames where the ball bounces on the court by analyzing ball trajectory and motion patterns.
The system then combines these components to determine if shots are in, out, or in the correct service box.
Results
Testing showed that:
In the main test video, the system achieved 100% accuracy across 6 shots
In an additional test with 19 more shots, 80% were detectable (the rest were obscured by players)
Of the detectable shots, 80% were correctly called, meeting the project goal
Challenges
The team encountered significant issues when implementing live streaming:
Video compression artifacts distorted the ball’s appearance
Streaming latency affected real-time processing
Resolution inconsistency during transmission
Ball appearance degradation due to compression
Conclusion
The project successfully created a low-cost, accessible virtual referee system for amateur tennis players. The solution achieves the target 80% accuracy while remaining non-intrusive and easy to set up. Users only need a smartphone to record the game and a computer to run the software.
Future improvements could include enhanced accuracy through better cameras, more robust algorithms for different court conditions, real-time decision making, and advanced ball detection through refined machine learning models.

