Football Video Analysis System with YOLO, OpenCV, and Python

FIRAS TLILI

Football-Video-Analysis-System-with-YOLO-OpenCV-and-Python

Project Overview

This project is a comprehensive football analysis system that uses state-of-the-art machine learning, computer vision, and deep learning techniques to track players, calculate ball possession, and analyze player performance in real-time. The system leverages YOLOv8 for object detection, custom-trained models, KMeans clustering for team assignment, and advanced techniques like optical flow and perspective transformation.

Output Showcase

Witness the power of this system with real-time statistics overlaid on the video, offering a comprehensive view of player dynamics and team analysis .

Watch The Output

Features

Object Detection: Utilizes YOLOv11 to detect players, referees, and the football in real-time.
Custom YOLO Model: Fine-tuned and trained a custom object detection model for enhanced accuracy.
Team Assignment: Uses KMeans clustering to segment player t-shirt colors and automatically assign players to teams.
Real-Time Ball Possession: Tracks player-ball interactions to calculate real-time ball possession for each team.
Optical Flow: Measures camera movement between frames to ensure accurate player tracking.
Perspective Transformation: Converts player movement from pixel distances to real-world meters, providing more meaningful performance data.
Player Performance Analysis: Calculates player speed and total distance covered during the match.

Installation

Prerequisites

Python 3.8 or higher
OpenCV
YOLOv11 (Ultralytics)
NumPy
SciKit-Learn
Pandas
Matplotlib
Like this project

Posted May 2, 2025

Developed a real-time football analysis system using YOLO, OpenCV, and Python.

Likes

1

Views

0

Timeline

Dec 23, 2024 - Mar 1, 2025

End-to-End Medical Chatbot Project
End-to-End Medical Chatbot Project
Water Leak Detection with YOLO11 and PyQt5
Water Leak Detection with YOLO11 and PyQt5
AI-Powered Oral Disease Detection System
AI-Powered Oral Disease Detection System
Hand-Gesture-AI-Mouse-Control
Hand-Gesture-AI-Mouse-Control