FOOTBALL PLAYER TRACKING, TEAM ASSIGNMENT, AND SPEED ESTIMATION USING YOLOV5 AND OPTICAL FLOW
Abstract
Football analysis is indispensable in improving team performance, developing strategy, and assessing the capabilities of players. A powerful system that combines YOLOv5 for object detection with optical flow tracks football players, assigns them to their respective teams, and estimates their speeds accurately. In the most crowded scenarios, the players and the ball are detected by YOLOv5 at 94.8% and 93.7% mAP, respectively. KMeans clustering based on jersey color assigns teams with 92.5% accuracy. Optical flow is estimating the speed with less than 2.3%. The perspective transformation using OpenCV improves trajectory and distance measurement, overcoming the challenges in overlapping players and changing camera angles. Experimental results underlined the system's reliability for capturing player speeds from 3 to 25 km/h and gave insight into the dynamic nature of team possession. However, there is still some challenge: 6% accuracy degradation in high overlap and illuminative changes. The future work involves expanding the dataset for higher robustness and ball tracking, which will comprehensively explain the dynamics of a match. The paper presents a flexible framework for automated football video analysis that paves the way for advanced sports analytics. This would also, in turn, enhance informed decision-making by coaches, analysts, and broadcasters by providing them with actionable metrics during training and competition. The proposed system joins the state-of-the-art YOLOv5 with optical flow and thereby forms the backbone of near-future football analysis.
Downloads
References
P. Mavrogiannis and I. Maglogiannis, “Amateur football analytics using computer vision,” Neural Comput Appl, vol. 34, Dec. 2022, doi: 10.1007/s00521-022-07692-6.
P. P. Khaire, R. D. Shelke, D. Hiran, and M. Patil, “Comparative Study of a Computer Vision Technique for Locating Instances of Objects in Images Using YOLO Versions: A Review,” in ICT for Intelligent Systems, J. Choudrie, P. N. Mahalle, T. Perumal, and A. Joshi, Eds., Singapore: Springer Nature Singapore, 2023, pp. 349–359. doi: 10.1007/978-981-99-3982-4_30.
P. Rahimian and L. Toka, “A survey on player and ball tracking methods in soccer and other team sports,” J Quant Anal Sports, vol. 18, no. 1, pp. 35–57, 2022, doi: 10.1515/jqas-2020-0088.
F. Bimantoro and I. Gede Pasek Suta Wijaya, “STUDENT FOCUS DETECTION USING YOU ONLY LOOK ONCE V5 (YOLOV5) ALGORITHM,” Jurnal Teknik Informatika (JUTIF), vol. 5, no. 5, pp. 1203–1211, 2024, doi: 10.52436/1.jutif.2024.5.5.1977.
O. E. Olorunshola, I. M. Ekata, and A. E. Evwiekpaefe, “A Comparative Study of YOLOv5 and YOLOv7 Object Detection Algorithms,” Journal of Computing and Social Informatics, vol. 2, no. 1, pp. 1–12, Feb. 2023, doi: 10.33736/jcsi.5070.2023.
X. Cong, S. Li, F. Chen, C. Liu, and Y. Meng, “A Review of YOLO Object Detection Algorithms based on Deep Learning,” Frontiers in Computing and Intelligent Systems, vol. 4, no. 2, pp. 17–20, Jun. 2023, doi: 10.54097/fcis.v4i2.9730.
A. Alfarano, L. Maiano, L. Papa, and I. Amerini, “Estimating optical flow: A comprehensive review of the state of the art,” Computer Vision and Image Understanding, vol. 249, p. 104160, 2024, doi: 10.1016/j.cviu.2024.104160.
A. M. Ikotun, A. E. Ezugwu, L. Abualigah, B. Abuhaija, and J. Heming, “K-means clustering algorithms: A comprehensive review, variants analysis, and advances in the era of big data,” Inf Sci (N Y), vol. 622, pp. 178–210, 2023, doi: 10.1016/j.ins.2022.11.139.
S. Basar, M. Ali, G. Ochoa-Ruiz, M. Zareei, A. Waheed, and A. Adnan, “Unsupervised color image segmentation: A case of RGB histogram based K-means clustering initialization,” PLoS One, vol. 15, no. 10 October, Oct. 2020, doi: 10.1371/journal.pone.0240015.
MD Shahnawaz Hussain, Rohan Jadhav, Rutvik Manthalkar, Uday Raj Kushagra, and Prof. S. S. Peerzade, “Cricket and Football Detection Using YOLOV5 Algorithm,” International Journal of Advanced Research in Science, Communication and Technology, pp. 249–258, May 2023, doi: 10.48175/ijarsct-10457.
Feri Imanuel, S. K. Waruwu, A. Linardy, and A. M. Husein, “Literature Review Application of YOLO Algorithm for Detection and Tracking,” Journal of Computer Networks, Architecture and High Performance Computing, vol. 6, no. 3, pp. 1378–1383, Jul. 2024, doi: 10.47709/cnahpc.v6i3.4374.
J. L. Suárez, S. García, and F. Herrera, “A tutorial on distance metric learning: Mathematical foundations, algorithms, experimental analysis, prospects and challenges,” Neurocomputing, vol. 425, pp. 300–322, 2021, doi: 10.1016/j.neucom.2020.08.017.
Deutsche Fußball Liga e.V, “DFL - Bundesliga Data Shootout,” https://www.kaggle.com/competitions/dfl-bundesliga-data-shootout/data.
(accessed Nov. 13, 2024).
R. Universe, “football-players-detection Computer Vision Project,” https://universe.roboflow.com/roboflow-jvuqo/football-players-detection-3zvbc/dataset/12.
(accessed Nov. 13, 2024).
B. Adhikari and H. Huttunen, “Iterative Bounding Box Annotation for Object Detection,” Jul. 2020, [Online]. Available: http://arxiv.org/abs/2007.00961
(accessed Nov. 28, 2024).
R.-C. Chen, C. Dewi, Y.-C. Zhuang, and J.-K. Chen, “Contrast Limited Adaptive Histogram Equalization for Recognizing Road Marking at Night Based on Yolo Models,” IEEE Access, vol. 11, pp. 92926–92942, 2023, doi: 10.1109/ACCESS.2023.3309410.
S.-H. Tsang, “Brief Review: YOLOv5 for Object Detection,” https://sh-tsang.medium.com/brief-review-yolov5-for-object-detection-84cc6c6a0e3a.
(accessed Nov. 29, 2024).
X. Wang and J. Sun, “TSNS-YOLO: An Improved Traffic Sign Detection Network for Natural Scenes Based on YOLOv7,” in 2024 4th International Conference on Computer Communication and Artificial Intelligence (CCAI), 2024, pp. 7–13. doi: 10.1109/CCAI61966.2024.10603378.
K. Xia et al., “Mixed Receptive Fields Augmented YOLO with Multi-Path Spatial Pyramid Pooling for Steel Surface Defect Detection,” Sensors, vol. 23, no. 11, Jun. 2023, doi: 10.3390/s23115114.
Q. A. Putra, C. A. Sari, E. H. Rachmawanto, N. R. D. Cahyo, E. Mulyanto, and M. A. Alkhafaji, “White Bread Mold Detection using K-Means Clustering Based on Grey Level Co-Occurrence Matrix and Region of Interest,” in 2023 International Seminar on Application for Technology of Information and Communication (iSemantic), 2023, pp. 376–381. doi: 10.1109/iSemantic59612.2023.10295369.
M.-N. Chapel and T. Bouwmans, “Moving objects detection with a moving camera: A comprehensive review,” Comput Sci Rev, vol. 38, p. 100310, 2020, doi: 10.1016/j.cosrev.2020.100310.
Y. Zhang, Z. Chen, and B. Wei, “A Sport Athlete Object Tracking Based on Deep Sort and Yolo V4 in Case of Camera Movement,” in 2020 IEEE 6th International Conference on Computer and Communications (ICCC), 2020, pp. 1312–1316. doi: 10.1109/ICCC51575.2020.9345010.
J. C. Marutotamtama and I. Setyawan, “Physical Distancing Detection using YOLO v3 and Bird’s Eye View Transform,” in 2021 2nd International Conference on Innovative and Creative Information Technology (ICITech), 2021, pp. 50–56. doi: 10.1109/ICITech50181.2021.9590157.
J. Joshan Athanesious and S. Kiruthika, “Perspective Transform Based YOLO With Weighted Intersect Fusion for Forecasting the Possession Sequence of the Live Football Game,” IEEE Access, vol. 12, pp. 75542–75558, 2024, doi: 10.1109/ACCESS.2024.3402370.
R. Suwanda, Z. Syahputra, and E. M. Zamzami, “Analysis of Euclidean Distance and Manhattan Distance in the K-Means Algorithm for Variations Number of Centroid K,” in Journal of Physics: Conference Series, Institute of Physics Publishing, Jul. 2020. doi: 10.1088/1742-6596/1566/1/012058.
B. T. Naik and Md. F. Hashmi, “YOLOv3-SORT: detection and tracking player/ball in soccer sport,” J Electron Imaging, vol. 32, no. 1, p. 11003, 2022, doi: 10.1117/1.JEI.32.1.011003.
R. Padilla, S. L. Netto, and E. A. B. Da Silva, “A survey on performance metrics for object-detection algorithms,” in 2020 international conference on systems, signals and image processing (IWSSIP), 2020, pp. 237–242. doi: 10.1109/IWSSIP48289.2020.9145130.
H. Tahir, M. Shahbaz Khan, and M. Owais Tariq, “Performance Analysis and Comparison of Faster R-CNN, Mask R-CNN and ResNet50 for the Detection and Counting of Vehicles,” in 2021 International Conference on Computing, Communication, and Intelligent Systems (ICCCIS), 2021, pp. 587–594. doi: 10.1109/ICCCIS51004.2021.9397079.
M. Tan, R. Pang, and Q. V Le, “EfficientDet: Scalable and Efficient Object Detection,” in 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 2020, pp. 10778–10787. doi: 10.1109/CVPR42600.2020.01079.
Z. Chen et al., “Plant Disease Recognition Model Based on Improved YOLOv5,” Agronomy, vol. 12, no. 2, 2022, doi: 10.3390/agronomy12020365.
G. Guo and Z. Zhang, “Road damage detection algorithm for improved YOLOv5,” Sci Rep, vol. 12, no. 1, p. 15523, 2022, doi: 10.1038/s41598-022-19674-8.
F. Yu et al., “Improved YOLO-v5 model for boosting face mask recognition accuracy on heterogeneous IoT computing platforms,” Internet of Things, vol. 23, p. 100881, Oct. 2023, doi: 10.1016/J.IOT.2023.100881.
Copyright (c) 2025 Matthew Raymond Hartono, Christy Atika Sari, Rabei Raad Ali

This work is licensed under a Creative Commons Attribution 4.0 International License.