Mubarek Dubiso Ofolcha
Mubarek Dubiso Ofolcha
Mubarek Dubiso Ofolcha
Adama
March, 2019
CAMERA BASED FLOOD DETECTION AND RECOGNITION
WITH WIRELESS SENSOR NETWORK; IN CASE OF AWASH
FLUVIAL
Adama
March, 2019
Approval of Board of Examiners
We, the undersigned, members of the Board of Examiners of the final open defense by Mubarek
Dubiso Ofolchahave read and evaluated his/her thesis entitled “Camera Based Flood Detection
and Recognition with Wireless Sensor Network; in case of Awash Fluvialandexamined the
candidate. This is, therefore, to certify that the thesis has been accepted in partialfulfillment of the
requirement of the Degree of Master’s in computer science and Engineering.
i
Declaration
I hereby declare that this MSc thesis is my original work and has not been presented for a degree
in any other university, and all sources of material used for this thesis have been duly
acknowledged.
Name: Mubarek Dubiso Ofolcha
Signature: ___________________________________________________________________
This MSc Thesis has been submitted for examination with my approval as thesis advisor.
Name: ____________________________________________________________________
Signature: __________________________________________________________________
ii
Acknowledgement
First and foremost, we would like to thank Almighty Allah for enabling us to initiate the
research, to put our best efforts and successfully conclude.
Secondly, it has been an incredible experience to follow my M.Sc. at the Adama Science
and Technology in Computer Science and Engineering. I learned a lot both from a professional as
well as a personal angle, and I am still learning! I would like to begin by thanking Dr. Shatish
Kumer, who has been my advisor and mentor for the past two years. He has been a wonderful
advisor, providing me encouragement, support, and always valuable advices during my M.Sc.
experience. His enthusiasm for research and his vision for the future have been an inspiration. I
thank him for the time he spent with me, discussing everything from research to career choices,
and led me to this vibrant and challenging research field for wireless sensor networks. While at
ASTU, I had the privilege of interacting with bright, wonderful and talented people.
I want to thank every single member of my advisory committee for taking the time to discuss my
research ideas as well as their effort that was put in to completion of this thesis. I would not be
here without the support of my wonderful family. My father Dubiso Ofolcha and my wonderful
mom Faxuma Musa’sand also all brother and sisters the greatest parents any one would dream of
having.
Last but not the least; I would like to thank my best friends Mekuria Gemechu,Megersa Dereje
and Muhidin Kedir for having encouraged me during the entire Master’s Degree program.
iii
Table of Contents
iv
2.5.3 Design issues of a wireless sensor network ........................................................................ 14
2.5.4 Application of Wireless sensor Network ............................................................................ 16
2.6 Wireless Sensor NetworkMechanism for Flood Detection ......................................................... 16
2.6.1 GPS-based ........................................................................................................................... 17
2.6.2 Radio Frequency (RF) based............................................................................................... 18
2.6.3 Camera based ...................................................................................................................... 18
2.7 Compare of Existing Flood detection Mechanism in WSN ........................................................ 19
2.8 Camera Based Wireless sensor Network .................................................................................... 20
2.8.1 Camera Node System .......................................................................................................... 20
2.8.2 Characteristics of Camera Based Wireless Sensor Network ............................................... 20
2.9 Flood Detection and Recognition ............................................................................................... 21
2.10 Challenge of Camera Based Using Wireless Senor Network ......................................................... 22
2.11 Related Work .............................................................................................................................. 22
CHAPTER THREE .................................................................................................................................... 25
3. RESEARCH METHODOLOGY ........................................................................................................ 25
3.1 Introduction ................................................................................................................................. 25
3.2 Literature Review........................................................................................................................ 26
3.3 Data Collection Method .............................................................................................................. 26
3.4 Design Proposed Prototype ......................................................................................................... 26
3.5 Design Tools ............................................................................................................................... 26
3.6 Development and Implementation Tools .................................................................................... 26
3.7 Evaluation Proposed Solution ..................................................................................................... 27
CHAPTER FOUR....................................................................................................................................... 27
4. DESIGN PROPOSED SOLUTION.................................................................................................... 27
4.1 Introduction ................................................................................................................................. 27
4.2 Pseudo code of proposed solution............................................................................................... 28
4.3 Description of Proposed Solution ............................................................................................... 29
4.3.1 Networking Part .................................................................................................................. 29
4.3.2 Processing Part .................................................................................................................... 30
Training Phase ................................................................................................................................ 31
1. Image Acquisition ....................................................................................................................... 31
2. Preprocessing .............................................................................................................................. 31
3. Feature Extraction ....................................................................................................................... 32
v
4. Image Classification.................................................................................................................... 33
Testing Phase .................................................................................................................................. 34
4.4 Proposed Block Diagram of Proposed Solution.......................................................................... 34
CHAPTER FIVE ........................................................................................................................................ 36
5. EXPERIMENTAL SETUP AND IMPLEMENTATION .................................................................. 36
5.1 Introduction ................................................................................................................................. 36
5.2 Software Requirement................................................................................................................. 36
5.3 Hardware Requirement ............................................................................................................... 36
5.4 Selection of Simulation Tools ..................................................................................................... 37
5.4.1 Networking Phase ............................................................................................................... 37
5.4.2 Basic Architecture of NS2 .................................................................................................. 41
5.4.3 Installation........................................................................................................................... 41
5.4.4 NS2 Simulation Steps ......................................................................................................... 42
5.4.5 Visual Processing Tools ...................................................................................................... 43
CHAPTER SIX ........................................................................................................................................... 44
6. RESULT, DISCUSSION AND EVALUATION ............................................................................... 44
6.1 Introduction ................................................................................................................................. 44
6.2 Networking part .......................................................................................................................... 44
6.2.1 Experimental result for Networking Part ............................................................................ 44
6.3 Processing Part ............................................................................................................................ 46
6.3.1 Experimental Results of Flood Detection and Recognition ................................................ 47
6.4 Evaluation ................................................................................................................................... 52
CHAPTER SEVEN .................................................................................................................................... 53
7. CONCLUSION AND RECOMMENDATION .................................................................................. 53
7.1 Conclusion .................................................................................................................................. 53
7.2 Recommendation ........................................................................................................................ 54
7.3 Future work ................................................................................................................................. 54
Reference .................................................................................................................................................... 55
Appendix ..................................................................................................................................................... 59
Appendix 1: source code for camera based wireless Network Communication .................................... 59
Appendix 2: Sample Code train the image ............................................................................................. 63
Appendix 3: sample code for Flood detection and recognition, Image .................................................. 63
vi
List of Figures
vii
List of Table
viii
List of Abbreviations and Acronyms
ix
Abstract
Camera based wireless senor Network (WSN) is active and hottest research area of Computer
Science. It is mainly applied by the most of the researchers in the areas of E-health, military,
surveillance, Industrial and Environmental monitoring application. In Flood detection and
recognition, wireless sensor network commonly used for monitoring environment from flood
disaster. Awash fluvial affects communities by damaging property and loss of life. There are no
technologies that applied to detect flood and provide information to save community from flood
disaster.
In this paper, we study how to protect Awash fluvial from community by develop a prototype
camera based flood detection and recognition with wireless sensor network. To achieve the
objective specifically classified into two part such as networking and processing module. First
moduleusedtocollect image using sensor camera and transmitted to base station. Second module
processing, at this stage, pattern matching the unknown imagewhich is given as inputand the
stored reference model are compared using SVM for the purpose of training the model and detect
the image and provide information.
SVM classifier is used to identify either flood is occur or not. The proposed solution have high
rate of accuracy when compared to existing related work research with respect to Position,
Illumination and expression as well as it takes low training and Testing time. By using
YCbCralgorithms with SVM Classifier the accuracy of recognized face is an average rate
of 96.44%.It I also identified that, the image input from real world through sensor camera and
processed through external database are also determine the rate of accuracy.
x
CHAPTER ONE
1. INTRODUCTION
1.1 Background
Flood is one of natural disaster. It is an overflow of water that submerges land that is usually dry.
It is occurcondition of fractional or temporary andgeneral or complete effect of normally dry land
areas from overflow of tidal waters from the normal and rapid runoff of surface waters from any
source [1].
The fundamental causes of flood are topographical condition, meteorological condition; planning
problem and natural status to human activities etc. the hydrological condition is specifically and
in winding way related to metrological condition such as storm, devastating precipitation and
violent wind. Hydrological condition emerges due to release of heavy rain drop and huge water.
The geological condition is moreover amount flood condition, for illustration, elevation of the
place. The natural status due to human movement is main factor for flooding situation, distinctive
sort of pollution, deforestation and building development etc.
Flood is one of the major problems in some countries of the world including Ethiopia.In Ethiopia
also flood can influence various zones particularly along Wabishaballe, Ganale, Dire Dawa
somewhere around 210,600 individuals relocated and furthermore Flood that happened in Somali
region Mustahil and East Imayworada of Shebelle zone in excess of 46,500 individuals dislodge,
10,000 domestic animals are killed, it also damaged Health center, water pumps, and Crop[2].
Around the world different types of floods occur in every year. In general, they can be classified
into three commonly categories such as Coastal floods, Fluvial (River Flood) and Pluvial (Surface
Flood) [3].In case of Ethiopia, most of parts are affected by fluvial. Because, geographicallycovers
land area 1,104,300km2 only 104,300 km2water area coved [4].It is not surrounded by ocean or
sea.
In our research study, we examine the problem of flooding on the Awash River in Ethiopia.
According to the national disaster risk management commission (NDRMC) reported flooding in
communities within the Awash River basin and of the potential for additional flooding in areas
1
that lie downstream. As of 14 September 2017, over 20,000 people in Oromia Region are reported
to be affected by floods.in addition On 8 September, the overflow of Awash and Asabera rivers
caused massive flooding in Aysaita woreda (district) in Zone 1 and Buremoditu woreda in Zone 3
of Afar Region affecting over 4,500 people displaced and over 500 hectares of agricultural land
damaged [5]. In fig1.1blue color show the disaster areas affected by Awashfluvial.
Risk management of disasters are divided into three parts: before the event (preparation), during
(crisis management) and after (rehabilitation).These tasks are not easy, especially when affected
area is completely enclosed, or some hardware necessary interventions (such as map) are not
available.
To alleviate these problems, government practices to civil engineering work but, not yet considered
technology based solution. We propose a new approach .As world experience several technologies
used for flood monitor. The technology such as Open Geospatial Consortium’s (OGC), Sensor
Web Enablement (SWE) [5] monitoring using satellite data by GIS [7] so, it is difficult to
implement Ethiopia. Because highly costly, require equipment like satellite and train man power
beyond this area. So, wireless sensor network the most common service utilized in commercial
and Industrial application, because of technical development in processing, communication,
chipper and use of low power computing devices. WSN is important because it uses less energy,
no need of wiring and can transfer over long distance.
2
Using wireless sensor Network they are different mechanism for flood detection such as follows.
Mainly there are three approaches to detect flood using wireless sensor network such as
Geographical information system (GIS), Radio Frequency (RF) and Camera based.
Geographical information system approach needs satellite to receive a data, very cost and need
much train manpower [6].RF approach transmit through radio wave signal propagation, it is
cheap but not provide accurate information. And camera based approach is to transmit the
capture image capture imagethrough WSN.
Generally, in our country flood detection mechanism not yet implements. The community may
not get the prior information when floods happen. After flood happen it noticed by telephone,
television and radio. This notification technique is artificial method and it cannot save life or
properties before flood occur.Therefore, it is prominenttostudy anddevelop prototype for camera
based for flood detection and recognition using wireless sensor Network. Because, compare to
other two techniquesCamera-based systems offer high localization accuracy, High density of
reference nodes in order to cover the tracking area of interest systems track positions and
identities of mobile targets. So we develop a prototype for Awash Fluvial using Camera based
flood detection and recognition with wireless sensor Network.
1.2Motivation
Flood is a natural disaster that results loss of life and property. In Oromia Region every year
fluvial of Awash River disturb massive area of community such as, Botu Kurabo, Awash Melkasa
Bati Germana, Qechachule Guja, Koloba Bli, Bato Degaga and Sodere Resort [8], and in Afar
Region Aysaita and Buremoditu woreda [5]. Due to occurrence of Fluvial,The community may
not get the prior information when floods happen such as Agricultural land, Health center, School,
homes and also their livestock’s such as cattle’s, goats, sheep and poultry. According to NDRMC
[5] reported in two regional community more than forty thousands of people displaced from their
living areas.
Due to these fluvial disasters, Government and Non-governmental Organizations such as UNICEF
and USAID operate to save the lives and properties of the affected communities. These aids require
millions of Birr for disaster management and rehabilitation purposes.
3
Because of the above problems stated and as community live that area, we plan to implement my
thesis work to solve community provide systems which help to minimize the damage through early
flood detection. The major advantage of this research is simple and efficientlyminimized the loss
of life and property. However, in a constrained environment, this thesis has a fast processing time
and reasonable accuracy.
Every year, River flood destroys valuable resources and life’ in Ethiopia. In last year of 2017,
Ethiopian natural disaster risk management commission on flood affected areas shows that, more
floods affected by Awash fluvial. Ten hundreds people are dead, more than four werada agriculture
seeds are lost and more than millions of birr properties are damaged [4]. To handle and monitoring
flood affected areas, community and government are working different activities such as structural
engineering and natural resource management. Those activities basically important however, do
not provide information before flood is happened.
Now a day’s, so many research works on area of flood detection that distinguish the flood by using
deferent parameter model and other tools such as GIS, Open Geospatial consortium (OGC) and
Satellite[6][7]. But those listed approach is very expensive and needs more professional expert.
Lack of efficient device to trigger flood notification, could not detect when will the flood happen,
product are expensive, flimsy and wired, which is not suitable outdoor.
Our model design and implementations based on community level. So, the research is to detect
flood using camera sensors that capture and transmit visual images through wireless sensor
network approach and provide information to base station.
1.4 Objectives
1.4.1 General objective
The general objective of this research is to develop a prototype Camera based flood
detection and recognition with wireless sensor network; in case of Awash fluvial.
4
To collect and prepare data set image from Awash fluvial and other area for training and
testing purpose.
To develop a prototype for Camera based flood detection and recognition with wireless
sensor Network aspect.
Evaluate the performance of developed system with different datasets.
To draw for conclusions from experiment results.
I. How to protecting human life and property from awash fluvial disaster areas?
II. How to communicate individual sensor camera through wireless sensor network to base
station?
III. How to develop a training model to detect flood detection and recognition?
IV. Is SVM flood detection model providing information for detect individual inputs?
1.6 Scope/Delimitation
The scope of this study is to develop a prototype camera based flood detection and recognition
using wireless sensor Network in Awash fluvial. Due to time and first try of the study our system
is not detect when the image capture from distance greater than 20 meters because of the system
depend on the quality of the captured image and constraints of the image background. It is difficult
to classify the background which is similar to the flood image. It isdifficult to recognize if images
are nonstandard.
5
1.8 Research Process Procedures
In order to attain the objective and answer the research questions, the following procedures and
technique is used.
6
Chapter one describes about an over view of the study such as, background information,
statements of the problem, motivation, objectives, scope and limitation, and significance
of the study. Chapter two describes about literature review and related works.
Chapter three describes about research methodology. It includes development tools, Design
tools, data collection method, proposed system design method, proposed system
implementation method, proposed system evaluation and model of pattern matching.
Chapter four describes the design proposed solution. It is contain the detail description of
proposed solution of thesis, flow chart component diagram, model and etc.
Chapter five presented the experimental setup and implementation of study. In these
section includes software and hardware requirement and also selection of simulation is
discussed.
Chapter six describes, the detail description result and evaluation of proposed research and
Chapter seven describes the conclusion and feature work of the study.
CHAPTER TWO
2. LITERATURE REVIEW
2.1Introduction
In this chapter, discussed aboutliterature review related to research areas such as flood, Awash
River, Awash fluvial history, network, wireless sensor network, wsn approach for flood detection
technology and related work.
2.2 Flood
Flood is natural disaster. It has responsible for the loss of valuable lives and damage of large
amounts of property every year, especially in the poor and developing countries, where people are
at the mercy of natural elements. A lot of solutions have been put to minimize the damage through
early flood detection [10].There are several different kinds of flood, and each has a different impact
in terms of how it occurs, how it damage and forecastedit causes. They are three common types
of flood [3].
7
Coastal flood is type flood happen by ocean, sea or other large area of open water. The cause of
such a surge is a severe storm. The storm wind pushes the water up and creates high waves by
dangerous weather condition but the wind can have a larger effect. The most characteristics of a
coastal flood is that the water level drop and increases with the tide. At high drift the water may
flow in and at low drift it may recede again
Overbank flooding: occurs while water rises overflows over the edges of a river or stream.
This is the most common and can occur in any size channel from small streams to huge rivers.
Flash flooding: is described by an intense, high velocity torrent of water that occurs in an
existing river channel with little to notice.
The flood detection mechanism is different from one to another due to the source of flooding,
Couse of flooding and geographical areas that cover the disaster. Therefore, studyareafocused on
fluvial floods.
8
2.3 Awash River
The Awash River basin (Fig 2.1) is one of the dozen river basins of Ethiopia. It drains the central
and eastern highlands of the country. It has a catchment area of about 110,000 km2 .The river
starts from Ginichi town west of the capital Addis Ababa. It is travels along the Rift Valley and
ends in Lake Abe on the border between Ethiopia and Djibouti. Through its journey, the river
flows from an altitude of 3000 m above sea level to 250m als with a total length of about 1200 km.
The Awash basin is divided into three parts upper, middle, and lower basins based on
climatologically, physical, socio-economic, agricultural, and water resources characteristics The
basin hosts an estimated 18.3 million people. The Largepopulationis leads a pastoralist and
smallholder farmer livelihood [11].
9
flood happen by Awash River. According to Awash fluvial mostly affected community each year
frequently.
Table 2. 1Awashfluvialsources as reported by communities [8]
For Flood detection and recognition WSN are becoming increasingly important for monitoring the
environment of flood affected area that provides information. They provide more comfort for
stakeholder, with the absence of wires reducing costs and providing more flexibility [14].WSN are
getting a special place in the development of Flood detection application, due to its characteristics
such as: not intrusive design, low energy consumption, low price and its flexibility to integrate
into health care environments [7].
10
the capability of sensing, communication and computation. Usually data are transferred to server
to monitor the environment or the required phenomena [15].Wireless networks to monitor
environmental or physical conditions, such as sound, temperature, pressure, vibration motion or
pollutants and to cooperatively pass their data through the network to a sink or main location where
the data can be observed and analyzed. A base station or sink acts like an interface between the
network and users. One can retrieve required information from the network by injecting queries
and gathering results from the sink. Typically a wireless sensor network is contains a sensor nodes.
The sensor nodes can communicate among themselves using radio signals [16].Fig 2. 2 below
show datacollected by sensors is transmitted to a specialnode equipped with higher energy and
processingcapabilities called “sink” or “Base Station” (BS).
11
units are usually composed of two subunits: analogue to digital converters (ADCs) and sensors
[17]. The sensors is generate analogue signals are converted to digital signals using ADC, and then
transmit into the processing unit. The processing unit is generally associated with a storage unit
and it’s managing the procedures that make the sensor node work together with the other nodes to
carry out the assigned sensing tasks. A transceiver unit connects the node to the network. One of
the most key components of a sensor node is the power unit. These units can be supported by a
power scavenging unit such as solar cells. The other subunits, of the node are application
dependent.
12
Fig 2. 4Protocol Stack forWSN[18].
IEEE 802.15.4 (fig 2.5) WSNs, can be configured as either star or peer-to-peer networks. In star
networks operate in a more structured way, where one of the FFDs acts as a PAN coordinator, and
then other nodes join the network On the other hand, peer-to-peer networks nodes connect with
each other in an arbitrarily manner based on reach ability, whereas nodes are self-managed.
13
Fig 2. 5IEEE 802.15.4 peer-to-peer or star topology [21]
Network layer
Network layer is responsible for routing of messages from node to cluster, node to node ,cluster
leaders to the base station, leadercluster leaders to cluster leaders and vice versa. Internet Protocol
(IP) is the protocol in computer networks. IP protocol is proven for scalability, and specification
of IP protocols is open and freely accessible for everyone. Therefore, a new standard was
introduced to facilitate IPv6 to WSNs, named “IPv6 overLow Power Wireless Personal Area
Network” or 6LoWPAN.The advantages of 6LoWPANs are their popularity, applicability, bigger
address space, stateless address configuration and IPv6 security.
Application layer
Data is collected and managed at application layer therefore it is important to ensure the reliability
of data. The constrained application Protocol (CoAP) is application Layer protocol that to assign
for Low resource, low Memory, low computation and low power requirement.
I. Fault tolerance: Each node in the network is prone to unanticipated failure. Sensor nodes
are frequently deployed in dangerous and vulnerable environment. Nodes can fail due to
physical damage or hardware problems or by exhausting their energy supply. We expect
14
the node failures to be much higher than the one normally considered in wired or
infrastructure-based wireless networks.
II. Scalability: Sensor networks vary in scale from several nodes to potentially several
hundred thousand. In addition, the deployment density is also variable. The protocols
deployed in sensor networks need to be scalable to these levels and be able to maintain
adequate performance.
III. ProductionCosts: sensor networks can compete with conventional information gathering
approaches only if the individual sensor nodes can be produced very cheaply.
IV. Hardware Constraints:At least, every sensor node needs to have a power supply, a
transmission unit, processing unit, and a sensing unit. Optionally, the nodes may have
several built-in sensors or additional devices such as a localization system to enable
location-aware routing. However, additional functionality comes increases the power
consumption and additional cost, physical size of the node. Thus, additional functionality
needs to be always balanced against cost and low-power requirements.
V. Sensor Network Topology: WSNs have evolved in many aspects; they continue to be
networks with constrained resources in terms of computing power, energy, memory, and
communications capabilities. Of these constraints, energy consumption is of paramount
importance, which is demonstrated by techniques, algorithms, and protocols that have been
developed to save energy, and thereby extend the lifetime of the network. Topology
Maintenance is one of the important issues researched to reduce energy consumption in
wsn.
VI. Transmission Media:the media communication within the nodes is normally
implemented using radio communication. But, some sensor network use infrared or optical
communication.
VII. Power Consumption: many of the challenges of sensor networks revolve around the
limited power resources. The size of the nodes limits the size of the battery. We have to
carefully consider efficiency of battery when to design the hardware and software. For
instance compression and other police might be acceptable of conserve energy.
15
2.5.4 Application of Wireless sensor Network
WSN applications [9] can be classified into two categories: monitoring and tracking. That see (Fig
2.6) Monitoring applications include indoor/outdoor environmental monitoring, health and
wellness monitoring, power monitoring, inventory location monitoring, factory and process
automation, and seismic and structural monitoring. Tracking applications include tracking objects,
animals, humans, and vehicles. While there are many different applications, below describe a few
example applications that have been deployed and tested in the real environment.
16
Fig 2. 7Classification of Flood detection using WSN
2.6.1 GPS-based
The GPS satellites transmit signals to the GPS receiver and compute its current flood location.
GPS operations depend on a very precise time reference, which is provided by atomic clocks on
board of satellites. GPS receivers do not transmit and require a line of sight between the GPS
satellites and receivers, and therefore, GPS-systems work effectively outdoors.
GPS-based flood detection require attaching a GPS receiver and transceiver to each target flood.
The GPS receiver (Fig 2.8) obtains the location information from satellites, while the transceiver
is used information to a base station using Global System of Mobile Communications (GSM)
network.
17
2.6.2 Radio Frequency (RF) based
Radio Frequency (RF) baseddetection is use of radio waves to determine the flood flow of target’s
location. Radio signal information from a wireless transmitter can be used to estimate the location
of target nodes in two ways: the first uses the signal propagation model to convert signal strength
to a distance measurement, using previous knowledge about reference nodes’ coordinates, and
deploys a geometry method to compute the location for target nodes. Figure 2.9 demonstrates the
high-level system style thought. A transportable transmitter system with star charging feature
wirelessly sends water level knowledge to a motionless receiver system.
18
Fig 2. 10A camera-based wireless sensor device [22]
Due to above (Table 2.2) comparison of three flood detection wsn mechanism, we have selecting
for thesis camera based is best choice because, Camera-based systems offer efficient localization
accuracy, as these systems track positions and identities of mobile targets, without the need for
attaching any device to suspect object and the cost of camera based is compatible to capacity
community and government.
19
2.8 Camera Based Wireless sensor Network
Camera-based WSN are an emerging research area with many promising applications. Potential
applications include remote video surveillance, monitoring assisting elderly and health patients
and habitat monitoring. The sensor cameras communicate through wireless sensor Network and
transmitted image or video frame depend on application used [24].
Resource Requirements
Local Processing
Real-time Performance
20
Precise Location and Orientation Information on Resource Requirements
Time Synchronization
Data Storage
Autonomous Camera Collaboration
RGB Colors are specified in terms of three primary colors such as Red (R), Green (G), and
Blue (B).In RGB color space, a normalized color histogram is used to detect the pixels of flood
color of an image and can be further normalized for changes in intensity on dividing by luminance.
[37]
YCbCr Color model is basically in terms of luminance(Y channel) and chrominance (Cb and
Crchannels). It segments the image into a chrominance components and luminous components. In
YCbCr color model, the distribution of the areas is consistent across different r in theCb and Cr
color spaces.YCbCr color model is light sensitive so to improve the performance of image color
clustering. Its chrominance components are almost independent of luminance and there is non-
linear relationship between luminance(Y) andchrominance (Cb, Cr) of image color high and low
luminance region.
Image Classification
In image processing one complex and importantsteps is image classification. Different type of
image classification algorithm, basically classified either unsupervised or category supervised.
Most of classifier such as minimum distance, neural network, support vector machine, and decision
tree are defining decision about requires training sample and class. On other hand clustering based
21
algorithm, example. K-NN, K-Means or ISODTA are fuzzy- set classifier and unsupervised are
classification provide more accurate result and information. In this study we support vector
machine [38].
This is also true of image segmentation systems, including those using a modified version SVM
that uses the privileged approach. SVMs are effective when the number of features is quite large.
It works effectively even if the number of features is greater than the number of samples. Non-
Linear data can also be classified using customized hyper planes built by using kernel trick. It is a
robust model to solve prediction problems since it maximizes margin. The biggest limitation of
Support Vector Machine is the choice of the kernel. The wrong choice of the kernel can lead to an
increase in error percentage. With a greater number of samples, it starts giving poor performances.
SVMs have good generalization performance but they can be extremely slow in the test phase.
SVMs have high algorithmic complexity and extensive memory requirements due to the use of
linear programming.
22
patient, elderly people and infant monitoring are designed and automatically detected. And also
Automatic detection of events can support the human observer with alerts to attract his attention.
The research processed by motion detection algorithm and advantage reduce response time and
efficiency nurse’s and related for care of elder, baby and patient.
Indira et al [25] design a model for flood prediction and detection using wireless sensor network.
This paper mainly is concerned deploy different type sensor in river by forming wireless sensor
network. The sensor collected two parameters; such as pressure sensor, level sensor to monitoring
the level of barrage. If level water is greater than barrage level water the system alerted information
to work station. The research work important easy computation area barrage or dam.
Shi-Wei Lo, et al [26] focused on the determination of flood monitoring based on image processing
techniques. The experimental results proposed that the visual sensing approach may be a reliable
way for determining the water fluctuation and measuring its elevation and flood affected area with
respect to real world environment. The research detects the water level by monitoring the stage
between the rulers and water body using cameras. This paper is advantage for monitoring flood
and forecast system. A single pre-warning system can accurately monitor and forecast floods under
certain environmental conditions; however, it lacks an intelligent triggering and response function
for field flooding and over flow events. Large amount flood forecast systems can’t provide
sufficient field information to report office.
Jaymala Patil, et al [27] develop wireless sensor network using flood monitoring. The process
monitoring technique using water level sensor around bridge transmitted alert based on
information access from sensor install. The research only discuss flood affect area around bridge
so, it cannot detect a flood rate.
Lívia C. Degrossi, et al [15] develop Brazil flood monitoring in using sensor web in wireless sensor
networks. Our approach collected data based on Open Geospatial Consortium’s (OGC) Sensor
Web Enablement (SWE) standards. This kind of approach has become important owing to the
constant occurrence of floods in Brazil, as well as technological advances in the detection of
flooding in urban rivers, which can help to save many lives and give protection against material
losses. But, the drawback of the thesis is very costly material of Geospatial equipment.
23
In this paper, we design prototypeflood detection and recognition concept of image from sensor
camera different settled place distribution along the road with wireless sensor network. As input
data taken from the set sensor camera then train dataset of from the database detect the input image
by image processing concept then provide information to the stockholder. In (Table 2.3)
summarized related work of thesis such as objective, the pros and limitation with their reference.
24
15 Develop Brazil flood important owing to the Used very cost
monitoring in using sensor constant occurrence of equipment used for
CHAPTER THREE
3. RESEARCH METHODOLOGY
3.1 Introduction
In this chapter, we have discussed the way of the thesis methodology of the camera based flood
detection and recognition with wireless sensor network; inquiring the proposed system
understanding way of development method, deign the proposed solution, describe the testing and
implementation method and tools that used in order to achieve the proposed solution.
25
3.2 Literature Review
The literature review, deals with reviewing the related with current research work. The main source
of literature review includes a book, journal articles, thesis, and resource form website and
conference papers from national and international repositories are deeply reviewed. in order to get
better knowledge or sentiment analysis and polarity classification various techniques will be
reviewed in details.
26
3.7 Evaluation Proposed Solution
Evaluation is a systematic determination of subject merit, significance and worth using criteria or
standard. In our case, evaluation performance is of proposed prototype accuracy based on
parameter. The number of Image testing in percentage for a given data set in classification, with
respect to the whole dataset.
CHAPTER FOUR
4. DESIGN PROPOSED SOLUTION
4.1 Introduction
This chapter, we have discussed the overall proposed solution of camera-based flood detection and
recognition with wireless sensor network isillustratedinfig4.1.it explain whole process of design
Such as the architecture, Process Model, pseudo code solution, algorithms we used, their relation
and interaction, the representation and description of components.
27
Fig 4. 1Overall Detail Architecture of proposed solution.
Input image
Output Information
Begin
28
Flood_occur and Provide_information
Else
29
Sink Node: Receive the image capture from camera sensor and transmitted to network for
further processing
Base Station: collected image from base station, detect image using image processing and
provide information.
Image Processing is the method to converting an image into digital form and perform operation on
it.in order to enhanced image useful information. The image process include the following three
steps.
Raw image: camera raw image file contains minimally processed data from image sensor either
digital camera or motion picture. Raw file are not yet processed and read to preprocess.
Capture Dataset: collection of raw image collect from camera sensor further processed.
Existing Flood image Dataset: collection of Awashfluvial image that used for training model. For
training purpose we collected 60 different images for training and testing propose.
30
Training Phase
In training phase, it is process to create model from train dataset. To create a model, flow such
steps such as preprocessing feature extraction and classification. The figs 4.3 describe flow chart
of training phase to provide model.
1. Image Acquisition
In this step, we store or load image capture from camera sensor to database.it is step involved
camera and transfers into computers to receive the image in its digital format. Image format used
is JPG.
2. Preprocessing
It is step deals with an operation done before a key processing steps, such as: filtering color
transforms, sub-sampling/scaling histogram generation. It also refers with enhancement of image
quality by resize image and adjusts the image for further processing. Such as histogram
equalization, filtering and sharpening. In this study, used RGB and YCbCr color space.
In order to detect flood, pixel of flood region in RGB is explored. Then for YCbCr colour space,
the image from RGB format has to be converted to YCbCr format before the image could be
analyze by equation 4.1
31
𝑌 0.299 0.587 0.114 𝑅
𝐶𝑏 = 0.5 −0.1687 ∗
−0.3313 𝐺 …………….…………………………… (4.1)
𝐶𝑟 0.25 0.5 0.312 𝐵
In this step we add smooth code for removal of noise.to doing this using Gaussian algorithm.
(Equation 4.2) is implemented by replacing the value of every pixel in an image by the average
value of the gray levels in the neighborhood. Where, S is the M - pixel neighborhood of points,
surrounding the point (x, y).
1
g(𝑥, 𝑦)=𝑀 ∑𝑠 𝑠(𝑥, 𝑦)……………………………………..……………………………(4.2)
3. Feature Extraction
Feature extraction is where all the data pixels that represent and describe the desired pixels is been
grouped. The set of features will extract relevant information accordingly to the desired task. For
this research, flood pixel had been extracted by using two color spaces and six rules that were
applied for each of image tested.
RGB 1: R>G>B
YCbCr 3:Y(x,y)>=Cb(x,y)
5: Cb(x,y)- Cr(x,y)≥Th
6: Cb(x,y)≤120∩ Cr(x,y)≥150
32
4. Image Classification
In this study uses supervised classification using SVM to classify the flood images because of
dynamic in nature and high accuracy of images, it tries to find the separating hyper-plane with
maximum margin to separate positive and negative samples from the training set.
i. First input data called capture image's dataset. This input dataset is continuous data
stream to the flood detection process.
ii. Second steps require preprocessing stage method to define the proper input to the image
classifier.
iii. Third steps is the classification process which involves trained dataset to classify the
image under SVM classification.
iv. Finally, Graphical User Interface creates the reports in required format for flood occurs
or not.
Let training data set{(xi,yi)}i=1….n, yi€ {-1,1} by separated by hyper-plane with margin ρ.
33
WTXi+b ≤ρ/2 if yi=-1………………….……………………….………. (4.3)
2
ρ= ||w||………………………….…..……………….…….…………… (4.5)
Testing Phase
In this testing phase, initially the image is given as input to this system and initially the image is
applied with the preprocessing mechanisms such as extraction and demonstration for detection.
After completing this, the image is provided to the first SVM in order to observe image status and
then these regions are utilized to identify the flood occur or not. Thus this system identifies the
stage of the flood with the aid of a raw camera image.
34
I. The camera collect image from distribute camera
II. Transmit the image throw wireless sensor communication
III. The collect data goes to image processing way then compare the image with train
dataset.
IV. Final provide information based on input data
Block diagram of the proposed solution classified into three sub block such as data collection,
transmission and Processing sub block.
The data collection using camera sensor collect image from the environmental install and
wireless communication is using wireless media transmitted the data from one sensor to another
and base station. Lastly, after the image reach to database processing and compared to dataset
exit and provide information.
35
CHAPTER FIVE
5. EXPERIMENTAL SETUP AND IMPLEMENTATION
5.1 Introduction
In this chapter discuss the experimental environment that used to implement this thesis.
Conducting experimental thesis work proposed solution for camera base Flood detection and
recognition with wireless sensor Network in case of Awash fluvial. It is difficult implement in real
world. So, reduce the cost of research using best and computable simulation tools for research
work. In section discuss the software and Hardware requirement used and also compare the
simulations.
36
5.4 Selection of Simulation Tools
Basically, there are a lot of tools available for simulator. This research common need tools the
network phase and image processing phase. In this section simulation to achieve thesis work and
also compare and contrast tools used justify simulation to this thesis.
Comparison Simulation
a) NS2
Network Simulator (Version 2) [28], widely known as NS2, is simply an event-driven simulation
tool that has proved useful in studying the dynamic nature of communication networks. Simulation
of wired as well as wireless network functions and protocols (e.g., routing algorithms, TCP, UDP)
can be done using NS2. In general, NS2 provides users with a way of specifying such network
protocols and simulating their corresponding behaviors. NS2 start alternative of Real network
simulation in1989. The key role of Ns2 is as follow visual the network connection, data
transferring and related stuff.
Some drawback of Ns2 simulation as follow stated such it require advance skill effectively use
simulation, difficult to customized available, it contradiction between application and network
level in sensor network.
b) TOSSIM
TinyOS wireless sensor networks [29], used to simulate a discrete event developed by UC
Berkeley. TOSSIM specifically designed for application of TinyOS execute on MICA Motes.
TOSSIM simulates entire TinyOS applications. The simulation language is written in nesC. The
simulation simulated in bit format.
c) GloMoSim
37
Global Mobile Information System Simulator (GloMoSim) [30] is a scalable of environment
simulation for wired communication and wireless network. In GloMoSim node repented
geographical area of simulator. The network nodes which particular entities represent are
determined by the physical position of the nodes. it also use for mobile wireless routing protocol
and good for Mobile IP.
d) UWSim
S. Dhurandher and Misra [31] stated thatUWSim is type of simulation used for underwater sensor
Network (UWSN) a simulator used for Underwater Sensor Networks (UWSN). The simulator
focus on ad hoc network and ground based do understand factor that effect underwater
communication. it process the network based on component based rather than protocol based
approach.
e) Avrora
Avrora [31] is simulator an open sources for emended a sensing program. It simulator a network
of motes, execute in microcontroller program and run accurate simulation device and radio
communication. Avrora provide analysis framework program, checking static of embedded
software, and analysis an infrastructure for future program. It can emulate two typical platforms,
MicaZ, and Mica2 and run AVR elf-binary or assembly codes for both platforms.
SENS is type of network simulation that simulator wireless sensor network with model,
architecture layered with customize component model of application layer.it enable realistic
simulation by using real sensor to represent component implementation.it is advance sensor
network for WSN. SENS used for deploy for actual sensor node. It programmed by C++
COOJA is simulation type used simulator for the Contiki sensor node operating system. It allows
simultaneous cross-level simulation at application for machine code instruction and operating
system and set level [33]. COOJA combines low level simulation of sensor node hardware and
simulation of high-level behavior in a single simulation. It can simulate sensor networks
38
simultaneously at different levels, including the operating system level and network. The scripting
language of COOJA is java.
h) Castalia
Castalia is developed in C++ by Australia National ICT. It is application level simulator for
Wireless Sensor Network based on OMNeT++.It can be used evaluate platform specific
applications, the sensor node are implement modules, sub module represent instance network stack
layer and application. Module Node is interconnected to physical process module and wireless
channel. Node modules are connected to wireless channel and physical process modules.
i) Shawn
It is open source that used to design help to advance scale network simulation. Shawn is design
the estimate phenomena of network simulation. It support large network and provide highest
abstract level compare to other simulation tools such as SENSE, ns2, OmNeT++, TOSSIM and
GloMoSim.But, only concern on wireless sensor Network [32].
j) EmStar
Simulation is type that provides flexible environment bridge between simulation and deployment
for iPAQ-class sensor running Linux. Stakeholders have three options such as execute many
virtual nodes on single host with single simulation network, running many virtual nodes on single
host with individual virtual node bridge to real world network and execute a single node on host
with network interface. [33]
k) JSim
J-Sim is a general purpose simulator modeled after Ns-2, developed at the University of
Washington by the National Simulation Resource. Unlike Ns-2, however, J-Sim uses the concept
of components, replacing the notion that each node should be represented as an object. J-Sim uses
three top level components: the target node (which produces stimuli), the sensor node (that reacts
to the stimuli), and the sink node (the ultimate destination for stimuli reporting).J-Sim provides
support for sensors and physical phenomena. Energy modeling, with theexception of radio energy
consumption, is also appropriately provided for sensor networks [34].
39
l) SENSE
SENSE was a sensor network simulator developed in 2004.SENSE supports an energy model that
is sufficient for wireless sensor networks. It is similar to J-Sim in that it is component based, but
is written in C++ in order to avoid the perceived inefficiency of Java. SENSE runs on top of COST,
a component based discrete event simulator that is written in C++, A comparison between different
NS2 simulators are shown table below [35].
40
EmStar Linux May be run on a diverse set of Only run code for the types
execution platforms. of nodes
Combination of simulator and Does not support parallel
emulator. simulations.
J-Sim Java Provides support for energy Low efficiency of
modeling, with the exception of simulation
radio energy consumption
Based on above (Table 5.1) description and comparison, NS2 is the more appropriate with our
requirement.
5.4.3 Installation
NS2is a free available simulation tool. It runs on different operating system such as Linux, Mac
and Windows. In Linux operating is installation byonline package. But, whenwe used window
environment two options popular available the first case install virtual box then install Linux and
NS2 package. The second option install Cygwin (UNIX emulator) activate on windows system.
41
NS2 source codes are distributed in two forms: the component-wise and the all-in-one suite. With
the all-in-one package, users get all the required components along with some optional
components.
Install Ns2 on theLinux operating machines by simply running the “install” script and following
the step of instructions therein. The only requirement is a computer with a CCC compiler
installed. The following two commands validated, respectively:
>>./install
>>./validate
Validating NS2 involves simply running a number of working scripts that verify the essential
functionalities of the installed components.
NS release 2.35,
Tcl/Tk release 8.5.8,
OTcl release 1.14, and Tcl release 1.20 and
The following are the optional components:
NAM release 1.15: NAM is an animation tool for viewing network simulation traces and
packet traces.
Zlib version 1.2.3: This is the required library for NAM.
Xgraph version 12.2: This is a data plotter with interactive buttons for panning,
zooming, printing, and selecting display options.
Design the simulation is the first step of simulating a network. In this stage user must define
simulation purpose, assumption, work configuration, performance measures and expect output.
Phase 1: Network Configuration: in this phase conjuring network component (TCP, UDP)
according to simulation design and scheduling events.
Phase 2: Simulation Phase: in this phase maintain simulation clock and execute chorological
events.it also define simulation scenario in Tcl script and feed file as input argument of NS2.
The main reason researcher selected based on the two necessities and basic feature of MATLAB
for developing are toolbox of image processing and it has a vast library, interactive environment,
built-in graphics for visualizing data and tools for design, ability to access the direct camera and
detect the from input image are with graphical user interfaces. MATLAB image processing
Toolbox provides tools for designing, implementing, visualizing, and simulating flood image. The
code for the project was written in MATLAB script m-files and for the image Database it has saved
and stored in the format of MAT with an extension .jpg file format. Training and testing were done
in MATLAB with the association of the provided Graphical User Interface (GUI).
43
CHAPTER SIX
6. RESULT, DISCUSSION AND EVALUATION
6.1 Introduction
In this chapter, we detail discuss the result, and evaluation of the proposed solution camera flood
detection and recognition method simulated on two part; such the networking part and Processing
part. Next topic detail discuss about the simulation result proposed solution.
Parameters Value
Simulator AODV
44
Bandwidth 2 mbps
Number of source 1
The above (figure 6.1) demonstrate the camera sensor node configuration using network
simulation. The constellation of camera sensor between 250 meter distances with 10,000 meter
square land. Camera sensor node 0 to 9 and sink node is 10. Data rate transmission at time 1000kps
and simulation time to execute is 60s.
45
Fig 6. 2Data Transfer from one node to another
In the above (Fig6.2) simulation scenario using AODV protocol to show the how to simulate
camera sensornode communicate from one node to
46
Fig 6. 4Snip Shoot of Sample Dataset for Training Phase of Awash River
The methodology used in detection module is shown in Fig5.1. First of all the initial image is
preprocessed and extracted feature based on color information. This process are accelerates the
detection and reduce the color space as the number of region of interest to be reduced. The stage
successfully detects the flood shown in Fig 6.5(b), 6.5(e), 6.5(h) and 6.5(k).
47
48
49
(m)
Fig 6.5The Processing used in Flood Detection and Recognition. Original image (a), (d), (g) and
(i). Preprocess and Extracted image (b),(e),(h) and (k) Final result (c) ,(f),(i) and (l) Flood
classification (m).
The flood detection and recognition processing is applied on different weather including low light
condition. Some examples of successful outputs of given results are demonstrated in Fig
6.6.However, the image could not be detected are shown in Fig 6.6 The image were low light
condition, background similar and blur for their motion failure results are shown in Fig 6.7.
50
Fig 6. 6Detection Example
51
6.4 Evaluation
Evaluate efficiency and performance of proposed solution using confusion matrix (See Table).
There are use 60 images out this 58 are correctly classified into flood occur and the rest are
persistence not classified. On the other hand, 96.66% images are properly classified and 3.33%
only are misclassified in correct categories.
60 58 2
PERFORMANCE EVALUATION
Error
Accurancy
0 20 40 60 80 100 120
The graph chart above (Fig.6.8) depicts the accuracy rate and error rate obtained by the model after
testing with the available dataset. The high accuracy rate compared to the low error rate throws
light on the accuracy of the algorithm devised for flood detection and recognition.
52
CHAPTER SEVEN
7. CONCLUSION AND RECOMMENDATION
In this chapter we described the summary of the proposed solution and future research directions.
7.1Conclusion
The main objective of this research work is to develop a prototype camera based flood detection
and recognition with wireless sensor network for Awash Fluvial selected area of disaster. The
proposed solution employs the use of advanced sensing technology in performing real-time camera
sensor offlood information. The developed prototype solution is composed of two major phase:
First sensor camera and transmitting modules, second Processing Module.
The camera based flood detection and recognition is implemented at remote sites, where network
infrastructure is available. The connectivity is done through the wireless sensor network. The
camera sensor captures image data. While the processing and transmission module is used to
processing modulecapture data to the base station.
The base station is processing phase implemented as processing application to allow users to view
real-time camera image-related data as well as historical data. It is also able to send warning
information to the responsible authorities in case of emergency.
For sustainable social development of community, this study has successfully demonstrated a
regional flood monitoring for final verification of flooding situations. Previously, there was no yet
flood detection equipment’sinstalled in the area. The Local authoritiesmeasure Awash River water
level and report the information to local stakeholders via telephone, television and FM
communication channel. Often the reports are too late and are not very useful for them in
responding to flood events.
The developed proposed solution have provides up-to-date flood-status informationfrom remote
camera sensor sites. Users (expert’s, stakeholders and authorities,) can now obtain information
from base station office. This allows the local authorities, to obtained actual information about
flood status. In addition, experts can exploit this accumulated information to better understand the
behavior of floods.
53
Our proposed solution, therefore, allows a much greater degree of continuity and availability than
those conventional approaches. In particular, our flood detection and recognition with wireless
sensor network allows the authority to know the floodoccurrence and then provide more effective
and timely information to stakeholder.
7.2Recommendation
I will recommended to further study for the researcher in flood detection and recognition area by
using other parameter and approach such as satellite image, Geographical information system
(GIS) that to help increase performance of flood detection and high accuracy flood detection
information. It also we recommended to future to design another architecture and algorithm or
enhance the performance of the proposed prototype.
7.3Future work
Future work involves performing real world field tests. Here we will observe the reading process
communication process between the nodes and the real-time implementation.
54
Reference
[1] [Online]. Available: http://en.m.wikipedia.org/wiki/Flood
[2][Online]Available:https://reliefweb.int/report/ethiopia/unicef-ethiopia-humanitarian-situation-
report-6-reporting-period-october-2015.
[3]Onlinehttps://weather.com/safety/floods/news/flood-safety-20120423.
[5]Online].Aailable:https://www.humanitarianresponse.info/sites/www.humanitarianresponse.inf
o/files/documents/files/ethiopia_flash_update_on_floods_14sept2017.pdf.
[6] J. Sunkpho, "Real-time flood monitoring and warning system.," Vols. Vol.33 (2), 227-
235,Mar. - Apr. 2011.
[7] Naveed Ahmad, MureedHussain and FahadShinwari., "Flood Prediction and Disaster Risk
Analysis using GIS based Wireless Sensor Networks," A ReviewJournal of Basic and Applied
Scientific Research, no. ISSN 2090-4304, 2013.
[8] K. Chambers, "Flood Modeling and Assessments for Downstream Communities of Koki
Dam, Ethiopia," Cooperative Institute for Research in Environmental Studies, 2017.
[9] J. Patil, "wireless sensor network using flood monitoring," International Journal of Computer
Science and Mobile Computing, vol. 2, no. 11, pp. 297-302 , 2017.
[10] Victor Seal and ArnabRaha, "A simple flood forecasting scheme using wireless sensor
networks," I international Journal of Ad hoc, Sensor &UbiquitousComputing (IJASUC), vol. 3,
2012.
[12][online]https://fcit.usf.edu/network/chap1/chap1.htm: network
[13][Online]http://www.rfwireless-world.com/Terminology/wired-network-vs-wireless-
network.html: wired and wireless
55
[14] Basha, D. and Rus, D. “Design of Early Warning Flood Detection System for developing
countries. Proceeding of the conference on Information andCommunication Technologies and
Development, Bonsalove, India.Pp 1-10, 2017.
[15] Lívia C. Degrossi and Guilherme G., "Using Wireless Sensor Networks in the Sensor Web
for Flood Monitoring in Brazil," in Proceedings of the 10thInternational ISCRAM Conference,
2013.
[16]Akkaya, and M. Younis, “A survey on routing protocols for wireless sensor networks”,
“Elsevier Journal of Ad Hoc Networks “ 3 (3325–349)2015
[17]F. Akyildiz, W. Su, and E. Cayirci. “Wireless sensor networks: A survey”. Computer
Networks, 38(4):393–422, 2002
[18] Ankita,”A Survey on Wireless Sensor Network based Approaches “International Journal of
Advanced Research in Computer Science and Software Engineering, Volume 4, Issue 4, April
2014.
[19]C. karlof, N. Shastry and D. Wagner, TinySec: “A link layer security architecture for
wireless sensor networks”, SenSys’04, Baltimore, Maryland, November 3-5USA, 2004.
[21] R. U. Islam, "Wireless Sensor Network Based Flood Prediction Using Belief Rule," in Luleå
University of Technology, 2017.
[22]Tareq Alhmiedat and Anas Abu Taleb, "a study on threats detection and tracking systems for
military applications using wsn," international journal of computerapplications (0975 – 8887),
vol. 40, p. 15, 2012.
56
[24] A. AL-Marakey, “Camera-Based Wireless Sensor Networks forE-Health” International
Journal of Advanced Research in Computer and CommunicationEngineeringVol. 2, Issue 12,
December 2013.
[25] Indira P et al, “Flood Prediction and Prevention through Wireless Sensor Networking
(WSN): A Survey” International Journal of Computer Applications (0975 – 8887) Volume 113 –
No. 9, 2015.
[26] Shi-Wei Lo,”Visual Sensing for Urban Flood Monitoring”/journal/sensors Sensor, 2015
[27]Jaymala Patil, “wireless sensor network using flood monitoring “International Journal of
Computer Science and Mobile Computing Vol.2 pg. 297-302 , 2013
[29]P. Levis, N. Lee, M. Welsh, and D. Culler, “TOSSIM: Accurate and scalable simulation of
entire TinyOS applications,” 1st ACM Conference on EmbeddedNetworked Sensor Systems,
Los Angeles, CA, Nov. 2013
[30] X. Zeng, R. Bagrodia, and M. Gerla, “GloMoSim: A library for parallel simulation of large-
scale wireless networks,” SIGSIM Simulation Digest, vol. 28, no. 1, pp. 154-161, 1998.
[31] “UWSim: A simulator for underwater sensor networks,” Simulation, vol. 84, no. 7, pp. 327-
338, 2008precise timing,” 4th Int. Conf. on Information Processing in Sensor Networks, 2005.
[33] L. Girod, et. al., “EmStar: An environment for developing wireless embedded systems
software,” Technical report, Center for Embedded NetworkedSensing, University of California,
Los Angeles, CENS Technical Report 009, 2003.
58
Appendix
#===================================
# Initialization
#===================================
#Create a ns simulator
set ns [new Simulator]
#===================================
# Mobile node parameter setup
#===================================
$ns node-config -adhocRouting $val(rp) \
-llType $val(ll) \
-macType $val(mac) \
-ifqType $val(ifq) \
-ifqLen $val(ifqlen) \
-antType $val(ant) \
59
-propType $val(prop) \
-phyType $val(netif) \
-channel $chan \
-topoInstance $topo \
-agentTrace ON \
-routerTrace ON \
-macTrace ON \
-movementTrace ON
#===================================
# Nodes Definition
#===================================
#Create 11 nodes
set n0 [$ns node]
$n0 set X_ 253
$n0 set Y_ 345
$n0 set Z_ 0.0
$ns initial_node_pos $n0 20
$ns at 0.0 "$n0 label Camera_sensor0"
$n0 color "blue"
set n1 [$ns node]
$n1 set X_ 450
$n1 set Y_ 462
$n1 set Z_ 0.0
$ns initial_node_pos $n1 20
$ns at 0.0 "$n1 label Camera_sensor1"
$n1 color "blue"
set n2 [$ns node]
$n2 set X_ 624
$n2 set Y_ 332
$n2 set Z_ 0.0
$ns initial_node_pos $n2 20
$ns at 0.0 "$n2 label Camera_sensor2"
$n2 color "blue"
set n3 [$ns node]
$n3 set X_ 434
$n3 set Y_ 184
$n3 set Z_ 0.0
$ns initial_node_pos $n3 20
$ns at 0.0 "$n3 label Camera_sensor3"
$n3 color "blue"
set n4 [$ns node]
$n4 set X_ 846
$n4 set Y_ 374
$n4 set Z_ 0.0
$ns initial_node_pos $n4 20
$ns at 0.0 "$n4 label Camera_sensor4"
$n4 color "blue"
set n5 [$ns node]
$n5 set X_ 982
$n5 set Y_ 195
$n5 set Z_ 0.0
60
$ns initial_node_pos $n5 20
$ns at 0.0 "$n5 label Camera_sensor5"
$n5 color "blue"
set n6 [$ns node]
$n6 set X_ 1055
$n6 set Y_ 476
$n6 set Z_ 0.0
$ns initial_node_pos $n6 20
$ns at 0.0 "$n6 label Camera_sensor6"
$n6 color "blue"
set n7 [$ns node]
$n7 set X_ 1179
$n7 set Y_ 292
$n7 set Z_ 0.0
$ns initial_node_pos $n7 20
$ns at 0.0 "$n7 label Camera_sensor7"
$n7 color "blue"
set n8 [$ns node]
$n8 set X_ 1409
$n8 set Y_ 273
$n8 set Z_ 0.0
$ns initial_node_pos $n8 20
$ns at 0.0 "$n8 label Camera_sensor8"
$n8 color "blue"
set n9 [$ns node]
$n9 set X_ 1513
$n9 set Y_ 430
$n9 set Z_ 0.0
$ns initial_node_pos $n9 20
$ns at 0.0 "$n9 label Sink_Node"
$n9 color "blue"
set n10 [$ns node]
$n10 set X_ 1284
$n10 set Y_ 475
$n10 set Z_ 0.0
$ns initial_node_pos $n10 20
$ns at 0.0 "$n10 label Camera_sensor10"
$n10 color "blue"
#===================================
# Agents Definition
#===================================
#Setup a TCP connection
set tcp0 [new Agent/TCP]
$ns attach-agent $n0 $tcp0
set sink1 [new Agent/TCPSink]
$ns attach-agent $n9 $sink1
$ns connect $tcp0 $sink1
$tcp0 set packetSize_ 1500
#===================================
61
# Applications Definition
#===================================
#Setup a CBR Application over TCP connection
set cbr0 [new Application/Traffic/CBR]
$cbr0 attach-agent $tcp0
$cbr0 set packetSize_ 1000
$cbr0 set rate_ 1.0Mb
$cbr0 set random_ null
$ns at 1.0 "$cbr0 start"
$ns at 2.0 "$cbr0 stop"
#===================================
# Termination
#===================================
#Define a 'finish' procedure
proc finish {} {
global ns tracefilenamfile
$ns flush-trace
close $tracefile
close $namfile
execnamproject.nam&
exit 0
}
for {set i 0} {$i< $val(nn) } { incri } {
$ns at $val(stop) "\$n$i reset"
}
$ns at $val(stop) "$ns nam-end-wireless $val(stop)"
$ns at $val(stop) "finish"
$ns at $val(stop) "puts \"done\" ; $ns halt"
$ns run
62
Appendix 2: Sample Code train the image
63
blueVal = abs(blue(x,y) - blueMean);
sd = 48;
if((redVal<= sd) && (greenVal<= sd) && (blueVal<= sd))
biIm(x,y) = 1;
else
biIm(x,y) = 0;
end
end
end
sedisk = strel('disk',2);
openedIm = imopen(biIm, sedisk);
closedIm = imclose(openedIm, sedisk);
numberOfPixels = numel(biIm);
removeTh = round(numberOfPixels - numberOfPixels * 90 / 100);
filteredIm = bwareaopen(closedIm, removeTh);
numberOfTruePixels = sum(filteredIm(:));
if(numberOfTruePixels> 0)
disp('Flood is occur!! ');
for x=1:1:row
for y=1:1:col
if(filteredIm(x,y) > 0)
red(x,y) = 255;
green(x,y) = 0;
blue(x,y) = 0;
else
red(x,y) = red(x,y);
green(x,y) = green(x,y);
blue(x,y) = blue(x,y);
end
end
64
end
newIm = cat(3, red, green, blue);
else
disp(‘Flood is not occur!!’);
newIm = img;
end
subplot(1,2,1);
imshow(uint8(img));
title('Input');
subplot(1,2,2);
imshow(uint8(newIm));
title('Output');
65