Padel AI System is a comprehensive Computer Vision project developed for the Computer Vision I course at Universidad Pontificia Comillas (ICAI).
This system implements a two-module solution using a single mobile device camera:
- Security System: An access control module based on geometric pattern recognition that acts as a visual password.
- Tracking System (AI Chair Umpire): An autonomous sports analysis engine capable of tracking a padel ball, detecting players via pose estimation, and validating serves (Valid/Fault) in real-time.
The project is organized into modular directories to ensure scalability and order:
├── 📂 assets/ # Images and visual content, e.g., for the ReadMe.md banner
├── 📂 calibration_process/ # Scripts and images for intrinsic camera calibration
├── 📂 complete_padel_system/ # Unified application integrating Security + Tracker
├── 📂 security_system/ # Independent geometric pattern recognition module
├── 📂 tracking_system/ # Independent ball tracking and umpire logic module
├── 📄 .gitignore # Git configuration
├── 📄 ReadMe.md # Project documentation
└── 📄 documentation.pdf # Final report and project documentation
└── 📄 requirements.txt # Dependencies and required libraries
The system relies on a hybrid approach combining Classical Computer Vision and advanced algorithms such as those offered by the YOLO library:
-
Core Framework: Python 3, OpenCV (cv2).
-
Deep Learning: YOLOv8-Pose (Ultralytics) for player keypoint extraction (waist/feet).
-
Classical Techniques:
- HSV color segmentation and MOG2 background subtraction for ball detection.
- Optical Flow (Lucas-Kanade) for trajectory smoothing.
- Kalman Filters for state prediction and occlusion handling.
- Geometric approximation (Douglas-Peucker) on the Convex Hull for the security module.
- Use of morphological operations, thresholding, binarization, etc.
-
Interface: Streamlit for the web dashboard and real-time visualization.
-
Optimization: Multithreading for video capture and optional TensorRT support for inference.
Ensure you have Python 3.9 or higher installed.
git clone https://github.com/andresgilvicente/padel-ai-system.git
python -m venv venv # On Windows
.\venv\Scripts\activate # On Mac/Linux
source venv/bin/activate
All necessary libraries are listed in requirements.txt.
pip install -r requirements.txt
You can run the modules independently or as a complete system.
Executes the full flow. You must pass the security check (show 4 geometric shapes) to unlock the tracker.
streamlit run complete_padel_system/complete_padel_system_app.py
Launches the AI Chair Umpire directly for analysis or debugging.
streamlit run tracking_system/tracking_system_app.py
Tests the geometric pattern recognition logic in isolation.
streamlit run security_system/security_system_app.py
🔒 Security Module
- Shape Detection: Identifies Lines, Triangles, Squares, Rectangles, Circles, and Pentagons using contour analysis and convex hulls.
- Sequence Decoder: Unlocks the system only when a specific sequence of 4 predefined geometric shapes is detected.
🎾 Tracking Module (AI Umpire)
-
Ball Tracking: Hybrid detection using Color/Motion + Kalman Filter Prediction.
-
Serve Validation:
- Detects serve impact based on acceleration peaks.
- Compares ball height vs. player waist height (YOLO Keypoints).
- Classifies the serve as VALID or FAULT.
-
Bounce Detection: Analyzes the trajectory on the Y-axis to detect direction changes (bounces) on the court.
-
Evidence Generation: Automatically saves "Photo Finish" frames of each analyzed serve.
- Jorge Carnicero Príncipe
- Andrés Gil Vicente
Completion Date: January 10, 2026