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)
demo.mp4
The system can be executed from the main.py
.
main.py
: Initializes classes and loads or rectifies the needed imagesvideo_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 ballplayer_detection.py
: Detects and tracks the playersplayer.py
: Contains the classPlayer
.tools
: Helper functions.resources
: Contains template images, input video.