Introduction

In my previous work, I used pre-trained Yolov3 model to detect and used SORT (simple online and realtime tracking) to track football players from video. Then I used OpenCV’s getPerspectiveTransform function to convert the video to bird’s-eye view.

How to track football players using Yolo, SORT and Opencv.

Detect and track football players using Yolov3, Opencv and SORT, and convert the players’ movement to bird’s-eye view.

towardsdatascience.com

One of the problems of this work is that the model cannot tell the difference between teams. It will be good if the program is able to identify players’ team instead of just detecting ‘person’. To further improve this, I wish to include a function which tells the difference based on the colors of players’ jersey.

Two approaches I can think of now to this problem.

  1. Train an object detection model using custom dataset containing 3 classes — the players of two teams and referees. This approach might not be practical for real application because one has to train a specific model before every match.
  2. Use to current object detection model and extract the color information from the detections. Based on that I can identify the color of players’ jersey.

I decided to try approach 2 using OpenCV.

Football video

The stationary football video is downloaded from here.

“T. D’Orazio, M.Leo, N. Mosca, P.Spagnolo, P.L.Mazzeo A Semi-Automatic System for Ground Truth Generation of Soccer Video Sequences, 6th IEEE International Conference on Advanced Video and Signal Surveillance, Genoa, Italy September 2–4 2009”

#deep-learning #artificial-intelligence #sports #data-science #machine-learning #deep learning

Football players tracking — identifying players’ team based
6.85 GEEK