You are on page 1of 7

See discussions, stats, and author profiles for this publication at: https://www.researchgate.

net/publication/261453048

Smoke and flame detection in video sequences based on static and dynamic
features

Conference Paper · January 2013

CITATIONS READS

5 62

2 authors, including:

Rykhard Bohush
Polotsk State University
21 PUBLICATIONS   28 CITATIONS   

SEE PROFILE

All content following this page was uploaded by Rykhard Bohush on 05 November 2016.

The user has requested enhancement of the downloaded file.


Smoke and flame detection in video sequences
based on static and dynamic features

Rykhard Bohush, Nadzeay Brouka


Department of Computer Systems and Networks
Polotsk State University
Blokhin str., 29, Novopolotsk, Belarus
bogushr@mail.ru, nadzeya.brouka@gmail.com

Abstract— In this paper we propose efficient smoke and flame Motion information provides a key as the precondition to
detection algorithms for intelligent video surveillance systems. locate the possible smoke regions. The algorithm of background
Our algorithms consider dynamic and static features of smoke subtraction is traditionally applied to movement definition in
and flame: contrast, color, texture features and motion. For video sequence [2-5]. Common technique is using adaptive
smoke detection the approach uses motion and contrast as the Gaussian Mixture Model to approximate the background
two key features of smoke. Motion is a primary sign and is used modeling process [2,3]. In [6], optical flow calculation is
at the beginning for extraction from a current frame of candidate applied to detection of movement of a smoke. Lacks of the
areas. In addition to consider a direction of smoke distribution given approach are high sensitivity to noise and high
the movement estimation based on the optical flow is applied. For
computational cost. Algorithms based on color and dynamic
flame detection we use color image segmentation, temporal and
spatial wavelet analyses on the first step. After that color and
characteristics of a smoke are applied for classification of the
texture features for candidate flame regions are extracted. given moving blobs. In [7], the algorithm comparative
Texture features are defined based on normalized gray level co- evaluation of the histogram-based pixel level classification is
occurrence matrix after computation of local binary pattern. considered. In this algorithm the training set of video sequences
Experimental results are presented in the paper. on which there is a smoke is applied to the analysis. Methods
based on preliminary training are dependence of quality of
Keywords— fire detection, background subtraction, contrast classification on a training set. It demands much of qualitative
analysis, wavelet transform, texture segmentation characteristics for processed video images. The area of
decreased high frequency energy component is identified as
I. INTRODUCTION smoke using wavelet transforms [2,3]. However change of
Early fire detection on open spaces, in buildings, in scene illumination can be contours degradation reason.
territories of the industrial enterprises is important making any Therefore such approach requires additional estimations. Color
system of fire safety. Traditional fire detectors which have information is also used for identifying smoke in video. Smoke
been widely applied in the buildings are based on infrared color at different stages of ignition and depending on a burning
sensors, optical sensors, or ion sensors that depend on certain material is distributed in a range from almost transparent white
characteristics of fire, such as smoke, heat, or radiation. Such to saturated gray and black. In [2] decrease in value of
detection approaches require a position of sensor in very close chromatic components U and V of color space YUV is
proximity to fire or smoke and often give out false alarms. So estimated.
they may be not reliable and cannot be applied into open Phillips et al. [8] use color model based on Gaussian
spaces and larger areas. Due to the rapid developments in distribution to the color histogram for flame detection. This
digital camera technology and video processing techniques algorithm employs information gained through both color and
currently intelligent video surveillance systems are installed in temporal variation to detect fire. In [9] flame is detected by
various public places for monitoring, therefore there is a analyzing the video in the wavelet domain in addition to
noticeable trend to use such systems for early fire detection ordinary motion and color clues. The algorithm checks flicker
with special software applied. in flames using 1-D temporal wavelet transform and color
Generally the video processing-based fire detection variation in fire-colored moving regions using 2-D spatial
algorithms are carried out using two principal characteristics of wavelet transform. Töreyin at al. [10] use the Hidden Markov
fire, which are flame and smoke [1]. Video fire detection still Models and the wavelet transform for flickering pixels
has challenges. This is mainly due to the following reasons: detection that indicate the presence of flames. The hidden
diverse background, lighting and none of the primitive image Markov models are used temporally and spatially to determine
features such as intensity, motion, edge and texture if flame colored pixels flicker or not. In [11], video fire
characterizes smoke and flame well. Because, there are several detection algorithm based on the covariance texture
methods developed for video smoke and flame detection based representation method is considered. The algorithm does not
on more features. use a background subtraction method and therefore can be
used with moving cameras, but he works well when the fire is
clearly visible and in close range such that the flicker and
irregular nature of flames are observable. Chenebert at al. [12]
use a combined texture and color based feature descriptor as an
 I ( x, y)  I
t t 1
( x, y)  Tt ( x, y)  &  I t ( x, y)  I t 2 ( x, y)  Tt ( x, y) 
input to a trained classifier based detection boundary. Feature
classification is performed based on isolation of candidate fire where It 2 ( x, y), I t 1 ( x, y), I t ( x, y) values of intensity of pixel
pixel regions using a basic color spectroscopy approach and
combined color-texture classification of these regions using a ( x, y) at time instant t  2, t  1 and t respectively; Tt ( x, y) is
trained classification approach. adaptive threshold for pixel ( x, y) at time instant t calculated
We propose algorithms for smoke and flame detection on as follows:
color video sequences obtained from a stationary camera.
Smoke detection algorithm consists of the following steps:
preprocessing; slowly moving areas and pixels segmentation in  Tt 1 ( x, y )  (1   )(5  I t 1 ( x, y )  Bt 1 ( x, y ) ) 

a current input frame based on adaptive background Tt ( x, y )  if ( x, y ) is moving
subtraction; merge slowly moving areas with pixels into blobs; T ( x, y ), if ( x, y ) is stationary
classification of the blobs obtained before. Flame detection  t 1
algorithm composed of basic steps: candidate flame regions
detection; color and texture features extraction and object At the initial moment of time T0 ( x, y)  const  0 .
classification.
Accurate separating of a foreground object from the
background is the main task of digital matting. Porter and Duff
II. SMOKE DETECTION [14] introduced the blending parameter (so-called alpha
The proposed algorithm uses motion and contrast as the channel) as a solution of this problem and a mean to control the
two key features for smoke detection. The preprocessing block linear combination of foreground and background components.
applies some methods of image processing which increase the Mathematically the current frame I t 1 is modeled as a
performance of the proposed detection algorithm and reduce combination of foreground Ft 1 and background Bt components
false alarms. Frame preprocessing block comprises three steps:
using the blending parameter  :
grayscale transformation, histogram equalization and the
discrete wavelet of the current input frame. Cameras and image It 1 ( x, y)   Ft 1 ( x, y)  (1   ) Bt ( x, y) .
sensors must usually deal not only with the contrast on a scene
but also with the image sensors exposure to the resulting light For opaque objects value of  is equal to 1, for transparent
on that scene. Histogram equalization is a most commonly used objects value of  is equal to 0 and for the semitransparent
method for improvement of contrast image characteristics. To
resize the image and to remove high frequencies on horizontal, objects, such as smoke, value of  lays in a range from 0 to 1.
vertical and diagonal details the discrete wavelet transform to As it is shown further in this section we have experimentally
Haar basis is applied. Wavelet transform to Haar basis is the established the optimum value for  , to be equal to 0.38.
simplest and the fastest algorithm that is important for systems
of video processing. So, as soon as we have obtained Bt component on
In the course of the distribution a smoke is being gradually background update step, current frame I t 1 and set  to 0.38,
blended to the background. Our adaptive algorithm of we can estimate the foreground component Ft 1 . Then we
background subtraction considers this characteristic of a smoke apply the threshold processing to receive the binary
and is based on the ideas stated in works [3,13]. A background foreground Fbin :
image Bt at time instant t is recursively estimated from the
image frame I t 1 and the background image Bt 1 of the video as 1, if ( Ft 1  245)
Fbin  
follows [13]: 0, otherwise
 Bt 1 ( x, y )  (1   ) I t 1 ( x), if ( x, y ) is moving On the next step of smoke detection algorithm to clear of
Bt ( x, y)   noise and to connect of moving blobs the connected
 Bt 1 ( x, y ), if ( x, y ) is stationary components analysis is used. This form of analysis takes in a
where ( x, y) represent a pixel video frame and  is a noisy input foreground. Morphological operations are applied
to reduce the noise:
adaptation parameter between 0 and 1. As the area of a smoke
frame by frame grows slowly that the pixels belonging to a  morphological opening to shrink areas of small
smoke, quickly did not fix in a background, value  should be noise:
close to 1.
S M  (S ()M )  M ,
At the initial moment of time B0 ( x, y)  I 0 ( x, y) . Pixel
where S – image, M - structuring element 3×3;
( x, y) belongs to moving object if the following condition is
satisfied [13]:  morphological closing to rebuild the area of
surviving components that was lost in opening:
S  M  (S  M )()M , where c - the total number of blocks on a current frame, and
Weber contrast Cw :
where M - structuring element 3×3.
1 n Ft 1 ( x, y)  Bt ( x, y)
Then search of all contours is carried out. Then it tosses the Cw   ,
contours that are too small and approximate the rest with n i1 Bt ( x. y )
polygons.
where Ft 1 ( x, y) - value of pixel intensity ( x, y) at time
Blocks matching approach for optical flow calculation
instant t , belonging to a blob, Bt ( x, y) - value of background
assumes that the frame is divided into small regions called
blocks. It considers a primary direction of smoke propagation. pixel intensity ( x, y) at time instant t under blob, n - number
In [15] it is shown, that global direction of smoke is 0-45°. This of the pixels belonging to a blob. If the blob has successfully
statement allows to simplify procedure of blocks matching checked out that we classify it as a smoke. Experimentally
detection and, hence, considerably to reduce number of established values Cw  0,5 and   20 % allow efficient
calculations. Blocks are typically squares and contain some distinguishing a smoke from objects with similar behavior: a
number of pixels. These blocks do not overlap. In our fog, shadows from slowly moving objects and patches of light.
implementation frames in the size 320×240 pixels divided into
blocks 2×2 pixels. Block matching algorithm attempt to divide
both the previous and current frames into such blocks and then III. FLAME DETECTION
compute the motion of these blocks. Each block of size 2×2 Candidate flame regions (CFR) are initially isolated based
can move in eight possible directions. Our implementation on color image segmentation, wavelet analysis and post-
searches in three directions of the original block qxprev
,y
(in the processing for binary mask of CFR. For image segmentation
and flame-colored pixels we use RGB space and rule-set [16]:
previous frame) and compares the candidate new blocks qxcurr
1, y 1
,
qxcurr
, y 1
and qxcurr
1, y 1
(in the current frame) with the original. This  R( x, y )  Rmean
comparison is calculated as follows: 
 Rmean  1  R ( xi , yi )
K

 min( I iprev , I icurr )  K i 1


k{ 1;0;1}
  R ( x, y )  G ( x, y )  B ( x, y )
 max( I , I ) 
prev curr ,j ,j
F (q ,q )
x, y x k , y 1 x , y[2; N ]

prev curr


1.1403 g  0.0759  r  0.9889 g  0.9913
i, j i, j


where I iprev
,j
is the intensity value of pixel on the previous 0.8459b  0.0482  g  0.4608b  0.4954
frame, belonging to the block qxprev
,y
, I icurr
,j
is the intensity value
of pixel on the current frame, belonging to the block qxcurr , N where R( x, y ) , G( x, y) , B( x, y ) are Red, Green and Blue
,y

is count of blocks into which divided the previous and current values of pixel, K is the total number of pixels in image,
frame. The block qxprev in the previous frame will correspond to Rmean is the mean of Red channel of pixels where a change is
,y

the block in the current frame if function F has the maximum not detected and rgb are normalized color space for RGB. The
rgb space can be represented:
value. Optical flow calculation (function F) is done only for the
blocks belonging to the foreground (fig. 1b). The result of this
step is the set of vectors cs having a direction corresponding to r  R / R  G  B, g  G / R  G  B, b  B / R  G  B
primary propagation of smoke (fig. 1c).
We set a binary mask with include fire-colored pixels (fig.2).

(a) (b) (c)

Fig. 1. The current frame (a), the clean up foreground (a) by the connected
(a) (b)
components analysis and the results of optical flow calculation (c)

From each blob from the previous steps we calculate Fig. 2. The input frame (a) and binary mask after image segmentation (b)
percentage  of blocks which have moved in primary
After that, we use one-dimensional temporal wavelet
direction of smoke:
transform for analysis of checks flicker in flames and two-
cs dimensional spatial wavelet transform for analysis of color
 100 %, variation in flame-colored regions. For temporal wavelet
c
analysis each red component of RGB space fire-colored pixel In contrast to work on fire detection [12], texture features
is fed to a two stage-filter bank. If the pixel is part of a flame are calculated for a gray-scale CFR after applying a local
boundary at some time, then there will be several spikes in one binary pattern operator. Ojala et al. [18] introduced the Local
second due to transitions from background colors to flame Binary Pattern (LBP) operator in 1996 as a means of
colors and vice versa [3]. In contrast to work on fire detection summarizing local gray-level structure. It should be noted that
[3], we don’t use moving region detection. the basic LBP features have performed very well in various
Spatial wavelet analysis using low-high (SIlh), high-low applications, including texture classification and segmentation,
(SIhl) and high-high (SIhh) wavelet sub-images are added to image retrieval and surface inspection [19]. The operator takes
obtain these images for parameter calculation of pixel (x,y) [3]: a local neighborhood around each pixel, the pixels of the
neighborhood at the value of the central pixel and uses the
resulting binary valued image patch as a local image
v
1
M  N x, y
2

  SIlh    SI hl    SI hh  ,
2 2
 descriptor. It was originally defined for 3×3 neighborhoods,
giving 8 bit codes based on the 8 pixels around the central one.
LBP code for center pixel p is defined as equation:
where M  N is the number of pixels in the fire-colored
7
moving region. LBPp   2i S ( gi  gc ) ,
As a result we receive a mask for CFR. On a final steps i 0
clearing of noise based on morphological opening and closing,
area filtering by size for mask is used. If the area perimeter is where g c is gray value of p, g i is gray value of i pixels.
equal or more than 1/8 perimeters of a frame, this area is CFR.
S(x) is the threshold function that can be defined as
Texture is an important feature which is applied to image
equation:
segmentation. Texture characterizes the spatial distribution of
color or intensity values of an image. For texture description of  1, if x  0,
flame statistical approach can be used. Haralick [17] suggested S ( x)  
the use of grey level co-occurrence matrices (GLCM) to 0, atherwise
extract second order statistics from an image. This method is For color features CFR we use HSV space which allows us
based on the joint probability distributions of pairs of pixels. to isolate the illumination component of the scene. Hue and
Textural features are calculated with use of co-occurrences Saturation channels are quantized as 20 element normalized
matrix: Pd (i, j )  {((r, s),(t , v)) : I (r, s)  i, I (t , v)  j}, histograms for input as features for classification [12].
where (r, s),(t , v)  N x  N y ; (t , v)  (r  d , s  d ); In the first step is trained classifier. We are used 50 positive
and 50 negative flame images. Sample images from the
d – distance between two next pixels in a direction  . training set are shown in fig. 3. Calculated texture features
(Entropy, Energy, Contrast, Inverse difference moment and
In our work, we will use a set of offsets sweep through 180
Correlation) after applying a LBP operator and color features in
degrees (00, 450, 900 and 1350) and d=1, obtaining four GLCM
HSV space were used for object classification.
matrices. From the co-occurrence matrices, nine Haralick
texture descriptors (entropy, energy, contrast, sum average,
variance, correlation, maximum probability, inverse difference
moment, and cluster tendency) are computed [17]. We use five

such summary statistics based on normalized GLCM N d :

Entropy: E   N d (i, j ) log 2 N d (i, j ),


i j

Energy: En   ( N d (i, j )) ,
2
(a) (b) (c)
i j

Contrast: C   (i  j )2 N d (i, j ),
i j

N d (i, j )
Inverse difference moment: IDM   ,
i j 1 i  j
 (i   )( j   ) N  (i, j)
i j d

Correlation: Cor 
i j
, (d) (e) (f)
 i j
where i   i  N d (i, j ) ,  j   j  N d (i, j ) ,
Fig. 3. Examples for positive (a,b,c) and negative (d,e,f,) flame images

i j i j
For objects classification k-nearest neighbor algorithm is
 i   N d (i, j )(i  i ) ,  j   N d (i, j )( j   j ) .

used. This algorithm is a method for classifying objects based
i j i j on closest training examples in the feature space. In a second
step is performed to assess the quality of training based on test
sample images. We have no overlap between training and
testing images. Training and testing phases are performed once
for classifier configuration.

IV. EXPERIMENTAL RESULTS


The developed algorithms were tested on the real cases.
Test were run on a PC (AMD Athlon (tm) II X2 245, 2,91 (a) (b)
GHz, RAM 2 GB). Our program was implemented using
Visual C++ and an open source computer vision library
OpenCV. The proposed algorithm has been evaluated using
data set publicly available at the web address
http://signal.ee.bilkent.edu.tr/VisiFire/Demo/SampleClips.html,
http://www.openvisor.org, http://cvpr.kmu.ac.kr. Test video
sequences contain a smoke, moving people, moving transport,
a complex dynamic background, and also a number of video
sequences without any smoke/flame. Fig.4 shows some (c) (d)
examples for smoke and flame detection.
Detection results for some of the test sequences are
presented in Table 1.

TABLE I. DETECTION RESULTS FOR SOME OF THE TEST VIDEO


SEQUENCES
The number of
The The flame was
Video frames on which
processing present with / is
sequences there was false (e) (f)
time per found with
(Fig. 4) alarm /total of
frame (ms) (number of frame)
frames
(a) 12.665 10 / 12 0 / 900
(b) 14.786 20 / 112 0 / 244
(c) 14.969 80 / 87 0 / 483
(d) 15.003 30 / 117 0 / 630
(e) 16.346 - 0 / 1073
(f) 14.567 - 0 / 1179
(g) 63 1/125 0/439
(h) 56 1/223 0/1201
(i) 45 1/123 0/411
(g) (h)
(k) 48 -/- 0/530
(l) 42 -/- 0/160
(m) 47 -/- 0/171
For smoke detection processing time of a current frame
depends on the blob sizes and frequency of changes occurring
in a background. If the background is stable and few blobs are
detected then processing time decreases. The smoke has been
found successfully out on all test video sequences with a
smoke.
(i) (k)
Therefore in this case, we cannot directly find out a smoke,
and detection time is increasing. The performed experiments
have shown that the algorithm quickly finds out a smoke on a
complex dynamic scene. Smoke detection is achieved
practically in real time. The processing time per frame is about
15 ms. for frames with sizes of 320 by 240 pixels. The
algorithm considers both dynamic and static features of a
smoke. The algorithm has a low false alarm level. False
alarms on objects with properties similar to a smoke are
(l) (m)
sometimes possible. Tracing of smoky properties during some
frames can solve this problem. Fig. 4. Smoke and flame detection in video
V. CONCLUSION [7] D. Kristinić, T.Jakovčević, D.Stipaničev, ―Histogram-Based Smoke
Segmentation in Forest Fire Detection System‖, Information Technology
We have presented in this paper algorithms for smoke and and Control,2009, 38(3), pp.237-244.
flame detection in video sequences. Our algorithms consider [8] W. Phillips III, M. Shan, N. and V. Lobo, ―Flame Recognition in
dynamic and static features of smoke and flame: contrast, Video,‖ Pattern Recognition Letters, 2002, vol. 23(1-3), pp.319-327.
color, texture features and motion. For smoke detection the [9] B.U. Töreyin, Y. Dedeoglu, U. Güdükbay and A.E. Çetin, ―Computer
vision based method for real-time fire and flame detection‖, Pattern
algorithm uses motion and contrast as the two key features of Recognition Letters, 2006, vol. 27(1),pp.49-58.
smoke. Motion is a primary sign and is used at the beginning [10] B.U. Töreyin, Y. Dedeoglu and Y. Enis-Çetin, ―Flame Detection in
for extraction from a current frame of candidate areas. In Video Using Hidden Markov Models,‖ Proc. IEEE Int. Conf. on Image
addition to consider a direction of smoke distribution the Proc. (ICIP '05), Genoa, Italy, 11–14 September 2005, vol. 2, pp. 1230-
movement estimation based on the optical flow is applied. For 1233
flame detection we use color image segmentation, temporal [11] Y. Habiboglu, O. Gunay and A.E. Cetin, ―Flame detection method in
video using covariance descriptors,‖ Proc. IEEE Int. Conf. on Acoustics,
and spatial wavelet analyses on the first step. After that color Speech and Signal Processing (ICASSP), Prague, Czech Republic, 22-27
and texture features for candidate flame regions are extracted. May 2011, pp. 1817 - 1820
Texture features are defined based on normalized gray level [12] A. Chenebert, T.P. Breckon and A. Gaszczak, ―A non-temporal texture
co-occurrence matrix after computation of local binary driven approach to real-time fire detection,‖ Proc. IEEE Int. Conf. on
pattern. We use Hue and Saturation channels HSV space for Image Processing (ICIP'11), Brussels, Belgium, 11-14 September 2011,
pp. 1781-1784
color features.
[13] R. T.Collins, ―A System for Video Surveillance and Monitoring‖, Proc.
of American Nuclear Society 8th Int. Topical Meeting on Robotics and
REFERENCES Remote Systems, 1999, pp. 68-73
[1] L. Millan-Garcia, G. Sanchez-Perez, M. Nakano, K. Toscano-Medina, [14] T. Porter and T. Duff, Compositing digital images. Computer Graphics,
H. Perez-Meana and L. Rojas-Cardenas, ―An Early Fire Detection 1984, vol.18 (3), pp. 253-259
Algorithm Using IP Cameras,‖ Sensors, 2012, vol. 12(5), pp. 5670-5686.
[15] R. Yasmin, ―Detection of Smoke Propagation Direction Using Color
[2] P. Piccinini, S. Calderara, and R. Cucchiara, ―Reliable smoke detection Video Sequences‖, International Journal of Soft Computing,2009, vol. 4
system in the domains of image energy and color‖, Proc 15th Int. Conf. (1), pp.45-48
on Image Processing, 2008, pp.1376-1379
[16] T. Celik, H. Demirel, H. Ozkaramanli, ―Automatic fire detection in
[3] B.U. Toreyin et al, "Wavelet based real-time smoke detection in video," video sequences,‖ Proc. of 14th European Signal Processing Conference
Signal Processing: Image Communication, EURASIP, Elsevier,2005, (EUSIPCO 2006), Florence, Italy, September 4-8, 2006.
(20), pp.255-256
[17] R. Haralick, ―Statistical and structural approaches to texture,‖. Proc. of
[4] D. Kim and Y. Wang ―Smoke Detection in Video‖, World Congress on the IEEE,1979, vol. 67 (5), pp. 786-804
Computer Science and Information Engineering,2009, pp. 759-763
[18] T. Ojala, M. Pietikäinen and D. Harwood, ―A comparative study of
[5] B. U. Toreyin, Y. Dedeoglu, and A. Cetin ―Contour based smoke texture measures with classification based on feature distributions,‖
detection in video using wavelets‖, Proc. of European Signal Processing Pattern Recognition, 1996, vol. 29, pp. 51-59.
Conf, 2006, pp. 123-128.
[19] G. Zhao and M. Pietikäinen, ―Dynamic texture recognition using local
[6] F. Comez-Rodriuez et al, ―Smoke Monitoring and measurement Using binary patterns with an application to facial expressions,‖ IEEE
Image Processing. Application to Forest Fires‖, Proc. of SPIE Automatic Transactions on Pattern Analysis and Machine Intelligence,2007,vol.
Target Recognation XIII, 2003, pp.404-411. 29(6), pp. 915-928

View publication stats

You might also like