Smart Security System to Detect Fire and Abnormal Human Motion Using Open CV
Sangmesh Wadgave
1,Likitha Rayapati
2,Bhanu Prasad
3,Mrs.V.Jyothi
41,2,3,4 Department of Electronics and Communication Engineering Vardhaman College of Engineering
Hyderabad, India-501218
1[email protected],2[email protected],3[email protected]
ABSTRACT
In recent years, we've begun to employ a variety of surveillance systems to keep an eye on the targeted location. To enforce and track the area under surveillance, this necessitates a large amount of storage space as well as a large amount of human resources. This is supposed to be a time-consuming and unreliable operation. We propose an intelligent surveillance device in this paper that continues to monitor the target area and detect human, fire, and abnormal movements in each image. A notification is automatically sent to the user via email when the device detects movement in a designated area. As this method does not save everything, the available memory space is limited because it does not save the entire video but only saves it when the human motion or fire is detected. This is performed by using real-time video processing, Raspberry Pi framework and as well as the free CV i.e computer vision/machine vision technology.
Keywords
HaarCascade; BackgroundSubtractorMOG; OpenCv; Pi camera; Raspberry Pi; Python;
INTRODUCTION
In our everyday life we can see how the technology is improving rapidly from the last few decades. As the growth in the technology is increasing everyday we can notice that the man power need is decreased, we can notice human need not to have more attention or need not even need to do the work which can be taken over by the technology.
Though many of us believe that this improve in technology is making us do less work and intern making us lazy, it is not deniable that this change is for better human lifestyle.
Building management is one area we can see technology is slowly growing and it is snatching all the responsibilities of human beings. We can see now many of the building, Shops, Offices, homes are an smart automation system, which is for improving the security and other operations like power issues management, ventilation and many more.
All this places are given name as smart offices, smart homes etc. So we can notice here that surveillance is an important and more needed role in our all surroundings.
Security and surveillance plays very important role in our day to day life, It can be defined as continuous observation of electronic devices like CCTV cameras in our everyday work place or at our home doors. There is an improvement by using this kind of technologies we can observe security is increased. But still there are many holdings or can say limitations and no effective use of technology. One of the unnoticed cons of CCTV cameras is they record the videos continuously, is there any need of recording a picture where there is no human, no motion of any object, no harmful accident do we need recording of all this, It is waste of memory usage. Instead we should have a system we can be able to reduce the memory usage by recording only required pictures.
In requirement of removing all the unnecessary memory usage and to improve the security by making use of new technologies like opencv, deep learning and machine learning we came with our system. This project consists of raspberry pi 3 and pi camera as hardware component and which is of very low cost compared to current existed systems. As a simple example of use or can say an simple use of our project can be, that in any mall or any rental shops where we can see CCTV camera is always in use whole day, even at night so, the amount of storage required for storing the recording from CCTV cameras will be large and it is not efficient as even if there is no motion or no human at night the recording is still continued, so to save the recording usage memory and to improve the security we developed a system which can do both the things.
We added three main features in our system to improve the security in our surroundings or to have continuous monitoring at specific area, We are using image processing to convert our images into desired one so to apply fire
and human detection algorithms on it. And with that we are using smtp protocol to send email alert messages with the images or frames taken by our system.
The Algorithm we used in our system is HaarCascade algorithm for detection of fire and to detect human we are using BackgroundSubtractionMog2 which is inbuilt method of opencv. So, we are using opencv and deep learning algorithms.
The next things of our paper is given as Related Work, Implementation and Design, Result and Discussions, Conclusion and Future Scope, References.
LITERATURE REVIEW
All the previous papers had PIR sensors which is not very effective as it has very low sensing range of 9m at max.
And the papers which used image processing ,OpenCv to detect any kind of motion is not very secure and efficient system for security based projects. So in our paper we are trying to detect human motion and human abnormal motion
That is if any human falling down on the ground is an abnormal motion. It is the only type of abnormal motion our project detects and we are also adding fire detection feature to give an alert email in case of fire accidents.
IMPLEMENTATION AND DESIGN
A. Block Diagram
The Block diagram consists of mainly two important components the raspberry pi 3 and raspberry pi camera as hardware components and we also need a desktop monitor to see our output result. So normally as shown in Fig 1.
We have pi camera which is connected to raspberry pi 3 and raspberry pi is remotely controlled by using VNC viewer which is a virtual network computing software should be present in computer to run the program and to interact with raspberry pi without having any wired connection with it.
Fig. 1. Proposed System Block Diagram
B. Flow Chart
Fig. 2. Proposed System Flow of Execution C. Hardware Implementation
I. Raspberry Pi 3
Rаsрberry Pi is one of the сheарest and smallest соmрuters. Rаsрberry Pi is one of the smallest creditсаrd-size соmрuters, Which is not only famous for its size but also for its соst. Rаsрberryрihаs the inbuilt СРU аnd as well as the RАM. Rаsрberryрi is роwered by using the miсrоusbсhаrger. Rаsрberryрiсоnsistsоf 40 generаl inputs аndоutрutрins which аre used to соnneсt with the рi. Tоlоаd the орerаting system in the Rаsрberryрi, usesmiсrо SD memory
.
Fig. 3. Raspberry Pi 3
II. Pi camera
The Raspberry Pi Camera Module v2 is a high-resolution 8-megapixel camera that uses a Sony IMX219 image sensor to produce HD video and still images. It's a Raspberry Pi add-on board with a fixed focus lens that's been specially designed. It connects to the Pi through one of the little ports on the board's upper surface and uses the unique interface, which was created specifically for linking with camera.
Fig. 4. Pi camera D. Software Implementation
1. Vnc (viewer)
VNC's main purpose is to allow a local computer (client) to operate a remote computer (server) while viewing the VNC server's screen content on the local monitor. Any operating system installed on the server or client computer can be used with a VNC session. Users using VNC Viewer see the same thing as if they were sitting in front of the computer. This is either the presently logged in user's desktop or the login screen. VNC Viewer transforms your phone into a remote desktop, allowing you to connect to your Mac, Windows, or Linux computer from anywhere on the planet.
E. Related Algorithms 1. Haarcascade Algorithm
Haarcascade algorithm is one of the machine learning algorithm which is used to detect objects depending upon the program trained. In our system we are trying to find fire, so we trained our program with positive and negative images, here positive means the pictures where we can find fire in them and negative pictures means where we cannot find fires, so providing this pictures and training the program then we get a trained xml file which we can say a cascaded file which is used to detect fire in our input video.
2. BackgroundSubtractormog2
BackgroundSubtractormog2 is one of the class of OpenCV. We are using this class to detect human motion and human abnormal activity. Using this we can easily try to differentiate what is normal and abnormal activity of human, here abnormal activity is a person falling down is treated as an abnormal activity. So first we try to remove the unnecessary background in the picture and try to convert the picture into white grey picture which will be having only white and black color present in the picture, so after converting into white and black we are then finding the area of the object shape and try to figure out if the shape is of human or not. So in this way this built-in feature of OpenCV is used to detect human motion and human abnormal motion.
F.
Algorithm
Start (run the program).
Opens the live stream either from Pi camera or Computer Camera.
Checks for Human and fire in the stream frame.
Program uses HaarCascade algorithm to detect fire in the input video.
If the fire is detected then an email is sent to the system user as an alert message.
Program uses BackgroundSubtractorMog2 which is used to find human motion and abnormal motion.
If the shape area height is less than width than we detect it as falling body and it will be a abnormal motion.
Email is sent after detecting abnormal motion or activity.
Even if human is detect as an normal behavior the frame is saved.
Video is recorded only with fire or human detection frames.
Stop.
G.
Model of our work
Fig. 5 shows the proposed system model.
RESULT
Fig. 6 Human motion is detected(Normal behaviour) Fig. 7 Fire is detected by the System.
Fig. 8 human falling down unconscious (as abnormal activity)Fig. 9 email alert for abnormal activity