This repository features a comprehensive computer vision and machine learning project dedicated to football analysis. It employs various cutting-edge techniques to provide detailed insights into player movements and actions.
Check out this video!🎥
-
Object Detection with YOLOv8
- Utilizes ultralytics and YOLOv8 to detect objects in images and videos.
- Fine-tune and train YOLO on a custom dataset for tailored detection.
-
Pixel Segmentation with KMeans
- Clusters pixels to segment players from the background.
- Accurate t-shirt color detection using advanced K-means clustering.
-
Motion Tracking with Optical Flow
- Measures camera movement through optical flow analysis.
- Tracks player motion seamlessly across frames.
-
Perspective Transformation with OpenCV
- Uses CV2's perspective transformation to represent depth and perspective of the scene.
- Enhances visual analysis by adjusting for perspective changes.
-
Player Movement Analysis
- Measures player speed and distance covered in the image.
- Provides quantitative data on player performance and movement.
- 30s football clips: https://www.kaggle.com/competitions/dfl-bundesliga-data-shootout/data?select=clips
- Fine tuning and training of YOLO: https://universe.roboflow.com/roboflow-jvuqo/football-players-detection-3zvbc/dataset/1
- Utilised YOLOv8 for object detection
- Fine tuned YOLOv8 to accurately detect players, referees and ball while filtering out noise factors
- Updated players, referees and ball bounding box for easier tracking
- Performed KMeans Clustering to separate players into their separate teams
- Implemented interpolation and back filling using Pandas to address occasional missing data for the ball tracker
- Integrated a tracking mechanism (Red Triangle) to identify the player in possession of the ball
- Added ball control statistics for respective teams (White = Team 1, Green = Team 2)
- Estimated camera movement using Optical Flow
- Adjusted players' positions in relation to camera movement
- Integrated CV2's perspective transformation to accurately represent depth of each frame
- Provided quantitative data (speed and distance) for each player