Professional Documents
Culture Documents
Godson Development of A Suveillance System
Godson Development of A Suveillance System
By
PSC1707442
UNIVERSITY OF BENIN
BENIN CITY
DECEMBER, 2022
DEVELOPMENT OF A SURVEILLANCE AND DETECTION SYSTEM
By
PSC1707442
DECEMBER, 2022
CERTIFICATION
This is to certify that this project work was carried out by EBENUWA GODSON
MARVELOUS in the Department of computer science of the Faculty of Physical Science,
University of Benin.
___________________________ ___________________
(project supervisor)
APPROVAL
This project work is hereby approved by the Department of Computer Science, Faculty of
Physical Science, University of Benin, in partial fulfillment for the award of Bachelor of Science
(B.Sc). degree in computer science.
______________________ ___________________
(Project Supervisor)
_____________________ ___________________
(Head of Department)
DEDICATION
This Project work is dedicated to God Almighty for his goodness in my life throughout my study
in this noble institution.
ACKNOWLEDGEMENT
I wish to appreciate and give gratitude to God Almighty for his abundance grace, guide and
protection throughout the period of this study. I sincerely acknowledge with great gratitude to
my supervisor Prof. Mrs. S. Konyeha for her support, encouragement, advice and time she spent
putting me through in this project despite his busy schedule, Also to my Head of Department
Prof. Mrs A. O. Egwali and to Dr. Mrs. Osubor for her motherly role and support, I also express
my gratitude to all my lecturers in Computer Science Department Prof. Frank Amadin, Prof. A.
A. Imiavian, Dr. K. C. Ukaocha, Dr. E. P. Ebitomere, Prof. Mrs. Egbokhare, Mr. S. O. P.
Oliomogbe, Mrs O. I. Usiosefe, Mr. E. Nwelih, Mr. E. E. Obasohan, Mrs. N. E. O. Agbonlahor,
Mrs. S.O. P. Oliomogbem, Mrs. R. A. Usiobaifo, Mr. F. Osagie, Mr. E. Obayagbona, Mrs. T.
Agenmonmen, Mrs. O. Aziken, Mr. E. C. Igodan Dr. Obi, Dr. Mrs. R. O. Osaseri, Prof. Mrs A.
O. Egwali, Mrs. A. R. Usiobaifo, Mr. K. O. Otikiti, Mr. Odetayo, Mr. Ojo Solomon for all their
support throughout my time in the Department of Computer Science.
My Family especially my parents Mr. and Mrs. Ebenuwa for their financial supports and also to
my siblings and my friends for their love and support, God bless you all.
ABSTRACT
Security is a big issue in Nigeria and the world at large. Therefore, there is definitely a need for a
surveillance system for our homes and offices which can be accessed via a PC or mobile phone.
This research concentrates on developing an automatic system to replace the need for human
monitoring. In this work we implemented a surveillance system to detect intruders and notify
security staff using computer vision and email communication technologies. The system is also
cost effective and easy to implement. This developed project uses one hikvision ip camera and
one router. The motion detection algorithm was coded in Python OpenCV library in combination
with AgentUI to provide database, thread handling and local server capabilities. We tested the
system to verify that the system operated as expected. The test results were satisfactory.
TABLE OF CONTENT
TITLE..............................................................................................................................................ii
CERTIFICATION .........................................................................................................................iii
DEDICATION................................................................................................................................iv
ACKNOWLEDGEMENTS ............................................................................................................v
ABSTRACT...................................................................................................................................vi
TABLE OF CONTENT................................................................................................................vii
LIST OF FIGURES.........................................................................................................................x
LIST OF PLATES..........................................................................................................................xi
LIST OF TABLES........................................................................................................................xii
2.12.2 IP address 16
2.12.3 Subnetting .........................................................................................................................16
REFERENCES............................................................................................................................52
Table 4.1 Network performance result on the server side with no stream ...................................46
Table 4.2 Network performance result on the client side with no stream ....................................47
Table 4.3 Network performance on server side with stream ........................................................47
Table 4.4 Network performance on client side with stream .........................................................48
Table 4.5 Comparison between expected and actual results ........................................................49
Table 4.6 Bill of Engineering Measurement and Evaluation (BEME) .........................................50
CHAPTER ONE
INTRODUCTION
Security is important for every organization. In the traditional security system, if there is an
illegal invasion that cannot be detected in a timely manner, then it is not possible to provide
evidence for tracking because there is no automatic alerting mechanism in place. (Norris &
Armstrong, 1998). Iyapo et al. (2018) stated that the degree of protection from danger, loss, and
2021, reported over 135000 crimes reported in Nigeria of which 68600 were crimes against
function of video surveillance includes camera control, video display, data recording and
monitoring, and its infrastructure include a front-side camera, transmission cable, and video
Before the wide spread of IoT technologies and methods, security surveillance systems had to be
monitored by a security staff on ground. There was no way of triggering events based on certain
parameters and hence made for an efficient but ineffective mode of surveillance. Accurately
detecting humans and motion in a video surveillance system is critical for a variety of
gender classification, and fall detection for the elderly. The initial stage in the detection
procedure is to detect a moving item. Object identification methods such as background removal,
1
optical flow, and spatio-temporal filtering might be used. When a moving item is discovered, it
(Paul et al., 2013). Alzughaibi et al., (2015) explained that foreground detection or backdrop
removal refers to the broad method of detecting moving objects in films captured by stationary
cameras. This is widely used to identify human activities, object tracking, traffic monitoring,
computer vision applications, and human computer interaction. Objects in motion, often known
as the foreground, must be separated from static information for this process to work. This static
information is referred to as the backdrop, and the background subtraction method is commonly
Huang (2011) aimed for a high-tech video surveillance system. His approach categorizes motion
1. Background subtraction
2. Temporal differencing
3. Optical flow
This research makes use of the background subtraction approach for motion detection.
Due to the rise in security challenges and the ineffectiveness of the popular surveillance system
currently in use, which involves personnel being around the area of surveillance. A more suitable
approach of solving security surveillance issues is required. One that eliminates the requirements
for a staff to be physically present while also boosting the security through advanced technical
techniques.
Securing lives and property is of topmost importance and hence a motivation for this study.
1.3 AIM AND OBJECTIVES OF THE STUDY
The fundamental aim of the study is to design and implement a web based security surveillance
system. The study will put into consideration the cost and ease of installation. The design
methods: IP Camera connection, software programming, IoT linking, real-time computer vision
1. To design a web-based application that will detect motion using background subtraction
The world is being digitized every day and corporations are looking for the best ways to reduce
manpower and improved results with the use of automatic techniques. Security is a major, never
ending, concern in any organization and this research will help shed light on security
surveillance techniques via IoT. This will not only help students benefit from the wealth of
knowledge that will be shared, but will also add to the existing studies on home security and
surveillance systems.
Based on the objectives of the study, the scope of this research is to design and implement a web
based surveillance system to detect motion and automatically alert the system administrator.
The alerting may not be instant due to network downtime and may take some time before it
reaches the devices. By so doing, the email notification alert may not come at the exact moment
LITERATURE REVIEW
2.1 INTRODUCTION
This chapter extensively discusses the theoretical literature involved in internet of things,
A Russian Physicist, Léon Theremin developed a surveillance system in 1927 requested by the
Soviet for labour and defense purposes, the system consisted of a manually-operated scanning-
transmitting camera and wireless shortwave transmitter and receiver which was used to monitor
approaching visitors in the courtyard of the Moscow Kremlin. The earliest video surveillance
systems involved constant monitoring because there was no way to record and store information.
The development of reel-to-reel media enabled the recording of surveillance footage. These
expensive and unreliable process, with the operator having to manually thread the tape from the
tape reel through the recorder onto an empty take-up reel. Due to these shortcomings, video
A work by Lubos Ovsenik and Ján Turán in 2010 viewed and implemented a surveillance system
based on four independent but interacting modules: detection, tracking, classification and
The current system, which is still in operation and has been for a long time, has been reviewed in
various ways and proven to have certain flaws. A number of flaws in the current system are
listed below.
movement; however, current motion detection systems are not equipped to handle noise
and environmental changes such as wind-blown tree leaves, a bird flying by, a change in
weather (rainfall), and a change from day to night time, and may raise false alarms.
2. The current widespread system does not automatically detect motion and starts recording
the action taking place. The operator would have to go through hours of footage to get the
Due to the false alarm, the system will require a significant storage capacity to record the data of
The Internet of things (IoT) describes the network of physical objects – ‘things- or objects that
are embedded with sensors, software and other technologies for the purpose of connecting and
exchanging data with other devices and systems over the internet. (Rouse, 2019).
Things have evolved due to the convergence of multiple technologies like real-time analytics,
machine learning, commodity sensors, and embedded systems. Traditional fields of embedded
systems, wireless sensor networks, control systems, automation (including home and building
automation), and others all contribute to enabling the internet of things. In the consumer market,
IoT technology is most synonymous with products pertaining to the concept of the ‘smart home’,
including devices and appliances (such as, lighting fixtures, thermostats, home security systems
and cameras, and other home appliances) that support one or more common ecosystems, and can
be controlled via devices associated with that ecosystem, such as smart phones and smart
Surveillance is a vital utility in all places to enable the provision of secure environment for the
well-being of organized society and can be effectively achieved with the help of a video.
Industries, along with researchers are endeavouring hard to overcome the difficulties seen in the
application.
There is an increasing demand for automated video surveillance with a wide range of threats in
the society and less manpower to monitor them. With traditional surveillance system, detection
of intrusion is limited to the presence of a security personnel and therefore tracking moving
image is an important task in surveillance system, since there is a continuous change in the
location of the objects. Object detection involves obtaining objects in consecutive frames and
intrusion alerting systems tracks these objects and reports back if the objects exceed the
By harnessing the power of IoT for security in surveillance solutions, it enables building owners,
organization managers, and security professionals manage and control surveillance devices
remotely to monitor all aspects of a facility, make smarter decisions about the best course of
action to take based on real-time security conditions, determine when there is a false alarm
without having to physically inspect the location or unnecessarily dispatch security staff and
collect and analyse data to make important improvements to security processes and systems.
Perhaps the greatest benefit using IoT solutions for security and surveillance system is the ability
to prevent the loss of critical assets. IoT security solutions allow organizations to gain greater
visibility over who enters and leaves a facility in real-time, consistently and securely monitor
facility conditions from any location with Wi-Fi access and act quickly on important security
Philip N. Howard a professor and author, cautions that privacy threats are enormous, as is the
potential for social control and political manipulation (Howard, 2015). Concerns about privacy
have led many to consider the possibility that big data infrastructures such as the internet of
things and data mining are inherently incompatible with privacy (McEwan, 2019).
Also, the IoT suffers from platform fragmentation, lack of interoperability and common technical
standards (Wieland, 2016) a situation where the variety of IoT devices, in terms of both
hardware variations and differences in the software running on them, makes the task of
Motion detection is an important branch of Computer Vision research that has acquired a lot of
traction. The process of detecting a change in the location of an item in relation to its
identifying changes within a video and recognizing and interpreting human gestures in a video.
Many computer vision applications, such as video surveillance, traffic monitoring, and human
gesture identification, require the detection of moving objects in an image sequence. The frame
subtraction technique, the background subtraction method (which is later studied in depth), the
background estimation method, and the optical flow method are the primary methods utilized in
moving object identification at the moment (Shah et al., 2013). The objective of a motion
detector is to detect a region of interest embodied in a region of awareness, where the region of
awareness, or something comparable to the camera's focus in the field of vision, is defined as the
area being watched. The region of interest is in the area of the environment that is being
monitored for activity (Dellosa, 2014). The detection of a moving item in the scene is what
Moving object detection in visual surveillance is the key step, especially for foreground and
better performance to each moving object, especially in object tracking. The conventional
technique of video frame difference includes the subtraction of two consecutive frames simply
followed by thresholding and analysing gradient or histogram; key points as a typical feature of
motion also have been applied to foreground and background separation. Nowadays, motion
analysis and optical flow by using information theory and deep learning have been employed to
At the stage of object tracking, filtering (Kalman filtering, Bayesian filtering, particle filtering,
etc.) is used to predict every position of the target object. Another tracking approach uses
connected components to segment the changes into different objects without prior knowledge.
The approach exhibits a good performance when the object has a very low resolution.
Motion detection in video surveillance refers to the surveillance system's capacity to detect
motion and record it. When a security camera detects motion, it triggers a software-based
monitoring mechanism that instructs the camera to begin recording the event. This is referred to
as activity detection. The kind of motion detected by an advanced motion detection surveillance
system may be analysed to see if it merits an alarm. The goal of the Real-Time Security System
with Human Motion Detection design is to create a system to monitor an area using an IP camera
that is suited for areas where no one is allowed to access and where motion detection is required.
Apart from the obvious benefit of being able to split video streams into moving and background
components, identifying moving blobs offers a focal point for identification, classification, and
activity analysis, making these procedures more efficient because only “moving” pixels must be
evaluated. The three most common methods for detecting moving objects are temporal
extremely adaptable to dynamic settings, it performs a poor job of recovering all important
feature pixels in most cases. Background subtraction offers the most detailed feature data, but it
is very sensitive to dynamic scene changes caused by lighting and other factors. In the presence
of camera motion, optical flow may be used to identify independently moving objects; however,
most optical flow calculation methods are computationally expensive, and cannot be applied to
full-frame video streams in real-time without specialist hardware (Rahman, 2008). The goal of
the Real-Time Security System with Human Motion Detection design is to create a system to
monitor an area using a web camera that is suited for areas where no one is allowed to access and
where motion detection is required. If any object was moving, the camera was utilized to take
live photos of the area under examination, and the acquired images were saved for future use.
According to Patel et al., (2016), CCTV cameras are more expensive due to the usage of
computers in surveillance. The detection of the unlawful activity also necessitated human effort.
Over the last several years, motion detection surveillance technology has sparked a lot of
attention. Based on a review and assessment of currently available methodologies. The suggested
method is both efficient and practical for usage at home and in offices. Only when the
movements surpass a pre-determined value or threshold does the system take pictures (Charadva
et al., 2014).
According to Shah et al. (2013), the frame subtraction technique, the background subtraction
method, the background estimation method, and the optical flow method are the primary
methods utilized in moving object identification at the moment. Any motion detection system
based on the approaches outlined above must be able to handle a variety of crucial
circumstances. These circumstances cause motion in parts of the scene that aren't important. If
we want to achieve a near-perfect motion detection system, we need to handle and control these
circumstances properly. These crucial situations can take various forms, including:
2. Small movements of non-static objects such as tree branches and bushes blowing in the
wind.
5. Objects that are moving so quickly that they are only caught in a single frame of the
entire scene.
Shah et al. (2013) stated that some of these scenarios need frame pre-processing, such as noise
reduction and illumination adjustments. However, it adds to the amount of processing required to
detect moving objects. The motion detection system must also be able to operate for an extended
period of time without human intervention. To do this, the system must be able to adjust to both
slow and abrupt illumination or light changes, as well as new items settling in the scene, such as
a new automobile (new object) parked in a parking lot (scene). This implies that the background
should be adaptable in terms of time. In addition, the system should filter out extraneous motion
and minor camera oscillations, such as when the camera mount shakes due to wind turbulence.
This implies that the confidence in the background value must be estimated locally.
A video or scene is made up of frames, which are a series of pictures. The camera is observing a
static view, which is captured in these frames. The illusion of motion is created by viewing these
frames at a fast pace. The frame rate of a video can range from 6 frames per second to 120 or
more frames per second. A pleasant illusion of a moving image requires a frame rate of around
16 frames per second. Because a video is made up of a series of pictures, mastering the art of
image manipulation is essential. A visual depiction of a real item is called an image. A picture, or
more specifically a Raster Image, is made up of a limited number of digital values known as
picture components or pixels. It has a set number of pixels in each row and column. Pixels are
the tiniest individual elements of a picture, containing quantized values that indicate the
brightness of a particular colour at any given instant in time. A pixel's size, which specifies how
much colour may be shown, can range from 8 bits to 64 bits. Each row and column have a fixed
number of pixels. Pixels are the tiniest individual parts in an image, containing quantized values
that represent the brightness of a specific colour at any given time. The size of a pixel, which
determines how much colour may be shown, can range from 8 to 64 bits (Shah et al., 2013).
2.9 BENEFITS OF USING MOTION DETECTION FOR VIDEO SURVEILLANCE
The detection is essentially triggered by comparing successive images and evaluating if the
change between them represents motion. If there are substantial changes between two successive
images, the cameras will "deduce" that there has been motion inside the monitored region. With
this function, the user may set up a series of events, such as starting the recording and sending
email notifications, when the camera detects motion/movement in the monitoring area.
According to (Advantages of Motion Detection CCTV Cameras, 2019) these are some key
With the aid of a motion detection camera, you may set the system to only capture film when
there are movements detected. This will save time while analysing footage because recordings
You will be able to extend the recording time on your recorder by using motion detection
recording. This is due to the fact that recordings are only made when there is movement and not
continually 24 hours a day, seven days a week. This is one of the primary reasons why so many
3. Enhances Security
With the motion detection function, you may set up email notifications whenever motion is
detected in a pre-defined limited region. This will send you messages when the cameras detect
movement, allowing you to be more proactive in protecting your property. It is also possible to
Intelligent surveillance has become an essential and practical means for security which combines
computer science and engineering with multidisciplinary studies including data repository,
intelligence.
Video surveillance and the IoT are converged for ensuring compactness for the nodes of video
surveillance, ease of time, and high efficiency, and for providing video surveillance over Internet
of Things (VS-IoT). There is an increasing demand for automated video surveillance with a wide
range of threats in the society and less manpower to monitor them. Especially, detecting violence
in crowded scenes is challenging because of the rapid movement, overlapping features due to
occlusion, and cluttered backgrounds. Different from traditional monitoring, scenes related to
security concerns are possible to be monitored automatically and remotely with assistance of
Computer vision is an interdisciplinary scientific field that deals with how computers can gain
high-level understanding from digital images or videos. From the perspective of engineering, it
seeks to understand and automate tasks that the human visual system can do.
Computer vision tasks include methods for acquiring, processing, analysing and understanding
digital images, and extraction of high-dimensional data from the real world in order to produce
numerical or symbolic information, e.g. in the forms of decisions. Understanding in this context
means the transformation of visual images (the input of the retina) into descriptions of the world
that make sense to thought processes and can elicit appropriate action. This image understanding
can be seen as the disentangling of symbolic information from image data using models
constructed with the aid of geometry, physics, statistics, and learning theory.
The scientific discipline of computer vision is concerned with the theory behind artificial
systems that extract information from images. The image data can take many forms, such as
video sequences, views from multiple cameras, multi-dimensional data from a 3D scanner, or
medical scanning device. The technological discipline of computer vision seeks to apply its
Sub-domains of computer vision include scene reconstruction, object detection, event detection,
video tracking, object recognition, 3D pose estimation, learning, indexing, motion estimation,
The Internet (or internet) is the global system of interconnected computer networks that uses the
Internet protocol suite (TCP/IP) to communicate between networks and devices. With the
internet, we can monitor, receive and send information and data remotely. There are various
The Internet protocol suite is the conceptual model and set of communications protocols used in
the internet and similar computer networks. It is commonly known as TCP/IP because the
foundational protocols in the suite are the Transmission Control Protocol (TCP) and the Internet
Protocol (IP). The Internet protocol suite provides end-to-end data communication specifying
2.12.2 IP ADDRESS
An Internet Protocol address (IP address) is a numerical label assigned to each device connected
to a computer network that uses the Internet Protocol for communication (Postel, 1981). An IP
address serves two main functions: host or network interface identification and location
addressing.
2.12.3 SUBNETTING
The practice of dividing a network into two or more networks is called subnetting. Similarly, a
subnet mask is a 32-bit number created by setting host bits to 0s and setting network bits to 1s.
The main function of the subnet mask is to determine the network and host part of a network
The Transmission Control Protocol (TCP) is one of the main protocols of the Internet protocol
suite. It originated in the initial network implementation in which it complemented the Internet
Protocol (IP). Therefore, the entire suite is commonly referred to as TCP/IP. TCP provides
reliable, ordered, and error-checked delivery of a stream of octets (bytes) between applications
running on hosts communicating via an IP network. Major internet applications such as the
World Wide Web, email, remote administration, and file transfer rely on TCP, which is part of
the Transport Layer of the TCP/IP suite. SSL/TLS often runs on top of TCP.
TCP is connection-oriented, and a connection between client and server is established before
data can be sent. The server must be listening (passive open) for connection requests from clients
error-detection adds to reliability but lengthens latency. Applications that do not require reliable
data stream service may use the User Datagram Protocol (UDP), which provides a
connectionless datagram service that prioritizes time over reliability. TCP employs network
congestion avoidance. However, there are vulnerabilities to TCP including denial of service,
OpenCV: (Open Source Computer Vision Library) is a software library for computer vision and
machine learning that is free and open source. OpenCV was created to offer a standard
foundation for computer vision applications and to speed up the incorporation of machine
software, and artificial intelligence (AI) to enable systems to “see” and identify objects.
Current Frame: The frame that determines if motion has been or will be detected or not.
Pixel: A minute area of illumination on a display screen, one of many from which an image is
composed.
Power over Ethernet (PoE): Power over Ethernet, or PoE, describes any of several standards
that pass electric power along with data on twisted-pair Ethernet cabling. This allows a single
cable to provide both data connection and electric power to devices such as wireless access
points (WAPs), Internet Protocol (IP) cameras, and voice over Internet Protocol (VoIP) phones.
This chapter briefly covered video surveillance and motion detection to explain how motion
detection and video surveillance operate together. Motion detection and video surveillance are
inextricably linked because adding motion detection into surveillance may increase security and
reduce crime. Various methods of motion detection, such as temporal difference, optical flow,
and background subtraction. This chapter concludes by highlighting the advantages of employing
a motion detection surveillance system and an explained on computer vision and necessary
internet protocols.
CHAPTER THREE
METHODOLOGY
3.1 INTRODUCTION
This chapter discusses the process of developing the research methodologies needed to complete
the system. This chapter will go many steps of developing the present study’s methodology in
detail.
The goal of this research project is to secure a facility to be able to detect motion and alert the
facility owner/ manager when motion is detected. The motion detection surveillance system
(MDSS) automatically alerts the user when motion is detected in the area without any human
intervention. It also automatically starts recording once motion has been detected so that the user
can download and watch the action that took place. The alerting medium used here is via SMS or
email with the ability of remote access via any internet connected device.
The design of this system is a combination of electrical hardware and software applications all
for the goal of achieving an accurate and more efficient motion detection system. This system is
for organizations, individuals as well as corporations that need to have an effective and
The project, development of office surveillance and alerting is to ensure higher safety and anti-
burglary protection in offices. This research operates with two sections, which are:
1. Hardware (equipment).
2. Software.
The hardware components involved includes: one IP camera, one router, one base PC (windows
OS preferably). The IP camera is mounted and installed in a way that it overlooks the area under
The equipment used as well as the procedural setup are outlined in the diagram below. The setup
5. Router
The procedure for the hardware installation is simple and straightforward. Below are the steps to
3. Verify the camera is connected to the network by doing a ping test to the default IP
(192.168.1.64)
Note: for the network camera which enables the DHCP by default, you need to activate network
1. Connect the Ethernet cable from the device to the PoE port of the PoE Adapter.
2. Connect an Ethernet cable from your LAN to the LAN port of the PoE Adapter.
3. Connect the power cord tot eh adapter’s power port. Connect the other end of the Power
SADP (Search Active Devices Protocol) software is used for detecting the online device,
activating the camera, and resetting the password. Get the SADP software from the supplied disk
or the official website (hikvision.com), and install the SADP according to the prompts.
2. Check the device status from the device list, and select the inactive device.
3. Create and input the new password in the password field, and confirm the password
This details the minimum required specifications needed to replicate system operation and the
Model: DS-2CD1323G0E-I
CAMERA
Min. Illumination Colour: 0.01 Lux @(F2.0, AGC ON), B/W: 0 Lux with IR
LENS
Aperture F2.0
NETWORK
Hardware features
Wireless Features
Software features
Others
This section discusses the applications and design languages used in the development of a new
system, as well as the model and structural design of the major modules, functions, and feature
All designs and decisions are made with the following four essential considerations in mind:
2. Build ability.
3. Flexibility.
This project was designed and implemented using the python flask framework for its
compatibility with the OpenCV (computer vision) library with some other development language
like HTML5 to produce plain text and picture files and Bootstrap for frontend and some static
files, JavaScript for client-side validation. AgentUI was also used to assist with the front end and
motion detection capabilities. These applications after compilation are tested using a personnel
computer or laptop with windows, Linux, Mac etc. and run on a browser.
1. Python programming language was used to create python scripts that added functionality
to webpages that HTML alone couldn't provide and interact with the web server (Apache
etc).
2. OpenCV was used to build the motion detection algorithm with computer vision
3. HTML was chosen since it is a standard authoring language for creating web pages. Each
page has a large number of HTML labels, including hyperlinks, that are used to link to
other sites.
4. AgentUI library was also used to assist the frontend and motion detection algorithm.
Detailed below, are the steps the algorithm takes to determine whether motion occurred from a
received frame. The code for this was written in python and it is attached to the appendix of this
research. The approach use is known as background subtraction approach and it is explained
below.
The basic idea behind this approach is to create a model of the static scene (i.e., without moving
objects) called background, and then compare every frame of the series to this backdrop to
distinguish the regions of motion termed foreground (the moving objects). Figure 2.4 shows a
procedural view of how this technique works. This method necessitates image modification in
order to distinguish the foreground from the background. In general, the modifications listed
below are necessary. Assume we have two images, X and Y, and we are altering them to get
(https://docs.opencv.org/4.5.1/d1/dc5/tutorial_background_subtraction.html)
1. Difference
The difference of two images of the same size and pixel format yields an image in which each
pixel represents the absolute difference between the corresponding pixels in the given images.
The reason for not using 32bpp pictures is because if alpha channel images are used, the
presentation of the final image may appear a bit surprising - possibly nothing will be visible (if
image is presented according to its alpha channel). The reason for this is that after differencing,
the whole alpha channel will be zeroed (zero difference between alpha channels), resulting in a
2. Threshold
It binarizes images based on a threshold value that is given. All pixels whose intensities are equal
to or greater than the threshold value is transformed to white pixels. Everything else pixels with
intensities less than the threshold value are ignored.pixels were changed to black pixels.
Z.setPixel(x) = White
Else
Z.setPixel(x) = Black
Threshold – The threshold that determine whether the movement is motion or not.
1. We Calculate the Difference between the Background Frame and the Current Frame.
change) are wiped out and all pixels that change (i.e. regions of motion) are highlighted. The
process does not stop here; the finished image will include both relevant and irrelevant areas of
2. Using the threshold value as a Threshold for the image calculated in (1), we filter the areas of
motion.
Else
We may filter out and exclude irrelevant areas, such as tree leaf movement in the wind, by
3. The Current Frame is then highlighted in the resulting image from (2) to identify regions
of motion.
4. The final step is to change the background. This is accomplished by a defined amount of
movement of the background to the current frame. This approach becomes frame
Updating the background is generally accomplished by warping it slightly toward the current
Frame. The simplest method of morphing is to combine the two pictures by extracting a
percentage of the pixels' intensities from the first image and the remainder from the second.
The diagram above graphically depicts a user’s possible interactions with the web-based IP-
CAM surveillance system. It shows the various use cases and different types of users the system
has. The user is not only restricted to the physical human but also the electrical equipment’s
involved in the system like the server, and the motion detection engine.
3.9 OVERALL MODEL OF THE SYSTEM
This shows how the hardware equipment’s are interconnected with each other in the network.
The intruder interacts with the capture video device (IP Camera) with triggers the motion
detection algorithm installed on the MDSS server. The client are the web-based medium where
the client can view recordings and snapshots on the intruder. The database holds sensitive
information’s about the system like user login details and system log information.
3.10 SEQUENCE DIAGRAM OF THE SYSTEM
This sequence diagram shows object interactions arranged in a time sequence for the system. It
depicts the objects involved in the scenario and the sequence of messages exchanged between the
From the diagram above, the user interface is responsible for turning on and off the IP Camera
feed. The IP Camera grabs each frame which is then analyse by the motion detection algorithm
to determine whether motion occurred. If there is motion, it starts the alarm and sends out a SMS
The diagram above is the class diagram for the developed system which describes the structure
of a system by showing the system’s classes, their attributes, operations (or methods) as well as
Similar to the sequence diagram, the camera interacts with the frame grabber which in turn
interacts with the motion detector object that analyses the frames captured. The result of the
analysis by the algorithm will determine whether to send alerts, SMS and/or email as well as
CHAPTER FOUR
IMPLEMENTATION AND TESTING
In this section, we discuss the steps to implement and test the developed system. System
components were purchased, the hardware were installed, and the software developed was
loaded and the localhost setup. The element is built with acceptable technology and industry
practices. This procedure connects the system definition and integration phases. This program
requires the following tools to be implemented: Python, HTML, and so on. This set of tools is
used in tandem to produce the code that is run on the local machine (127.0.0.1:3000), resulting in
the application system.
The HikVision IP camera was subjected to a ping test to ascertain the device was reachable and
communicating in the network. It is also important to note, the IP camera comes with a default IP
(192.168.1.64). After activation, the IP address will need to be changed to correspond with the
AgentUI works on .NET framework 4.7+ which provides the database and localhost capabilities
as well as providing services like thread management, garbage collection, type-safety, exception
One IP Camera, one router, one laptop, extension boxes, and PoE adapters, etc.
The processes and activities carried out in designing the system is presented pictorially below.
Step 2: Mount the IP camera in such a way that it overlooks the area under surveillance
especially hotspot areas (points where motion is likely to take place, for example door entrances,
windows, etc.)
Mounting instructions and steps can be found in the Quick Start Guide that comes in the package
content.
Step 3: Install the necessary software onto the system and start up the software.
Note: Software for Windows runs on Windows 7 SP1+. Requires the .NET framework v4.7+.
Note: As mentioned in chapter 3, make sure both the laptop and IP Camera are both connected to
the same router. This creates a network making it possible for the laptop and camera to
communicate. Once the IP Camera is connected, an IP will be displayed with will be entered into
Step 6: Set up the detector and alert system. Enter the desired email address to send alert
notifications.
Step 7: Move into frame to trigger the detection and check email after few seconds.
Plate 4.6: Triggering the motion detector
Step 8: Log back into the software to access the recordings of the motion detected.
System testing is performed on an entire integrated system to assess the system's conformance
with its stated objectives. System testing is done on the complete system in the context of either
functional or system requirement specifications, or both. System testing examines not just the
design, but also the behavior and even the customer's perceived expectations. It is also meant to
test up to and above the limits stated in the software or hardware requirements specification(s).
This testing was performed to guarantee that the system satisfies the needs of the business and
Test results are the end result of the entire software testing life cycle procedure. The resulting
findings provide insight into the deliverables of a software project, which is important in
This describes the test carried out on the network to ascertain the devices (ip camera, router and
The above figure indicates that after the network camera is connected, it is reachable on the
network by pinging the initial default IP address of the network camera (192.168.1.64).
4.3.1.2 NETWORK PERFORMANCE TEST
Network performance refers to the measures of service quality of a network as seen by the
customer.
JPerf stands for Java Perf which is the GUI version of iPerf. IPerf is an open source tool for
network performance measurement and tuning. It is a cross-platform tool that can produce
Step 2: You need two hosts that will send and receive traffic which is known as the client and
server respectively. First, you have to start the JPerf server in order to listen for incoming traffic.
Click on server option, choose a port to listen to and the click ‘Run iPerf’ icon.
client option. Input the IP and port of the JPerf server (IP: 192.168.1.178, Port: 5001). Incase you
are not sure of the IP, start up the command prompt and type ‘ipconfig’.
a. Without streaming: The test was first run when the IP Camera isn’t streaming to the
software and the network performance was studied on the server and client side. The
Server side:
Table 4.1: Network performance result on the server side with no stream
Table 4.2: Network performance result on the client side with no stream
b. With stream: Network performance when the IP camera is streaming. The results are as
follows.
Server side:
Client side:
The test results above reveals that the system has a maximum network bandwidth when no
streaming is taking place of 249116 Kbits/sec on the client and 1248920 Kbits/sec on the server,
while the maximum network bandwidth when streaming is taking place is 842596 Kbits/sec on
the client and 842596 Kbits/sec on the server. This validates that the network is in fact functional
In order to ensure the software meets the objectives and performs as expected, behavioural test
was carried out. The aim of the behavioural test is to ensure the features implemented performs
as expected.
Table 4.5: Comparison between expected and actual results
Users’ login to the Users will be navigated to the The main menu with direction
system to setup security dashboard where the main menu is modules on how to setup the
User sets up security Upon configuring the camera with The camera was able to detect
camera to detect motion the appropriate settings, the camera motion and this was indicated by
User receives a An alarm should sound and an email When motion was detected, an
notification when notification should be sent to the user alarm was raised and an email
motion is detected when motion is detected notification was sent to the user
4.4: BILL OF ENGINEERING MEASUREMENT AND EVALUATION
The components and their relative cost are shown in the table below. The total would give an
TOTAL 68000
CHAPTER FIVE
5.1 SUMMARY
This research work provides an approach to security surveillance system by incorporating motion
detection. This project is a web based application using AgentUI and Python Opencv with the
noise, when motion is detected it will trigger an alarm and send an email notification to alert the
5.2 CONCLUSION
When a motion detection algorithm detects an intruder, the designed motion detection alarm and
security system responds quickly. The method described above was capable of determining near-
exact points of motion. The threshold value played an important part in categorizing relevant and
irrelevant motion. Internet of things have given us the ability to network physical objects
embedded with sensors, software, etc. in order to exchange data and automatically take actions.
5.3 RECOMMENDATIONS
Motion detection in security surveillance system is a very young and developing area. The
opportunity is enormous, and there is so much to be done. This research successfully opens the
door for individuals to investigate the potentials concealed inside it. It has piqued the curiosity of
forensic scientists in recent years. This work can also be further improved by adding face
recognition to further enhance security and also being able to intelligently detect situations of
false alarm accurately. It could also be adapted to a large scale system and outdoor conditions.
REFERENCES
Advantages of Motion Detection CCTV Cameras. (2019, April 13). VIN Services & Solutions.
https://www.vin-services.com/guide/advantages-of-motion-detection-cctv-cameras
Dave Evans (2011). "The Internet of Things: How the Next Evolution of the Internet Is
Changing Everything". CISCO White Paper.
https://www.cisco.com/c/dam/en_us/about/ac79/docs/innov/IoT_IBSG_0411FINAL.pdf
Dellosa, R. (2014). Development of an Anti-Theft Device using Motion Detection and Body
Temperature. Asia Pacific Journal of Multidisciplinary Research, 2(6).
http://www.apjmr.com/wp-content/uploads/2014/12/APJMR-2014-2-158-Revised-
Development-of-an-Anti-theft-device-using-motion-detection-system.pdf
Forsyth, David; Ponce, Jean (2012). Computer vision: a modern approach. Pearson.
Hossain, M. S., Hassan, M. M/, Al Qurishi, M., & Alghamdi, A. (2012). Resource allocation for
Howard, Philip N. (2015). The Internet of Things is Posed to Change Democracy Itself.
Politico.
Iyapo, K. O., Fasunla, O. M., Egbuwalo, S. A., Akinbobola, A. J., & Oni, O. T. (2018). DESIGN
AND IMPLEMENTATION OF MOTION DETECTION ALARM AND SECURITY
SYSTEM. International Journal of Engineering and Advanced Technology Studies, 6(1),
26–38. https://www.eajournals.org/wp-content/uploads/Design-and-Implementation-of-
Motion-Detection-Alarm-and-Security-System.pdf
Laplante, Phillip A.; Kassab, Mohamad; Laplante, Nancy L.; Voas, Jeffrey M. (2018). Building
Caring Healthcare Systems in the Internet of Things. IEEE Systems Journal. 12 (3).
Wieland, Ken (25 February 2016). IoT experts fret over fragmentation. Mobile World.
Norris, C., Moran, J., & Armstrong, G. (Eds). (1998). Surveillance, closed circuit television and
Patel, P. B., Choksi, V. M., Jadhav, S., & Potdar, M. (2016). Smart Motion Detection System
using Raspberry Pi. International Journal of Applied Information Systems, 10(5), 37–40.
https://doi.org/10.5120/ijais2016451506
Rahman, M. J. (2008, November). Motion Detection for Video Surveillance (Master Thesis
E3651D). Högskolan Dalarn University.
http://du.diva-portal.org/smash/get/diva2:518464/FULLTEXT01.pdf
Raji, R.S. (1994). Smart networks for control. IEEE Spectrum. Available at:
https://ieeexplore.ieee.org/document/284793
Rob Mayell (2006). Simple circuit design tutorial for PoE applications. EDN.
https://www.edn.com/simple-circuit-design-tutorial-for-poe-applications/
Stallings, William (2016). Foundations of modern networking : SDN, NFV, QoE, IoT, and
Shah, S., Adhikari, V., & Pokhriyal, V. (2013). Motion detection algorithm based on
Background Subtraction. International Journal of Scientific & Engineering Research,
4(8). https://www.ijser.org/researchpaper/Motion-detection-algorithm-based-on-
Background-Subtraction.pdf
Tim Morris (2004). Computer Vision and Image Processing. Palgrave Macmillan.
ISBN 978-0-333-99451-1.
Uhunmwangho Victory (2021). Video surveillance using motion detection. BIU Faculty of
Science.
https://en.wikipedia.org/wiki/Transmission_Control_Protocol
J. Postel, ed. (September 1981). Internet Protocol, DARPA Internet Program Protocol
APPENDIX A
import smtplib
gmail_user = 'your_email@gmail.com'
gmail_password = 'your_password'
sent_from = gmail_user
to = ['person_a@gmail.com', 'person_b@gmail.com']
subject = 'Lorem ipsum dolor sit amet'
body = 'consectetur adipiscing elit'
email_text = """\
From: %s
To: %s
Subject: %s
%s
""" % (sent_from, ", ".join(to), subject, body)
try:
smtp_server = smtplib.SMTP_SSL('smtp.gmail.com', 465)
smtp_server.ehlo()
smtp_server.login(gmail_user, gmail_password)
smtp_server.sendmail(sent_from, to, email_text)
smtp_server.close()
print ("Email sent successfully!")
except Exception as ex:
print ("Something went wrong….",ex)