%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Beamer Presentation
% LaTeX Template
% Version 1.0 (10/11/12)
%
% This template has been downloaded from:
% http://www.LaTeXTemplates.com
%
% License:
% CC BY-NC-SA 3.0 (http://creativecommons.org/licenses/by-nc-sa/3.0/)
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%----------------------------------------------------------------------------------------
%	PACKAGES AND THEMES
%----------------------------------------------------------------------------------------

\documentclass{beamer}

\mode<presentation> {

% The Beamer class comes with a number of default slide themes
% which change the colors and layouts of slides. Below this is a list
% of all the themes, uncomment each in turn to see what they look like.

%\usetheme{default}
%\usetheme{AnnArbor}
%\usetheme{Antibes}
%\usetheme{Bergen}
%\usetheme{Berkeley}
%\usetheme{Berlin}
%\usetheme{Boadilla}
%\usetheme{CambridgeUS}
%\usetheme{Copenhagen}
%\usetheme{Darmstadt}
%\usetheme{Dresden}
%\usetheme{Frankfurt}
%\usetheme{Goettingen}
%\usetheme{Hannover}
%\usetheme{Ilmenau}
%\usetheme{JuanLesPins}
\usetheme{Luebeck}
%\usetheme{Madrid}
%\usetheme{Malmoe}
%\usetheme{Marburg}
%\usetheme{Montpellier}
%\usetheme{PaloAlto}
%\usetheme{Pittsburgh}
%\usetheme{Rochester}
%\usetheme{Singapore}
%\usetheme{Szeged}
%\usetheme{Warsaw}

% As well as themes, the Beamer class has a number of color themes
% for any slide theme. Uncomment each of these in turn to see how it
% changes the colors of your current slide theme.

%\usecolortheme{albatross}
%\usecolortheme{beaver}
%\usecolortheme{beetle}
%\usecolortheme{crane}
%\usecolortheme{dolphin}
%\usecolortheme{dove}
%\usecolortheme{fly}
%\usecolortheme{lily}
%\usecolortheme{orchid}
%\usecolortheme{rose}
%\usecolortheme{seagull}
%\usecolortheme{seahorse}
%\usecolortheme{whale}
%\usecolortheme{wolverine}

%\setbeamertemplate{footline} % To remove the footer line in all slides uncomment this line
%\setbeamertemplate{footline}[page number] % To replace the footer line in all slides with a simple slide count uncomment this line

%\setbeamertemplate{navigation symbols}{} % To remove the navigation symbols from the bottom of all slides uncomment this line
}

\usepackage{graphicx} % Allows including images
\usepackage{booktabs} % Allows the use of \toprule, \midrule and \bottomrule in tables

%----------------------------------------------------------------------------------------
%	TITLE PAGE
%----------------------------------------------------------------------------------------

\title[Short title]{Real Time Image Segmentation} % The short title appears at the bottom of every slide, the full title is only on the title page

\author{Miklos Homolya, Ravikishore Kommajosyula, Gaurav Kukreja} % Your name
\institute[TUM] % Your institution as it will appear on the bottom of every slide, may be shorthand to save space
{
Technical University of Munich \\ % Your institution for the title page
\medskip
}
\date{\today} % Date, can be changed to a custom date

\begin{document}

\begin{frame}
\titlepage % Print the title page as the first slide
\end{frame}

\begin{frame}
\frametitle{Overview} % Table of contents slide, comment this block out to remove it
\tableofcontents % Throughout your presentation, if you choose to use \section{} and \subsection{} commands, these will automatically be printed on this slide as an overview of your presentation
\end{frame}

%----------------------------------------------------------------------------------------
%	PRESENTATION SLIDES
%----------------------------------------------------------------------------------------

%------------------------------------------------
\section{Introduction} % Sections can be created in order to organize your presentation into discrete blocks, all sections and subsections are automatically printed in the table of contents as an overview of the talk
%------------------------------------------------

\begin{frame}
\frametitle{Problem Definition}

\end{frame}

%------------------------------------------------
%------------------------------------------------

\section{Algorithm}

\subsection{Binary Image Segmentation}

\begin{frame}
  \frametitle{Binary Image Segmentation}

  Energy functional
  \begin{equation*}
    E_1(u) := \int_{{\rm I\!R}^N} \left| \nabla u \right|
    + \lambda \int_{{\rm I\!R}^N} \left| u(x) - f(x) \right| \, dx
  \end{equation*}

  Functional derivative
  \begin{equation*}
    \frac{\delta E_1}{\delta u} = - \, \mathrm{div} \left( {\frac{\nabla u}{| \nabla u |}} \right)
    + \lambda \frac{u - f}{|u - f|}
  \end{equation*}

  Gradient descent solver \\~\\

  \begin{thebibliography}{99}
  \bibitem[Chan, 2005]{} Tony F. Chan, Selim Esedoglu and Mila Nikolova (2005)
    \newblock Finding the Global Minimum for Binary Image Restoration
  \end{thebibliography}
\end{frame}

\begin{frame}
  \frametitle{Sample Result}

\end{frame}

\subsection{Grayscale Image Segmentation}

\begin{frame}
  \frametitle{Grayscale Image Segmentation}

  Euler-Lagrange equation
  \begin{equation*}
    \mathrm{div} \left( {\frac{\nabla u}{| \nabla u |}} \right)
    - \lambda \, s(x) - \alpha \, \nu'(u) = 0
  \end{equation*}
  where $ s(x) = (c_1 - f(x))^2 - (c_2 - f(x))^2 $, and $ \alpha \, \nu'(u) $ forces $ u $ into $ [0; 1] $.
  \\~\\
  Gradient descent solver
  \\~\\
  \begin{thebibliography}{99}
  \bibitem[Chan, 2004]{} Tony F. Chan, Selim Esedoglu and Mila Nikolova (2004)
    \newblock Algorithms for Finding Global Minimizers of Image Segmentation and Denoising Models
  \end{thebibliography}
\end{frame}

\begin{frame}
  \frametitle{Sample Result}

\end{frame}

\subsection{Primal-Dual Method}

\begin{frame}
  \frametitle{Primal-Dual Method}
  \emph{Motivation:} Gradient descent solver has slow convergence.
  \\~\\
  Primal variable $ u $

  Dual variable $ \xi $ (roughly similar to $ \mathrm{grad} \, u $):
\end{frame}

\section{CUDA Implementation}

\begin{frame}
  \frametitle{CUDA Implementation}
  \begin{itemize}
  \item Update kernels calls from CPU to have synchrionzation

  \item Update X and update U implemented as two kernels

  \item Image arrays swapped after each iteration

  \item Branching to avoid invalid memory accesses
  
  \end{itemize}

\end{frame}

\section{Optimizations}


\subsection{Texture Memory}

\begin{frame}
  \frametitle{CUDA Implementation}
  \begin{itemize}
  \item Swapping images after each iteration makes things difficult

  \item Can not be used in gradient calculation, Can be used in divergence calculation

  \item Texture memory used on intermediate results $ X_i $ and $ X_j $
  
  \item Improves the fps by 12 \%
  
  \end{itemize}

\end{frame}

\subsection{OpenGL Interoperability}


\begin{frame}
\frametitle{References}
\footnotesize{
\begin{thebibliography}{99} % Beamer does not support BibTeX so references must be inserted manually as below
\bibitem[Smith, 2012]{p1} John Smith (2012)
\newblock Title of the publication
\newblock \emph{Journal Name} 12(3), 45 -- 678.
\end{thebibliography}
}
\end{frame}

%------------------------------------------------

\begin{frame}
\Huge{\centerline{The End}}
\end{frame}

%----------------------------------------------------------------------------------------

\end{document} 
