VISVESVARAYA TECHNOLOGICAL UNIVERSITY
BELGAUM- 590018
Project Report
On
ā€œSMART WEB CAM MOTION DETECTION
SURVEILLANCE SYSTEMā€
To the Visvesvaraya Technological University during the academic year 2016-2017
in partial fulfillment for the award of
BACHELOR OF ENGINEERING
in
COMPUTER SCIENCE AND ENGINEERING
Submitted by
Roshan Paul Anand [4RA11CS043]
Anu M M [4RA13CS006]
Archana C P [4RA13CS007]
Betty K S [4RA13CS009]
Under the Guidance of,
Mr. Prapulla Kumar M S,
Assistant Professor,
Department of Computer Science & Engineering,
Rajeev Institute of Technology,
Hassan
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING
RAJEEV INSTITUTE OF TECHNOLOGY
HASSAN-573201
2016-2017
RAJEEV INSTITUTE OF TECHNOLOGY, HASSAN
(Approved by AICTE, New Delhi and Affiliated to VTU, Belagavi-590018)
Plot # 1-D, Growth Center, Industrial Area, B-M Bypass Road, Hassan-573201
Ph: (08172)-243180/80/84 Fax: (08172)-243183
Department of Computer Science & Engineering
CERTIFICATE
Certified that the project work entitled ā€œSMART WEB CAM MOTION
DETECTION SURVEILLANCE SYSTEMā€ is carried out by Mr.ROSHAN PAUL
ANAND (4RA11CS043), Mr.ANU M M (4RA13CS006), Ms.ARCHANA C P
(4RA13CS007) and Ms.BETTY K S (4RA13CS009) bonafide students of RAJEEV
INSTITUTE OF TECHNOLOGY, HASSAN in partial fulfillment for the award
of BACHELOR OF ENGINEERING in COMPUTER SCIENCE AND ENGINEERING
of Visvesvaraya Technological University, Belagavi during the year 2016-2017. The project
report has been approved as it satisfies the academic requirements in respect of project work
prescribed for the said degree.
Mr. Prapulla Kumar M S,
Assistant Professor,
Dept. of Computer
Science and Engineering.
Dr. Prakash H. N,
Professor and Head,
Dept. of Computer
Science and Engineering.
Dr. A. N. Ramakrishna,
Principal,
RIT Hassan.
Examiners Name: Signature with Date:
1. _______________________ _______________________
2. _______________________ _______________________
DECLARATION
We Mr.ROSHAN PAUL ANAND, Mr.ANU M M, Ms.ARCHANA C P and Ms.BETTY K S,
bearing University Seat Numbers 4RA11CS043, 4RA13CS006, 4RA13CS007 and
4RA13CS009 students, Bachelor of Engineering in Computer Science and Engineering,
hereby declare that this Project work entitled, ā€œSMART WEB CAM MOTION DETECTION
SURVEILLANCE SYSTEMā€ has been carried out by us under the guidance of Mr. Prapulla
Kumar M S, Assistant Professor, Dept. of Computer Science and Engineering, Rajeev Institute
of Technology, Hassan for partial fulfillment of the degree of Bachelor of Engineering in
Computer Science and Engineering of Visvesvaraya Technological University, Belagavi. We
also declare that we have not submitted this Project Work to any other university for the award
of any degree.
Date :
Place : Hassan
Mr.ROSHAN PAUL ANAND - (4RA11CS043)
Mr.ANU M M - (4RA13CS006)
Ms.ARCHANA C P - (4RA13CS007)
Ms.BETTY K S - (4RA13CS009)
i
ACKNOWLEDGEMENT
Apart from our effort, the success of this project work depends largely on the
encouragement and guidelines of many. We take this opportunity to express my gratitude
to the people who have been instrumental in the successful completion of this technical
seminar.
We express immense gratitude to my guide Mr. Prapulla Kumar M S, Assistant
Professor, Department of Computer Science Engineering, RIT, Hassan for having
extended his priceless technical expertise. We also thank for his patient thoughtful
guidance and also for his most generous support and encouragement towards the
development of the technical seminar.
We also express immense gratitude to technical seminar Coordinators, Assistant
Professors, Department of Computer Science Engineering, RIT, Hassan for their
encouragement and support for carrying the technical seminar.
We express my sincere thanks to Dr. Prakash H. N., Professor and Head,
Department of Computer Science Engineering, RIT, Hassan for his valuable
encouragement and support in carrying out the project by providing all the facilities.
We also convey my sincere thanks and gratitude to Dr. A. N. Ramakrishna,
Principal, RIT, Hassan for his kind encouragement.
Roshan Paul (4RA11CS043)
Archana C P (4RA13CS007)
Anu M M (4RA13CS006)
Betty K S (4RA13CS009)
ii
ABSTRACT
The Basic Idea Behind ā€œSmart Web Cam Motion Detection Surveillance Systemā€ Is To
Stop The Intruder To Getting Into The Place Where A High End Security Is Required. This
Paper Proposes A Method For Detecting The Motion Of A Particular Object Being Observed.
The Motion Tracking Surveillance Has Gained A Lot Of Interests Over Past Few Years. This
System Is Brought Into Effect Providing Relief To The Normal Video Surveillance System
Which Offers Time-Consuming Reviewing Process. Through The Study And Evaluation Of
Products, We Propose A Motion Tracking Surveillance System Consisting Of Its Method For
Motion Detection And Its Own Graphic User Interface.
Various Methods Are Used In Motion Detection Of A Particular Interest. Each Algorithm
Is Found Efficient In One Way. But There Exits Some Limitation In Each Of Them. In Our
Proposed System Those Disadvantages Are Omitted And Combining The Usage Of Best Method
We Are Creating A New Motion Detection Algorithm For Our Proposed Motion Tracking
Surveillance System. The Proposed System In This Paper Does Not Have Its Effect Usage In
Office Alone. It Also Offers More Convenient, Effective And Efficient Usage Where High-End
Security Comes Into Picture.
iii
TABLE OF CONTENTS
Contents Page no
ACKNOWLEDGEMENT i
ABSTRACT ii
TABLE OF CONTENTS iii - iv
LIST OF ABBREVIATIONS v
LIST OF FIGURES vi
1 INTRODUCTION
1.1 Aim
1.2 Objective
1
4
-
2 LITERATURE SURVEY 6
3 WORK SPECIFICATION
3.1 System architecture functioning
3.1.1 Capturing phase
3.1.2 Comparing phase
3.1.3 Storage phase
3.2 System indication phase
3.3 Image segmentation
3.4 The two types of motion detection algorithm
3.4.1 Background subtraction method
3.4.2 Frame difference method
3.4.3 BSFD algorithm based on the dynamic background
8
-
-
9
-
-
-
10
-
12
-
4 SYSTEM STUDY
4.1 Existing system
4.2 Proposed system
4.3 Feasibility study
4.3.1. Economical feasibility
4.3.2. Technical feasibility
4.3.3. Social feasibility
15
-
-
16
-
-
-
5 SYSTEM SPECIFICATION 17
iv
5.2 Hardware used
5.3 Software used
-
-
6 SYSTEM DESIGN
6.1 Data Flow Diagram
6.2 Motion Detectors
6.3 How motion detection cameras work?
6.4 Sensor Technology
6.5 Video Motion Detection
6.6 Principle of Operation
18
20
22
26
27
29
31
7 MODULE SPECIFICATION
7.1 Login
7.2 Sign up
7.3 Monitoring
7.4 Logout
7.5 Hardware setup
7.5.1 Web camera
7.5.2 GSM module circuit
7.6 Simulation and comparing frames
7.7 Notification generation system
39
-
-
-
-
-
-
40
-
42
-
8 IMPLEMENTATION
8.1 Background and foreground separation
43
-
9 CONCLUSION 44
10 FUTURE WORKS 45
REFERENCES
APPENDICES
v
LIST OF ABBREVIATIONS
VCR - Video Cassette Recorder
CCD - Charge Coupled Devices
BSFD - Background Subtraction Frame Difference
SMS - Short Message Service
MOV - Moving Object
RBI - Revised Background Image
FPS - Frames Per Second
WAV - Wave Form Audio Format
PIR - Passive Infrared
CMOS - Complementary Metal–Oxide–Semiconductor
VMD - Video Motion Detection Devices
CCTV - Closed Circuit Television
GUI - Graphic User Interface
GSM - Global System for Mobile Communication
UART - Universal Asynchronous Receiver/Transmitter
LIST OF FIGURES
Figure Title Page
Number
3.1 System Architecture 8
3.4.1 Flow Chart Of Background Subtraction Method 11
3.4.2 Flow Chart Of Frame Difference Method 12
3.5 Flow Chart of BSFD Algorithm 14
6.1 Dataflow Diagram 20
6.6 Principles of video motion detection 32
6.7 Frame Divided Into Cells 33
6.8 Intelligent cells 34
6.9 Problems of Perspective -
7.5.2 GSM module circuit. 40
7.5.3 Microcontroller 41
8.1 Background Separation 43
A.1 Login Page 47
A.2 Tab Title -
A.3 Logout Button 48
A.4 Opening Default Cam 49
A.5 Red circle at the motion area 50 - 52
A.6 Path and default name to save files 53
A.7 Output motion detected -
A.8 Alert by SMS 54
Smart Web Cam Motion Detection Surveillance System
B.E., Dept. of CSE, RIT, Hassan Page 1
CHAPTER 1
INTRODUCTION
In this we would just briefly look into the introduction of the project requirements
needed for it and its purpose and aim.Motion Detection surveillance and security systems
have become very common in modern days. This kind of system can easily be found in
places like retail stores, banks,supermarkets, airports, commercial buildings and even private
premises. There are twokinds of video surveillance and security systems: analogue system
and digital system.
In traditional systems for security operations, cameras are used to deliver
analoguevideo images to monitors or time-lapse video cassette recorder (VCR). Although
manylocal image processing functions are possible to improve the system application,
thisrequires a lot of processing resources and high-power-consuming hardware.
Althoughdigital video surveillance and security system is widely used, analogue
system stillserves as a cheaper alternative. Charge coupled devices (CCD) camera and
digitalcamera one among the most popular cameras used in the system.
Motion detection is the ability to recognize the presence of movements. Thereare
many different ways to detect motion. The conventional way is by using eitheractive sensor
or passive sensor. The new method to detect motion is "vision motiondetection". It is the
artificial way of machine vision system compared to human'svision in detecting motion.
So our idea was to take a picture from a web cam every period of time (make it the
current picture) and compare it with a previous picture and if we find a big difference
between them we will save both pictures else will free memory from the old picture and make
the new picture the current picture.
Motion detection includes detecting and recording the whole movement process. The
purpose of motion detection is to provide an automatic detection in the region of interest. The
task for motion detection is to detect motion in a region of interest. This region is always
embodied in a region of awareness or in terms of the camera geometry is called the field of
view. It is also defined as a portion of environment being monitored. The region of interest in
the present case is the environment with moving object and activity. A region of interest can
be therefore a person, an animal or an artifact, circumscribed with the term moving object.
Smart Web Cam Motion Detection Surveillance System
B.E., Dept. of CSE, RIT, Hassan Page 2
Role of Surveillance Cameras: Public, Privacy and Protection
The potential value of public surveillance technology took on new meaning in April,
2013 when investigators identified the two suspects in the Boston Marathon bombing after
sifting through video images captured by the city’s cameras.The Boston bombers were
apprehended quickly due to surveillance cameras. Yes! All agree! No dispute over how well
the public cameras were on that day. Yet, many lingering questions need to be answered now,
since we have time and opportunity to gather our wits and thoughts!
We should have surveillance cameras in public places because they ensure public
safety. Rarely will anyone attempt to harm you when they know their actions are being
recorded on camera. Cameras keep you and your personal property safe.
Types of Surveillance Systems
Types of Surveillance Systems Fortunately, surveillance can come in many forms.
Know what they are, now. Security surveillance systems are designed to monitor and report
on changes or notable changes within an assigned field. Security surveillance systems are
commonly installed to monitor public security and health, the weather and the safety of
homes or commercial buildings and complexes.
Home Security Cameras/ Security Cameras for Home Security surveillance systems
are generally designed to monitor the movement of people in any given area. Home
monitoring systems are set up to monitor personal property, such as residences with the use
of wireless lighting and a wireless security camera, while other surveillance systems are
employed to monitor a building or complex of structures.
In a smaller scale, the use of CCTV or wireless camera security systems, motion
sensors and alarm systems for security are very common. Far more complex measures are
utilized in larger scale security surveillance, similar to that managed for national security.
These systems can usually survey the Internet and telephone activity, people getting into the
county, movement of suspicious individuals and collect data on suspicious activity. A larger
framework of national security surveillance systems will then collect data from public places.
Weather Surveillance Systems to predict and forewarn about weather disturbances, weather
surveillance systems are utilized to monitor weather patterns, usually on a daily basis, just
like newspapers or broadcast reports. This type of surveillance system can also identify
global trends, such as the recognition of El Nino and La Nina effects or the Greenhouse
effect. High-tech instruments are usually associated with weather surveillance systems, such
Smart Web Cam Motion Detection Surveillance System
B.E., Dept. of CSE, RIT, Hassan Page 3
as radars and satellites, as well as computer modeling software, to collect and key in weather
data and develop forecasts of weather disturbances. Weather surveillance systems are also
used to assess changes in weather patterns.
In weather surveillance, such as anemometers, wind vanes, barometers and rain
gauges. The data collected from these instruments will then be collated and incorporated into
weather surveillance databases.
Background
Video surveillance and security systems have become very common in modern days.
This kind of system can easily be found in places like retail stores, banks,supermarkets,
airports, commercial buildings and even private premises. There are twokinds of video
surveillance and security systems: analogue system and digital system.In traditional systems
for security operations, cameras are used to deliver analoguevideo images to monitors or
time-lapse videocassette recorder (VCR). Although manylocal image processing functions
are possible to improve the system application, thisrequires a lot of processing resources and
high-power-consuming hardware. Althoughdigital video surveillance and security system is
widely used, analogue system stillserves as a cheaper alternative. Charge coupled devices
(CCD) camera and digitalcamera one among the most popular cameras used in the system.
Digital surveillance systems are mostly specifically designed for commercialuse and it
has always been out of reach for other users. The cost for CCD cameras,networking devices
and the software designed for this system has made it inaccessibleand unpractical for home
users with moderate requirements. Also, not all the existingproduct has the motion detection
function.
Most of the video surveillance and security systems in the market does notissue
alarms in real time, manual monitoring system are costly in term of manpower.This can be
overcome by a real time motion detection system with the ability toautomatically analyze the
video images and archive the images with moving objects.
Description
Motion Detection System can be used in surveillance and security systems. The
system that this project came up with will be useful for security in a fixed restriction area.
Therefore, the background of the targeted area is assumed to be non-moving and
considerations of sudden change in lightings are ignored as well. However, the considerations
Smart Web Cam Motion Detection Surveillance System
B.E., Dept. of CSE, RIT, Hassan Page 4
of other factors are taken into consideration. Basically, the initial plan was to use a technique
called image segmentation to abstract the foreground image from the source image obtained
and later processed to filter out noises or small images disturbance. To perform this, we
would use Open Source Computer Vision Libraries from Intel to obtain contours from the
foreground image subtracted. We will map these contours’ pixels with the original images’ to
send raw data into the other module of the project performed by our partner on classifying
the image frame obtained on whether it’s a human motion or not. His module would return a
percentage of recognition rates on whether the motion belongs to human or not. Based on a
level on acceptable percentage that it is sure it’s a human motion, the program would detects
and displays the motion with a bounding box on the human which is in a different color to
other moving objects that caused motion as well since all moving objects are bounded by the
rectangles. The program will record down the scene when the motion event occurs.
1.1 AIM
Information is a strategic resource which is paramount for the effective functioning of
any organization. This information needs to be managed and safeguarded from malicious and
unauthorized users. Various encryption and data security standards have been suggested and
implemented for this purpose.
The Aim of this project is to propose new DATA ENCRYPTION and DECRYPTION
software that amalgamates the best of many encryption algorithms creating a new unified
approach to data security, confidentiality, and authentication by bringing all these diverse
algorithms to work in tandem.
1.2 OBJECTIVE
This project would be focused on the Motion Detection module where we would
perform research on the techniques and methodology to detect motion and to develop a
module for a technique that we prefer to use in this project. This module would record down
motion and pass it into the next module that would be on object classification where it
classify human and non-human object. Thus, this project is to come up with a solution that
detects motion effectively and record it down with one or more objects that are moving and
causing motions. The purpose of this project is to help new researchers learn and further
research on their topic of interest, which in this case is the motion detection system. The
question to be addressed here in this module is, given a sequence of images, how do we
Smart Web Cam Motion Detection Surveillance System
B.E., Dept. of CSE, RIT, Hassan Page 5
detect motion or track a moving object? The project is to mainly answer this particular
question addressed by providing a prototype to emulate or prove the algorithms or techniques
that are available to perform motion detection by an input of images in a number of frames.
In today’s competitive environment, the securityconcerns have grown tremendously.
In the modern world,possessionis known to be 9/10’ths of the law. Hence, it is imperative for
one tobe able to safeguard one’s property from worldly harms such asthefts, destruction of
property, people with malicious intent etc.
Therefore, it is necessary for the surveillancetechniques to also improve with the
changing world. With theimprovement in mass media and various forms of communication,
itis now possible to monitor and control the environment to theadvantage of the owners of the
property.
The flaws of existing surveillance and security system would be overcome by areal
time motion detection system with the ability to automatically analyze the videoimages and
archive the images with moving objects. Therefore, a digital surveillancesystem based on
web camera and targeted for small-scale user is developed.
Main Objective of this Project is to provide
• To investigate if motion detection is possible for web camera.
• To develop a low cost security system using web camera.
• To develop software with motion detection function algorithm.
This project aims to achieve web camera application system with automaticmotion
detection capability. The main idea is to develop a low cost surveillancesystem using web
camera, which runs the software that is incorporated with motiondetection algorithm. It uses
the concept of "motion detection by vision" to achievemotion detection capability where no
hardware sensors are required.
Automatic motion detection capability helps to reduce archive space and
monitoringmanpower. The system would be a simple "do-it-yourself' system, which
meansanyone can just setup by himself/herself.
Smart Web Cam Motion Detection Surveillance System
B.E., Dept. of CSE, RIT, Hassan Page 6
CHAPTER 2
LITERATURE SURVEY
• Content-based Retrieval and Real Time Detection from Video Sequences Acquired
by Surveillance Systems (Elena Stringa and Carlo S. Regazzoni,2001)
In this paper, a surveillance system devoted to detect abandoned objects in unattended
environments is presented to which image processing content based retrieval capabilities
have been added for making easier inspection task from operators. Video-based surveillance
systems generally employ one or more cameras connected to a set of monitors. This kind of
systems needs the presence of a human operator, who interprets the acquired information and
controls the evolution of the events in a surveyed environment. During the last years efforts
have been performed to develop systems supporting human operators in their surveillance
task, in order to focus the attention of operators when unusual situations are detected. Image
sequences databases are also managed by the proposed surveillance system in order to
provide operators with the possibility of retrieving in a second time the interesting sequences
that may contain useful information for discovering causes of an alarm.
• Robust Real-Time Periodic Motion Detection (Ross CutlerandLarry,2012)
In this paper,We describe new techniques to detect and analyze periodic motion as
seen from both a static and moving camera. By tracking objects of interest, we compute an
object's self-similarity as it evolves in time. For periodic motion, the self-similarity measure
is also periodic, and we apply Time-Frequency analysis to detect and characterize the
periodic motion. The periodicity is also analyzed robustly using the 2-D lattice structures
inherent in similarity matrices. A real-time system has been implemented to track and classify
objects using periodicity. Examples of object classification (people, running dogs, vehicles),
person counting, and non-stationary periodicity are provided.
• Study of Motion Detection Method for Smart Home System (Mayur J.
Charadva,2014)
In this paper, Motion detection surveillance technology give ease for time-consuming
reviewing process that a normal video surveillance system offers. By using motion detection,
Smart Web Cam Motion Detection Surveillance System
B.E., Dept. of CSE, RIT, Hassan Page 7
it save the monitoring time and cost. It has gained a lot of interests over the past few years. In
this paper, a proposed motion detection surveillance system, through the study and evaluation
of currently available different methods. The proposed system is efficient and convenient for
both office and home uses as a smart home security system technology.
• Outdoor wildlife motion triggered camera (Shafika, Suhaimi,2015)
In this paper, Animal extinction means there is no more individual of that species
alive in the world. The animal extinction problem happen all around the world even in
Malaysia. World Bank data shows that, Malaysia record 70 of the 336 species of mammals
are threatened in 2014 and make it the seventh highest in the world in this category. One of
the cause of wildlife extinction is destruction of their natural habitat. This project Outdoor
Wildlife Motion Triggered Camera is develop to help biologist monitor and study about the
wildlife behavior and natural habitat so they can control the wildlife extinction. This project
are using 8051 microcontroller and interfacing with 3 parts that is sensor, camera and SD
card breakout board. The sensor detect the presence of wildlife and triggered the camera to
capture the scene and automatically save the shot taken into external SD card.
• Motion Detection for Security Surveillance (Prof. Joshi Vilas, Mergal Bhauso, Borate
Rohan,2016)
This paper deals with the design and implementation of smart surveillance monitoring
system using raspberry pi and CCTV camera. This design is a small portable monitoring
system for home and college security. This system will monitor when motion detected, the
Raspberry Piwill control the Raspberry Pi camera to take a picture and sent out image to the
user according to the program written in python environment. The proposed home security
system captures information and transmits it via a Raspberry towards PC. Raspberry pi
operates and controls motion detectors and CCTV camera for remote sensing and
surveillance, streams live records it for future playback. Python software plays an important
role in this project.
Smart Web Cam Motion Detection Surveillance System
B.E., Dept. of CSE, RIT, Hassan Page 8
CHAPTER 3
WORK SPECIFICATION
In our project we have aimed to build such a surveillance system, which can not only
detect motion, but will
A) warn the user of the intrusion,
B) record the footage from the moment the motion was detected,
D) sends SMS on the mobile phone of the user.
Fig 3.1: A Basic System Architecture of Our System
3.1 SYSTEM ARCHITECTURE FUNCTIONING
The system architecture is going to function in following way:
3.1.1 CAPTURING PHASE
To detect motion we first have to capture live images of the area to be monitored and
kept under surveillance. This is done by using a web cam which continuously provides a
sequence of images in a particular speed of fps (frames per second).
Motion
Encounte
Sensor BSFD Algorithm
Storing
System
Indication
SMS on
Mobile
Smart Web Cam Motion Detection Surveillance System
B.E., Dept. of CSE, RIT, Hassan Page 9
3.1.2 COMPARING PHASE
Comparing the current frames captured with previous frames to detect motion: for
checking whether any motion is present in the live images, we compare the live images being
provided by the web cam with each other so that we can detect changes in these frames and
hence predict the occurrence of some motion.
3.1.3 STORAGE PHASE
Storing the frames on the memory if motion is detected: if motion is being detected,
we would require storing such motion so that the user can view it in the near future. This also
helps the user in providing a legal proof of some inappropriate activity since a video coverage
can be used as a proof in the court of law.
3.2 SYSTEM INDICATION PHASE
Indicating through an SMS when the motion is detected: the user may want to be
notified immediately that there has been some intrusion detected by the software, hence an
alarm system is included in the software. This alarm system immediately activates a wav file
format audio alarm signal if any kind of motion is detected hence. This helps in preventing
any kind of breach of security at that moment of time. As soon as the motion is detected an
location containing the pictures of the intruder are sent to the user and simultaneously an
SMS will be delivered on the user’s cell phone.
3.3 IMAGE SEGMENTATION
In the images research and application, imagesare often only interested in certain
parts. Theseparts are often referred to as goals or foreground (as other parts of the
background). In order toidentify and analyze the target in the image, weneed to isolate them
from the image. The imagesegmentation refers to the image is divided intoregions, each with
characteristics and to extract thetarget of interest in the process.
The image segmentation used in this paper isthreshold segmentation. To put it simply,
thethreshold of the gray scale image segmentation isto identify a range in the image of the
comparedwith the threshold and according to the results tothe corresponding pixel is divided
Smart Web Cam Motion Detection Surveillance System
B.E., Dept. of CSE, RIT, Hassan Page 10
into twocategories, The foreground and background. Thesimplest case the image after the
single-thresholdsegmentation can be defined as
š‘”(š‘„, š‘¦) = ļæ½
1 š‘“(š‘„, š‘¦) > š‘‡
0 š‘“(š‘„, š‘¦) ≤ š‘‡
Threshold segmentation has two main steps:
 Determine the threshold T
 Pixel value will be compared with thethreshold value T
In the above steps to determine the thresholdvalue is the most critical step in partition.
In thethreshold selection, there is a best threshold basedon different goals of image
segmentation. If wecan determine an appropriate threshold, we cancorrect the image for
segmentation.
3.4 THE TWO TYPES OF MOTION DETECTION ALGORITHM
Intelligent visual surveillance-system can beused many different methods for
detection ofmoving targets, a typical method such asbackground subtraction method, frame
differencemethod. These methods have advantages anddisadvantages, the following will be
introduced.
3.4.1 BACKGROUND SUBTRACTION METHOD
Background subtraction method is a techniqueusing the difference between the
current image and background image to detect moving targets. Process flow chart is shown as
Fig 3.4.1.
The basic idea is the first frame image stored asa background image. Then the current
image fk with the pre stored background image B subtraction, and if the pixel difference is
larger than the bound threshold, then it determines that the pixel to pixel on the moving
target, or as the background pixel. The choice of threshold of the background subtraction to
achieve the success of motion detection is very important. The success of motion detection is
very important. The threshold value is too small will produce a lot of false change points, the
threshold choice is too large will reduce the scope of changes in movement.
Smart Web Cam Motion Detection Surveillance System
B.E., Dept. of CSE, RIT, Hassan Page 11
The appropriate threshold request adapts with the impact which be had by scenes and
camera onthe wavelength of the color, the changes of light conditions, so the choice of the
dynamic threshold should be selected. The method formula is shown as,
š‘…š‘˜(š‘„, š‘¦) = š‘“k(š‘„, š‘¦) āˆ’ šµ(š‘„, š‘¦)
š·š‘˜(š‘„, š‘¦) = ļæ½
1 š‘š‘Žš‘š‘˜š‘”š‘Ÿš‘œš‘¢š‘›š‘‘ š‘…š‘˜(š‘„, š‘¦) > š‘‡
0 š‘”š‘Žš‘Ÿš‘”š‘’š‘” š‘…š‘˜(š‘„, š‘¦) ≤ T
Fig 3.4.1: Flow Chart of Background Subtraction Method
Background subtractions used in case of the fixed cameras for motion detection. Its
advantage is easy to implement, fast, effective detection, can provide the complete feature
data of the target. The short comings are frequent in the moves of the occasions may be
difficult to obtain the background image. The immovable background difference is
particularly sensitive to the changesin dynamic scenes, such as indoor lighting gradually
change.
Input Video
Convert Frames
Background Subtraction
Apply Threshold operation
Moving Object
Reference
Frame
Current
Frame
Smart Web Cam Motion Detection Surveillance System
B.E., Dept. of CSE, RIT, Hassan Page 12
3.4.2 FRAME DIFFERENCE METHOD
Frame difference method, is also known as the adjacent frame difference method, the
image sequence difference method etc.it refers to a very small time intervals Δt of the two
images before and after the pixel based on the time difference, and then thresholding to
extract the image region of the movement, according to which changes in the difference of
the specific flow chart as shown in Fig 3.4.2.
Fig 3.4.2: Flow Chart of Frame Difference Method
3.5 BSFD ALGORITHM BASED ON THE DYNAMIC BACKGROUND
Through the comparison of two moving target detection algorithms in the above
section, in this paper it presents BFSD algorithms based on the dynamic background.
Dynamic background can be achieved through the frame difference method. To overcome the
Input Video
Frame Conversion
Frame Subtraction
Process
Result
fi fi-1
Smart Web Cam Motion Detection Surveillance System
B.E., Dept. of CSE, RIT, Hassan Page 13
disadvantages of difference method fi, fi-5 and fi+5 frames can be chosen, so that slowly
moving object can be identified.
After updating the background image that is referenced image, the background
subtraction method performs for getting the moving object. The dynamic updating of the
background.
In the background subtraction method, we can consider that the whole scene from two
parts, the background, the foreground. The background is a static scene and which can be
seen, foreground is the moving objects which are interested in the video surveillance, such as
vehicles, pedestriansetc. however due to the scene of the monitor changes over time, the
foreground stagnation in the picture for a long time could be treated as part of the
background, so updating of the reference image periodically is essential for moving object
detection. Updating of reference image can be achieved through the frame difference method.
Three frames fi, fi-5 and fi+5 can be taken and Di-5 and Di+5 calculated. Then perform
AND operation, it gives the moving object M. Subtract M from fi itgives the background
image B. Now apply logical OR on background image B and the Reference image. It
produces the dynamic background image DB now the Reference image can be replaced by
DB, this will be the new reference image. Finally subtraction can be made between DB and
fi, then suitable threshold value should be applied to detect the moving object. The flow chart
is shown in Fig 3.5.
Smart Web Cam Motion Detection Surveillance System
B.E., Dept. of CSE, RIT, Hassan Page 14
Fig 3.5: Flow Chart of BSFD Algorithm
The formula of the moving target detection algorithms based on the dynamic
background as follows,
Di-5 = |fi - fi-5|
Di+5 = |fi - fi+5|
MOV(x,y) = |RBI(x,y) - fi(x,y)|
D(x,y) = {1 target MOV(x,y) > T, 0 background MOV(x,y) < =T}
Input Video
Frame Conversion
Frame
fi
Frame
fi+5
Frame
fi-5
Difference
Matrix Di-5
Difference
Matrix Di+5
Moving
Object
Frame fi
Reference
Image
Background
Image
Revised
Background
Frame fi
MOV=RBI- Frame fi
Target Object
Smart Web Cam Motion Detection Surveillance System
B.E., Dept. of CSE, RIT, Hassan Page 15
CHAPTER 4
SYSTEM STUDY
4.1 EXISTING SYSTEM
Digital surveillance systems are mostly specifically designed for commercialuse and it
has always been out of reach for other users. The cost for CCD cameras,networking devices
and the software designed for this system has made it inaccessibleand unpractical for home
users with moderate requirements. Also, not all the existingproduct has the motion detection
function.
In traditional systems for security operations, cameras are used to deliver
analoguevideo images to monitors or time-lapse videocassette recorder (VCR). Although
manylocal image processing functions are possible to improve the system application,
thisrequires a lot of processing resources and high-power-consuming hardware.
Althoughdigital video surveillance and security system is widely used, analogue system
stillserves as a cheaper alternative.
4.2 PROPOSED SYSTEM
Most of the video surveillance and security systems in the market do notIssue alarms
in real time, manual monitoring system are costly in term of manpower. This can be
overcome by a real time motion detection system with the ability to automatically analyze the
video images and archive the images with moving objects.
The flaws of existing surveillance and security system would be overcome by areal
time motion detection system with the ability to automatically analyze the videoimages and
archive the images with moving objects and it alerts automatically when the motion detects
from the view of camera. Therefore, a digital surveillancesystem based on web camera and
targeted for small-scale user is developed.
The latest technologiesused in the fight against thefts and destruction are the
videosurveillance and monitoring. By using the technologies, it is possibleto monitor and
capture every inch and second of the area in interest.However, so far the technologies used
are passive in nature, i.e., themonitoring systems only help in detecting the crime but do
notactively participate in stopping or curbing the crime while it takesplace.
Smart Web Cam Motion Detection Surveillance System
B.E., Dept. of CSE, RIT, Hassan Page 16
Therefore, we have developed a methodology to detect themotion in a video stream
environment and it generate alert by sending alert message to nearest Police station (or)
Security service.
So our Proposed Project gives the camera the capability to capture when needed
rather than capture all the time and this leads to huge reduction in storage space.
4.3 FEASIBILITY STUDY
The feasibility study is carried out to test whether the proposed system in words is
being implemented. The feasibility study is based on the following major factors.
Types of feasibility
• Economical Feasibility.
• Technical feasibility.
4.3.1 ECONOMICAL FEASIBILITY
Economical feasibility is the most recently used method for evaluating effectiveness
of the proposed system .It is obliquely known as cost benefit analysis. This procedure
determined the benefits and savings that are expected from the proposed system and
compared with the cost of the existing system. In case of the existing system, the hardware in
the company is sufficient for system development and maintenance.
3.3.2 TECHNICAL FEASIBILITY
The hardware, the software and to what extent they can support the proposed system
are the keys for this study .The airways has all the required software necessary development
and maintenance. Taking into consideration of the above criteria, the proposed system is
technically feasible and further developments could be accomplished easily.
4.3.3 SOCIAL FEASIBILITY
Infrastructure projects will often have significant social and environment impacts
arising from their construction and operation, which can be both positive and negative. The
impact may include flow on affects beyond the immediate project area and beyond the people
directly associated with the project. In this project the social relationship between the traffic
police and the highway group.
Smart Web Cam Motion Detection Surveillance System
B.E., Dept. of CSE, RIT, Hassan Page 17
CHAPTER 5
SYSTEM SPECIFICATION
5.1 HARDWARE USED
• Processor
• Keyboard
• Mouse
• Color Monitor
• 1GB RAM
• Camera or Web Camera
• GSM module circuit
5.2 SOFTWARE USED
• Windows XP
• Java
• Net Beans IDE
Smart Web Cam Motion Detection Surveillance System
B.E., Dept. of CSE, RIT, Hassan Page 18
CHAPTER 6
SYSTEM DESIGN
In this paper we propose an advanced system of motion detection techniques along
with multimedia techniques. This system will be more securing than any other these
techniques alone and also as compared to traditional video surveillance systems.
After some research, I came up with an algorithm which detected motion by
comparing each frame captured by the camera with the previous one. If the frames were more
or less the same, fine, but if they had differences above a certain limit, the program would
trigger a motion detection event. So, for every frame captured, I compared the pixels with the
previous frame for brightness changes. If the brightness change of a certain pixel exceeded a
tolerance limit, the program would increment a counter. At the end of the scan, it checked the
value of the counter and if it exceeded a certain limit, it triggered a motion detection event.
So my idea was to take a picture from a web cam every period of time (make it the
current picture) and compare it with a previous picture and if we find a big difference
between them we will save both pictures else will free memory from the old picture and make
the new picture the current picture.
The system architecture is going to function in following way:
• Capturing the live video feed through a web cam: To detect motion we first have to
capture live video frames of the area to be monitored and kept under surveillance this
is done by using a web cam which continuously provides a sequence of video frames
in a particular speed of FPS (frames per second).
• Comparing the current frames captured with previous frames to detect motion: For
checking whether any motion is present in the live video feed, we compare the live
video frames being provided by the web cam with each other so that we can detect
changes in these frames and hence predict the occurrence of some motion.
• Storing the frames on the memory if motion is detected: If motion is being detected,
we would require storing such motion so that the user can view it in the near future.
Smart Web Cam Motion Detection Surveillance System
B.E., Dept. of CSE, RIT, Hassan Page 19
This also helps the user in providing a legal proof of some inappropriate activity since
a video coverage can be used as a proof in the court of law.
• Indicating through an alarm when the motion is detected: The user may want to be
notified immediately that there has been some intrusion detected by the software,
hence an alarm system is included in the software. This alarm system immediately
activates a WAV file format audioalarm signal if any kind of motion is detected
hence. This helps in preventing any kind of breach of security at that moment of time.
And the software sends the alert message to the Nearest Police station (or) Security
services.
Smart Web Cam Motion Detection Surveillance System
B.E., Dept. of CSE, RIT, Hassan Page 20
6.1 DATA FLOW DIAGRAM
NO
YES
Fig 6.1: Dataflow Diagram.
The motion detection method that was selected is a background subtraction technique.
A previous frame is used as the background, and its color is subtracted from the current frame
to detect any differences in the new frame. This background frame will be resettable at any
time by the user, but the first background frame used is the first frame that is processed by the
CAMERA
COMPARE
NEW FRAME WITH
OLD FRAME
PIXEL BY PIXEL
IF ANY CHANGE
IN RGB VALUE OF PIXELS
THEN
CAPTURE AND SAVE
IN TEMP MEMORY
25 FRAMES PER SEC
SAVE THE NEW FRAME
ALERT SYSTEM
GENERATE SMS ALERT
SEND MESSAGE TO SMS
VIDEO STREAMINGMOTION DETECTION
Smart Web Cam Motion Detection Surveillance System
B.E., Dept. of CSE, RIT, Hassan Page 21
application. A ā€œsliding windowā€ for the background frame was considered as well. The
sliding time window would change the background frame at intervals so that it would come
closer to what we are seeing in the current frames. This would improve the motion detection
overall, but it would also eliminate any detected blobs that stop moving. Once the blob stops
moving, the background sliding window would slowly incorporate the blobs into the
background.
First, grab image from web cam called Old. Second, grab another image from web
cam after a while, called Cur. Compare Cur&Old by comparing each pixel color. If
difference is greater than tested value (according to the quality of your web cam & light
system you are using is 60 or 50 Hz), then save the two pictures. Finally, make the old picture
the Cur picture. Back to second step (infinite loop).
Purpose– The problem of automatic recognition of human activity is one of the most
important and challenging areas of research in computer vision because of the wide range of
possible applications, for example surveillance, advanced human-computer interactions,
monitoring. This paper presents statistical computer vision approaches to automatically
recognize different human activities.
Design/methodology/approach – The human activity recognition process has three steps:
firstly human blobs are segmented by motion analysis; then the human body posture is
estimated and, finally a temporal model of the detected posture series is generated by discrete
hidden Markov models to identify the activity.
Findings– The system was tested on image sequences acquired in a real archaeological site
while some people simulated both legal and illegal actions. Four kinds of activity were
automatically classified with a high percentage of correct detections.
Research limitations/implications – The proposed approach provides efficient solutions to
some of the most common problems in the human activity recognition research field: high
detailed image requirement, sequence alignment and intensive user interaction in the training
phase. The main constraint of this framework is that the posture estimation approach is not
completely view independent.
Practical implications – Results of time performance tests were very encouraging for the use
of the proposed method in real time surveillance applications.
Smart Web Cam Motion Detection Surveillance System
B.E., Dept. of CSE, RIT, Hassan Page 22
Originality/value – The proposed framework can work using low cost cameras with large
view focal lenses. It does not need any a priori knowledge of the scene and no intensive user
interaction is required in the early training phase.
6.2 MOTION DETECTORS
Did you know that a home is burglarized every 14.6 seconds? 73.9% of all burglaries
target residential properties. These statistics provided by the FBI reflect how vulnerable
residential properties are in the US.So what do you do to keep burglars at bay? How do you
keep your family and property safe? You can obviously use a baseball bat or get a dog, but
that won’t really offer you the level of security that comes with technology. To protect your
home from intruders, you may want to look into getting a motion detector.
Motion sensors and detectors have been around since the seventies and are designed
to provide effective security to home owners. Although technological advancements have
improved the functioning of motion detectors, the basic purpose and system of this device
remains the same. A motion detector is basically designed to detect motion or movement in a
designated area and may instantly send a signal to the security alarm system.
A motion detector is a device that detects moving objects, particularly people. Such a
device is often integrated as a component of a system that automatically performs a task or
alerts a user of motion in an area. They form a vital component of security, automated
lighting control, home control, energy efficiency, and other useful systems.
An electronic motion detector contains an optical, microwave, or acoustic sensor, and
in many cases a transmitter for illumination. However, a passive sensor senses a signature
only from the moving object via emission or reflection, i.e., it can be emitted by the object, or
by some ambient emitter such as the sun or a radio station of sufficient strength. Changes in
the optical, microwave, or acoustic field in the device's proximity are interpreted by the
electronics based on one of the technologies listed below. Most low-cost motion detectors can
detect up to distances of at least 15 feet (4.6 m). Specialized systems cost more, but have
much longer ranges. Tomographic motion detection systems can cover much larger areas
because the radio waves are at frequencies which penetrate most walls and obstructions, and
are detected in multiple locations, not only at the location of the transmitter.
Smart Web Cam Motion Detection Surveillance System
B.E., Dept. of CSE, RIT, Hassan Page 23
Motion detectors have found wide use in domestic and commercial applications. One
common application is activating automatic door openers in businesses and public buildings.
Motion sensors are also widely used in lieu of a true occupancy sensor in activating street
lights or indoor lights in walkways, such as lobbies and staircases. In such smart
lighting systems, energy is conserved by only powering the lights for the duration of a timer,
after which the person has presumably left the area. A motion detector may be among the
sensors of a burglar alarm that is used to alert the home owner or security service when it
detects the motion of a possible intruder. Such a detector may also trigger a security
camera to record the possible intrusion.
 Types of Motion Detectors
o These detectors come in different shapes and sizes. Here are a couple of examples;
• Passive Infrared Detectors - These are one of the most commonly used sensors
nowadays and may be found in many home security systems. The device is
designed to pick up infrared rays and detect any form of movement.
• Active Infrared Sensors - Designed to emit an electrical signal that connects to a
light detector. As soon as the beam gets interrupted, it may sound the motion
sensor alarm.
• Passive Ultrasonic Detector – In theory, an ultrasonic detector sends out high
frequency sound waves that are reflected back to the sensor. If any interruption
occurs in the sound waves, the active ultrasonic sensor may sound the alarm.
• Combined Motion Sensors - You could also choose a combined motion sensor
that is designed to detect all kinds of motion, together. These sensors could be
useful if you wish to reduce the risk of false alarms.
• Wireless Motion Sensor - Wireless motion sensors are mostly used in doors and
windows. These could be convenient to place and easy to install. When the device
detects movement or motion, it may send signals back to a base device that
triggers an alarm.
• Motion Sensor Camera - This detector is designed to capture still images when
movement is detected. Some motion sensor cameras also generate videos.
Smart Web Cam Motion Detection Surveillance System
B.E., Dept. of CSE, RIT, Hassan Page 24
 How to Select Motion Sensor
o These detectors could be placed both indoors and outdoors. When you go
out searching for one, you must know why you need it, where you need it, and what
your budget is. Apart from this, it is also important that you choose a detector that can
be installed easily. There are plenty of DIY models available in the market. If it’s
your first time, a sales person should be able to help you in this regard.
 What are pet immune motion detectors and how do they work?
o Pet immune detectors, as the name suggests, are motion detectors, which are not
triggered by the movement of animals. They are designed to detect the movement of
living beings above a certain weight only and therefore when an animal gets in their
range, they do not go off.
 Is DIY motion sensor alarm easy to use?
o Depends on the complexity of the alarm that you havebuilt.Usually constructed with a
simple set of items including photocells, 741 Op Amp, a buzzer or alarm, a 9 volt
battery breadboard and a 10k potentiometer, you may find it relatively easy to use
since you built it. But keep in mind that this will require some basic knowledge of
electronics on your part.
 What are DIY motion detector alarms and how do they work?
o These are motion detectors that you can construct yourself with a set of accessories
you will find in any major electronics store. Since you are building this yourself, its
working will vary according to your design. But as a general principle it will operate
just like a typical motion alarm, detecting movements in its predefined area.
 How light and sound waves are involved in motion detectors?
o There are many different detectors that trigger different responses. The most common
motion detectors are either passive infrared (PIR), microwave, or ultrasonic. A PIR
sensor will detect temperature of a body within its proximity. A microwave sensor
when activated omits a continuous wave of radiation which will experience
disturbance if an object comes in its path, triggering the alarm. On the other hand, an
ultrasonic sensor will omits ultrasonic waves that are reflected back when an object
appears in its proximity. Sensors and detectors use different technologies to functions.
Smart Web Cam Motion Detection Surveillance System
B.E., Dept. of CSE, RIT, Hassan Page 25
You can also opt for dual-technology motion sensors depending upon your security
needs.
 How to keep motion sensor on?
o In order to keep your motion sensor on, you would need to keep in mind a few
important points. You may check if the motion sensor is connected properly to the
system, batteries are working fine, and if the system is correctly wired. If you have a
wireless system, you must make sure there is no interference in the signals.
 Can you tell about motion detectors how do they use sound and light waves?
o Motion detectors make use of a beam of light, which crosses the room near the
entrance, while the photo sensor is placed on the opposite side of the room. When
someone passes through the beam causing it to break, the photo sensor identifies the
change in the amount of light, and rings a bell. This way, both sound and light waves
are used in motion detectors.
 What type of rays do motion sensors detect?
o There are different types of motion detectors, which use different technologies to
detect rays. Passive infrared detectors detect body heat or infrared rays. Microwave
detectors make use of microwave pulses and detect motion by reflection of a moving
object. Dual technology detectors have combined features of microwave and infrared
sensors. Ultrasonic detectors make use of ultrasonic waves to measure the reflection
of moving objects.
 Do motion detectors work in complete darkness?
o Typically, motion detectors use infra-red rays to detect motion and they work just fine
in complete darkness. Motion detectors do not need to emit any light or infra-red of
their own, as they rely on picking up infrared radiation given off by people. So, you
would not need to light up your area for the motion detector to work properly.
 Will electrical tape stop a motion detector from working?
o If you are using an electrical tape to stop your motion detector from working, it may
not be very effective. Although, electrical tape may look black, but it is not
completely opaque, so infrared rays can pass through the tape and are likely to be
detected by the motion detector.
Smart Web Cam Motion Detection Surveillance System
B.E., Dept. of CSE, RIT, Hassan Page 26
 How to disable a motion detector?
o It is easy to disable those motion detectors which are battery operated or wireless. For
these motion detectors, you will only need to remove the battery. If your motion
detector has an alarm system, you will only need to switch the alarm off. However, if
you want to completely stop your detector, you would need to deconstruct it by
removing battery and cables. If you have a wired detection system, you may need
professional help to disable the motion detector.
6.3HOW MOTION DETECTION CAMERAS WORK
Monitoring your data centers and building access points with CCD cameras can
represent a boon to your overall security, but you need to know a little about camera
terminology to make the best use of them. Don't think about "aim and shoot" when you think
about these cameras. Think, instead, about how you might go about detecting motion in a
series of still images.
First off, let's examine the term "CCD". This stands for "charge-coupled device". A
CCD is a silicon chip with a surface that is divided into light-sensitive pixels. When light hits
these pixels, tiny electric charges are generated. With enough of these pixels, you can get a
fairly high resolution image. With adequate "sensitivity" you can detect motion even in a
dimply lit room.
Initially designed as a memory device, CCD became a good choice for image sensing
because of its ultra-sensitivity to light. Astronomers used the technology because it was as
much as 100 times as sensitive as film and allowed previously invisible objects to be viewed.
Digital cameras can use CCD or CMOS (complementary metal–oxide–
semiconductor) circuitry. However, CCD produces higher quality images. Thus, security
cameras generally use CCD technology.
The difference between digital cameras and security cameras is in their basic way of
working. Digital cameras store images when you tell them to. Security cameras only provide
images (save and transmit them) when they detect motion. And motion detection is basically
the process of comparing sequential images and determining whether the differences between
them represent motion. If there are significant differences between two consecutive images,
the cameras "conclude" that there has been motion within the camera view. They do this
based on a couple important settings -- sensitivity and percentage.
Smart Web Cam Motion Detection Surveillance System
B.E., Dept. of CSE, RIT, Hassan Page 27
Most, if not all, surveillance cameras will give you the option of selecting a particular
area within the viewing screen to be monitored. In other words, you can say that you only
want to detect motion in one area -- say the door or window.
There are two types of image changes that can occur. We can have an overall change
in the pixels as we would if the lights in the room went on or off. If the room has windows
through which incoming light will enter, you probably don't want to generate motion
detection photos just because the sun is setting. So, you can select a "sensitivity" setting that
provides a contrast setting and determines how much of a change should be reported.
You can also select how much of a change in your overall viewing area or within one
or more sub-areas of interest represent motion. Maybe you want to detect a man-sized change
something that affects 50% of the pixels in an area of interest, but you don't want to respond
to a mouse running across the floor.
Setting the sensitivity and percentage settings on cameras in your data center or office
space can be time-consuming. After all, you want to know when something or someone is
moving through your space, but you probably don't want 300 images every time someone
walks through the door. Similarly, you probably don't want to be looking through shots of
your office space every time a light goes on or off or a fan blows the drapes. Generating too
many images can be as bad as generating too few because people will stop looking at them.
Setting up your cameras to detect what you want to know about and nothing else is nearly
impossible, but you can probably strike a balance that has you looking through mostly at
things that matter and only half or a quarter as many "false positives".
6.4 SENSOR TECHNOLOGY
 Passive infrared (PIR)
o Passive infrared (PIR) sensors are sensitive to a person's skin temperature through
emitted black body radiation at mid-infrared wavelengths, in contrast to background
objects at room temperature. No energy is emitted from the sensor, thus the
name passive infrared. This distinguishes it from the electric eye for instance (not
usually considered a motion detector), in which the crossing of a person or vehicle
interrupts a visible or infrared beam.
Smart Web Cam Motion Detection Surveillance System
B.E., Dept. of CSE, RIT, Hassan Page 28
 Microwave
o These detect motion through the principle of Doppler radar, and are similar to a radar
speed gun. A continuous wave of microwave radiation is emitted, and phase shifts in
the reflected microwaves due to motion of an object toward (or away from) the
receiver result in a heterodyne signal at a low audio frequency.
 Ultrasonic
o An ultrasonic wave (sound at a frequency higher than a human ear can hear) is
emitted and reflections from nearby objects are received.[1]
Exactly as in Doppler
radar, heterodyne detection of the received field indicates motion. The
detected Doppler shift is also at low audio frequencies (for walking speeds) since the
ultrasonic wavelength of around a centimeter is similar to the wavelengths used in
microwave motion detectors. One potential drawback of ultrasonic sensors is that the
sensor can be sensitive to motion in areas where coverage is undesired, for instance,
due to reflections of sound waves around corners.[2]
Such extended coverage may be
desirable for lighting control, where the goal is detection of any occupancy in an
area. But for opening an automatic door, for example, a sensor selective to traffic in
the path toward the door is superior.
 Tomographic motion detector
o These systems sense disturbances to radio waves as they pass from node to node of a
mesh network. They have the ability to detect over large areas completely because
they can sense through walls and other obstructions.
 Video camera software
o With the proliferation of low-cost digital cameras able to shoot video, it is possible to
use the output of such a camera to detect motion in its field of view using software.
This solution is particularly attractive when the intent is to record video triggered by
motion detection, as no hardware beyond the camera and computer is needed. Since
the observed field may be normally illuminated, this may be considered
another passive technology. However it can also be used together with near-
infrared illumination to detect motion in the dark, that is, with the illumination at a
wavelength undetectable by a human eye.
 Gesture detector
o Photo detectors and infrared lighting elements can support digital screens to detect
hand motions and gestures with the aid of machine learning algorithms.
Smart Web Cam Motion Detection Surveillance System
B.E., Dept. of CSE, RIT, Hassan Page 29
 Dual technology motion detectors
o Many modern motion detectors use combinations of different technologies. While
combining multiple sensing technologies into one detector can help reduce false
triggering, it does so at the expense of reduced detection probabilities and increased
vulnerability. For example, many dual-tech sensors combine both a PIR sensor and a
microwave sensor into one unit. For motion to be detected, both sensors must trip
together. This lowers the probability of a false alarm since heat and light changes
may trip the PIR but not the microwave, or moving tree branches may trigger the
microwave but not the PIR. If an intruder is able to fool either the PIR or microwave,
however, the sensor will not detect it.
o Often, PIR technology is paired with another model to maximize accuracy and
reduce energy use. PIR draws less energy than emissive microwave detection, and so
many sensors are calibrated so that when the PIR sensor is tripped, it activates a
microwave sensor. If the latter also picks up an intruder, then the alarm is sounded.
6.5 VIDEO MOTION DETECTION
There are many methods of detecting intruders into premises. These include such
systems as:
• Intruder alarms.
• Fence mounted detectors.
• Buried vibration or electric field devices.
• Active infrared devices.
• Passive infrared devices.
• Microwave devices.
• Video motion detection devices.
This chapter is concerned with Video Motion Detection devices. (VMD). These may
be within or outside the premises and, besides detecting intruders, can be used as part of a
building management system. VMD may often be used either as a stand-alone system or
integrated with other detection systems. In an ideal world, detection devices would give no
false alarms and 100% of genuine alarms. Unfortunately, this is not an ideal world, and a
Smart Web Cam Motion Detection Surveillance System
B.E., Dept. of CSE, RIT, Hassan Page 30
certain amount of compromise is necessary. This compromise must be reduced to the most
effective and acceptable level to achieve the system objectives.
There are really only two types of alarm, genuine alarms and false alarms. Sometimes
mention is made of ā€˜spurious alarms’, unexplained alarms and system failures. These must
only be considered as false alarms because the system has alarmed for no apparent reason. A
genuine alarm is one created by deliberate nefarious human action, e.g. by movement of a
person or vehicle into the detection field or disturbance of the alarm system. A false alarm is
one that has no deliberate human input, such as those caused by animals, birds or any
malfunction of equipment. One measure of the efficiency of a system is the ā€˜False Alarm
Rate’ (FAR). This is the ratio of false alarms to a time scale, i.e. five per day. The FAR level
will depend on many local site considerations. The objective is to reduce this to the minimum
without missing any real alarms. Another measure is the ā€˜probability of detection’ (PD) rate,
which is the ratio of detections to the number of attempts in controlled tests. The ideal for PD
is 100%.
Uses of VMD
The primary function of a VMD system is to relieve CCTV operators from the stress
of monitoring one or many screens of information that may not change for long periods. The
VMD system will be monitoring all the cameras in its system, and only reacting when there is
suspicious activity in one of the scenes. During the long periods of inactivity the operator can
continue with other tasks, secure in the knowledge that when something occurs the system
will immediately respond. Even a moderate sized system, with eight cameras, would prove
impossible for an operator to monitor. Eight monitors could not be viewed with any degree of
concentration for more than about twenty minutes. If the monitors were set to sequence, then
activity on seven cameras is lost for most of the time and would be totally ineffective to
detect intruders. With more cameras in a system, the task of detecting intruders becomes
impossible and technology must take over the strain.
The idea of VMD systems is that the processor is continuously monitoring all the
cameras in the system. During this time, the, operator may select or sequence cameras using
the conventional switching system. The system may include an additional monitor connected
to the VMD system that will normally show a blank screen. When activity in any camera
occurs that the VMD system interprets as an intruder, the alarmed camera is immediately
switched to the blank monitor and a warning sounded to alert the operator. The operator’s
Smart Web Cam Motion Detection Surveillance System
B.E., Dept. of CSE, RIT, Hassan Page 31
attention, is therefore, immediately focused on the camera covering the alarm. The detection
of an intruder can also set off further events, such as setting a video recorder to real time
recording, setting a matrix switching system to sequence through a specific series of cameras,
etc. The operator can analyse the scene and take the appropriate course of action.
An intruder could generate an alarm and be out of view of the camera before it is
displayed. The operator would therefore see just a blank screen and be unsure about what to
do next. To overcome this, at the time of detection, many VMD systems will capture an
alarm image sequence containing one or more freeze frames. This may be displayed as the
first view on the previously blank screen. The operator may then examine the scene at the
instant of alarm in more detail.
6.6 PRINCIPLE OF OPERATION
In the descriptions that follow reference is made to a ā€˜frame’ of video. Some systems
use frames and some use fields, some systems can select between the two. This also applies
to storage devices. For ease of description, the term frame is used for consistency but the
actual method used should be checked for the system being considered.
Video Motion Detection is an electronic method of detecting a change in the field of
view of a camera. In its simplest form, this is achieved by storing one frame of the video
information and then comparing the next frame with this to decide whether there has been a
change. The change detected would be a difference in the video voltage, indicating a change
of brightness within the scene. This would be initially ignored as an alarm until a further
frame confirmed the change, or not. If confirmed as a change of brightness in the scene, then
an alarm would be generated. This could cause a contact to close and activate some warning
device such as a buzzer, or cause the switcher to select the camera that detected the motion.
The sampling process may take somewhere between one fiftieth of a second and one second
to detect a change, depending on the method of sampling. This simple detector could be used
in an environment where all conditions were absolutely stable and the only possible change in
brightness would be due to an intruder. However, the intruder could be a mouse or a person.
The system couldn’t differentiate between the two. In addition, by the time the alarm is
displayed on a monitor, the cause of it could be out of view. If the scene were being
continuously recorded, the event could be reviewed but this may be too late to take effective
action.
Smart Web Cam Motion Detection Surveillance System
B.E., Dept. of CSE, RIT, Hassan Page 32
Fig 6.6: Principles of video motion detection
• Detection Cells
For the purposes of this chapter the following definitions are used although there are
no standard terms used at present. A CELL is a single detection block that is analysed
electronically for brightness changes. A cell may be a single pixel, a block of pixels, or the
whole screen. A ZONE is a group of cells that have been defined as an active area. The exact
meaning of ā€˜zone’ must be checked with a manufacturer’s specification before assuming
what area is covered and to what degree of definition. This method of comparing complete
frames therefore has severe drawbacks. The next development was to divide the picture into a
number of separate areas or cells. This was refined by being able to switch cells on or off to
define the area of the scene that is of interest. Diagram 18.4 illustrates a VMD system that
divides the picture into cells, and how only a selected part of the scene can be set for motion
detection. The shaded areas are inactive and the clear parts are the active cells. In this case,
only activity in the area of the car will create an alarm. The cells are only displayed as such
during setting up the system. Once the set-up mode is exited, the complete picture is
displayed as normal and it is not possible to see any of the cells.
The sensitivity of the cells can be adjusted to take into account local conditions. This
control though is applied across all cells to the same extent. Some systems can be pre-set to
Smart Web Cam Motion Detection Surveillance System
B.E., Dept. of CSE, RIT, Hassan Page 33
different sensitivity levels, for instance, to make allowance for day or night operation when
the lighting levels may be different.
Fig 6.7: Frame Divided Into Cells
This type of system would not be suitable in the scene shown out of doors. This is
because external light conditions are changing frequently. Clouds moving across the sky
would cause changes in brightness and create alarms. This type is used in simple indoor
situations, where the lighting conditions are constant and anything breaking the cells could be
considered an alarm. The set-up can be refined to reduce unwanted activations. For instance,
there may be two doors in the scene, only one of which needs to be monitored. In this case,
the part of the scene of interest could be adjusted accordingly. Note that with this type of
system any change in any one or all the cells will create an alarm.
• Intelligent Cells
The next move towards reducing false alarms is to build in the computing power to
process each cell individually and create algorithms that will intelligently analyse certain
situations. In this way, decisions can be made according to the direction of movement. For
instance, one cell may be declared as a pre-alarm cell and another as a detection cell. Pre-
alarm cells do not create alarms. Instead, they instruct the system to associate detection in this
area with detection in another. Activation of detection cells alone will not create an alarm. A
combination of successive detection in adjacent cells will trigger a logical action dependant
on the program. For example, if a detection cell is activated after a pre-alarm cell an alarm
will be created. However, movement in the reverse direction, detection before pre-alarm, will
not create an alarm. In this way, all persons leaving a building will not create an alarm but
persons approaching it will do so. Also, persons moving down the right of the perimeter will
not create an alarm.
Smart Web Cam Motion Detection Surveillance System
B.E., Dept. of CSE, RIT, Hassan Page 34
• Cell Count
Another factor that could be calculated in the processor is the number of cells caused
to change simultaneously. This would then be used as a further part of the equation, so that an
alarm would only be created if more than ā€˜x’ cells change contrast simultaneously. This
brings in attendant problems in some situations. Three dogs in the scene could activate the
same number of cells as one person. A major problem with cell count is that of the different
number of cells a certain size of object occupies in relation to the position of the camera.
Fig 6.8: Intelligent cells
Fig 6.9: Problems of Perspective
Smart Web Cam Motion Detection Surveillance System
B.E., Dept. of CSE, RIT, Hassan Page 35
Diagram shows that a person in the foreground occupies eight cells while one in the
background is less than half a cell. Similarly, a cat close to the camera would activate far
more cells than a person in the background. Simple cell count systems may offer some
improvement in false alarms but do not offer accurate size discrimination.
• Contrast Levels
It was stated that the detection of movement was obtained by measuring the changes
in video level (brightness) between successive frames. This is fine if a person in a dark suit
passes through a very bright scene. The change in brightness will be dramatic and
immediately evident to the processor. However, a person in a grey suit in a grey scene, with
little contrast, will cause only a small change in the brightness levels. If the sensitivity of the
system were set to detect the latter event, it would be over responsive to insignificant changes
in a bright scene. This is less important for indoor systems, but a significant factor in external
systems where the light changes frequently and greatly. In addition, where the object is
smaller than the cell, the brightness change will be a function of both the size of the object
and the contrast between the object and the background. This becomes especially critical
when detecting a person in the background when they may be only 10% of the screen height.
This can be only 0.25% of the screen area. If the person is substantially smaller than the cell,
the sensitivity would have to be very high to detect this change, but would cause many false
alarms for larger subjects providing greater contrast, although much smaller than a person.
Another problem with measuring brightness using large cells is that a small dark
object such as a cat could cause the same brightness change as a large low contrast object
such as a person.
• Camera Shake
In external systems, cameras are mounted on brackets or towers. It is often
impractical to ensure that they are absolutely rigid with no movement. The camera would
only have to move a small amount, such as can happen in the wind, to cause a global change
and register an alarm.
• Changes in Light Levels
By processing separate cells and having the power to define better algorithms, other
problems can be overcome. For instance, light changes may be ignored if all cells are affected
Smart Web Cam Motion Detection Surveillance System
B.E., Dept. of CSE, RIT, Hassan Page 36
to the same extent. Another method to allow for global light changes is to make one reference
cell in which movement is unlikely. The other cells are then referenced to this to compensate
for light levels. This latter method can impose limitations on the system set-up and is now
infrequently used.
• Cell Sensitivity
All the systems described so far have only been able to set the overall sensitivity of all
cells. This renders them quite unsuitable for outdoor use. The next need therefore is to be able
to adjust the sensitivity of each cell individually. This obviously requires much more
computing power but is an absolute prerequisite for any VMD to be used externally.
• Processing Speed
Most simple VMD systems have one processor irrespective of the number of cameras.
If it requires three frames to analyse a scene then the processing time for one camera will be
about 0.12 seconds. This must be multiplied by the number of cameras in the system.
Therefore, with eight cameras the processing speed for each will be about one second. For
example, a 1/2ā€ camera with a 25mm lens has a width of view of about 5m at 20m from the
camera. A person could run across this field of view in less than the processing time and not
be detected.
• Limitations of Simple VMD Systems
The previous examples have served to show the principles of simple video motion
detectors. Variations of these types are still available but their use is limited, and they should
be used with great caution in anything but the most basic applications. However, they do
have uses and can provide a very cost-effective method of motion detection when the
situation is appropriate.
The limitations of the types described for demanding external situations are as follows.
• Will not cope with moderate changes in light levels.
• Sporadic generation of alarms in high contrast scenes.
• Will not cope with changing weather conditions.
• Lack of size discrimination means compromise in setting up.
• Non-uniform sensitivity with range.
Smart Web Cam Motion Detection Surveillance System
B.E., Dept. of CSE, RIT, Hassan Page 37
• Will not cope with size variation due to perspective.
• Slow processing speed can miss moving action.
• Inability to discriminate between small high contrast dark and large low contrast
objects.
• Prone to false alarm due to camera shake.
• Cell measurements prevent accurate area discrimination.
• Restricted to small areas of view.
• Unlikely to detect a person at 10% of screen height.
• Only simple algorithms can be computed.
• Cannot distinguish between a person moving in a line and a waving object.
• Single processor increases time between frame comparisons.
Governance and Governing Body
In the ensuing debates over privacy versus safety and security, advocates on both
sides would be wise to consider the following guidelines –
• Responsibilities and Reasons: We need to consider privacy issues when creating
surveillance policies. For one, cameras should avoid or mask inappropriate views
of private areas, such as yards and windows of bedrooms or washrooms.
• Crime, Cost and Benefits: Public surveillance camera systems can be a cost-
effective way to deter, document, and reduce crimes. For example the cost savings
associated with crimes averted through camera systems in a city of USA saved
over four dollars for every dollar spent on the technology, while another city
yielded a 50 cent return on the dollar.
• Document and Publicize Policies. The law enforcing agencies must formulate on
how surveillance cameras can be used and what are the disciplinary consequences
for misuse. Likewise, officers should be thoroughly trained on these policies and
held accountable for abiding by them.
• Forecasting and Post-Event Investigations: The usefulness of surveillance
technology in preventing and solving crimes depends on the resources put into it.
The most effective systems are those which are monitored by trained staff, have
enough cameras to detect crimes in progress, and integrate the technology into all
manner of law enforcement activities. Use of correct video-analytics can actually
Smart Web Cam Motion Detection Surveillance System
B.E., Dept. of CSE, RIT, Hassan Page 38
raise alarms about crimes or accidents before they take place. Correct
management software will help in tagging, archiving and retrieving the authentic
data for post-event investigation.
• Mix of Man and Machine: People should be out on the streets and work-places
trying to prevent crime or losses. CCTV cameras are just a less effective
alternative to having police walk the streets or security personnel on patrolling and
physical surveillance. As with any technology, the use of cameras is by no means
a substitute for good old-fashioned ground work. The camera footage provides
additional leads in an investigation and aids in securing witness cooperation. The
video footage serves as a complement to – but not a replacement for – eyewitness
evidence in the courtroom.
Smart Web Cam Motion Detection Surveillance System
B.E., Dept. of CSE, RIT, Hassan Page 39
CHAPTER 7
MODULE SPECIFICATION
7.1 LOGIN
The users who are created by the master can login into the system using this
module. The user will have to enter their username and password. The GUI has boxes
to enter the username and password and a login button to login.
7.2 SIGN UP
The username and password of the respective users are created using this
module by the master or the admin. For this module there are boxes to specify the
username, his/her password and other details.
7.3 MONITORING
In this module, when the system is started then it will monitor an area,
according to the capturing capacity of camera, it will compare frames and if it founds
any variations in the frame when compared to other frames, then the corresponding
frame will be saved to the computer and at the same time a sms will be send to the
registered user.
7.4 LOGOUT
The master or the admin user for exiting application when the job done, we
providing logout button. This are secure exiting option.
7.5HARDWARE SETUP
The first stage is setting up the system of which consists of PC and web camera. The
web camera is only operable with the web camera driver installed in the PC.Our Project
recognize the installed Hardware (WEB CAM), It provides control for the setting facilities of
camera such as Resolution, size of the frame in pixels, and Rate of frame to be captured.
System capture the view at particular rate of speed as specified at the settings of
camera.Captured image is stored temporarily.
Smart Web Cam Motion Detection Surveillance System
B.E., Dept. of CSE, RIT, Hassan Page 40
7.5.1 WEB CAMERA
Web camera or more precisely should be named as PC camera. It is the type
ofcomputer-based camera that can only function when it is connected to Pc. It is
morecommonly being known as webcam. This is a small and compact type of digital
videocamera. Most of the web cameras currently in market are using standard UniversalSerial
Bus (USB) but the old type was using PCI computer connections.
Web camera has a wide variety of usage in many different fields. It was usedin
astronomical observation and photography, animal observation, robotic webcam(Web Cam
World 2001), recreation of 3 D modeling (3D Webcam 2003), weather observation in Alaska
(Alaska Climate 2003) and many others. Generally, its usagecan be classified according to its
function and place where the web camera is installed,e.g. scenery cam, personal cam, weather
cam, building cam, etc. For different usageobjectives and purposes, different supporting
hardware and software may be required(Churchill 2001).
New application of web camera is developed every now and then.The new
applications of web camera require software or both hardware and softwareto achieve the
desired function.
7.5.2 GSM MODULE CIRCUIT
Fig 7.5.2: GSM module circuit.
ļ‚§ PIC18F452 microcontroller: In this project PIC18F452 pic microcontroller is used. It
received data from algorithm with the help of built it analog to digital converter .If the
Smart Web Cam Motion Detection Surveillance System
B.E., Dept. of CSE, RIT, Hassan Page 41
motion detection algorithm finds any motion, PIC microcontroller sends commands to
GSM module. GSM module send SMS or make call according to selection of user.
Fig 7.5.3: Microcontroller
ļ‚§ SIM900A GSM module: GSM module used in this project to either send SMS to user or
to make call to user on his/her cell number. GSM module communicates with pic
microcontroller through AT commands. You should make sure to connect GSM module
with pic microcontroller which has same operating voltages as operating voltages of
pic18f452. If your GSM module works on 5 volt, you can connect it directly with
PIC18F452. Because PIC18F452 also works on same operating voltages. But if your
GSM module works on 3.3 volt, you need to use a interfacing circuit between them. So
here in the project we are using an external power for the SIM to work, GSM module
communicate with pic microcontroller through serial communication UART(universal
asynchronous receiver/transmitter).
ļ‚§ An external power supply is also used for the working of the circuit.
So these are the main components used in home security system or SMS based home
alarm system. The SIM900 is a complete quad band GSM module which delivers
GSM/850/900/1800/1900MHz performance for SMS and data with low power consumption.
Smart Web Cam Motion Detection Surveillance System
B.E., Dept. of CSE, RIT, Hassan Page 42
7.6 SIMULATION AND COMPARING FRAMES
In the second stage, simulation done on the frame images using Java with Image
Processing Module as simulation tool to investigate thepossibilities of motion detection
algorithm on images captured by web camera.
In this stage first, grab image from web cam called Old. Second, grab another image
from web cam after a while, called Current. Compare Current&Old by comparing each pixel
color. If difference is greater than tested value (according to the quality of your web cam &
light system you are using is 60 or 50 Hz), then save the two pictures. Finally, make the old
picture the Cur picture. Back to second step (infinite loop)
7.7 NOTIFICATION GENERATION SYSTEM
In the third stage, implementation process is done by coding the motion detection
software using Java. The algorithm that was successfully simulated isused as the reference for
forming the working mechanism in creating motion detectionsoftware.
In this stage the new frames will be stored at specified Locations, and GSM based
message alert for anybody.
Smart Web Cam Motion Detection Surveillance System
B.E., Dept. of CSE, RIT, Hassan Page 43
CHAPTER 8
IMPLEMENTATION
8.1 BACKGROUND AND FOREGROUND SEPARATION
The discrimination between background and foreground is based on block-based
motion estimation. In this paper, the modified block-based estimator is used to track changes
of the individual block. Each frame of the 320x240 pixel resolution is divided into non-
overlapping of 32x24 pixels. For the block motion estimation, a 9x9 window region with the
maximum standard deviation is extracted within each block.
The basic method of background subtraction is to
Fig 8.1: Background Separation
In the above figure, an input stream of images will be provided to the system which is
then subject to background separation. Subtraction takes place based on the predefined
threshold value and resultant is the foreground image which we obtain.
Smart Web Cam Motion Detection Surveillance System
B.E., Dept. of CSE, RIT, Hassan Page 44
CHAPTER 9
CONCLUSION
The ā€œSmart webcam motion detection surveillance systemā€ is a home/office based
security system which can be of great where security is a matter of concern. Due to the
advent of technology in the modern world, the methodologies used by thieves and robbers for
stealing has been improving exponentially. Therefore, it is necessary for the surveillance
techniques to also improve with the changing world.
The latest technologies used in the fight against thefts and destruction are the video
surveillance and monitoring. By using the technologies, it is possible to monitor and capture
every inch and second of the area in interest. Motion detection is the most important feature
in digital video surveillance system. It gives the camera the capability to capture when
needed rather than capture all the time and this leads to huge reduction in storage space.
Alarm can also be triggered when unexpected motion is detected. This relieves the Personnel
in monitoring at all time.
The motion detector patches up for the need of a cheap and small security system in
day-to-day life. Computerized home-based security can develop a lot with the coming future.
Future is promising and easier with innovative technologies.
Smart Web Cam Motion Detection Surveillance System
B.E., Dept. of CSE, RIT, Hassan Page 45
CHAPTER 10
FUTURE WORKS
Here, we had presented a research on some image processing techniques implemented
for motion detection algorithms and also some of the methodology and approaches of
implementing a motion detection algorithm itself. The review includes research on a basic
end-product implementation of a motion detection application. We had presented some ways
for implementing the approaches researched and also shared some ideas for alternatives ways
to implement the motion detection algorithm. An implementation and system design of a
prototype system developed for testing purposes is reviewed in this report as well.
There are still many areas which can be further researched from this point onwards.
For example, the techniques introduced may be enhanced to suit some problem specific
applications or some domain specific applications. Also the techniques may be further
enhanced by implementing more useful methods and algorithms such as those involving with
tracking the object which causes the motion events such as those using optical flows or also
known as image flows. Here, human motions are being detected. However, future works may
also want to recognize the pose or gesture of the human body registered by the algorithm
implemented here in the prototype system
Smart Web Cam Motion Detection Surveillance System
B.E., Dept. of CSE, RIT, Hassan Page 46
REFERENCES
[1]. Google search.
[2]. Yahoo search engine.
[3]. www.w3schools.com.
[4]. www.mathworks.com.
[5]. www.matlab.com.
[6]. Rozinet, O. and Z. Szabo, ā€œHand motion detection using Matlab software
environmentā€.
[7]. 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, 2003, 14-17 Dec.
sensor2003 , pp. 696 – 700, 14-17 Dec. 2003.
[8]. JosuƩ A. HernƔndez-Garcƭa, HƩctor PƩrez-Meana and Mariko Nakano Miyatake,
ā€œVideo Motion Detection Using the Algorithm of Discrimination and the Hamming
Distanceā€, Lecture Notes in Computer Science, Springer-Verlag, Germany.
[9]. H.A.M. El_Salamony, H.F. Ali, and A.A. Darweesh, ā€œ3D Human Body Motion
Detection and Tracking in Videoā€, Proc. Acta Press.
[10]. Song, Y.,ā€œA perceptual approach to human motion detection and labelingā€, PhD
thesis, California Institute of Technology, 2003.
[11]. Yilmaz, A., M. Shah, ā€œContour Based Object Tracking with Occlusion Handling in
Video Acquired Using Mobile Camerasā€, Proc. IEEE Transactions on Pattern
Analysis and Machine Intelligence, 2005.
[12]. Borst, A. and Egelhaaf, M., ā€œPrinciples of visual motion detectionā€, Trends in
Neurocience, Vol. 12, pp. 297-305, 1989.
[13]. Wachter, S. and H.H. Nagel, ā€œTracking persons in monocular image sequences,ā€
Proc. Computer Vision and Image Understanding, Vol. 74, pp. 174-192, 1999.
[14]. Gavrila, D., ā€œThe visual analysis of human movement: A survey,ā€ Proc. Computer
Vision and Image Understanding, Vol. 73, pp. 82-98, 1999.
[15]. Motion detection with image acquisition toolbox, Mathworks, Matlab.
Smart Web Cam Motion Detection Surveillance System
B.E., Dept. of CSE, RIT, Hassan Page 47
APPENDIX A
A.1 SCREENSHOTS
Fig A.1: Login Page
In our database already saved user id and password with help of jdbc connector will respond
login time.
setTitle("Motion Detector Demo");
it is the default title of the tab
Fig A.2: Tab title
Smart Web Cam Motion Detection Surveillance System
B.E., Dept. of CSE, RIT, Hassan Page 48
This statement says to close the motion detection panel whenever we press the logout
button.
Fig A.3: Logout button
This statement is used to access the default system webcam with standard resolutions.
webcam = Webcam.getDefault();
webcam.setCustomViewSizes(nonStandardResolutions);
webcam.setViewSize(WebcamResolution.VGA.getSize());
Smart Web Cam Motion Detection Surveillance System
B.E., Dept. of CSE, RIT, Hassan Page 49
Fig A.4: opening default cam
detector = new WebcamMotionDetector(webcam);
detector.setInterval(100); // one check per 500 ms
detector.setPixelThreshold(50);
detector.start();
Here the webcam is opened and the threshold frequency is set to 30` and the detection is
started.
if (detector.isMotion()) {
g.setStroke(new BasicStroke(2));
g.setColor(Color.RED);
g.drawOval(cog.x , cog.y, 50, 50);
Smart Web Cam Motion Detection Surveillance System
B.E., Dept. of CSE, RIT, Hassan Page 50
If the motion is detected a red circle has to come on that particular area.
Smart Web Cam Motion Detection Surveillance System
B.E., Dept. of CSE, RIT, Hassan Page 51
Smart Web Cam Motion Detection Surveillance System
B.E., Dept. of CSE, RIT, Hassan Page 52
Fig A.5: Red circle at the motion area
Here the default filename is set to the current time and path to save the file is set.
{String name = String.format("C:UsersabcPicturesCamera Rolltest-%d.jpg",
System.currentTimeMillis());
Smart Web Cam Motion Detection Surveillance System
B.E., Dept. of CSE, RIT, Hassan Page 53
Fig A.6: Path and default name to save files
So that the system display the output ā€œmotion detectedā€ and the SMS has been send.
System.out.println("Motion Detected");
SendSMS a=new SendSMS();
Fig A.7: Output motion detected
Smart Web Cam Motion Detection Surveillance System
B.E., Dept. of CSE, RIT, Hassan Page 54
This statements checks whether the SMS has sent or not.
if(a.send()==true)
{
System.out.println("Message has been send");
}
else
{
System.out.println("Message not send");
And here is the alert message that delivered to the connected phone number.
Fig A.8: Alert by SMS

Smart web cam motion detection

  • 1.
    VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAUM-590018 Project Report On ā€œSMART WEB CAM MOTION DETECTION SURVEILLANCE SYSTEMā€ To the Visvesvaraya Technological University during the academic year 2016-2017 in partial fulfillment for the award of BACHELOR OF ENGINEERING in COMPUTER SCIENCE AND ENGINEERING Submitted by Roshan Paul Anand [4RA11CS043] Anu M M [4RA13CS006] Archana C P [4RA13CS007] Betty K S [4RA13CS009] Under the Guidance of, Mr. Prapulla Kumar M S, Assistant Professor, Department of Computer Science & Engineering, Rajeev Institute of Technology, Hassan DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING RAJEEV INSTITUTE OF TECHNOLOGY HASSAN-573201 2016-2017
  • 2.
    RAJEEV INSTITUTE OFTECHNOLOGY, HASSAN (Approved by AICTE, New Delhi and Affiliated to VTU, Belagavi-590018) Plot # 1-D, Growth Center, Industrial Area, B-M Bypass Road, Hassan-573201 Ph: (08172)-243180/80/84 Fax: (08172)-243183 Department of Computer Science & Engineering CERTIFICATE Certified that the project work entitled ā€œSMART WEB CAM MOTION DETECTION SURVEILLANCE SYSTEMā€ is carried out by Mr.ROSHAN PAUL ANAND (4RA11CS043), Mr.ANU M M (4RA13CS006), Ms.ARCHANA C P (4RA13CS007) and Ms.BETTY K S (4RA13CS009) bonafide students of RAJEEV INSTITUTE OF TECHNOLOGY, HASSAN in partial fulfillment for the award of BACHELOR OF ENGINEERING in COMPUTER SCIENCE AND ENGINEERING of Visvesvaraya Technological University, Belagavi during the year 2016-2017. The project report has been approved as it satisfies the academic requirements in respect of project work prescribed for the said degree. Mr. Prapulla Kumar M S, Assistant Professor, Dept. of Computer Science and Engineering. Dr. Prakash H. N, Professor and Head, Dept. of Computer Science and Engineering. Dr. A. N. Ramakrishna, Principal, RIT Hassan. Examiners Name: Signature with Date: 1. _______________________ _______________________ 2. _______________________ _______________________
  • 3.
    DECLARATION We Mr.ROSHAN PAULANAND, Mr.ANU M M, Ms.ARCHANA C P and Ms.BETTY K S, bearing University Seat Numbers 4RA11CS043, 4RA13CS006, 4RA13CS007 and 4RA13CS009 students, Bachelor of Engineering in Computer Science and Engineering, hereby declare that this Project work entitled, ā€œSMART WEB CAM MOTION DETECTION SURVEILLANCE SYSTEMā€ has been carried out by us under the guidance of Mr. Prapulla Kumar M S, Assistant Professor, Dept. of Computer Science and Engineering, Rajeev Institute of Technology, Hassan for partial fulfillment of the degree of Bachelor of Engineering in Computer Science and Engineering of Visvesvaraya Technological University, Belagavi. We also declare that we have not submitted this Project Work to any other university for the award of any degree. Date : Place : Hassan Mr.ROSHAN PAUL ANAND - (4RA11CS043) Mr.ANU M M - (4RA13CS006) Ms.ARCHANA C P - (4RA13CS007) Ms.BETTY K S - (4RA13CS009)
  • 4.
    i ACKNOWLEDGEMENT Apart from oureffort, the success of this project work depends largely on the encouragement and guidelines of many. We take this opportunity to express my gratitude to the people who have been instrumental in the successful completion of this technical seminar. We express immense gratitude to my guide Mr. Prapulla Kumar M S, Assistant Professor, Department of Computer Science Engineering, RIT, Hassan for having extended his priceless technical expertise. We also thank for his patient thoughtful guidance and also for his most generous support and encouragement towards the development of the technical seminar. We also express immense gratitude to technical seminar Coordinators, Assistant Professors, Department of Computer Science Engineering, RIT, Hassan for their encouragement and support for carrying the technical seminar. We express my sincere thanks to Dr. Prakash H. N., Professor and Head, Department of Computer Science Engineering, RIT, Hassan for his valuable encouragement and support in carrying out the project by providing all the facilities. We also convey my sincere thanks and gratitude to Dr. A. N. Ramakrishna, Principal, RIT, Hassan for his kind encouragement. Roshan Paul (4RA11CS043) Archana C P (4RA13CS007) Anu M M (4RA13CS006) Betty K S (4RA13CS009)
  • 5.
    ii ABSTRACT The Basic IdeaBehind ā€œSmart Web Cam Motion Detection Surveillance Systemā€ Is To Stop The Intruder To Getting Into The Place Where A High End Security Is Required. This Paper Proposes A Method For Detecting The Motion Of A Particular Object Being Observed. The Motion Tracking Surveillance Has Gained A Lot Of Interests Over Past Few Years. This System Is Brought Into Effect Providing Relief To The Normal Video Surveillance System Which Offers Time-Consuming Reviewing Process. Through The Study And Evaluation Of Products, We Propose A Motion Tracking Surveillance System Consisting Of Its Method For Motion Detection And Its Own Graphic User Interface. Various Methods Are Used In Motion Detection Of A Particular Interest. Each Algorithm Is Found Efficient In One Way. But There Exits Some Limitation In Each Of Them. In Our Proposed System Those Disadvantages Are Omitted And Combining The Usage Of Best Method We Are Creating A New Motion Detection Algorithm For Our Proposed Motion Tracking Surveillance System. The Proposed System In This Paper Does Not Have Its Effect Usage In Office Alone. It Also Offers More Convenient, Effective And Efficient Usage Where High-End Security Comes Into Picture.
  • 6.
    iii TABLE OF CONTENTS ContentsPage no ACKNOWLEDGEMENT i ABSTRACT ii TABLE OF CONTENTS iii - iv LIST OF ABBREVIATIONS v LIST OF FIGURES vi 1 INTRODUCTION 1.1 Aim 1.2 Objective 1 4 - 2 LITERATURE SURVEY 6 3 WORK SPECIFICATION 3.1 System architecture functioning 3.1.1 Capturing phase 3.1.2 Comparing phase 3.1.3 Storage phase 3.2 System indication phase 3.3 Image segmentation 3.4 The two types of motion detection algorithm 3.4.1 Background subtraction method 3.4.2 Frame difference method 3.4.3 BSFD algorithm based on the dynamic background 8 - - 9 - - - 10 - 12 - 4 SYSTEM STUDY 4.1 Existing system 4.2 Proposed system 4.3 Feasibility study 4.3.1. Economical feasibility 4.3.2. Technical feasibility 4.3.3. Social feasibility 15 - - 16 - - - 5 SYSTEM SPECIFICATION 17
  • 7.
    iv 5.2 Hardware used 5.3Software used - - 6 SYSTEM DESIGN 6.1 Data Flow Diagram 6.2 Motion Detectors 6.3 How motion detection cameras work? 6.4 Sensor Technology 6.5 Video Motion Detection 6.6 Principle of Operation 18 20 22 26 27 29 31 7 MODULE SPECIFICATION 7.1 Login 7.2 Sign up 7.3 Monitoring 7.4 Logout 7.5 Hardware setup 7.5.1 Web camera 7.5.2 GSM module circuit 7.6 Simulation and comparing frames 7.7 Notification generation system 39 - - - - - - 40 - 42 - 8 IMPLEMENTATION 8.1 Background and foreground separation 43 - 9 CONCLUSION 44 10 FUTURE WORKS 45 REFERENCES APPENDICES
  • 8.
    v LIST OF ABBREVIATIONS VCR- Video Cassette Recorder CCD - Charge Coupled Devices BSFD - Background Subtraction Frame Difference SMS - Short Message Service MOV - Moving Object RBI - Revised Background Image FPS - Frames Per Second WAV - Wave Form Audio Format PIR - Passive Infrared CMOS - Complementary Metal–Oxide–Semiconductor VMD - Video Motion Detection Devices CCTV - Closed Circuit Television GUI - Graphic User Interface GSM - Global System for Mobile Communication UART - Universal Asynchronous Receiver/Transmitter
  • 9.
    LIST OF FIGURES FigureTitle Page Number 3.1 System Architecture 8 3.4.1 Flow Chart Of Background Subtraction Method 11 3.4.2 Flow Chart Of Frame Difference Method 12 3.5 Flow Chart of BSFD Algorithm 14 6.1 Dataflow Diagram 20 6.6 Principles of video motion detection 32 6.7 Frame Divided Into Cells 33 6.8 Intelligent cells 34 6.9 Problems of Perspective - 7.5.2 GSM module circuit. 40 7.5.3 Microcontroller 41 8.1 Background Separation 43 A.1 Login Page 47 A.2 Tab Title - A.3 Logout Button 48 A.4 Opening Default Cam 49 A.5 Red circle at the motion area 50 - 52 A.6 Path and default name to save files 53 A.7 Output motion detected - A.8 Alert by SMS 54
  • 10.
    Smart Web CamMotion Detection Surveillance System B.E., Dept. of CSE, RIT, Hassan Page 1 CHAPTER 1 INTRODUCTION In this we would just briefly look into the introduction of the project requirements needed for it and its purpose and aim.Motion Detection surveillance and security systems have become very common in modern days. This kind of system can easily be found in places like retail stores, banks,supermarkets, airports, commercial buildings and even private premises. There are twokinds of video surveillance and security systems: analogue system and digital system. In traditional systems for security operations, cameras are used to deliver analoguevideo images to monitors or time-lapse video cassette recorder (VCR). Although manylocal image processing functions are possible to improve the system application, thisrequires a lot of processing resources and high-power-consuming hardware. Althoughdigital video surveillance and security system is widely used, analogue system stillserves as a cheaper alternative. Charge coupled devices (CCD) camera and digitalcamera one among the most popular cameras used in the system. Motion detection is the ability to recognize the presence of movements. Thereare many different ways to detect motion. The conventional way is by using eitheractive sensor or passive sensor. The new method to detect motion is "vision motiondetection". It is the artificial way of machine vision system compared to human'svision in detecting motion. So our idea was to take a picture from a web cam every period of time (make it the current picture) and compare it with a previous picture and if we find a big difference between them we will save both pictures else will free memory from the old picture and make the new picture the current picture. Motion detection includes detecting and recording the whole movement process. The purpose of motion detection is to provide an automatic detection in the region of interest. The task for motion detection is to detect motion in a region of interest. This region is always embodied in a region of awareness or in terms of the camera geometry is called the field of view. It is also defined as a portion of environment being monitored. The region of interest in the present case is the environment with moving object and activity. A region of interest can be therefore a person, an animal or an artifact, circumscribed with the term moving object.
  • 11.
    Smart Web CamMotion Detection Surveillance System B.E., Dept. of CSE, RIT, Hassan Page 2 Role of Surveillance Cameras: Public, Privacy and Protection The potential value of public surveillance technology took on new meaning in April, 2013 when investigators identified the two suspects in the Boston Marathon bombing after sifting through video images captured by the city’s cameras.The Boston bombers were apprehended quickly due to surveillance cameras. Yes! All agree! No dispute over how well the public cameras were on that day. Yet, many lingering questions need to be answered now, since we have time and opportunity to gather our wits and thoughts! We should have surveillance cameras in public places because they ensure public safety. Rarely will anyone attempt to harm you when they know their actions are being recorded on camera. Cameras keep you and your personal property safe. Types of Surveillance Systems Types of Surveillance Systems Fortunately, surveillance can come in many forms. Know what they are, now. Security surveillance systems are designed to monitor and report on changes or notable changes within an assigned field. Security surveillance systems are commonly installed to monitor public security and health, the weather and the safety of homes or commercial buildings and complexes. Home Security Cameras/ Security Cameras for Home Security surveillance systems are generally designed to monitor the movement of people in any given area. Home monitoring systems are set up to monitor personal property, such as residences with the use of wireless lighting and a wireless security camera, while other surveillance systems are employed to monitor a building or complex of structures. In a smaller scale, the use of CCTV or wireless camera security systems, motion sensors and alarm systems for security are very common. Far more complex measures are utilized in larger scale security surveillance, similar to that managed for national security. These systems can usually survey the Internet and telephone activity, people getting into the county, movement of suspicious individuals and collect data on suspicious activity. A larger framework of national security surveillance systems will then collect data from public places. Weather Surveillance Systems to predict and forewarn about weather disturbances, weather surveillance systems are utilized to monitor weather patterns, usually on a daily basis, just like newspapers or broadcast reports. This type of surveillance system can also identify global trends, such as the recognition of El Nino and La Nina effects or the Greenhouse effect. High-tech instruments are usually associated with weather surveillance systems, such
  • 12.
    Smart Web CamMotion Detection Surveillance System B.E., Dept. of CSE, RIT, Hassan Page 3 as radars and satellites, as well as computer modeling software, to collect and key in weather data and develop forecasts of weather disturbances. Weather surveillance systems are also used to assess changes in weather patterns. In weather surveillance, such as anemometers, wind vanes, barometers and rain gauges. The data collected from these instruments will then be collated and incorporated into weather surveillance databases. Background Video surveillance and security systems have become very common in modern days. This kind of system can easily be found in places like retail stores, banks,supermarkets, airports, commercial buildings and even private premises. There are twokinds of video surveillance and security systems: analogue system and digital system.In traditional systems for security operations, cameras are used to deliver analoguevideo images to monitors or time-lapse videocassette recorder (VCR). Although manylocal image processing functions are possible to improve the system application, thisrequires a lot of processing resources and high-power-consuming hardware. Althoughdigital video surveillance and security system is widely used, analogue system stillserves as a cheaper alternative. Charge coupled devices (CCD) camera and digitalcamera one among the most popular cameras used in the system. Digital surveillance systems are mostly specifically designed for commercialuse and it has always been out of reach for other users. The cost for CCD cameras,networking devices and the software designed for this system has made it inaccessibleand unpractical for home users with moderate requirements. Also, not all the existingproduct has the motion detection function. Most of the video surveillance and security systems in the market does notissue alarms in real time, manual monitoring system are costly in term of manpower.This can be overcome by a real time motion detection system with the ability toautomatically analyze the video images and archive the images with moving objects. Description Motion Detection System can be used in surveillance and security systems. The system that this project came up with will be useful for security in a fixed restriction area. Therefore, the background of the targeted area is assumed to be non-moving and considerations of sudden change in lightings are ignored as well. However, the considerations
  • 13.
    Smart Web CamMotion Detection Surveillance System B.E., Dept. of CSE, RIT, Hassan Page 4 of other factors are taken into consideration. Basically, the initial plan was to use a technique called image segmentation to abstract the foreground image from the source image obtained and later processed to filter out noises or small images disturbance. To perform this, we would use Open Source Computer Vision Libraries from Intel to obtain contours from the foreground image subtracted. We will map these contours’ pixels with the original images’ to send raw data into the other module of the project performed by our partner on classifying the image frame obtained on whether it’s a human motion or not. His module would return a percentage of recognition rates on whether the motion belongs to human or not. Based on a level on acceptable percentage that it is sure it’s a human motion, the program would detects and displays the motion with a bounding box on the human which is in a different color to other moving objects that caused motion as well since all moving objects are bounded by the rectangles. The program will record down the scene when the motion event occurs. 1.1 AIM Information is a strategic resource which is paramount for the effective functioning of any organization. This information needs to be managed and safeguarded from malicious and unauthorized users. Various encryption and data security standards have been suggested and implemented for this purpose. The Aim of this project is to propose new DATA ENCRYPTION and DECRYPTION software that amalgamates the best of many encryption algorithms creating a new unified approach to data security, confidentiality, and authentication by bringing all these diverse algorithms to work in tandem. 1.2 OBJECTIVE This project would be focused on the Motion Detection module where we would perform research on the techniques and methodology to detect motion and to develop a module for a technique that we prefer to use in this project. This module would record down motion and pass it into the next module that would be on object classification where it classify human and non-human object. Thus, this project is to come up with a solution that detects motion effectively and record it down with one or more objects that are moving and causing motions. The purpose of this project is to help new researchers learn and further research on their topic of interest, which in this case is the motion detection system. The question to be addressed here in this module is, given a sequence of images, how do we
  • 14.
    Smart Web CamMotion Detection Surveillance System B.E., Dept. of CSE, RIT, Hassan Page 5 detect motion or track a moving object? The project is to mainly answer this particular question addressed by providing a prototype to emulate or prove the algorithms or techniques that are available to perform motion detection by an input of images in a number of frames. In today’s competitive environment, the securityconcerns have grown tremendously. In the modern world,possessionis known to be 9/10’ths of the law. Hence, it is imperative for one tobe able to safeguard one’s property from worldly harms such asthefts, destruction of property, people with malicious intent etc. Therefore, it is necessary for the surveillancetechniques to also improve with the changing world. With theimprovement in mass media and various forms of communication, itis now possible to monitor and control the environment to theadvantage of the owners of the property. The flaws of existing surveillance and security system would be overcome by areal time motion detection system with the ability to automatically analyze the videoimages and archive the images with moving objects. Therefore, a digital surveillancesystem based on web camera and targeted for small-scale user is developed. Main Objective of this Project is to provide • To investigate if motion detection is possible for web camera. • To develop a low cost security system using web camera. • To develop software with motion detection function algorithm. This project aims to achieve web camera application system with automaticmotion detection capability. The main idea is to develop a low cost surveillancesystem using web camera, which runs the software that is incorporated with motiondetection algorithm. It uses the concept of "motion detection by vision" to achievemotion detection capability where no hardware sensors are required. Automatic motion detection capability helps to reduce archive space and monitoringmanpower. The system would be a simple "do-it-yourself' system, which meansanyone can just setup by himself/herself.
  • 15.
    Smart Web CamMotion Detection Surveillance System B.E., Dept. of CSE, RIT, Hassan Page 6 CHAPTER 2 LITERATURE SURVEY • Content-based Retrieval and Real Time Detection from Video Sequences Acquired by Surveillance Systems (Elena Stringa and Carlo S. Regazzoni,2001) In this paper, a surveillance system devoted to detect abandoned objects in unattended environments is presented to which image processing content based retrieval capabilities have been added for making easier inspection task from operators. Video-based surveillance systems generally employ one or more cameras connected to a set of monitors. This kind of systems needs the presence of a human operator, who interprets the acquired information and controls the evolution of the events in a surveyed environment. During the last years efforts have been performed to develop systems supporting human operators in their surveillance task, in order to focus the attention of operators when unusual situations are detected. Image sequences databases are also managed by the proposed surveillance system in order to provide operators with the possibility of retrieving in a second time the interesting sequences that may contain useful information for discovering causes of an alarm. • Robust Real-Time Periodic Motion Detection (Ross CutlerandLarry,2012) In this paper,We describe new techniques to detect and analyze periodic motion as seen from both a static and moving camera. By tracking objects of interest, we compute an object's self-similarity as it evolves in time. For periodic motion, the self-similarity measure is also periodic, and we apply Time-Frequency analysis to detect and characterize the periodic motion. The periodicity is also analyzed robustly using the 2-D lattice structures inherent in similarity matrices. A real-time system has been implemented to track and classify objects using periodicity. Examples of object classification (people, running dogs, vehicles), person counting, and non-stationary periodicity are provided. • Study of Motion Detection Method for Smart Home System (Mayur J. Charadva,2014) In this paper, Motion detection surveillance technology give ease for time-consuming reviewing process that a normal video surveillance system offers. By using motion detection,
  • 16.
    Smart Web CamMotion Detection Surveillance System B.E., Dept. of CSE, RIT, Hassan Page 7 it save the monitoring time and cost. It has gained a lot of interests over the past few years. In this paper, a proposed motion detection surveillance system, through the study and evaluation of currently available different methods. The proposed system is efficient and convenient for both office and home uses as a smart home security system technology. • Outdoor wildlife motion triggered camera (Shafika, Suhaimi,2015) In this paper, Animal extinction means there is no more individual of that species alive in the world. The animal extinction problem happen all around the world even in Malaysia. World Bank data shows that, Malaysia record 70 of the 336 species of mammals are threatened in 2014 and make it the seventh highest in the world in this category. One of the cause of wildlife extinction is destruction of their natural habitat. This project Outdoor Wildlife Motion Triggered Camera is develop to help biologist monitor and study about the wildlife behavior and natural habitat so they can control the wildlife extinction. This project are using 8051 microcontroller and interfacing with 3 parts that is sensor, camera and SD card breakout board. The sensor detect the presence of wildlife and triggered the camera to capture the scene and automatically save the shot taken into external SD card. • Motion Detection for Security Surveillance (Prof. Joshi Vilas, Mergal Bhauso, Borate Rohan,2016) This paper deals with the design and implementation of smart surveillance monitoring system using raspberry pi and CCTV camera. This design is a small portable monitoring system for home and college security. This system will monitor when motion detected, the Raspberry Piwill control the Raspberry Pi camera to take a picture and sent out image to the user according to the program written in python environment. The proposed home security system captures information and transmits it via a Raspberry towards PC. Raspberry pi operates and controls motion detectors and CCTV camera for remote sensing and surveillance, streams live records it for future playback. Python software plays an important role in this project.
  • 17.
    Smart Web CamMotion Detection Surveillance System B.E., Dept. of CSE, RIT, Hassan Page 8 CHAPTER 3 WORK SPECIFICATION In our project we have aimed to build such a surveillance system, which can not only detect motion, but will A) warn the user of the intrusion, B) record the footage from the moment the motion was detected, D) sends SMS on the mobile phone of the user. Fig 3.1: A Basic System Architecture of Our System 3.1 SYSTEM ARCHITECTURE FUNCTIONING The system architecture is going to function in following way: 3.1.1 CAPTURING PHASE To detect motion we first have to capture live images of the area to be monitored and kept under surveillance. This is done by using a web cam which continuously provides a sequence of images in a particular speed of fps (frames per second). Motion Encounte Sensor BSFD Algorithm Storing System Indication SMS on Mobile
  • 18.
    Smart Web CamMotion Detection Surveillance System B.E., Dept. of CSE, RIT, Hassan Page 9 3.1.2 COMPARING PHASE Comparing the current frames captured with previous frames to detect motion: for checking whether any motion is present in the live images, we compare the live images being provided by the web cam with each other so that we can detect changes in these frames and hence predict the occurrence of some motion. 3.1.3 STORAGE PHASE Storing the frames on the memory if motion is detected: if motion is being detected, we would require storing such motion so that the user can view it in the near future. This also helps the user in providing a legal proof of some inappropriate activity since a video coverage can be used as a proof in the court of law. 3.2 SYSTEM INDICATION PHASE Indicating through an SMS when the motion is detected: the user may want to be notified immediately that there has been some intrusion detected by the software, hence an alarm system is included in the software. This alarm system immediately activates a wav file format audio alarm signal if any kind of motion is detected hence. This helps in preventing any kind of breach of security at that moment of time. As soon as the motion is detected an location containing the pictures of the intruder are sent to the user and simultaneously an SMS will be delivered on the user’s cell phone. 3.3 IMAGE SEGMENTATION In the images research and application, imagesare often only interested in certain parts. Theseparts are often referred to as goals or foreground (as other parts of the background). In order toidentify and analyze the target in the image, weneed to isolate them from the image. The imagesegmentation refers to the image is divided intoregions, each with characteristics and to extract thetarget of interest in the process. The image segmentation used in this paper isthreshold segmentation. To put it simply, thethreshold of the gray scale image segmentation isto identify a range in the image of the comparedwith the threshold and according to the results tothe corresponding pixel is divided
  • 19.
    Smart Web CamMotion Detection Surveillance System B.E., Dept. of CSE, RIT, Hassan Page 10 into twocategories, The foreground and background. Thesimplest case the image after the single-thresholdsegmentation can be defined as š‘”(š‘„, š‘¦) = ļæ½ 1 š‘“(š‘„, š‘¦) > š‘‡ 0 š‘“(š‘„, š‘¦) ≤ š‘‡ Threshold segmentation has two main steps:  Determine the threshold T  Pixel value will be compared with thethreshold value T In the above steps to determine the thresholdvalue is the most critical step in partition. In thethreshold selection, there is a best threshold basedon different goals of image segmentation. If wecan determine an appropriate threshold, we cancorrect the image for segmentation. 3.4 THE TWO TYPES OF MOTION DETECTION ALGORITHM Intelligent visual surveillance-system can beused many different methods for detection ofmoving targets, a typical method such asbackground subtraction method, frame differencemethod. These methods have advantages anddisadvantages, the following will be introduced. 3.4.1 BACKGROUND SUBTRACTION METHOD Background subtraction method is a techniqueusing the difference between the current image and background image to detect moving targets. Process flow chart is shown as Fig 3.4.1. The basic idea is the first frame image stored asa background image. Then the current image fk with the pre stored background image B subtraction, and if the pixel difference is larger than the bound threshold, then it determines that the pixel to pixel on the moving target, or as the background pixel. The choice of threshold of the background subtraction to achieve the success of motion detection is very important. The success of motion detection is very important. The threshold value is too small will produce a lot of false change points, the threshold choice is too large will reduce the scope of changes in movement.
  • 20.
    Smart Web CamMotion Detection Surveillance System B.E., Dept. of CSE, RIT, Hassan Page 11 The appropriate threshold request adapts with the impact which be had by scenes and camera onthe wavelength of the color, the changes of light conditions, so the choice of the dynamic threshold should be selected. The method formula is shown as, š‘…š‘˜(š‘„, š‘¦) = š‘“k(š‘„, š‘¦) āˆ’ šµ(š‘„, š‘¦) š·š‘˜(š‘„, š‘¦) = ļæ½ 1 š‘š‘Žš‘š‘˜š‘”š‘Ÿš‘œš‘¢š‘›š‘‘ š‘…š‘˜(š‘„, š‘¦) > š‘‡ 0 š‘”š‘Žš‘Ÿš‘”š‘’š‘” š‘…š‘˜(š‘„, š‘¦) ≤ T Fig 3.4.1: Flow Chart of Background Subtraction Method Background subtractions used in case of the fixed cameras for motion detection. Its advantage is easy to implement, fast, effective detection, can provide the complete feature data of the target. The short comings are frequent in the moves of the occasions may be difficult to obtain the background image. The immovable background difference is particularly sensitive to the changesin dynamic scenes, such as indoor lighting gradually change. Input Video Convert Frames Background Subtraction Apply Threshold operation Moving Object Reference Frame Current Frame
  • 21.
    Smart Web CamMotion Detection Surveillance System B.E., Dept. of CSE, RIT, Hassan Page 12 3.4.2 FRAME DIFFERENCE METHOD Frame difference method, is also known as the adjacent frame difference method, the image sequence difference method etc.it refers to a very small time intervals Δt of the two images before and after the pixel based on the time difference, and then thresholding to extract the image region of the movement, according to which changes in the difference of the specific flow chart as shown in Fig 3.4.2. Fig 3.4.2: Flow Chart of Frame Difference Method 3.5 BSFD ALGORITHM BASED ON THE DYNAMIC BACKGROUND Through the comparison of two moving target detection algorithms in the above section, in this paper it presents BFSD algorithms based on the dynamic background. Dynamic background can be achieved through the frame difference method. To overcome the Input Video Frame Conversion Frame Subtraction Process Result fi fi-1
  • 22.
    Smart Web CamMotion Detection Surveillance System B.E., Dept. of CSE, RIT, Hassan Page 13 disadvantages of difference method fi, fi-5 and fi+5 frames can be chosen, so that slowly moving object can be identified. After updating the background image that is referenced image, the background subtraction method performs for getting the moving object. The dynamic updating of the background. In the background subtraction method, we can consider that the whole scene from two parts, the background, the foreground. The background is a static scene and which can be seen, foreground is the moving objects which are interested in the video surveillance, such as vehicles, pedestriansetc. however due to the scene of the monitor changes over time, the foreground stagnation in the picture for a long time could be treated as part of the background, so updating of the reference image periodically is essential for moving object detection. Updating of reference image can be achieved through the frame difference method. Three frames fi, fi-5 and fi+5 can be taken and Di-5 and Di+5 calculated. Then perform AND operation, it gives the moving object M. Subtract M from fi itgives the background image B. Now apply logical OR on background image B and the Reference image. It produces the dynamic background image DB now the Reference image can be replaced by DB, this will be the new reference image. Finally subtraction can be made between DB and fi, then suitable threshold value should be applied to detect the moving object. The flow chart is shown in Fig 3.5.
  • 23.
    Smart Web CamMotion Detection Surveillance System B.E., Dept. of CSE, RIT, Hassan Page 14 Fig 3.5: Flow Chart of BSFD Algorithm The formula of the moving target detection algorithms based on the dynamic background as follows, Di-5 = |fi - fi-5| Di+5 = |fi - fi+5| MOV(x,y) = |RBI(x,y) - fi(x,y)| D(x,y) = {1 target MOV(x,y) > T, 0 background MOV(x,y) < =T} Input Video Frame Conversion Frame fi Frame fi+5 Frame fi-5 Difference Matrix Di-5 Difference Matrix Di+5 Moving Object Frame fi Reference Image Background Image Revised Background Frame fi MOV=RBI- Frame fi Target Object
  • 24.
    Smart Web CamMotion Detection Surveillance System B.E., Dept. of CSE, RIT, Hassan Page 15 CHAPTER 4 SYSTEM STUDY 4.1 EXISTING SYSTEM Digital surveillance systems are mostly specifically designed for commercialuse and it has always been out of reach for other users. The cost for CCD cameras,networking devices and the software designed for this system has made it inaccessibleand unpractical for home users with moderate requirements. Also, not all the existingproduct has the motion detection function. In traditional systems for security operations, cameras are used to deliver analoguevideo images to monitors or time-lapse videocassette recorder (VCR). Although manylocal image processing functions are possible to improve the system application, thisrequires a lot of processing resources and high-power-consuming hardware. Althoughdigital video surveillance and security system is widely used, analogue system stillserves as a cheaper alternative. 4.2 PROPOSED SYSTEM Most of the video surveillance and security systems in the market do notIssue alarms in real time, manual monitoring system are costly in term of manpower. This can be overcome by a real time motion detection system with the ability to automatically analyze the video images and archive the images with moving objects. The flaws of existing surveillance and security system would be overcome by areal time motion detection system with the ability to automatically analyze the videoimages and archive the images with moving objects and it alerts automatically when the motion detects from the view of camera. Therefore, a digital surveillancesystem based on web camera and targeted for small-scale user is developed. The latest technologiesused in the fight against thefts and destruction are the videosurveillance and monitoring. By using the technologies, it is possibleto monitor and capture every inch and second of the area in interest.However, so far the technologies used are passive in nature, i.e., themonitoring systems only help in detecting the crime but do notactively participate in stopping or curbing the crime while it takesplace.
  • 25.
    Smart Web CamMotion Detection Surveillance System B.E., Dept. of CSE, RIT, Hassan Page 16 Therefore, we have developed a methodology to detect themotion in a video stream environment and it generate alert by sending alert message to nearest Police station (or) Security service. So our Proposed Project gives the camera the capability to capture when needed rather than capture all the time and this leads to huge reduction in storage space. 4.3 FEASIBILITY STUDY The feasibility study is carried out to test whether the proposed system in words is being implemented. The feasibility study is based on the following major factors. Types of feasibility • Economical Feasibility. • Technical feasibility. 4.3.1 ECONOMICAL FEASIBILITY Economical feasibility is the most recently used method for evaluating effectiveness of the proposed system .It is obliquely known as cost benefit analysis. This procedure determined the benefits and savings that are expected from the proposed system and compared with the cost of the existing system. In case of the existing system, the hardware in the company is sufficient for system development and maintenance. 3.3.2 TECHNICAL FEASIBILITY The hardware, the software and to what extent they can support the proposed system are the keys for this study .The airways has all the required software necessary development and maintenance. Taking into consideration of the above criteria, the proposed system is technically feasible and further developments could be accomplished easily. 4.3.3 SOCIAL FEASIBILITY Infrastructure projects will often have significant social and environment impacts arising from their construction and operation, which can be both positive and negative. The impact may include flow on affects beyond the immediate project area and beyond the people directly associated with the project. In this project the social relationship between the traffic police and the highway group.
  • 26.
    Smart Web CamMotion Detection Surveillance System B.E., Dept. of CSE, RIT, Hassan Page 17 CHAPTER 5 SYSTEM SPECIFICATION 5.1 HARDWARE USED • Processor • Keyboard • Mouse • Color Monitor • 1GB RAM • Camera or Web Camera • GSM module circuit 5.2 SOFTWARE USED • Windows XP • Java • Net Beans IDE
  • 27.
    Smart Web CamMotion Detection Surveillance System B.E., Dept. of CSE, RIT, Hassan Page 18 CHAPTER 6 SYSTEM DESIGN In this paper we propose an advanced system of motion detection techniques along with multimedia techniques. This system will be more securing than any other these techniques alone and also as compared to traditional video surveillance systems. After some research, I came up with an algorithm which detected motion by comparing each frame captured by the camera with the previous one. If the frames were more or less the same, fine, but if they had differences above a certain limit, the program would trigger a motion detection event. So, for every frame captured, I compared the pixels with the previous frame for brightness changes. If the brightness change of a certain pixel exceeded a tolerance limit, the program would increment a counter. At the end of the scan, it checked the value of the counter and if it exceeded a certain limit, it triggered a motion detection event. So my idea was to take a picture from a web cam every period of time (make it the current picture) and compare it with a previous picture and if we find a big difference between them we will save both pictures else will free memory from the old picture and make the new picture the current picture. The system architecture is going to function in following way: • Capturing the live video feed through a web cam: To detect motion we first have to capture live video frames of the area to be monitored and kept under surveillance this is done by using a web cam which continuously provides a sequence of video frames in a particular speed of FPS (frames per second). • Comparing the current frames captured with previous frames to detect motion: For checking whether any motion is present in the live video feed, we compare the live video frames being provided by the web cam with each other so that we can detect changes in these frames and hence predict the occurrence of some motion. • Storing the frames on the memory if motion is detected: If motion is being detected, we would require storing such motion so that the user can view it in the near future.
  • 28.
    Smart Web CamMotion Detection Surveillance System B.E., Dept. of CSE, RIT, Hassan Page 19 This also helps the user in providing a legal proof of some inappropriate activity since a video coverage can be used as a proof in the court of law. • Indicating through an alarm when the motion is detected: The user may want to be notified immediately that there has been some intrusion detected by the software, hence an alarm system is included in the software. This alarm system immediately activates a WAV file format audioalarm signal if any kind of motion is detected hence. This helps in preventing any kind of breach of security at that moment of time. And the software sends the alert message to the Nearest Police station (or) Security services.
  • 29.
    Smart Web CamMotion Detection Surveillance System B.E., Dept. of CSE, RIT, Hassan Page 20 6.1 DATA FLOW DIAGRAM NO YES Fig 6.1: Dataflow Diagram. The motion detection method that was selected is a background subtraction technique. A previous frame is used as the background, and its color is subtracted from the current frame to detect any differences in the new frame. This background frame will be resettable at any time by the user, but the first background frame used is the first frame that is processed by the CAMERA COMPARE NEW FRAME WITH OLD FRAME PIXEL BY PIXEL IF ANY CHANGE IN RGB VALUE OF PIXELS THEN CAPTURE AND SAVE IN TEMP MEMORY 25 FRAMES PER SEC SAVE THE NEW FRAME ALERT SYSTEM GENERATE SMS ALERT SEND MESSAGE TO SMS VIDEO STREAMINGMOTION DETECTION
  • 30.
    Smart Web CamMotion Detection Surveillance System B.E., Dept. of CSE, RIT, Hassan Page 21 application. A ā€œsliding windowā€ for the background frame was considered as well. The sliding time window would change the background frame at intervals so that it would come closer to what we are seeing in the current frames. This would improve the motion detection overall, but it would also eliminate any detected blobs that stop moving. Once the blob stops moving, the background sliding window would slowly incorporate the blobs into the background. First, grab image from web cam called Old. Second, grab another image from web cam after a while, called Cur. Compare Cur&Old by comparing each pixel color. If difference is greater than tested value (according to the quality of your web cam & light system you are using is 60 or 50 Hz), then save the two pictures. Finally, make the old picture the Cur picture. Back to second step (infinite loop). Purpose– The problem of automatic recognition of human activity is one of the most important and challenging areas of research in computer vision because of the wide range of possible applications, for example surveillance, advanced human-computer interactions, monitoring. This paper presents statistical computer vision approaches to automatically recognize different human activities. Design/methodology/approach – The human activity recognition process has three steps: firstly human blobs are segmented by motion analysis; then the human body posture is estimated and, finally a temporal model of the detected posture series is generated by discrete hidden Markov models to identify the activity. Findings– The system was tested on image sequences acquired in a real archaeological site while some people simulated both legal and illegal actions. Four kinds of activity were automatically classified with a high percentage of correct detections. Research limitations/implications – The proposed approach provides efficient solutions to some of the most common problems in the human activity recognition research field: high detailed image requirement, sequence alignment and intensive user interaction in the training phase. The main constraint of this framework is that the posture estimation approach is not completely view independent. Practical implications – Results of time performance tests were very encouraging for the use of the proposed method in real time surveillance applications.
  • 31.
    Smart Web CamMotion Detection Surveillance System B.E., Dept. of CSE, RIT, Hassan Page 22 Originality/value – The proposed framework can work using low cost cameras with large view focal lenses. It does not need any a priori knowledge of the scene and no intensive user interaction is required in the early training phase. 6.2 MOTION DETECTORS Did you know that a home is burglarized every 14.6 seconds? 73.9% of all burglaries target residential properties. These statistics provided by the FBI reflect how vulnerable residential properties are in the US.So what do you do to keep burglars at bay? How do you keep your family and property safe? You can obviously use a baseball bat or get a dog, but that won’t really offer you the level of security that comes with technology. To protect your home from intruders, you may want to look into getting a motion detector. Motion sensors and detectors have been around since the seventies and are designed to provide effective security to home owners. Although technological advancements have improved the functioning of motion detectors, the basic purpose and system of this device remains the same. A motion detector is basically designed to detect motion or movement in a designated area and may instantly send a signal to the security alarm system. A motion detector is a device that detects moving objects, particularly people. Such a device is often integrated as a component of a system that automatically performs a task or alerts a user of motion in an area. They form a vital component of security, automated lighting control, home control, energy efficiency, and other useful systems. An electronic motion detector contains an optical, microwave, or acoustic sensor, and in many cases a transmitter for illumination. However, a passive sensor senses a signature only from the moving object via emission or reflection, i.e., it can be emitted by the object, or by some ambient emitter such as the sun or a radio station of sufficient strength. Changes in the optical, microwave, or acoustic field in the device's proximity are interpreted by the electronics based on one of the technologies listed below. Most low-cost motion detectors can detect up to distances of at least 15 feet (4.6 m). Specialized systems cost more, but have much longer ranges. Tomographic motion detection systems can cover much larger areas because the radio waves are at frequencies which penetrate most walls and obstructions, and are detected in multiple locations, not only at the location of the transmitter.
  • 32.
    Smart Web CamMotion Detection Surveillance System B.E., Dept. of CSE, RIT, Hassan Page 23 Motion detectors have found wide use in domestic and commercial applications. One common application is activating automatic door openers in businesses and public buildings. Motion sensors are also widely used in lieu of a true occupancy sensor in activating street lights or indoor lights in walkways, such as lobbies and staircases. In such smart lighting systems, energy is conserved by only powering the lights for the duration of a timer, after which the person has presumably left the area. A motion detector may be among the sensors of a burglar alarm that is used to alert the home owner or security service when it detects the motion of a possible intruder. Such a detector may also trigger a security camera to record the possible intrusion.  Types of Motion Detectors o These detectors come in different shapes and sizes. Here are a couple of examples; • Passive Infrared Detectors - These are one of the most commonly used sensors nowadays and may be found in many home security systems. The device is designed to pick up infrared rays and detect any form of movement. • Active Infrared Sensors - Designed to emit an electrical signal that connects to a light detector. As soon as the beam gets interrupted, it may sound the motion sensor alarm. • Passive Ultrasonic Detector – In theory, an ultrasonic detector sends out high frequency sound waves that are reflected back to the sensor. If any interruption occurs in the sound waves, the active ultrasonic sensor may sound the alarm. • Combined Motion Sensors - You could also choose a combined motion sensor that is designed to detect all kinds of motion, together. These sensors could be useful if you wish to reduce the risk of false alarms. • Wireless Motion Sensor - Wireless motion sensors are mostly used in doors and windows. These could be convenient to place and easy to install. When the device detects movement or motion, it may send signals back to a base device that triggers an alarm. • Motion Sensor Camera - This detector is designed to capture still images when movement is detected. Some motion sensor cameras also generate videos.
  • 33.
    Smart Web CamMotion Detection Surveillance System B.E., Dept. of CSE, RIT, Hassan Page 24  How to Select Motion Sensor o These detectors could be placed both indoors and outdoors. When you go out searching for one, you must know why you need it, where you need it, and what your budget is. Apart from this, it is also important that you choose a detector that can be installed easily. There are plenty of DIY models available in the market. If it’s your first time, a sales person should be able to help you in this regard.  What are pet immune motion detectors and how do they work? o Pet immune detectors, as the name suggests, are motion detectors, which are not triggered by the movement of animals. They are designed to detect the movement of living beings above a certain weight only and therefore when an animal gets in their range, they do not go off.  Is DIY motion sensor alarm easy to use? o Depends on the complexity of the alarm that you havebuilt.Usually constructed with a simple set of items including photocells, 741 Op Amp, a buzzer or alarm, a 9 volt battery breadboard and a 10k potentiometer, you may find it relatively easy to use since you built it. But keep in mind that this will require some basic knowledge of electronics on your part.  What are DIY motion detector alarms and how do they work? o These are motion detectors that you can construct yourself with a set of accessories you will find in any major electronics store. Since you are building this yourself, its working will vary according to your design. But as a general principle it will operate just like a typical motion alarm, detecting movements in its predefined area.  How light and sound waves are involved in motion detectors? o There are many different detectors that trigger different responses. The most common motion detectors are either passive infrared (PIR), microwave, or ultrasonic. A PIR sensor will detect temperature of a body within its proximity. A microwave sensor when activated omits a continuous wave of radiation which will experience disturbance if an object comes in its path, triggering the alarm. On the other hand, an ultrasonic sensor will omits ultrasonic waves that are reflected back when an object appears in its proximity. Sensors and detectors use different technologies to functions.
  • 34.
    Smart Web CamMotion Detection Surveillance System B.E., Dept. of CSE, RIT, Hassan Page 25 You can also opt for dual-technology motion sensors depending upon your security needs.  How to keep motion sensor on? o In order to keep your motion sensor on, you would need to keep in mind a few important points. You may check if the motion sensor is connected properly to the system, batteries are working fine, and if the system is correctly wired. If you have a wireless system, you must make sure there is no interference in the signals.  Can you tell about motion detectors how do they use sound and light waves? o Motion detectors make use of a beam of light, which crosses the room near the entrance, while the photo sensor is placed on the opposite side of the room. When someone passes through the beam causing it to break, the photo sensor identifies the change in the amount of light, and rings a bell. This way, both sound and light waves are used in motion detectors.  What type of rays do motion sensors detect? o There are different types of motion detectors, which use different technologies to detect rays. Passive infrared detectors detect body heat or infrared rays. Microwave detectors make use of microwave pulses and detect motion by reflection of a moving object. Dual technology detectors have combined features of microwave and infrared sensors. Ultrasonic detectors make use of ultrasonic waves to measure the reflection of moving objects.  Do motion detectors work in complete darkness? o Typically, motion detectors use infra-red rays to detect motion and they work just fine in complete darkness. Motion detectors do not need to emit any light or infra-red of their own, as they rely on picking up infrared radiation given off by people. So, you would not need to light up your area for the motion detector to work properly.  Will electrical tape stop a motion detector from working? o If you are using an electrical tape to stop your motion detector from working, it may not be very effective. Although, electrical tape may look black, but it is not completely opaque, so infrared rays can pass through the tape and are likely to be detected by the motion detector.
  • 35.
    Smart Web CamMotion Detection Surveillance System B.E., Dept. of CSE, RIT, Hassan Page 26  How to disable a motion detector? o It is easy to disable those motion detectors which are battery operated or wireless. For these motion detectors, you will only need to remove the battery. If your motion detector has an alarm system, you will only need to switch the alarm off. However, if you want to completely stop your detector, you would need to deconstruct it by removing battery and cables. If you have a wired detection system, you may need professional help to disable the motion detector. 6.3HOW MOTION DETECTION CAMERAS WORK Monitoring your data centers and building access points with CCD cameras can represent a boon to your overall security, but you need to know a little about camera terminology to make the best use of them. Don't think about "aim and shoot" when you think about these cameras. Think, instead, about how you might go about detecting motion in a series of still images. First off, let's examine the term "CCD". This stands for "charge-coupled device". A CCD is a silicon chip with a surface that is divided into light-sensitive pixels. When light hits these pixels, tiny electric charges are generated. With enough of these pixels, you can get a fairly high resolution image. With adequate "sensitivity" you can detect motion even in a dimply lit room. Initially designed as a memory device, CCD became a good choice for image sensing because of its ultra-sensitivity to light. Astronomers used the technology because it was as much as 100 times as sensitive as film and allowed previously invisible objects to be viewed. Digital cameras can use CCD or CMOS (complementary metal–oxide– semiconductor) circuitry. However, CCD produces higher quality images. Thus, security cameras generally use CCD technology. The difference between digital cameras and security cameras is in their basic way of working. Digital cameras store images when you tell them to. Security cameras only provide images (save and transmit them) when they detect motion. And motion detection is basically the process of comparing sequential images and determining whether the differences between them represent motion. If there are significant differences between two consecutive images, the cameras "conclude" that there has been motion within the camera view. They do this based on a couple important settings -- sensitivity and percentage.
  • 36.
    Smart Web CamMotion Detection Surveillance System B.E., Dept. of CSE, RIT, Hassan Page 27 Most, if not all, surveillance cameras will give you the option of selecting a particular area within the viewing screen to be monitored. In other words, you can say that you only want to detect motion in one area -- say the door or window. There are two types of image changes that can occur. We can have an overall change in the pixels as we would if the lights in the room went on or off. If the room has windows through which incoming light will enter, you probably don't want to generate motion detection photos just because the sun is setting. So, you can select a "sensitivity" setting that provides a contrast setting and determines how much of a change should be reported. You can also select how much of a change in your overall viewing area or within one or more sub-areas of interest represent motion. Maybe you want to detect a man-sized change something that affects 50% of the pixels in an area of interest, but you don't want to respond to a mouse running across the floor. Setting the sensitivity and percentage settings on cameras in your data center or office space can be time-consuming. After all, you want to know when something or someone is moving through your space, but you probably don't want 300 images every time someone walks through the door. Similarly, you probably don't want to be looking through shots of your office space every time a light goes on or off or a fan blows the drapes. Generating too many images can be as bad as generating too few because people will stop looking at them. Setting up your cameras to detect what you want to know about and nothing else is nearly impossible, but you can probably strike a balance that has you looking through mostly at things that matter and only half or a quarter as many "false positives". 6.4 SENSOR TECHNOLOGY  Passive infrared (PIR) o Passive infrared (PIR) sensors are sensitive to a person's skin temperature through emitted black body radiation at mid-infrared wavelengths, in contrast to background objects at room temperature. No energy is emitted from the sensor, thus the name passive infrared. This distinguishes it from the electric eye for instance (not usually considered a motion detector), in which the crossing of a person or vehicle interrupts a visible or infrared beam.
  • 37.
    Smart Web CamMotion Detection Surveillance System B.E., Dept. of CSE, RIT, Hassan Page 28  Microwave o These detect motion through the principle of Doppler radar, and are similar to a radar speed gun. A continuous wave of microwave radiation is emitted, and phase shifts in the reflected microwaves due to motion of an object toward (or away from) the receiver result in a heterodyne signal at a low audio frequency.  Ultrasonic o An ultrasonic wave (sound at a frequency higher than a human ear can hear) is emitted and reflections from nearby objects are received.[1] Exactly as in Doppler radar, heterodyne detection of the received field indicates motion. The detected Doppler shift is also at low audio frequencies (for walking speeds) since the ultrasonic wavelength of around a centimeter is similar to the wavelengths used in microwave motion detectors. One potential drawback of ultrasonic sensors is that the sensor can be sensitive to motion in areas where coverage is undesired, for instance, due to reflections of sound waves around corners.[2] Such extended coverage may be desirable for lighting control, where the goal is detection of any occupancy in an area. But for opening an automatic door, for example, a sensor selective to traffic in the path toward the door is superior.  Tomographic motion detector o These systems sense disturbances to radio waves as they pass from node to node of a mesh network. They have the ability to detect over large areas completely because they can sense through walls and other obstructions.  Video camera software o With the proliferation of low-cost digital cameras able to shoot video, it is possible to use the output of such a camera to detect motion in its field of view using software. This solution is particularly attractive when the intent is to record video triggered by motion detection, as no hardware beyond the camera and computer is needed. Since the observed field may be normally illuminated, this may be considered another passive technology. However it can also be used together with near- infrared illumination to detect motion in the dark, that is, with the illumination at a wavelength undetectable by a human eye.  Gesture detector o Photo detectors and infrared lighting elements can support digital screens to detect hand motions and gestures with the aid of machine learning algorithms.
  • 38.
    Smart Web CamMotion Detection Surveillance System B.E., Dept. of CSE, RIT, Hassan Page 29  Dual technology motion detectors o Many modern motion detectors use combinations of different technologies. While combining multiple sensing technologies into one detector can help reduce false triggering, it does so at the expense of reduced detection probabilities and increased vulnerability. For example, many dual-tech sensors combine both a PIR sensor and a microwave sensor into one unit. For motion to be detected, both sensors must trip together. This lowers the probability of a false alarm since heat and light changes may trip the PIR but not the microwave, or moving tree branches may trigger the microwave but not the PIR. If an intruder is able to fool either the PIR or microwave, however, the sensor will not detect it. o Often, PIR technology is paired with another model to maximize accuracy and reduce energy use. PIR draws less energy than emissive microwave detection, and so many sensors are calibrated so that when the PIR sensor is tripped, it activates a microwave sensor. If the latter also picks up an intruder, then the alarm is sounded. 6.5 VIDEO MOTION DETECTION There are many methods of detecting intruders into premises. These include such systems as: • Intruder alarms. • Fence mounted detectors. • Buried vibration or electric field devices. • Active infrared devices. • Passive infrared devices. • Microwave devices. • Video motion detection devices. This chapter is concerned with Video Motion Detection devices. (VMD). These may be within or outside the premises and, besides detecting intruders, can be used as part of a building management system. VMD may often be used either as a stand-alone system or integrated with other detection systems. In an ideal world, detection devices would give no false alarms and 100% of genuine alarms. Unfortunately, this is not an ideal world, and a
  • 39.
    Smart Web CamMotion Detection Surveillance System B.E., Dept. of CSE, RIT, Hassan Page 30 certain amount of compromise is necessary. This compromise must be reduced to the most effective and acceptable level to achieve the system objectives. There are really only two types of alarm, genuine alarms and false alarms. Sometimes mention is made of ā€˜spurious alarms’, unexplained alarms and system failures. These must only be considered as false alarms because the system has alarmed for no apparent reason. A genuine alarm is one created by deliberate nefarious human action, e.g. by movement of a person or vehicle into the detection field or disturbance of the alarm system. A false alarm is one that has no deliberate human input, such as those caused by animals, birds or any malfunction of equipment. One measure of the efficiency of a system is the ā€˜False Alarm Rate’ (FAR). This is the ratio of false alarms to a time scale, i.e. five per day. The FAR level will depend on many local site considerations. The objective is to reduce this to the minimum without missing any real alarms. Another measure is the ā€˜probability of detection’ (PD) rate, which is the ratio of detections to the number of attempts in controlled tests. The ideal for PD is 100%. Uses of VMD The primary function of a VMD system is to relieve CCTV operators from the stress of monitoring one or many screens of information that may not change for long periods. The VMD system will be monitoring all the cameras in its system, and only reacting when there is suspicious activity in one of the scenes. During the long periods of inactivity the operator can continue with other tasks, secure in the knowledge that when something occurs the system will immediately respond. Even a moderate sized system, with eight cameras, would prove impossible for an operator to monitor. Eight monitors could not be viewed with any degree of concentration for more than about twenty minutes. If the monitors were set to sequence, then activity on seven cameras is lost for most of the time and would be totally ineffective to detect intruders. With more cameras in a system, the task of detecting intruders becomes impossible and technology must take over the strain. The idea of VMD systems is that the processor is continuously monitoring all the cameras in the system. During this time, the, operator may select or sequence cameras using the conventional switching system. The system may include an additional monitor connected to the VMD system that will normally show a blank screen. When activity in any camera occurs that the VMD system interprets as an intruder, the alarmed camera is immediately switched to the blank monitor and a warning sounded to alert the operator. The operator’s
  • 40.
    Smart Web CamMotion Detection Surveillance System B.E., Dept. of CSE, RIT, Hassan Page 31 attention, is therefore, immediately focused on the camera covering the alarm. The detection of an intruder can also set off further events, such as setting a video recorder to real time recording, setting a matrix switching system to sequence through a specific series of cameras, etc. The operator can analyse the scene and take the appropriate course of action. An intruder could generate an alarm and be out of view of the camera before it is displayed. The operator would therefore see just a blank screen and be unsure about what to do next. To overcome this, at the time of detection, many VMD systems will capture an alarm image sequence containing one or more freeze frames. This may be displayed as the first view on the previously blank screen. The operator may then examine the scene at the instant of alarm in more detail. 6.6 PRINCIPLE OF OPERATION In the descriptions that follow reference is made to a ā€˜frame’ of video. Some systems use frames and some use fields, some systems can select between the two. This also applies to storage devices. For ease of description, the term frame is used for consistency but the actual method used should be checked for the system being considered. Video Motion Detection is an electronic method of detecting a change in the field of view of a camera. In its simplest form, this is achieved by storing one frame of the video information and then comparing the next frame with this to decide whether there has been a change. The change detected would be a difference in the video voltage, indicating a change of brightness within the scene. This would be initially ignored as an alarm until a further frame confirmed the change, or not. If confirmed as a change of brightness in the scene, then an alarm would be generated. This could cause a contact to close and activate some warning device such as a buzzer, or cause the switcher to select the camera that detected the motion. The sampling process may take somewhere between one fiftieth of a second and one second to detect a change, depending on the method of sampling. This simple detector could be used in an environment where all conditions were absolutely stable and the only possible change in brightness would be due to an intruder. However, the intruder could be a mouse or a person. The system couldn’t differentiate between the two. In addition, by the time the alarm is displayed on a monitor, the cause of it could be out of view. If the scene were being continuously recorded, the event could be reviewed but this may be too late to take effective action.
  • 41.
    Smart Web CamMotion Detection Surveillance System B.E., Dept. of CSE, RIT, Hassan Page 32 Fig 6.6: Principles of video motion detection • Detection Cells For the purposes of this chapter the following definitions are used although there are no standard terms used at present. A CELL is a single detection block that is analysed electronically for brightness changes. A cell may be a single pixel, a block of pixels, or the whole screen. A ZONE is a group of cells that have been defined as an active area. The exact meaning of ā€˜zone’ must be checked with a manufacturer’s specification before assuming what area is covered and to what degree of definition. This method of comparing complete frames therefore has severe drawbacks. The next development was to divide the picture into a number of separate areas or cells. This was refined by being able to switch cells on or off to define the area of the scene that is of interest. Diagram 18.4 illustrates a VMD system that divides the picture into cells, and how only a selected part of the scene can be set for motion detection. The shaded areas are inactive and the clear parts are the active cells. In this case, only activity in the area of the car will create an alarm. The cells are only displayed as such during setting up the system. Once the set-up mode is exited, the complete picture is displayed as normal and it is not possible to see any of the cells. The sensitivity of the cells can be adjusted to take into account local conditions. This control though is applied across all cells to the same extent. Some systems can be pre-set to
  • 42.
    Smart Web CamMotion Detection Surveillance System B.E., Dept. of CSE, RIT, Hassan Page 33 different sensitivity levels, for instance, to make allowance for day or night operation when the lighting levels may be different. Fig 6.7: Frame Divided Into Cells This type of system would not be suitable in the scene shown out of doors. This is because external light conditions are changing frequently. Clouds moving across the sky would cause changes in brightness and create alarms. This type is used in simple indoor situations, where the lighting conditions are constant and anything breaking the cells could be considered an alarm. The set-up can be refined to reduce unwanted activations. For instance, there may be two doors in the scene, only one of which needs to be monitored. In this case, the part of the scene of interest could be adjusted accordingly. Note that with this type of system any change in any one or all the cells will create an alarm. • Intelligent Cells The next move towards reducing false alarms is to build in the computing power to process each cell individually and create algorithms that will intelligently analyse certain situations. In this way, decisions can be made according to the direction of movement. For instance, one cell may be declared as a pre-alarm cell and another as a detection cell. Pre- alarm cells do not create alarms. Instead, they instruct the system to associate detection in this area with detection in another. Activation of detection cells alone will not create an alarm. A combination of successive detection in adjacent cells will trigger a logical action dependant on the program. For example, if a detection cell is activated after a pre-alarm cell an alarm will be created. However, movement in the reverse direction, detection before pre-alarm, will not create an alarm. In this way, all persons leaving a building will not create an alarm but persons approaching it will do so. Also, persons moving down the right of the perimeter will not create an alarm.
  • 43.
    Smart Web CamMotion Detection Surveillance System B.E., Dept. of CSE, RIT, Hassan Page 34 • Cell Count Another factor that could be calculated in the processor is the number of cells caused to change simultaneously. This would then be used as a further part of the equation, so that an alarm would only be created if more than ā€˜x’ cells change contrast simultaneously. This brings in attendant problems in some situations. Three dogs in the scene could activate the same number of cells as one person. A major problem with cell count is that of the different number of cells a certain size of object occupies in relation to the position of the camera. Fig 6.8: Intelligent cells Fig 6.9: Problems of Perspective
  • 44.
    Smart Web CamMotion Detection Surveillance System B.E., Dept. of CSE, RIT, Hassan Page 35 Diagram shows that a person in the foreground occupies eight cells while one in the background is less than half a cell. Similarly, a cat close to the camera would activate far more cells than a person in the background. Simple cell count systems may offer some improvement in false alarms but do not offer accurate size discrimination. • Contrast Levels It was stated that the detection of movement was obtained by measuring the changes in video level (brightness) between successive frames. This is fine if a person in a dark suit passes through a very bright scene. The change in brightness will be dramatic and immediately evident to the processor. However, a person in a grey suit in a grey scene, with little contrast, will cause only a small change in the brightness levels. If the sensitivity of the system were set to detect the latter event, it would be over responsive to insignificant changes in a bright scene. This is less important for indoor systems, but a significant factor in external systems where the light changes frequently and greatly. In addition, where the object is smaller than the cell, the brightness change will be a function of both the size of the object and the contrast between the object and the background. This becomes especially critical when detecting a person in the background when they may be only 10% of the screen height. This can be only 0.25% of the screen area. If the person is substantially smaller than the cell, the sensitivity would have to be very high to detect this change, but would cause many false alarms for larger subjects providing greater contrast, although much smaller than a person. Another problem with measuring brightness using large cells is that a small dark object such as a cat could cause the same brightness change as a large low contrast object such as a person. • Camera Shake In external systems, cameras are mounted on brackets or towers. It is often impractical to ensure that they are absolutely rigid with no movement. The camera would only have to move a small amount, such as can happen in the wind, to cause a global change and register an alarm. • Changes in Light Levels By processing separate cells and having the power to define better algorithms, other problems can be overcome. For instance, light changes may be ignored if all cells are affected
  • 45.
    Smart Web CamMotion Detection Surveillance System B.E., Dept. of CSE, RIT, Hassan Page 36 to the same extent. Another method to allow for global light changes is to make one reference cell in which movement is unlikely. The other cells are then referenced to this to compensate for light levels. This latter method can impose limitations on the system set-up and is now infrequently used. • Cell Sensitivity All the systems described so far have only been able to set the overall sensitivity of all cells. This renders them quite unsuitable for outdoor use. The next need therefore is to be able to adjust the sensitivity of each cell individually. This obviously requires much more computing power but is an absolute prerequisite for any VMD to be used externally. • Processing Speed Most simple VMD systems have one processor irrespective of the number of cameras. If it requires three frames to analyse a scene then the processing time for one camera will be about 0.12 seconds. This must be multiplied by the number of cameras in the system. Therefore, with eight cameras the processing speed for each will be about one second. For example, a 1/2ā€ camera with a 25mm lens has a width of view of about 5m at 20m from the camera. A person could run across this field of view in less than the processing time and not be detected. • Limitations of Simple VMD Systems The previous examples have served to show the principles of simple video motion detectors. Variations of these types are still available but their use is limited, and they should be used with great caution in anything but the most basic applications. However, they do have uses and can provide a very cost-effective method of motion detection when the situation is appropriate. The limitations of the types described for demanding external situations are as follows. • Will not cope with moderate changes in light levels. • Sporadic generation of alarms in high contrast scenes. • Will not cope with changing weather conditions. • Lack of size discrimination means compromise in setting up. • Non-uniform sensitivity with range.
  • 46.
    Smart Web CamMotion Detection Surveillance System B.E., Dept. of CSE, RIT, Hassan Page 37 • Will not cope with size variation due to perspective. • Slow processing speed can miss moving action. • Inability to discriminate between small high contrast dark and large low contrast objects. • Prone to false alarm due to camera shake. • Cell measurements prevent accurate area discrimination. • Restricted to small areas of view. • Unlikely to detect a person at 10% of screen height. • Only simple algorithms can be computed. • Cannot distinguish between a person moving in a line and a waving object. • Single processor increases time between frame comparisons. Governance and Governing Body In the ensuing debates over privacy versus safety and security, advocates on both sides would be wise to consider the following guidelines – • Responsibilities and Reasons: We need to consider privacy issues when creating surveillance policies. For one, cameras should avoid or mask inappropriate views of private areas, such as yards and windows of bedrooms or washrooms. • Crime, Cost and Benefits: Public surveillance camera systems can be a cost- effective way to deter, document, and reduce crimes. For example the cost savings associated with crimes averted through camera systems in a city of USA saved over four dollars for every dollar spent on the technology, while another city yielded a 50 cent return on the dollar. • Document and Publicize Policies. The law enforcing agencies must formulate on how surveillance cameras can be used and what are the disciplinary consequences for misuse. Likewise, officers should be thoroughly trained on these policies and held accountable for abiding by them. • Forecasting and Post-Event Investigations: The usefulness of surveillance technology in preventing and solving crimes depends on the resources put into it. The most effective systems are those which are monitored by trained staff, have enough cameras to detect crimes in progress, and integrate the technology into all manner of law enforcement activities. Use of correct video-analytics can actually
  • 47.
    Smart Web CamMotion Detection Surveillance System B.E., Dept. of CSE, RIT, Hassan Page 38 raise alarms about crimes or accidents before they take place. Correct management software will help in tagging, archiving and retrieving the authentic data for post-event investigation. • Mix of Man and Machine: People should be out on the streets and work-places trying to prevent crime or losses. CCTV cameras are just a less effective alternative to having police walk the streets or security personnel on patrolling and physical surveillance. As with any technology, the use of cameras is by no means a substitute for good old-fashioned ground work. The camera footage provides additional leads in an investigation and aids in securing witness cooperation. The video footage serves as a complement to – but not a replacement for – eyewitness evidence in the courtroom.
  • 48.
    Smart Web CamMotion Detection Surveillance System B.E., Dept. of CSE, RIT, Hassan Page 39 CHAPTER 7 MODULE SPECIFICATION 7.1 LOGIN The users who are created by the master can login into the system using this module. The user will have to enter their username and password. The GUI has boxes to enter the username and password and a login button to login. 7.2 SIGN UP The username and password of the respective users are created using this module by the master or the admin. For this module there are boxes to specify the username, his/her password and other details. 7.3 MONITORING In this module, when the system is started then it will monitor an area, according to the capturing capacity of camera, it will compare frames and if it founds any variations in the frame when compared to other frames, then the corresponding frame will be saved to the computer and at the same time a sms will be send to the registered user. 7.4 LOGOUT The master or the admin user for exiting application when the job done, we providing logout button. This are secure exiting option. 7.5HARDWARE SETUP The first stage is setting up the system of which consists of PC and web camera. The web camera is only operable with the web camera driver installed in the PC.Our Project recognize the installed Hardware (WEB CAM), It provides control for the setting facilities of camera such as Resolution, size of the frame in pixels, and Rate of frame to be captured. System capture the view at particular rate of speed as specified at the settings of camera.Captured image is stored temporarily.
  • 49.
    Smart Web CamMotion Detection Surveillance System B.E., Dept. of CSE, RIT, Hassan Page 40 7.5.1 WEB CAMERA Web camera or more precisely should be named as PC camera. It is the type ofcomputer-based camera that can only function when it is connected to Pc. It is morecommonly being known as webcam. This is a small and compact type of digital videocamera. Most of the web cameras currently in market are using standard UniversalSerial Bus (USB) but the old type was using PCI computer connections. Web camera has a wide variety of usage in many different fields. It was usedin astronomical observation and photography, animal observation, robotic webcam(Web Cam World 2001), recreation of 3 D modeling (3D Webcam 2003), weather observation in Alaska (Alaska Climate 2003) and many others. Generally, its usagecan be classified according to its function and place where the web camera is installed,e.g. scenery cam, personal cam, weather cam, building cam, etc. For different usageobjectives and purposes, different supporting hardware and software may be required(Churchill 2001). New application of web camera is developed every now and then.The new applications of web camera require software or both hardware and softwareto achieve the desired function. 7.5.2 GSM MODULE CIRCUIT Fig 7.5.2: GSM module circuit. ļ‚§ PIC18F452 microcontroller: In this project PIC18F452 pic microcontroller is used. It received data from algorithm with the help of built it analog to digital converter .If the
  • 50.
    Smart Web CamMotion Detection Surveillance System B.E., Dept. of CSE, RIT, Hassan Page 41 motion detection algorithm finds any motion, PIC microcontroller sends commands to GSM module. GSM module send SMS or make call according to selection of user. Fig 7.5.3: Microcontroller ļ‚§ SIM900A GSM module: GSM module used in this project to either send SMS to user or to make call to user on his/her cell number. GSM module communicates with pic microcontroller through AT commands. You should make sure to connect GSM module with pic microcontroller which has same operating voltages as operating voltages of pic18f452. If your GSM module works on 5 volt, you can connect it directly with PIC18F452. Because PIC18F452 also works on same operating voltages. But if your GSM module works on 3.3 volt, you need to use a interfacing circuit between them. So here in the project we are using an external power for the SIM to work, GSM module communicate with pic microcontroller through serial communication UART(universal asynchronous receiver/transmitter). ļ‚§ An external power supply is also used for the working of the circuit. So these are the main components used in home security system or SMS based home alarm system. The SIM900 is a complete quad band GSM module which delivers GSM/850/900/1800/1900MHz performance for SMS and data with low power consumption.
  • 51.
    Smart Web CamMotion Detection Surveillance System B.E., Dept. of CSE, RIT, Hassan Page 42 7.6 SIMULATION AND COMPARING FRAMES In the second stage, simulation done on the frame images using Java with Image Processing Module as simulation tool to investigate thepossibilities of motion detection algorithm on images captured by web camera. In this stage first, grab image from web cam called Old. Second, grab another image from web cam after a while, called Current. Compare Current&Old by comparing each pixel color. If difference is greater than tested value (according to the quality of your web cam & light system you are using is 60 or 50 Hz), then save the two pictures. Finally, make the old picture the Cur picture. Back to second step (infinite loop) 7.7 NOTIFICATION GENERATION SYSTEM In the third stage, implementation process is done by coding the motion detection software using Java. The algorithm that was successfully simulated isused as the reference for forming the working mechanism in creating motion detectionsoftware. In this stage the new frames will be stored at specified Locations, and GSM based message alert for anybody.
  • 52.
    Smart Web CamMotion Detection Surveillance System B.E., Dept. of CSE, RIT, Hassan Page 43 CHAPTER 8 IMPLEMENTATION 8.1 BACKGROUND AND FOREGROUND SEPARATION The discrimination between background and foreground is based on block-based motion estimation. In this paper, the modified block-based estimator is used to track changes of the individual block. Each frame of the 320x240 pixel resolution is divided into non- overlapping of 32x24 pixels. For the block motion estimation, a 9x9 window region with the maximum standard deviation is extracted within each block. The basic method of background subtraction is to Fig 8.1: Background Separation In the above figure, an input stream of images will be provided to the system which is then subject to background separation. Subtraction takes place based on the predefined threshold value and resultant is the foreground image which we obtain.
  • 53.
    Smart Web CamMotion Detection Surveillance System B.E., Dept. of CSE, RIT, Hassan Page 44 CHAPTER 9 CONCLUSION The ā€œSmart webcam motion detection surveillance systemā€ is a home/office based security system which can be of great where security is a matter of concern. Due to the advent of technology in the modern world, the methodologies used by thieves and robbers for stealing has been improving exponentially. Therefore, it is necessary for the surveillance techniques to also improve with the changing world. The latest technologies used in the fight against thefts and destruction are the video surveillance and monitoring. By using the technologies, it is possible to monitor and capture every inch and second of the area in interest. Motion detection is the most important feature in digital video surveillance system. It gives the camera the capability to capture when needed rather than capture all the time and this leads to huge reduction in storage space. Alarm can also be triggered when unexpected motion is detected. This relieves the Personnel in monitoring at all time. The motion detector patches up for the need of a cheap and small security system in day-to-day life. Computerized home-based security can develop a lot with the coming future. Future is promising and easier with innovative technologies.
  • 54.
    Smart Web CamMotion Detection Surveillance System B.E., Dept. of CSE, RIT, Hassan Page 45 CHAPTER 10 FUTURE WORKS Here, we had presented a research on some image processing techniques implemented for motion detection algorithms and also some of the methodology and approaches of implementing a motion detection algorithm itself. The review includes research on a basic end-product implementation of a motion detection application. We had presented some ways for implementing the approaches researched and also shared some ideas for alternatives ways to implement the motion detection algorithm. An implementation and system design of a prototype system developed for testing purposes is reviewed in this report as well. There are still many areas which can be further researched from this point onwards. For example, the techniques introduced may be enhanced to suit some problem specific applications or some domain specific applications. Also the techniques may be further enhanced by implementing more useful methods and algorithms such as those involving with tracking the object which causes the motion events such as those using optical flows or also known as image flows. Here, human motions are being detected. However, future works may also want to recognize the pose or gesture of the human body registered by the algorithm implemented here in the prototype system
  • 55.
    Smart Web CamMotion Detection Surveillance System B.E., Dept. of CSE, RIT, Hassan Page 46 REFERENCES [1]. Google search. [2]. Yahoo search engine. [3]. www.w3schools.com. [4]. www.mathworks.com. [5]. www.matlab.com. [6]. Rozinet, O. and Z. Szabo, ā€œHand motion detection using Matlab software environmentā€. [7]. 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, 2003, 14-17 Dec. sensor2003 , pp. 696 – 700, 14-17 Dec. 2003. [8]. JosuĆ© A. HernĆ”ndez-GarcĆ­a, HĆ©ctor PĆ©rez-Meana and Mariko Nakano Miyatake, ā€œVideo Motion Detection Using the Algorithm of Discrimination and the Hamming Distanceā€, Lecture Notes in Computer Science, Springer-Verlag, Germany. [9]. H.A.M. El_Salamony, H.F. Ali, and A.A. Darweesh, ā€œ3D Human Body Motion Detection and Tracking in Videoā€, Proc. Acta Press. [10]. Song, Y.,ā€œA perceptual approach to human motion detection and labelingā€, PhD thesis, California Institute of Technology, 2003. [11]. Yilmaz, A., M. Shah, ā€œContour Based Object Tracking with Occlusion Handling in Video Acquired Using Mobile Camerasā€, Proc. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2005. [12]. Borst, A. and Egelhaaf, M., ā€œPrinciples of visual motion detectionā€, Trends in Neurocience, Vol. 12, pp. 297-305, 1989. [13]. Wachter, S. and H.H. Nagel, ā€œTracking persons in monocular image sequences,ā€ Proc. Computer Vision and Image Understanding, Vol. 74, pp. 174-192, 1999. [14]. Gavrila, D., ā€œThe visual analysis of human movement: A survey,ā€ Proc. Computer Vision and Image Understanding, Vol. 73, pp. 82-98, 1999. [15]. Motion detection with image acquisition toolbox, Mathworks, Matlab.
  • 56.
    Smart Web CamMotion Detection Surveillance System B.E., Dept. of CSE, RIT, Hassan Page 47 APPENDIX A A.1 SCREENSHOTS Fig A.1: Login Page In our database already saved user id and password with help of jdbc connector will respond login time. setTitle("Motion Detector Demo"); it is the default title of the tab Fig A.2: Tab title
  • 57.
    Smart Web CamMotion Detection Surveillance System B.E., Dept. of CSE, RIT, Hassan Page 48 This statement says to close the motion detection panel whenever we press the logout button. Fig A.3: Logout button This statement is used to access the default system webcam with standard resolutions. webcam = Webcam.getDefault(); webcam.setCustomViewSizes(nonStandardResolutions); webcam.setViewSize(WebcamResolution.VGA.getSize());
  • 58.
    Smart Web CamMotion Detection Surveillance System B.E., Dept. of CSE, RIT, Hassan Page 49 Fig A.4: opening default cam detector = new WebcamMotionDetector(webcam); detector.setInterval(100); // one check per 500 ms detector.setPixelThreshold(50); detector.start(); Here the webcam is opened and the threshold frequency is set to 30` and the detection is started. if (detector.isMotion()) { g.setStroke(new BasicStroke(2)); g.setColor(Color.RED); g.drawOval(cog.x , cog.y, 50, 50);
  • 59.
    Smart Web CamMotion Detection Surveillance System B.E., Dept. of CSE, RIT, Hassan Page 50 If the motion is detected a red circle has to come on that particular area.
  • 60.
    Smart Web CamMotion Detection Surveillance System B.E., Dept. of CSE, RIT, Hassan Page 51
  • 61.
    Smart Web CamMotion Detection Surveillance System B.E., Dept. of CSE, RIT, Hassan Page 52 Fig A.5: Red circle at the motion area Here the default filename is set to the current time and path to save the file is set. {String name = String.format("C:UsersabcPicturesCamera Rolltest-%d.jpg", System.currentTimeMillis());
  • 62.
    Smart Web CamMotion Detection Surveillance System B.E., Dept. of CSE, RIT, Hassan Page 53 Fig A.6: Path and default name to save files So that the system display the output ā€œmotion detectedā€ and the SMS has been send. System.out.println("Motion Detected"); SendSMS a=new SendSMS(); Fig A.7: Output motion detected
  • 63.
    Smart Web CamMotion Detection Surveillance System B.E., Dept. of CSE, RIT, Hassan Page 54 This statements checks whether the SMS has sent or not. if(a.send()==true) { System.out.println("Message has been send"); } else { System.out.println("Message not send"); And here is the alert message that delivered to the connected phone number. Fig A.8: Alert by SMS