Volume 1, No. 12, February 2013 ISSN 2278-1080 The International Journal of Computer Science & Applications (TIJCSA) RESEARCH PAPER Available Online at http://www.journalofcomputerscience.com/ Motion Detection Algorithm Kamna Kohli Baba Banda Singh Bhadur Engineering College, Fatehgarh,Punjab Baddi University of Engineering Sciences and Technology, Baddi Distt.-Solan kohli.kamna@gmail.com Jatinder Pal Singh Baba Banda Singh Bhadur Engineering College, Fatehgarh,Punjab jps.raina@bbsbec.ac.in Anshul kumar Baddi University of Engineering Sciences and Technology, Baddi Distt.-Solan anshul.kaundal@gmail.com Abstract Motion detection is the first essential process in the extraction of information regarding moving objects and makes use of stabilization in functional areas, such as tracking, classification, recognition, and so on. The frequently-used algorithms for motion detection are studied, including frame difference method and background subtraction method, and an algorithm composing of those methods for motion detection is proposed. This paper presents a new algorithm to detect moving objects within a scene acquired by stationary camera. In this paper Difference of successive frames and background were calculated by taking mean of n consecutive frames and then compare it with current frame with the help sub block matching-based scheme. It increases the sensitivity of human motion detection. Keywords-motion detection, background subtraction, motion alarm, sub block matching. Introduction Motion detection is the simplest of the three motion related task, detection, segmentation and estimation. Its goal is to identify which images points, and more generally which regions of the image have moved between two time instants. The motion of image points is not perceived directly but rather through intensity changes. However, such intensity changes over time may also induced by camera noise or illumination changes. Moreover, object motion itself may induce small intensity variations or even none at all. There are many algorithms for motion detection in a continuous video stream when the camera is stationary; most of them are based on comparing of the current video frame with one from the previous frames or with something that we will call background. This algorithm is called background subtraction One of the most common algorithms is to compare the current frame with the previous one. This algorithm presents an image with white pixels will be greater than a predefined alarm level (threshold), an alarm is produced about a motion event. This estimated background is just the previous frame. It evidently works only in particular conditions of objects, speed and frame rate. It is very sensitive to the threshold so that a noisy image motion will be detected in such places compared to places where there is no motion at all. If the object is moving smoothly, a small change is obtain which is less than the predefined threshold, so, it is impossible to detect moving object. Things become worse, when the object is moving very slowly, then the algorithms will not give any result at all. Another algorithm is to compare the current frame with a first frame in the video 2013, http://www.journalofcomputerscience.com - TIJCSA All Rights Reserved 79
sequence and if there were no objects in the initial frame, the comparison will detect the whole moving object independently of its motion speed. Background Subtraction Background subtraction is a computational vision process of extracting foreground objects in a particular scene. A foreground object can be described as an object of attention which helps in reducing the amount of data to be processed as well as provide important information to the task under consideration [3]. Often, the foreground object can be thought of as a coherently moving object in a scene. We must emphasize the word coherent here because if a person is walking in front of moving leaves, the person forms the foreground object while leaves though having motion associated with them are considered background due to its repetitive behavior. In some cases, distance of the moving object also forms a basis for it to be considered a background, e.g if in a scene one person is close to the camera while there is a person far away in background, in this case the nearby person is considered as foreground while the person far away is ignored due to its small size and the lack of information that it provides. Identifying moving objects from a video sequence is a fundamental and critical task in many computer-vision applications. A common approach is to perform background subtraction, which identifies moving objects from the portion of video frame that differs from the back ground model. There are many challenges in developing a good background subtraction algorithm. First, it must be robust against changes in illumination. Second, it should avoid detecting non-stationary background objects and shadows cast by moving objects. A good background model should also react quickly to changes in background and adapt itself to accommodate changes occurring in the background such as moving of a stationary chair from one place to another. It should also have a good foreground detection rate and the processing time for background subtraction should be real-time. The purpose of our work is to obtain a real-time system which works well in indoor workspace kind of environment and is independent of camera placements, reflection, illumination, shadows, opening of doors and other similar scenarios which lead to errors in foreground extraction This method explains the experimental performance of motion detection in a frame generated by real-time. The block-wise motion detection method uses information jointly among neighboring pixels frame differencing involves taking the difference between two frames and using this difference to detect the object. We demonstrate that a jointly use of frame by frame difference with a background subtraction algorithm allows us to have a strong and fast pixel foreground classification Motion Alarm It is pretty easy to add motion alarm feature to all these motion detection algorithms. Each algorithm calculates a binary image containing difference between current frame and the background one. So, the only we need is to just calculate the amount of white pixels on this difference image. For some algorithms it could be done even simpler. For example, in blob counting approach we can accumulate not the white pixels count, but the area of each detected object. Then, if the computed amount of changes is greater than a predefined value, we can fire an alarm event. Literature Survey We review many classes of algorithm used in motion detection, which include optical flow algorithms, two complementary background estimation technique, frame difference method. Optical flow is the velocity field which wraps one image into another one image. Background estimation algorithm models the background objects of the given scene.a segmentation of the foreground objects (foreground estimation) is obtained by comparing the current frame with the current state of the background model. 2013, http://www.journalofcomputerscience.com - TIJCSA All Rights Reserved 80
Method of operation Start Initialization of image acquisition toolbox Capturing last n frames Predicting mean image with last nth frames Capturing current frame Predicting difference with sub blocking threshold optimization All blocks captured? NO YES Calculating final image with sub block matching Apply morphological operations Predicting area in movement Predicting number of objects in movement Plotting in graphs End The motion detection module receives a wide-angle camera image as input and computes the difference between consecutive images within a local field. The motion detection process receives a digitized 720x720 2013, http://www.journalofcomputerscience.com - TIJCSA All Rights Reserved 81
image from the web camera. Incoming images are stored in a ring of n frame buffers; two frame buffers hold the current complete image and the previous complete image while the extra frame buffer is being written to. The absolute value of the difference between the grayscale values in each image is threshold to provide a raw motion image. The raw motion image is then used to produce a motion receptive field map. The receptive field map is a array in which each cell corresponds to the number of cells of the raw motion image that are above threshold. This reduction in size allows for greater noise tolerance and increased processing speed in the motion segmentation module[4]. The motion segmentation module takes the receptive field map from the motion detection processor and produces a bounding box for the largest contiguous motion group[5]. The process scans the receptive field map marking all locations which pass threshold with an identifying tag. Locations inherit tags from adjacent locations through a region grow-and-merge procedure. Once all locations above threshold have been tagged, the tag that has been assigned to the most locations is declared the ``winner''.. The blocks in a frame are classified as active or inactive based on a threshold and only the active blocks are subjected to motion estimation. The threshold value is decided automatically through an iterative algorithm. The motion vectors of the boundary active blocks are estimated using a sub block matching-based scheme. Unlike existing variable size block-matching algorithms, the proposed motion estimation scheme preserves the basic framework of the conventional block-matching algorithm. The morphological filter is then applied which is used to suppress noises while preserving the main object characteristics]. It consists of ways for digital image processing based on mathematical morphology which is a nonlinear approach developed based on set theory and geometry. It is able to decompose complex shapes into meaningful parts and separate them from the background. In addition, the mathematical calculation involves only addition, subtraction and maximum and minimum operations with no multiplication and division. The two fundamental morphological operations are dilation and erosion on which many morphological algorithms are based on. Experiments done by Lu et al [18] proved that the method is effective in preserving moving object areas and eliminating noises. Results Conclusion 2013, http://www.journalofcomputerscience.com - TIJCSA All Rights Reserved 82
In this paper we use new algorithm for motion detection.this method shows the percentage of area in which motion is present. This method improves the noise problem in motion detection algorithm. It shows results in real time imaging. In addition to this method we use morphological operations and graphical method for representing number of objects versus per frame. Refrences 1. Manzanera and J.C. Richefeu, A robust and computationally efficient motion detection algorithm based on Σ-_ background estimation. Proceedings, ICVGIP 04,Kolkata, India, 12/2004. 2. A. Elgammal, D. Harwood D., L. Davis, and D. Vernon, Non-parametric model for background subtraction,proceeding, ECCV 2000, Dublin, Irland, 26/06/2000. 3. M. Piccardi, Background subtraction techniques: a review, http://www-staff.it.uts.edu.au/~massimo/ 4. N. Friedman, S. Russell, Image segmentation in video sequences: a probabilistic approach, In Proc. 13th Conf.on Uncertainty in Artificial Intelligence, 1997 5. D. Zhang and G. Lu, Segmentation of moving objects in image sequence: A review, Circuits, Systems and Signal Process., vol. 20, no. 2, pp. 143 183, 2001. 6. P.L. Rosin and E. Ioannidis, Evaluation of global image thresholding for change detection, Pattern Recognition Letters, vol. 24, pp. 2345 2356, 2003. 7. A. Neri, S. Colonnese, G. Russo, and P. Talone, Automatic moving object and background separation, Signal Processing, vol. 66, no. 2, pp. 219 232, April 1998. 8. J. Konrad, Motion Detection and Estimation, chapter 3.10, Elsevier Academic Press, 2005. 9. N. Friedman and S.J. Russell, Image segmentation in video sequences: A probabilistic approach., in UAI, 1997, pp. 175 181. 2013, http://www.journalofcomputerscience.com - TIJCSA All Rights Reserved 83