Skip to content

Basketball 🏀 action tracking and understanding using classical computer vision approaches and deep learning.

License

Notifications You must be signed in to change notification settings

Basket-Analytics/BasketTracking

Repository files navigation

BasketTracking

Tactics and statistics in professional basketball teams are widespread. This operation can be optimized and speed up by an automatic computer vision system. We aim at developing such system capable of action tracking and understanding in basketball games using computer vision approaches and ideas alongside deep learning models such as Detectron2. Our system tracks player trajectories from videos and rectifies them to a standard basketball court, showing also the player who owns the ball.
(disclaimer: we implemented some components with old fashion CV techniques, e.g. ball detection with template matching, the performance was not the goal of the project)

Table of Contents

Demo

demo.mp4

Dependencies

Usage

The system can be executed from the main.py.

  • main.py: Initializes classes and loads or rectifies the needed images
  • video_handler.py: Manages the frame reading procedure from the input video.
  • rectify_court.py: Produces homographies, rectified images, panoramas.
  • ball_detect_track.py: Detects and tracks the ball
  • player_detection.py: Detects and tracks the players
  • player.py: Contains the class Player.
  • tools: Helper functions.
  • resources: Contains template images, input video.