\documentclass[envcountsect]{beamer}
%\includegraphics[height=6cm](full frame)
\usepackage{times,multimedia}
\usepackage{amsfonts,eucal}
%\usetheme{JuanLesPins}
\usetheme{Darmstadt}
%Frankfurt}
%\logo{\includegraphics[height=20px]{img/jmm2012.png}}
\title{Smoke Detection in Stationary Video Using Wavelets}
\institute{{\large Helmut Knaust}\medskip\\Department of Mathematical Sciences\\The University of Texas at El Paso\\El Paso TX 79968-0514\medskip\\\tt{hknaust@utep.edu}}
\date{{\small January 6, 2012}}
\setbeamertemplate{theorems}[normal font]
\newtheorem{defi}{Definition}
\newtheorem{con}[defi]{Conjecture}
\newtheorem{thm}[defi]{Theorem}
\newcommand{\field}[1]{\mathbb{#1}}
\newcommand{\nat}{\field{N}}
\newcommand{\zet}{\field{Z}}
\newcommand{\real}{\field{R}}
\newcommand{\rat}{\field{Q}}
\newcommand{\cpl}{\field{C}}
\newcommand{\ilf}[1]{$\displaystyle #1 $}
\renewcommand\thefootnote{\fnsymbol{footnote}}

\begin{document}
\begin{frame}
\titlepage
\begin{center}
\begin{figure}
\includegraphics[width=8cm]{img/jmm2012.png}
\end{figure}
\end{center}
\end{frame}

%\begin{frame}
%\tableofcontents[hideallsubsections]
%\end{frame}

\section{Introduction}

\subsection{The Problem}
\begin{frame}
The Problem:\bigskip
\begin{center}
VIDEO: \bigskip

\movie[autostart,externalviewer]{\includegraphics[width=5cm]{img/poster1.png}}{video/sBtFence2.avi}
\end{center}
\end{frame}

\subsection{Fire/Smoke Detection Techniques}
\begin{frame}
Standard techniques for fire or smoke detection:
\begin{itemize}
\item Indoor smoke detectors
\begin{itemize}
\item ionization
\item photoelectric
\item air-sampling
\item $CO$ or $CO_2$ sensors
\end{itemize}
\item Infra-red sensors/cameras
\end{itemize}
\end{frame}

\begin{frame}
Techniques for fire/smoke detection with stationary video:
\begin{itemize}
\item Fourier analysis - using the flickering of flames
\item Luminance/chrominance energy measurements (for color videos)
\item A wavelet technique - high frequency energy measurements 
\end{itemize}
\end{frame}

\subsection{Prerequisites}
\begin{frame}
Prerequisites for students are quite minimal:
\begin{itemize}
\item Basics of Digital Signal Processing
\item Some knowledge of the basic wavelet transforms and their application to digital images
\item Familiarity with \emph{Mathematica} or \emph{MatLab}
\end{itemize}
\end{frame}

\subsection{Student Outcomes}
\begin{frame}
Expected Student Outcomes:
\begin{itemize}
\item Students will get a flavor of the ideas and issues involved in applying mathematics to a relevant engineering problem.
\item Students will develop a deeper understanding of wavelet transforms and their applications.
\item Students will improve their programming skills.
\end{itemize}
\end{frame}

\section{Luminance and Chrominance}
\subsection{Theory}
\begin{frame}
Each pixel in a gray-scale image is represented by an integer between $0$ and $255=2^8-1$ (8 bit = 1 byte)\medskip\\
0=black, 255=white
\begin{columns}[c]
\column{4cm}
\begin{figure}
\includegraphics[width=4cm]{img/pix1.png}
\end{figure}
\column{6cm}
\begin{figure}
\includegraphics[width=6cm]{img/pix2.png}
\end{figure}
\end{columns}
\end{frame}

\begin{frame}
A color image consists of three color channels: Red, Green and Blue
\begin{figure}
\includegraphics[width=3.5cm]{img/cups.png}
\end{figure}
\begin{columns}[c]
\column{4cm}
\begin{figure}
\includegraphics[width=3.5cm]{img/cupsr.png}
\end{figure}
\begin{center}R\end{center}
\column{4cm}
\begin{figure}
\includegraphics[width=3.5cm]{img/cupsg.png}
\end{figure}
\begin{center}G\end{center}
\column{4cm}
\begin{figure}
\includegraphics[width=3.5cm]{img/cupsb.png}
\end{figure}
\begin{center}B\end{center}
\end{columns}
\end{frame}


\begin{frame}
The Red, Green and Blue color channels can be thought of as grayscale images:
\begin{figure}
\includegraphics[width=3.5cm]{img/cups.png}
\end{figure}
\begin{columns}[c]
\column{4cm}
\begin{figure}
\includegraphics[width=3.5cm]{img/cupsr_g.png}
\end{figure}
\begin{center}R\end{center}
\column{4cm}
\begin{figure}
\includegraphics[width=3.5cm]{img/cupsg_g.png}
\end{figure}
\begin{center}G\end{center}
\column{4cm}
\begin{figure}
\includegraphics[width=3.5cm]{img/cupsb_g.png}
\end{figure}
\begin{center}B\end{center}
\end{columns}
\end{frame}

\begin{frame}
For many applications it is more useful to split the color information into a \textbf{luminance} channel (Y) and two \textbf{chrominance} channels (Cb and Cr) instead:
\begin{figure}
\includegraphics[width=3.5cm]{img/cups.png}
\end{figure}
\begin{columns}[c]
\column{4cm}
\begin{figure}
\includegraphics[width=3.5cm]{img/cupsY.png}
\end{figure}
\begin{center}Y\end{center}
\column{4cm}
\begin{figure}
\includegraphics[width=3.5cm]{img/cupsCb.png}
\end{figure}
\begin{center}Cb\end{center}
\column{4cm}
\begin{figure}
\includegraphics[width=3.5cm]{img/cupsCr.png}
\end{figure}
\begin{center}Cr\end{center}
\end{columns}
\end{frame}

\begin{frame}
\textbf{Energy} is a measurement of the brightness of a grayscale image.

For a matrix $A=(a_{ij})$, its energy $E(A)$ is defined as \[E(A)=\sum_i\sum_j a_{ij}^2.\] 
(This is just the square of the 2-norm of $A$.)

A brighter image will have higher energy than a darker one. 
\end{frame}

\subsection{Application}
\begin{frame}
\textbf{Smoke Detection Idea \#1:}

\textbf{Smoke makes an image grayer and less colorful.} \bigskip

Thus an increase in the ratio between the energy of the luminance channel and the combined energy of the chrominance channels should be an indicator for the presence of smoke. 
\end{frame}

\begin{frame}
\begin{center}
VIDEO: Luminance vs. Chrominance Energy Ratio:\bigskip

\movie[autostart,externalviewer]{\includegraphics[width=5cm]{img/poster1b.png}}{video/LvC.mp4}
\end{center}
\end{frame}


\section{High Frequency Content}
\subsection{Theory}
\begin{frame}
Our next technique works for grayscale videos. In case of a color video, we will use its luminance channel.

Wavelet transforms separate the low-frequency content of an image from the high-frequency content.
\begin{columns}[c]
\column{5cm}
\begin{figure}
\includegraphics[width=5cm]{img/prewave.png}
\end{figure}
\column{5cm}
\begin{figure}
\includegraphics[width=5cm]{img/wave.png}
\end{figure}
\end{columns}
\end{frame}

\subsection{Applications}
\begin{frame}
\textbf{Smoke Detection Idea \#2:}

\textbf{Smoke obscures edges.}\bigskip 

Thus a decrease in the combined energy of the high-frequency portions of an image should be an indicator for the presence of smoke. 

(Note that this will detect smoke only if edges are present.)
\end{frame}

\begin{frame}
\begin{center}
VIDEO: High-frequency Energy:\bigskip

\movie[autostart,externalviewer]{\includegraphics[width=5cm]{img/poster2.png}}{video/hfenergy.mp4}
\end{center}
\end{frame}

\begin{frame}
 This technique can be refined to identify smoke regions within the video images.
\begin{enumerate}
\item Each image is partitioned into sub-images of size $8\times 8$ pixels each.
\begin{columns}[c]
\column{5cm}
\begin{figure}
\includegraphics[width=5cm]{img/region1.png}
\end{figure}
\column{5cm}
\begin{figure}
\includegraphics[width=5cm]{img/region2.png}
\end{figure}
\end{columns}\end{enumerate}
\end{frame}

\begin{frame}
\begin{enumerate}
\addtocounter{enumi}{1}
\item The wavelet transform is computed for each sub-image.
\item The energy of the high-frequency portions is computed for each sub-image.
\item The first (smoke-less) frame of the video is now used as a reference frame.
\end{enumerate}
\end{frame}

\begin{frame}
\begin{enumerate}
\addtocounter{enumi}{4}
\item The energies computed are subtracted from the corresponding energy values of the reference frame.
\item The result is visualized. 
\begin{itemize}
\item If the high-frequency energy of a region decreases, a positive value will result in Step~5, leading to a bright pixel.
\item If the high-frequency energy of a region increases or remains unchanged, a non-positive value is computed in Step~5, leading to a black pixel.  
\end{itemize}
\end{enumerate}
\end{frame}

\begin{frame}
\begin{center}
VIDEO: High-frequency Energy:\bigskip

\movie[autostart,externalviewer]{\includegraphics[width=5cm]{img/region1.png}}{video/region.mp4}
\end{center}
\end{frame}


\section{References}
\begin{frame}
References
\begin{itemize}
\item B.~Ugur Toreyin, Yigithan Dedeoglu \& A.~Enis Cetin: \emph{Contour Based Smoke Detection In Video Using Wavelets.} 
Proceedings of the 14th European Signal Processing Conference (EUSIPCO 2006).
\item Videos: http://signal.ee.bilkent.edu.tr/VisiFire/Demo/SampleClips.html
\item Video frame extraction program: VirtualDub-1.9.11
\end{itemize}
\vfill
{\tiny last edit: 4/11/2024}
\end{frame}

\end{document}
