Fall Detection
Fall Detection
Muddasir Awan
Maria Naseer
DEC 2018
ii
NUMBER
PROJECT
OF 2
ID
MEMBERS
Muddasir
SP17/MCS/47 [email protected]
Awan
Maria
SP17/MCS/08 [email protected]
Naseer
CHECKLIST:
I/We have enclosed the soft-copy of this document along-with the codes and scripts
created by myself/ourselves
YES / NO
My/Our supervisor has attested the attached document
YES / NO
I/We confirm to state that this project is free from any type of plagiarism and misuse of
copyrighted material.
YES / NO
MEMBER
S
SIGNATUR
ES
Supervisor’s
ii
Signature
ii
Declaration
“No portion of the work referred to in the dissertation has been submitted in support of an
application for another degree or qualification of this or any other university/institute or
other institution of learning”.
MEMBERS’ SIGNATURES
1
Acknowledgements
Starting with the name of ALMIGHTY ALLAH who is most kind and merciful. We are
thankful
to ALLAH that he provides us the resources and make us able to use these resources of
different type and help his people. We would like to thanks Mr. Muzzam Maqsood who
support us and help us in this project. He always motivates us to be different from others by
exchanging some new and different ideas. We would like to say thanks to our kind supervisor
because he always guides us, helps us in solving all the issues. He always encouraged us to
work hard and think smartly. We would like to express our special thanks to COMSATS
ATTOCK and department of computer science who gave us opportunity to do this project.
2
Abstract
Today, it has become unbelievable to be in a world without technology. Every day there are
3
Contents
Acknowledgements..........................................................................................................................2
Abstract.............................................................................................................................................3
Tables of Table..................................................................................................................................7
Chapter 1..........................................................................................................................................8
Introduction......................................................................................................................................8
1.1. Introduction...........................................................................................................................9
1.2. Problem Statement................................................................................................................9
1.3. Proposed System..................................................................................................................10
1.4. Solution of the Problem.......................................................................................................10
1.5. Features................................................................................................................................10
1.6. Goals and Objectives............................................................................................................11
1.7. Scope....................................................................................................................................11
1.8. Benefits................................................................................................................................11
Chapter 2........................................................................................................................................13
Literature Review............................................................................................................................13
2.1. Literature Review.................................................................................................................13
Related work...............................................................................................................................14
Chapter 3 Requirements Specifications........................................................................................15
3.1. Functional Requirements.....................................................................................................16
3.1.1. Capture Video...................................................................................................................16
3.1.2. Extract Video Frames........................................................................................................16
3.1.3. Change Alarm....................................................................................................................16
3.1.4. Detect Fall.........................................................................................................................17
3.2. Non-Functional Requirements.............................................................................................17
3.2.1. Performance......................................................................................................................17
3.2.2. Security.............................................................................................................................17
3.2.3. User Friendly.....................................................................................................................17
3.2.4. Accuracy and Consistency.................................................................................................17
Chapter 4 Design.............................................................................................................................19
4.1. Use case Diagram.................................................................................................................20
4.2. Activity Diagrams..................................................................................................................21
4
4.3. Sequence Diagram...............................................................................................................22
4.4. Block Diagram.......................................................................................................................23
Chapter 5........................................................................................................................................24
Implementation..............................................................................................................................24
5.1 Implementation.....................................................................................................................25
5.2. Tools.....................................................................................................................................25
5.3. Software Requirements........................................................................................................25
5.4. Hardware Requirements......................................................................................................25
5.5 User Interface........................................................................................................................26
5.6 Code View..............................................................................................................................27
5.7 Algorithm for Fall Detection..................................................................................................28
5.9 Fall Detected..........................................................................................................................29
Chapter 6 Testing............................................................................................................................31
6.1. System Testing......................................................................................................................32
6.2. Testing Phycology.................................................................................................................32
6.3. Objectives of Testing............................................................................................................33
6.4. Basics of software testing.....................................................................................................33
6.5. Testing’s type........................................................................................................................34
6.6. Test Cases.............................................................................................................................36
Chapter 7........................................................................................................................................38
Conclusion and Future Work..........................................................................................................38
7.1. Conclusion............................................................................................................................38
7.2. Future Work.........................................................................................................................39
8. References..............................................................................................................................40
5
Table of Figures
Tables of Table.........................................................................................................................................8
Chapter 1.................................................................................................................................................9
Introduction............................................................................................................................................9
Chapter 2...............................................................................................................................................14
Literature Review..................................................................................................................................14
Chapter 3 Requirements Specifications..............................................................................................17
Chapter 4 Design...................................................................................................................................21
Chapter 5...............................................................................................................................................28
Implementation.....................................................................................................................................28
Chapter 6 Testing...................................................................................................................................35
Chapter 7...............................................................................................................................................43
Conclusion and Future Work.................................................................................................................43
8. References..................................................................................................................................45
6
Tables of Table
7
Chapter 1
Introduction
8
1.1. Introduction
At present taking care of new born babies, infants or senior citizens with serious
diseases for example paralysis or dementia has become a challenging and more demanding
task than ever before. Traditional methods of hiring nanny for babies and care givers for
elders are adopted mostly over the entire globe. But they fail to in spite their level best efforts
to serve them as they are human beings and there is a certain chance of negligence that may
result in serious damage or to some extent could end up leading towards death. They need
proper attention and care 24 h a day which is not possible for a single person to handle
and make full use of them to decrease human efforts in our daily life multitasking. So far we
have some kind of human fall detection system implemented through sensor based
technologies and no doubt they are performing well. But we are going to implement the same
technology, but with some different approaches to eradicate the limitations imposed by the
in a form of wearable wrist bands or chest pack. One have to wear them all the time and carry
along them everywhere. Somehow it imposes a limitation on users willingness as elders with
dementia (a decline in memory with increase in age) usually forget to wear them. And
children usually chew or temper with those wearables or unintentionally drop them
somewhere and later on we can’t find them which costs us a lot. Those wearables contain
internal rechargeable batteries which they need to charge after some hours of usage.
9
We want to remove those dependencies by implementation of same mechanism through video
input gained by a video camera or already saved videos.
integrated with MATLAB and image processing algorithm to detect a defined fall pattern and
generate a notification.
use video camera that will be mounted on the wall or fixed at a suitable position where the
targeted humans are easy to be seen and monitored without facing any kind of obstacles.
Video captured through camera will be scanned and analyzed with image
processing algorithms and each frame will be checked to find fall pattern in it. If a
particular fall pattern is identified the system will generate a notification to alert the care
giver.
1.5. Features
• Users can use it as an independent separate system.
• A User can check any video frame at any time to check the position of elders or children
10
1.6. Goals and Objectives
• By developing the application we want to make our targeted users independent of
wearing sensor based wristbands and chest packs or wearing them on head all the
time.
• Reducing the overall cost for wearing more than one wrist bands for every single
targeted human instead we can monitor multiple humans through single camera and
detect fall.
• Reducing human efforts to monitor them all the time and allowing them to do their job
free of tension.
• Letting them notify whenever a false alarm generates and they can check the extracted
1.7. Scope
• The developed system can be implemented for indoor environment.
• We assume that no other moving objects are involved in our considered environment.
• External factors are ignored in the development of the system as they are assumed to
be non-variable.
• Fair light is available for a better and clear view of our targeted object.
1.8. Benefits
• Real-time human activity monitoring 24/7 h.
• Human efforts are reduced.
• Overall cost is reduced.
11
• Elders/children are not bound to wear sensor-based devices all the time.
• Quick response will make sure that the fall is reported as soon as possible to
provide medical assistance.
12
Chapter 2.
Literature Review
Most recently, some research has been done to detect falls using image sensors. For example,
a simple method consists to analyze the bounding box demonstrating the person in a single
image. This can only be done if the camera is placed sideward, and can fail because of
blocking objects. Therefore, in genuine situation, the camera will be placed higher in the
room to not suffer of obstructing objects and to have a larger field of view. In this case,
13
depending on the relative position of the person, the field of view of the camera, a bounding
box will not be sufficient to distinguish a fall from a person sitting down. To overcome this
problem, some researchers have mounted the camera on the ceiling. Some of them detect a
fall by analyzing the shape and the 2D velocity of the person, and define inactivity zones like
the bed. Infrared sensor can also be used to detect falls. But due to their limitations as elders
often forget to wear them which causes severe damages if they fall, we don’t consider them
as useful as they should have been.
We came up with a solution that track the person using an ellipse, and analyze the resulting
trajectory to detect inactivity outside the normal zones of inactivity like chairs or sofas.
Additionally, we are presenting here a new method based on the Motion History Image and
some changes in the shape of the person.
Related work
Recently, some research has been done to detect falls using image sensors. For instance, a simple
method consists to analyze the bounding box representing the person in a single image. This can
only be done if the camera is placed sideways, and can fail because of blocking objects.
Therefore, in realistic situation, the camera will be placed higher in the room to not suffer of
occluding objects and to have a larger field of view. In this case, depending on the relative
position of the person, the field of view of the camera, a bounding box will not be sufficient to
discriminate a fall from a person sitting down. To overcome this problem, some researchers have
mounted the camera on the ceiling. Lee and Mihailidis detect a fall by analyzing the shape and
the 2D velocity of the person, and define inactivity zones like the bed. Nait Charif and McKenna
track the person using an ellipse, and analyze the resulting trajectory to detect inactivity outside
the normal zones of inactivity like chairs or sofas. Infrared sensor can also be used to detect falls.
In their work, six smith and Johnson classify falls with a neural network using the 2D vertical
velocity of the person. However, 2D vertical velocity could not be sufficient to discriminate a real
14
Chapter 3 Requirements Specifications
15
3.1. Functional Requirements
captured videos. Already saved videos help to check the working of algorithms
without setting up video camera in short time. While working with live video stream
is a bit difficult, as it requires time and accuracy to mount the camera on proper
• Extraction of video frames within specific period is very important and crucial as
delaying may result in lack of accuracy and response that is the main purpose of our
fall occurs.
16
• A user of the system is privileged or have full access to choose the system alarm
of his choice as different people have problems with standard alarm tones due to
• Users can stop the notification alarm by stopping the detection process at once and
3.2.1. Performance
The system should be efficient and simple to use. User should be able to use it
efficiently and in compact manner without facing any difficulties. The system should
respond a request with in 2sec.
3.2.2. Security
Only caregiver can operate the system.
properly. The system should be easy to use for all users. User interface is easy to
understand.
17
18
Chapter 4 Design
19
4.1. Use case Diagram
20
4.1.3 Detect Fall
This use case takes a video as an input and apply fall detection algorithm and then
21
4.2. Activity Diagrams
22
Figure 4.3 Sequence Diagram
23
4.4. Block Diagram
24
Chapter 5.
Implementation
'
25
5.1 Implementation
In the development of software’s life cycle implementation is an important phase
where the developer gives physical existence to thought and ideas. The result of a
successful implementation is our desired application. During this phase developers makes
5.2. Tools
• MATLAB r2013a
• Language: C/C++
26
5.5 User Interface
User interface has five buttons and four windows. Button labeled with “Background” opens
the video directory and button labeled with “Start” caption starts detection process and the
last button labeled with “Stop” caption will stop the detection process.
It contains two check boxes labeled as “Video” and “Camera” respectively are used to select
video source.
27
5.6 Code View
28
5.7 Algorithm for Fall Detection
29
5.8 Object Tracking
30
5.9 Fall Detected
31
Chapter 6 Testing
32
6.1. System Testing
It is an experimental examination that is directed to give backer’s data about the
nature of the item below test. Procedure of testing is used to identify errors in the software
that is built. Testing plays a basic role in assuring quality and reliability of programming.
any error. The main aim of testing is to find errors that might be available in the system.
Hence one has to not initiate testing with the plan of demonstrating that a system works,
yet the goal is to demonstrate that a project does not work. The procedure of testing is used
33
6.3. Objectives of Testing
• The main goal of testing is to expose a large group of errors, intentionally and with
• Testing is technique for executing a system with the aim of finding a mistake.
• A great testing is one that has a high probability of finding errors, on the off chance
that it exists.
examined without looking at its internal code structure, understanding of internal paths
and internal information of the software program. This type of testing is totally based on
the software requirement. We simply focus on the inputs and outputs of the software
program gadget without bothering the external information of the software program.
• Test cases are constructed by the software tester with the selected inputs.
34
• The test cases are executed by the software tester.
• Actual outputs are compared with the expected outputs by the tester.
• If there is any defect in the software than it is fixed by developer and re-tested by
tester.
white box texting the internal structure or working of an application is tested. The
name clear box or glass box indicates that the tester has full visibility of the internal
working and structure of the code. Programming skills are required to build test cases.
To exercise paths through the code tester chooses input and determine the
appropriated output.
testing falls under the category of white box testing which means that code is
visible to the tester. Unit testing is done by the developer frequently. Developer
check each unit by executing the code that either it is giving the expected result or
not.
35
6.5.2 Link Testing
It does not test programming yet somewhat the mixture of every module in
framework. The important concern is the resemblance of every module. The maker
tests where units are planned with several parameters, length, sort etc.
might fall under both white box and black box testing. The purpose of integration
following
36
• How skillfully the customer can perform?
ensure that the modification is working precisely and is not spoiling or forcing
successfully as follows.
37
Test Test Condition Expected Result Actual Output Status
No. Name: Alarm Check
Test
Test 1. TestonCondition
Click “Stop” Expected
Toast Result
is displayed Please ToastActual Output
is displayed Status
Pass
No. button while selected Detection process Detection process
“Start” stopped stopped
Test 1. Delete alarm file No alarm file found error No alarm file found Pass
Test 2. Again, click on Toast is displayed Toast is displayed Pass
from main directory
“Stop” No detection process is Noerror
detection process is
Button when running currently running currently
detection is stopped
38
Chapter 7.
7.1. Conclusion
This System is developed to facilitate the parents having new born babies and elders with
serious diseases like dementia or paralysis etc. To prevent them from getting serious injuries
if they fall from a height or on a slippery floor by immediately notifying the caregiver who
39
can call for medical assistance as soon as possible that will reduce the chances of severe
injuries or death.
accommodate more than one rooms at a time and also it can be used to generate an sms to the
40
8. References
[1.]
https://www.researchgate.net/publication/320505786_Automatic_Fall_Detection_Syst
em_of_Unsupervised_Elderly_People_Using_Smartphone
[2.]
https://www.researchgate.net/publication/328580975_A_Study_on_Fall_Recognition
_using_Sensor_Data_from_Smartphones
[4.] https://www.researchgate.net/project/Human-Activity-Recognition-21