\documentclass[12pt]{beamer} 
% change the alerted colour to blue
%\setbeamercolor{alerted text}{fg=blue}

\usepackage{geometry}
% \usepackage{beamerthemesplit}
\usetheme{Singapore}
% theme split
\usepackage{epsfig}
%\usepackage{times}
\usepackage{subfigure}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{amsthm}
%\usepackage{mathrsfs}
\usepackage{graphicx}
%\usepackage{psfrag}
\usepackage{enumerate}
\usepackage{url}
% theme shadow
\setbeamertemplate{footline}[page number]
\definecolor{bluecolor}{rgb}{0,0,1}
\definecolor{redcolor}{rgb}{1,0,0}
\definecolor{darkredcolor}{rgb}{0.7,0.1,0.2}
\newcommand{\blue}[1]{{\color{bluecolor}#1}}
\newcommand{\red}[1]{{\color{redcolor}#1}}
\newcommand{\darkred}[1]{{\color{darkredcolor}#1}}

\newcommand{\bullettop}[1]{\overset{\bullet}{#1}}
\newcommand{\bullettopDBL}[1]{\overset{\bullet\bullet}{#1}}
\newcommand{\bullettopx}{\bullettop{x}}
\newcommand{\normof}[1]{{\norm #1 \norm}}
\newcommand{\normofx}{{\normof{x}}}

% logo
%\logo{\includegraphics[height=1.5cm]{iit1.jpg}}
\begin{document}
% sf family, bold font
%\sffamily 
%\bfseries
%\LARGE
\title{\textbf{Image Processing Using Scilab}}
\author[Anuradha]{Anuradha Amrutkar}

\institute{ Indian Institute of Technology Bombay \\
anuradha.amrutkar@gmail.com\\}

\date{Janauary 5, 2012}

\begin{frame}
   \titlepage
\end{frame}

\section{Introduction}
\begin{frame}{Introduction to Digital Images}
 \begin{itemize}
  \item Images can be Grayscale or Color (RGB)
  \item Specified as a matrix of size M $\times$ N $\times$ 3 (M $\times$ N for grayscale)
 \end{itemize}

\end{frame}

\begin{frame}{Image Processing in Scilab}
 \begin{itemize}
  \item Toolboxes - SIP (Scilab Image Processing) , SIVP (Scilab Image \& Video Processing), IPD (Image Processing Design Toolbox)
  \item We focus on SIVP Toolbox
  \item Installation in Ubuntu Linux - SIVP and IPD through atoms (5.3 onwards)
  \item Installation in Windows - SIVP and IPD through atoms (5.3 onwards)
 \end{itemize}
\end{frame}

\begin{frame}{Grayscale and Color Images}
 		\setcounter{subfigure}{0}  
		\begin{figure}
		\subfigure[Gray Scale Image]{\includegraphics[width=0.32\linewidth]{NewCodes/lena.jpg}}
		\subfigure[Color Image]{\includegraphics[width=0.32\linewidth]{NewCodes/bab.png}}
		\end{figure}
\end{frame}

\begin{frame}{Image Read/Write/Show}
 \begin{enumerate}
  \item Read Image - $lena=imread('lenagray.jpg')$
  \item Show Image - $figure; imshow(lena)$
  \item Write Image - $imwrite(lena,'lena.png')$
 \end{enumerate}
\end{frame}

\begin{frame}{Image Datatype Conversions}
 \begin{itemize}
  \item im2int8
  \item im2int16
  \item im2int32
  \item im2uint8
  \item im2uint16
  \item im2double
 \end{itemize}

\end{frame}




\begin{frame}{Image Conversions}
$-->babbon=imread('bab.png');$
 \begin{itemize}
  \item RGB to Gray scale - rgb2gray $-->babgray=rgb2gray(babbon);$
  \item RGB to Binary - im2bw $-->lenabw=im2bw(lena,0.5);$ $-->imwrite(lenabw, 'lenabw.png');$
  \item RGB to HSV format - rgb2hsv
  \item HSV to RGB format - hsv2rgb
  \item RGB to YCbCr - rgb2ycbcr
  \item YCbCr to RGB - ycbcr2rgb
 \end{itemize}
\end{frame}
 \begin{frame}{Image Conversions - Results}
  \setcounter{subfigure}{0}  
	\begin{figure}
	\subfigure[$rgb2gray(babbon);$]{\includegraphics[width=0.35\linewidth]{NewCodes/babgray.png}}
	\subfigure[$im2bw(lena,0.5);$]{\includegraphics[width=0.35\linewidth]{NewCodes/lenabw.png}}
	\end{figure}
 \end{frame}
		
\begin{frame}{Basic Operations}
\begin{itemize}
 \item Crop - $-->lenacrop=imcrop(lena, [200, 200, 200, 200]); $
 \item Complement - $-->lenacomp=imcomplement(lena);$
 \item Resize - $-->lenaresize=imresize(lena,2,'bicubic');$ 
\begin{itemize}
 \item The last term can be 'nearest', 'bilinear', 'bicubic' or 'area'
\end{itemize}
\end{itemize}
 
\end{frame}

\begin{frame}{Basic Operations - Complement}
       \setcounter{subfigure}{0}  
	\begin{figure}
%	\subfigure[$imcrop(lena,[200, 200, 200, 200]);$]{\includegraphics[width=0.35\linewidth]{NewCodes/lenacrop.png}}
	\subfigure[Original]{\includegraphics[width=0.35\linewidth]{NewCodes/lena.jpg}}
	\subfigure[Complement]{\includegraphics[width=0.35\linewidth]{NewCodes/lenacomp.png}}	
	\end{figure}
\end{frame}
\begin{frame}{Basic Operations - Crop}
       \setcounter{subfigure}{0}
	\begin{figure}
	\subfigure[Original]{\includegraphics[width=0.35\linewidth]{NewCodes/lena.jpg}}
	\subfigure[Cropped]{\includegraphics[width=0.2\linewidth]{NewCodes/lenacrop.png}}
	\end{figure}
\end{frame}
\begin{frame}{Basic Operations - Resize}
       \setcounter{subfigure}{0}  
	\begin{figure}
	\subfigure[Original]{\includegraphics[width=0.173\linewidth]{NewCodes/lena.jpg}}
	\subfigure[Resize by 2]{\includegraphics[width=0.35\linewidth]{NewCodes/lenaresize.png}}
	\end{figure}
 \end{frame}

%\section{Image Degradation}

\begin{frame}{Add Noise}
 $-->lenaNgaussian=imnoise(lena,'gaussian');$\\
The noise can be one of these:
\begin{enumerate}
 \item salt \& Pepper - white/black noise (default probability d=0.05)
 \item speckle - multiplicative noise (uniform with mean 0 and variance v=0.04)
 \item gaussian - additive noise (with mean 0 and variance v=0.01)
\end{enumerate}

\end{frame}

\begin{frame}{Add Noise - Results}
       \setcounter{subfigure}{0}
	\begin{figure}
	\subfigure[Original]{\includegraphics[width=0.28\linewidth]{NewCodes/lena.jpg}}
	\subfigure[Salt \& Pepper]{\includegraphics[width=0.28\linewidth]{NewCodes/lenaNsaltpepper.png}}
	\subfigure[Speckle]{\includegraphics[width=0.28\linewidth]{NewCodes/lenaNspeckle.png}}
	\subfigure[Gaussian]{\includegraphics[width=0.28\linewidth]{NewCodes/lenaNgaussian.png}}
	\end{figure}
\end{frame}




\section{Conclusion}
\begin{frame}{Advanced Topics - To be Explored}
 \begin{itemize}
  \item FFT
  \item Wavelets
  \item Radon Transform
  \item Hough Transform
 \end{itemize}

\end{frame}
%\begin{frame}{Recap}
% \begin{enumerate}
 % \item Read/Write/Show Image
  %\item Basic Operations
  %\item Noise and Blur
%  \item LTI Filtering
%  \item Image as a Matrix
%  \item Transform Domain Operations
% \end{enumerate}
%\end{frame}
\begin{frame}[fragile]
 \frametitle{Thank You!!}\pause
\begin{itemize}
\item Thank You!
%\item Good Bye
\end{itemize}
\end{frame}
\end{document}
