Skip to content

ehz0ah/KickVision

Repository files navigation

KickVision

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!🎥

Features

  1. 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.
  2. Pixel Segmentation with KMeans

    • Clusters pixels to segment players from the background.
    • Accurate t-shirt color detection using advanced K-means clustering.
  3. Motion Tracking with Optical Flow

    • Measures camera movement through optical flow analysis.
    • Tracks player motion seamlessly across frames.
  4. 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.
  5. Player Movement Analysis

    • Measures player speed and distance covered in the image.
    • Provides quantitative data on player performance and movement.

Datasets

Iteration 1

  • Utilised YOLOv8 for object detection

Iteration 1

Iteration 2

  • Fine tuned YOLOv8 to accurately detect players, referees and ball while filtering out noise factors

Iteration 2

Iteration 3

  • Updated players, referees and ball bounding box for easier tracking

Iteration 3

Iteration 4

  • Performed KMeans Clustering to separate players into their separate teams

Iteration 4

Iteration 5

  • 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

Iteration 5

Iteration 6

  • Added ball control statistics for respective teams (White = Team 1, Green = Team 2)

Iteration 6

Iteration 7

  • Estimated camera movement using Optical Flow
  • Adjusted players' positions in relation to camera movement

Iteration 7

Iteration 8 (Final Iteration)

  • Integrated CV2's perspective transformation to accurately represent depth of each frame
  • Provided quantitative data (speed and distance) for each player

Iteration 8 (Final Iteration)

About

Football Analysis with YOLO + OpenCV

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published