Shadow Elimination in Soccer Game Video using Background Subtraction and Sobel Operators

Object detection in real time is considered as a challenging problem. However, it is very important in a wide range of applications, especially in field of multimedia. The players and ball are the most important objects in soccer game videos and detecting them is a challenging task because of many difficulties, such as shadow and illumination, ball size, ball occluded by players or merged with lines, and similar appearance of players. To overcome these problems, we present a new system to detect the players and ball in real-time by using background subtraction and Sobel detection. The results were more accurate and approximately two times faster than those using only background subtraction.


Introduction
In computer vision, object detection is a very important step to identify the interesting objects in the image [1,2]. Over the past decades, although the ability to detect objects was improved greatly, it is still considered a complex problem to solve. There is a wide range of applications that depend on identifying objects, such as sports video analysing, surveillance, medical image processing, etc. [3] ISSN: 0067-2904

Najeeb and Ghani
Iraqi Journal of Science, 2020, Vol. 61, No. 9, pp: 2426-2433 2427 Object detection can be performed by various techniques such as background subtraction, optical flow, and frame differencing [4,5]. This paper focuses on sports videos.
Today, a soccer game is a very popular content for analyzing and summarizing the game to detect the interesting objects in each frame and analyze interesting objects to recognize their behaviors, such as the analysis of patterns of goal or attack to evaluate weaknesses or strengths of a player or a team. The most important objects in a soccer game are the players and ball, the analysis of which is a challenging task because of many difficulties, such as camera motion and zoom, similar appearance of players, shadow and illumination, ball size, ball occluded by players or merged with lines, etc. [6,7].
In this paper, we propose a new system to detect the players and ball in real-time by using background subtraction and Sobel detection, which achieved better results when used together as compared to using one of them.
The rest of the paper is organized as follows. In section 3, shadows elimination process is discussed. In section 4, the proposed system design is described. Experimental results are shown in section 5 and we conclude the paper in section 6.

Related Work
In soccer videos, there are many researches stating the problem of the ball and players detection; some of these researches are described below. Orazio [8] proposed an algorithm for detecting a ball using background subtraction and modified Circle Hough Transform. This algorithm is a modification of Tim et al. [9] approach. Although using the modified e Atherton algorithm for the improvement of the result, this approach still cannot overcome the occlusions and demands of the ball to be homogeneous, which highly limits its application. Yu [10] presented a new approach to detect the ball and players. This approach includes three phases: extracting the playfield by using histogram learning technique to get rid of lighting and shaded areas, extracting the foreground blobs by morphological processing (erosion and dilation), and eliminating the false alarm (not ball, not player) by skeleton pruning and shape analysis. This approach was compared with two different approaches which were earlier introduced [11,2]. The result indicated that the proposed approach is better than the previous two approaches in detecting the ball and players. The proposed algorithm works perfectly only when the players are far apart and not overlapping at the same place. Naushad et al. [1] proposed a new algorithm for detecting the players and ball which contains four steps: elimination of the ground by automatic ground detection algorithm to get rid of lighting and shaded areas, extracting the players and candidate balls by the Sobel gradient method, elimination of the line by line detection algorithm, and elimination of the unwanted object by the threshold. This algorithm was compared with the algorithm of Jong-Y et al. in a previous article [6] and the result indicated that the proposed algorithm is stronger than the previous algorithm in detecting the ball and players. The proposed algorithm works perfectly only when the players are far apart and not overlapping at the same place. Kamble et al. [13] presented a new method for detecting the ball. This method classifies the image into three classes: background, players, and ball, by using a deep learning algorithm. It can predict the location of the ball when it is lost or fully overlapped, with a high accuracy of about 87.45%.

Shadow Detection and Elimination Process
In any object detection system, a shadow has a negative effect on the final results. Therefore, it should be eliminated. One of the techniques to eliminate the shadow is the hybrid method which combines two color spaces (HSV and YCbCr). The method works without any hypothesis about the scene structure, such as the observed objects geometry, the source direction of the light, and localization of the camera [14,15]. The method is tested by evaluating sp1 and sp2, which represent the detection of shadows in HSV and YCbCr, respectively [16]. α1, β1, α2, β2, Tcb1, Tcb2,TS, TH are thresholds which are selected through trial and error (Table-1), and CB, CF represent a background and foreground pixel values, respectively. Shadow is detected when both sp1 and sp2 are equal to 1, otherwise it is a foreground pixel. In the image, the pixel P (I , J) can be classified as foreground or shadow using the equation shown below: --------(3) TCr1= -80 TCr2= 80

Proposed Method Design
The proposed method of object detection in broadcast soccer video consists of two phases. The first phase takes the soccer video, splits it into a sequencer of frames, and performs the necessary preprocessing operation to make it suitable for the next phase. The second phase performs filtering and smoothing to achieve the object detection. Read the current frame [i] which is denoted by CF. 4 Do normalization 5 Call Algorithm of Shadow Elimination Process 6 Implement a cropping process to BG and CF and get BGc and CFc 7 Implement processing to BGc and CFc by applying edge detection using Sobel Detection. 8 Find the difference between them . 9 Implement morphology operations ( Dilation and Erosion ). 10 Boundary extraction and object detection.

Experimental Results
The proposed method was applied in the dataset of elite soccer player movements and corresponding videos, which is captured at Alfheim Stadium , the home arena for Tromsø IL (Norway) [17]. The proposed method was tested on 997 video clips in pure H.264 which supports 30 frames per second at a resolution of 1280×960. Each video was split into a sequence of frames, normalized, the shadow was removed, and cropping was performed to obtain the interesting area and make it suitable for the next processes.

Filtering and Smoothing
The players and ball were detected by applying three methods, which are Background Subtraction, Sobel Detection, and the hybrid method which combines both methods (BGS and Sobel Detection). The results of the detecting methods were compared to select the most suitable method depending on the accuracy and speed.
The proposed method was compared with Guangyu [18] method which used Background Subtraction for detecting the players. The results are summarized in Table-2. Sobel Detection was not suitable for detecting players and ball. Background Subtraction was suitable when the frame contains one player who is about 30 pixels tall, but when the frame contains more players with a small size, this method detects with more error.

Conclusions
The players and ball positions in broadcast soccer videos is a challenging problem for a number of reasons. To solve this problem, we have presented a method for real-time detection of both of them.
The experimental results show that our work was implemented successfully when using background subtraction and Sobel detection to detect the players and ball in real-time. Our method has the ability to handle a small ball and handle a ball which is merging with other objects in the frame. Also, this work was efficient in overcoming the shadow and illumination problem. It achieved a higher accuracy than that achieved using background subtraction or Sobel detection, with a true detection which reached approximate %93.