Under the Guidance of, Smt. Anasuya M A Assistant Professor Dept of CS &E, SJCE
1 Outline Introduction Literature Survey: Background subtraction Normalized Cross Correlation Sum of Absolute Difference (SAD) Implementation Action on Motion Detection and Results Conclusion References 2 Introduction WHAT IS VIDEO SURVEILLANCE ? It is technology used to monitor and capture every inch and second of the area in interest. Motion detection from video sequence is the process of detecting the moving objects in the video frames using digital image processing techniques.
3 Introduction Aim of the project Block diagram
4 VIDEO INPUT MOTION DETECTION DECISION MAKING STORING SYSTEM INDICATION Introduction System architecture functioning: Capturing live video feed through a web cam Motion detection in captured video frames using motion detection algorithms Storing the frames on the memory if motion is detected Indicating through an alarm when the motion is detected. Requirements : camera to record video. monitor to display video .
5 Motion Detection Goals of motion detection Identify moving objects Detection of unusual activity patterns Applications of video surveillance Indoor/outdoor security Real time crime detection Traffic monitoring
6 Literature Survey
Motion detection using Background subtraction NEW APPROACH Motion detection using Normalized Cross Correlation
Motion detection using Sum of Absolute Difference (SAD)
7 Background Subtraction
Uses a reference background image for comparison purposes. It attempts to detect moving regions by subtracting the current image pixel by pixel from a reference background image The pixels, where the difference is above threshold are classified as foreground and below threshold are classified as background
8 Background Subtraction
Equation for background subtraction is | It(x,y) - Bt(x,y) | > T
A simple background subtraction technique does not work well.
It cannot handle the small motion and changes of the background pixels
9 Correlation is basically used to find the similarity between two frames
If the two consecutive frames are exactly same, then the value of Normalized cross correlation is maximum
The value of Normalized cross correlation is less than maximum when there is a motion
This concept of Normalized cross correlation is used for the detection of moving object in an image sequence 10
Normalized Cross Correlation
Normalized Cross Correlation
Two Consecutive frames from image sequence are partitioned into four quadrants.
Normalized Cross Correlation (NCC) is applied to each sub frame
This process produces four values ranging from -1 to 1
The sub frame which has minimum value of NCC indicates the presence of moving object 11 Correlation is mainly used for measuring similarity between two images
r is normalized with respect to both the images and it always lies in the range [-1, 1] 12
Normalized Cross Correlation
Normalized Cross Correlation
13 Partitioning of two consecutive frames Moving object detection using Cross Correlation Store the frame if motion is detected The block diagram Image sequences Algorithm Read two consecutive frames from the image sequence
Divide these frames into four quadrants: Current frame is divided into four parts called as x1, x2, x3 and x4. Similarly, previous frame is divided into four parts called as y1, y2, y3 and y4.
Now find out the NCC of each sub image of current frame with the previous frame After this there are four values of NCC, called as c1, c2, c3 and c4
Now find out the minimum value of NCC from these four values To this minimum value of NCC apply the threshold 14
Normalized Cross Correlation
Suppose the minimum value of NCC is obtained at the first quadrant, it means that the moving object is present in that quadrant
After this the second minimum value from the c1, c2, c3 and c4 is obtained. This is performed to check whether any other moving object is present in other part of the image.
If the second minimum value is also greater than threshold then it means that the moving object is present in that quadrant.
Repeat the same procedure for the next frame. 15
Normalized Cross Correlation
Sum of Absolute Difference (SAD) This algorithm is based on image differencing techniques
i j k k j i I j i I SAD , , 1 16 j i I k , Current Frame j i I k , 1 Previous Frame Frame Differencing The frame differencing method basically employs the image subtraction operator
The subtraction of two images is performed straightforwardly in a single pass. The output pixel values are given by:
FD (i, j) = F1 (i, j) F2 (i, j)
The threshold is applied to the resulting difference image, if the difference image is above the threshold, indicates motion is present. 17 Frame Differencing Below figure shows the frame differencing algorithm 18 19 Image Acquisition Process Flow Chart Implementation 20
videoinput function is used to initialize a video object that connects to the PC camera directly
preview function is used to display live video on the monitor
getsnapshot function is used to read images from the camera and place them in MATLAB workspace
Motion detection algorithm is applied to the captured video to detect the motion in captured video frames Implementation 21 Motion detection algorithms implemented in this project: Two dimensional Normalized Cross Correlation (NCC) algorithm The Sum of Absolute Difference (SAD) algorithm
Detection fails when images contain global variations such as illuminations changes or when camera moves
Implementation 22 To overcome this problem continuous re-estimation of threshold value is required
Solution is to look at the variance of the set of data produced from the cross correlation process
This method solves the problem of changing illumination and camera movements
Implementation 23 Actions on Motion Detection Flow Chart Actions on Motion Detection 24
2D normalized cross correlation algorithm is selected by taking a threshold of 0.01
Only the frames which are having variance value greater than threshold are stored in memory
Results 25 Results Output Log file 26 CONCLUSION It requires very less preprocessing of the frames from image sequence
The algorithms are robust against changes in illumination and lighting conditions
In poor lighting conditions also the algorithms gives the better results
This system mainly provides an efficient method for surveillance purposes REFERENCES 1. Duane C. Hanselman and Bruce L. Littlefield, Mastering Matlab 7.
2. Asif Ansari, Dr. T.C.Manjunath (Ph.D., IIT Bombay), Dr. C.Ardil, Implementation of a Motion Detection System, International Journal of Computer Science Vol-3, Num-1, 2008.
3. Manoj S. Nagmode, Mrs. Madhuri A. Joshi, Ashok M. Sapkal, A Novel approach to Detect and Track Moving Object using Partitioning and Normalized Cross Correlation ICGST-GVIP Journal, ISSN: 1687-398X, Volume 9, Issue 4, August 2009.
4. JAIN, R. AND NAGEL, H. On the analysis of accumulative difference pictures from image sequences of real world scenes. IEEE Trans. Patt. Analy. Mach. Intell. 1, 2, 206 214, 1979.
5. HARITAOGLU, I., HARWOOD, D., AND DAVIS, L. real-time surveillance of people and their activities. IEEE Trans Patt. Analy. Mach. Intell. 22, 8, 809830, 2000.
6. Wu Huimin1,2, Zheng Xiaoshi2 , Zhao Yanling2, li Na, A new thresholding method applied to Motion Detection. IEEE Pacific-Asia Workshop on Computational Intelligence and Industrial Application, 2008.
27 7. Guo Jing, Deepu Rajan and Chng Eng Siong, Motion Detection with Adaptive Background and Dynamic Thresholds IEEE Trans Patt. Analy. Mach. Intell. 25, 6, 709 730, 2005.
8. Christopher Wren, Ali Azarbayejani, Trevor Darrell, and Alex Pentland. Pfinder: Real- time tracking of the human body. IEEE Transactions on Pattern Analysis and Machine Intelligence, 19(7):780-785, July 1997.
9. Venkatesha M, Prasanth G Rao, Suhas N, Moving Vehicle Identification using Background Registration Technique for Traffic Surveillance, IMECS 2008, Hong Kong , 19-21 March 2008.
10. Nehme, M.A.; Khoury, W.; Yameen, B.; Al-Alaoui, M.A. Real time color based motion detection and tracking, Proc. ISSPIT 2003, 3rd IEEE International Symposium on Signal Processing and Information Technology, 14-17 Dec. 2003 28 REFERENCES 11. Richard J. Radke, Srinivas Andra, Omar Al-ofahi, Badrinath Roysam, Image change Detection Algorithms: A Systematic Survey, IEEE Transactions on Image Processing, Volume 14, No.3, pp. 294- 07, March 2005.
12. Gian Luca Foresti, Christian Micheloni, Lauro Sindaro, Paolo Remagnino and Tim Ellis, Active Video-Based Surveillance System, IEEE Signal Processing Magazine, Vol.22, No. 2, pp. 25-37, March 2005.
13. Damien LEFLOCH, Real-Time People Counting system using Video Camera MS thesis on Image and Artificial Intelligence.
14. Vibha L, Chetana Hegde, P Deepa Shenoy, Venugopal K R, L M Patnaik, Dynamic Object Detection, Tracking and Counting in Video Streams for Multimedia Mining. IAENG International journal of CS, 35:3, IJCS_35_3_16.
15. C. Stauffer and W. Grimson, Adaptive background mixture models for real time tracking, In Proc. CVPR, pp 246-252, 1999. 29 REFERENCES 30 THANK YOU