Paper 1
Paper 1
Paper 1
3, 2011
Shadow Removal of Vehicles in a Video Using Median-Based Approach for Initial Background Model
Kalpesh Dongre1 and Nilesh Kasat2
Department of Electronics and Tele. Communication Engineering, Sipnas College of Engineering and Technology Amravati University, Amravati, M.S.(India) kalpesh_dongre@rediffmail.com Department of Electronics and Tele. Communication Engineering, Sipnas College of Engineering and Technology Amravati University, Amravati, M.S.(India) knilesh123@rediffmail.com
2 1
Abstract
Shadow removal plays an important role in the moving object detection and retrieval of surveillance system. In order to remove shadow effectively, a detailed data analysis about shadow attribute is given after a brief introduction about how shadow comes into being. It is concluded that compared with the same field in background, the luminance of the shadow decreased a little, while each chroma per centum does not change a lot in RGB model. However, each chroma per centum of the moving object does change a lot. According to it, the paper proposes an easy algorithm which first picks up the front moving object, and detects the shadow in good use of the different properties between the shadow and object, and finally removes it successfully. This paper presents robust approach of shadow removal from moving vehicles in video. The first part of the paper deals the pre-processing stage in which median background estimation method is proposed to create a reliable background model even in the presence of moving objects. Considering the case of no static background median of frames is used to construct background model. In second part frame differencing method is utilised to segment out moving object and then HSV model with some predefined threshold is used to remove shadow from moving object. The experiment shows that the algorithm could indeed remove the shadow coming from moving object effectively.
Keywords: background model, background subtraction, median ,shadow removal, vehicle detection, chroma space.
1. Introduction
For the rapid increase of motor vehicles flux, traffic accidents happen frequently since traffic jam is becoming more and more serious. So, the detection to traffic flux is of great significance. Especially, vehicle detection with stationary camera is an important problem in traffic management, which is essential for the measurement of traffic parameters such as vehicle count, speed, and flow.Moving object detection is the fundamental and most important part of computer vision, automatic traffic surveillance especially when camera used is stationary [1]. However, accurate detection could be difficult due to the potential variability such as shadows cast by moving objects, non-stationary background processes (e.g. illumination variations) and camouflage (i.e. similarity between appearances of moving objects and the background). This is an active research subject in computer vision, with several applications such as surveillance, face tracking and videoconferencing [2]. Moving cast shadows need careful consideration in order to develop accurate object detection. Shadows may be misclassified as part of the foreground object and this at times could cause merging of foreground objects, object shape distortion, and even object losses (due to the shadow cast over another object). Therefore, the removal of the shadows aids in more accurate detection of vehicle. Removal of shadow usually includes two steps: detection of shadow area and removal of shadow area [1]. There are two kinds of detection. They are the method based on model [2] and the method based on color [3]. The method based on model supposes the three-dimension shape and the light attribute are known, then figure out the shadows shape and position [4] accurately using its model. But it is unpractical in factual application. The method based of the color mainly separates the object and shadow according to the different optics and color character [5] between them. For example, the HSV multicolor space [6] analyses the picture from chroma, saturation and luminance. Dealing with moving object detection or foreground detection most widely used technique is background subtraction in this shadow causes serious problems of foreground separation [3]. Often shadow gets misclassified as object. In applications using
Special Issue
Page 1 of 95
International Journal of Advances in Science and Technology, Vol. 3, No.3, 2011 fixed cameras with respect to the static background (e.g. stationary surveillance cameras), a very common approach is to use background subtraction to obtain an initial estimate of moving objects. Basically, background subtraction consists of subtracting each new frame with a representation of the scene background. The differences usually correspond to foreground objects. Ideally, background subtraction should detect real moving objects with high accuracy .Also the system should be able to separate shadow from foreground segmented object correctly .In case of frame subtraction where background frame consist of no moving object foreground moving object can be correctly detected but in case where background reference frame consist of object then results are not accurate. In order to avoid this problem associated with background frame consisting of an object we are proposing the method of building background model considering number of frames stead of single frame to generate background reference frame and the background subtraction is done to accurately detect foreground object. After that next part covers shadow removal from segmented moving object.
2. Background Model
The very first step we did is creating background reference frame. Background reference frame is obtained by taking median value of predefined number of frames, say n numbers of frames. The background estimation is defined to be the median at each pixel location of all the frames in the buffer. The assumption here is that the pixels of the background stay more than half of the frames in the buffer. This guarantees that the background pixel value is correctly found. If the short-term of image sequences is considered, the median approach works well due to less influence of the environment. This paper uses the median-based approach which allows background estimation from a training sequence consisting of frames. Thus, for a training set of N frames, the background reference frame can be constructed simply as
{I(x, y, 1),..... I(x, y, N)} where I(x, y, 1),..... I(x, y, N) represents frame 1 to frame N
(1)
The following formatting rules must be followed strictly. This (.doc/.docx) document may be used as a template for papers prepared using Microsoft Word. Papers not conforming to these requirements may not be published in the journal.
Figure 1. Background Reference Frame The background reference frame obtain by using median of first 100 frames of sample video is shown in figure 1. This frame is then used for frame differencing.
3. Frame Differencing.
The basic frame differencing approach is used here to calculate the absolute difference between current frame and background reference frame[5].
(2)
Then, the difference image M(x,y) used to detect moving regions can be defined as follows:
M(x,y) =
(3)
Special Issue
Page 2 of 95
International Journal of Advances in Science and Technology, Vol. 3, No.3, 2011 where Th is fixed threshold. Thus we get moving object separated from background but this detected moving object also contains shadow with it as shown in Figure 2.
4. Shadow Removal
We have used HSV colour space for shadow detection and suppression. HSV describes any color in terms of three quantities - Hue, Saturation, and Value. HSV color space corresponds closely to human perception of color .The color information improves the discrimination between shadow and object .To achieve better distinction between moving cast shadows and moving object, a shadow mask SP for each (x,y) points is defined as
Where are HSV component of current frame at time instant t and location (x,y) and are HSV components of background reference frame at time instant t and location (x,y) lower bound is used to define a minimum value for the darkening effect of shadows on the background and it is almost proportional to the light source intensity and the upper bound prevents the system from identifying noise which slightly changes the background in the shadow regions[6]. It has been shown that the chrominance values for both the shadow and non shadow pixels would vary only slightly. The choice of H and S is done according to this assumption. This choice is complicated and the threshold values have to be chosen by trial and error. Figure 3a. below shows the object with shadow and Figure 3b. Shows object detected without shadow using above HSV colour space.
(a)
Some morphological operations are performed on the detected object to give better results as shown in Figure 4. below.
(a)
Figure 4.(a) Object detected after morphological operation (b) Object enclosed
Special Issue
Page 3 of 95
Figure 4 (a) shows the shadow mask obtained after morphological operation on the mask SP obtain earlier. Using this mask boundary is set to detect moving object without shadow as shown in Figure 4 (b) which is shown enclosed in rectangle.
5. Conclusion
The paper proposes an algorithm based on RGB color model to detect the shadow. Compared with the corresponding area in the background, there is only decrease on RGB value in the shadow while its percent of RGB keeps comparatively steady. On the other hand, compared with the corresponding area in the background, the percent of RGB in the moving object changes a lot and paper presented a novel approach for background subtraction with shadow detection using median approach and HSV colour space. For background subtraction, the median of first N frames was employed as a robust estimate of the background model generating reference frame which is very significant in case of dynamic background condition.
6. References
[1] Yang Wang , Real-Time Moving Vehicle Detection With Cast Shadow Removal in Video Based on Conditional Random Field, IEEE Transactions on Circuits and Systems for Video Technology, vol. 19, NO. 3, pp. 437441, March 2009. [2] Cludio Rosito Jung, Efficient Background Subtraction and Shadow Removal for Monochromatic Video Sequences, IEEE Transactions On Multimedia, vol. 11, No. 3,pp.571-577, April 2009 [3] Muhammad Shoaib, Ralf Dragon, Jrn Ostermann, Shadow Detection for Moving Humans Using Gradient-Based Background Subtraction Institut fur Informationsverarbeitung, Leibniz Universitat Hannover [4] Chin Hong Low, Ming Kiat Lee, Siak Wang Khor, Frame based Object Detection - An Application for Traffic, 2nd International Conference on Computer Engineering and Technology,vol.3,pp.9-12, 2010. [5] Xiao Chen,Application of Matlab in Moving Object Detecting Algorithm, International Seminar on Future BioMedical Information Engineering, ,pp114-117, IEEE2008. [6] Shiping Zhu, Li Ma, An Adaptive Shadow Elimination Algorithm Using Shadow Position and Edges Attributes, 3rd International Congress on Image and Signal Processing (CISP2010),pp.76-80, IEEE 2010. [7] Wu T P, Tang C K. A bayesian approach for shadow extraction from a single image [A].10th IEEE International Conference on Computer Vision (ICCV)[C].Beijing, China: IEEE, 2005,1:480-487. [8] Gu X D, Yu D HZhang L M. Image shadow removal using pulse coupled neural network .IEEE Transaction on Neural Networks, 2005, 16(3):692-698.
Kalpesh Dongre received his BE degree in Electronic Engineering from Amravati University / India. He is working towards his Master in Electronic Engineering from Amravati University. He also published various papers in International Journal and Conference also. His research is focused on Image processing.
Prof. Nilesh Kasat Associate Professor of Department of Electronic and Telecommunication and Engineering at SIPNA COET Amravati. He did her B.E (Electronic and Telecommunication and Engineering.) from GOVT College - Amravati, M.E. ( Electronic and Telecommunication and Engineering.) from from GOVT College -Amravati . He is working towards his Phd in Electronic and Telecommunication and Engineering from Amravati University. He published various papers in International Journal and Conference also. She is life member of I.S.T.E.; Fellow of I.E.T.E..
Special Issue
Page 4 of 95