Player Detection and Ball Detection in Soccer Videos There are multiple ways to detect players in any sports videos.Here I have used simple image processing techniques to detect players by only using opencv.
Object Detection. The first step is to load the video and detect the players. I used the pre-trained Yolov3 weight and used Opencv’s dnn module and only selected detections classified as ‘person’. I drew bounding boxes for detected players and their tails for previous ten frames.
PlayerDetection - Player detection and ball detection in football matches using image processing(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.
OpenCV allows us to identify masks of specific colours and we can use that to identify red players and yellow players. See example below of how OpenCV masking works to detect red colour in the image. Prediction of red areas in an image
بسم الله الرحمن الرحيمdownload yolo files only :https://pysource.com/2019/06/27/yolo-object-detection-using-opencv-with-python/download full codes ...
Contour area is within the limits of players area on x,y location: OpenCV Method: cv2.contourArea() It has a "human" rectangle-like form Noise is discarded. The tracking system then obtains the color of the player by averaging the hue component inside the player rectangle and classifies it as "Red", "Blue", "Unknown".
lfcooh (Jul 2 '15) edit. Doing the bg subtraction you'll get the bops of the players (and maybe their shadows too), so you detected the players. thdrksdfthmn (Jul 2 '15) edit. I try using bg subtraction, it got this output link text but I want only player, ball and line of field.