This commit is contained in:
Nguyễn Anh Khoa
2019-05-14 22:37:19 +07:00
commit a43837539e
250 changed files with 26352 additions and 0 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
resource/IPCV/2-3/_DS_Store Normal file

Binary file not shown.

BIN
resource/IPCV/4-5/DCT.pdf Normal file

Binary file not shown.

BIN
resource/IPCV/4-5/FFT.pdf Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 148 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 141 KiB

View File

@ -0,0 +1,236 @@
% Copyright 2007 by Till Tantau
%
% This file may be distributed and/or modified
%
% 1. under the LaTeX Project Public License and/or
% 2. under the GNU Public License.
%
% See the file doc/licenses/LICENSE for more details.
% Common packages
\usepackage[utf8x]{inputenc}
\usepackage[vietnam,english]{babel}
\usepackage[utf8]{vietnam}
%\usepackage{times}
\usefonttheme[onlymath]{serif}
\usecolortheme{default}
\usepackage{booktabs}
\usepackage{mathpartir}
\usepackage{listings}
\usepackage{listingsutf8}
\usepackage{pbox}
\mprset{flushleft}
\mode<article>
{
\usepackage{times}
\usepackage{mathptmx}
\usepackage[left=1.5cm,right=6cm,top=1.5cm,bottom=3cm]{geometry}
}
\usepackage{hyperref}
\usepackage{tikz}
\usetikzlibrary{arrows,backgrounds}
%\tikzstyle{mnode}=[circle, draw, fill=black, inner sep=0pt, minimum width=4pt]
\usepackage{colortbl}
%\usepackage{yfonts}
\usepackage{translator} % comment this, if not available
% Common settings for all lectures in this course
\def\lecturename{Image Processing and Computer Vision}
\title{\insertlecture}
\author{\textbf{LE Thanh Sach}}
\institute
{
\textit{Faculty of Computer Science and Engineering}\\
\textit{Ho Chi Minh University of Technology, VNU-HCM}
}
\subject{Lecturer \lecturename}
% Beamer version theme settings
\useoutertheme[height=0pt,width=2cm,right]{sidebar}
\usecolortheme{rose,sidebartab}
\useinnertheme{circles}
\usefonttheme[only large]{structurebold}
\setbeamercolor{sidebar right}{bg=black!15}
\setbeamercolor{structure}{fg=blue}
\setbeamercolor{author}{parent=structure}
\setbeamerfont{title}{series=\normalfont,size=\LARGE}
\setbeamerfont{title in sidebar}{series=\bfseries}
\setbeamerfont{author in sidebar}{series=\bfseries}
\setbeamerfont*{item}{series=}
\setbeamerfont{frametitle}{size=}
\setbeamerfont{block title}{size=\small}
\setbeamerfont{subtitle}{size=\normalsize,series=\normalfont}
\setbeamertemplate{navigation symbols}{}
\setbeamertemplate{bibliography item}[book]
\setbeamertemplate{sidebar right}
{
{\usebeamerfont{title in sidebar}%
\vskip1.5em%
\hskip3pt%
\usebeamercolor[fg]{title in sidebar}%
\insertshorttitle[width=2cm,center,respectlinebreaks]\par%
\vskip1.25em%
}%
{%
\hskip3pt%
\usebeamercolor[fg]{author in sidebar}%
\usebeamerfont{author in sidebar}%
\insertshortauthor[width=2cm,center,respectlinebreaks]\par%
\vskip1.25em%
}%
\hbox to2cm{\hss\insertlogo\hss}
\vskip1.25em%
\insertverticalnavigation{2cm}%
\vfill
\hbox to 2cm{\hfill\usebeamerfont{subsection in
sidebar}\strut\usebeamercolor[fg]{subsection in
sidebar}\insertshortlecture.\insertframenumber\hskip5pt}%
\vskip3pt%
}%
\setbeamertemplate{title page}
{
\vbox{}
\vskip1em
{\huge Chapter \insertshortlecture\par}
{\usebeamercolor[fg]{title}\usebeamerfont{title}\inserttitle\par}%
\ifx\insertsubtitle\@empty%
\else%
\vskip0.25em%
{\usebeamerfont{subtitle}\usebeamercolor[fg]{subtitle}\insertsubtitle\par}%
\fi%
\vskip1em\par
\emph{\lecturename}\
%on \insertdate\par
\vskip3em\par
\leftskip=0pt plus1fill\insertauthor\par
\insertinstitute\vskip1em
}
\logo{\includegraphics[width=1.5cm]{hcmut.png}}
% Article version layout settings
\mode<article>
\makeatletter
\def\@listI{\leftmargin\leftmargini
\parsep 0pt
\topsep 5\p@ \@plus3\p@ \@minus5\p@
\itemsep0pt}
\let\@listi=\@listI
\setbeamertemplate{frametitle}{\paragraph*{\insertframetitle\
\ \small\insertframesubtitle}\ \par
}
\setbeamertemplate{frame end}{%
\marginpar{\scriptsize\hbox to 1cm{\sffamily%
\hfill\strut\insertshortlecture.\insertframenumber}\hrule height .2pt}}
\setlength{\marginparwidth}{1cm}
\setlength{\marginparsep}{4.5cm}
\def\@maketitle{\makechapter}
\def\makechapter{
\newpage
\null
\vskip 2em%
{%
\parindent=0pt
\raggedright
\sffamily
\vskip8pt
{\fontsize{36pt}{36pt}\selectfont Chapter \insertshortlecture \par\vskip2pt}
{\fontsize{24pt}{28pt}\selectfont \color{blue!50!black} \insertlecture\par\vskip4pt}
{\Large\selectfont \color{blue!50!black} \insertsubtitle\par}
\vskip10pt
\normalsize\selectfont Print version of
Lecturer \emph{\lecturename} of \@date\par\vskip1.5em
\hfill Le Thanh Sach and Luong The Nhan, Faculty of CSE, HCMC University of Technology
}
\par
\vskip 1.5em%
}
\let\origstartsection=\@startsection
\def\@startsection#1#2#3#4#5#6{%
\origstartsection{#1}{#2}{#3}{#4}{#5}{#6\normalfont\sffamily\color{blue!50!black}\selectfont}}
\makeatother
\mode
<all>
% Typesetting Listings
\usepackage{listings}
\lstset{language=Java}
\alt<presentation>
{\lstset{%
basicstyle=\footnotesize\ttfamily,
commentstyle=\slshape\color{green!50!black},
keywordstyle=\bfseries\color{blue!50!black},
identifierstyle=\color{blue},
stringstyle=\color{orange},
escapechar=\#,
emphstyle=\color{red}}
}
{
\lstset{%
basicstyle=\ttfamily,
keywordstyle=\bfseries,
commentstyle=\itshape,
escapechar=\#,
emphstyle=\bfseries\color{red}
}
}
% Common theorem-like environments
\theoremstyle{example}
\newtheorem{exercise}[theorem]{\translate{Exercise}}
% New useful definitions:
\newbox\mytempbox
\newdimen\mytempdimen
\newcommand\includegraphicscopyright[3][]{%
\leavevmode\vbox{\vskip3pt\raggedright\setbox\mytempbox=\hbox{\includegraphics[#1]{#2}}%
\mytempdimen=\wd\mytempbox\box\mytempbox\par\vskip1pt%
\fontsize{3}{3.5}\selectfont{\color{black!25}{\vbox{\hsize=\mytempdimen#3}}}\vskip3pt%
}}
\newenvironment{colortabular}[1]{\medskip\rowcolors[]{1}{blue!20}{blue!10}\tabular{#1}\rowcolor{blue!40}}{\endtabular\medskip}
\def\equad{\leavevmode\hbox{}\quad}
\newenvironment{greencolortabular}[1]
{\medskip\rowcolors[]{1}{green!50!black!20}{green!50!black!10}%
\tabular{#1}\rowcolor{green!50!black!40}}%
{\endtabular\medskip}

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 140 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 214 KiB

View File

@ -0,0 +1,446 @@
% Mathpartir --- Math Paragraph for Typesetting Inference Rules
%
% Copyright (C) 2001, 2002, 2003, 2004, 2005 Didier R<>my
%
% Author : Didier Remy
% Version : 1.2.0
% Bug Reports : to author
% Web Site : http://pauillac.inria.fr/~remy/latex/
%
% Mathpartir is free software; you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation; either version 2, or (at your option)
% any later version.
%
% Mathpartir is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details
% (http://pauillac.inria.fr/~remy/license/GPL).
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% File mathpartir.sty (LaTeX macros)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{mathpartir}
[2005/12/20 version 1.2.0 Math Paragraph for Typesetting Inference Rules]
%%
%% Identification
%% Preliminary declarations
\RequirePackage {keyval}
%% Options
%% More declarations
%% PART I: Typesetting maths in paragraphe mode
%% \newdimen \mpr@tmpdim
%% Dimens are a precious ressource. Uses seems to be local.
\let \mpr@tmpdim \@tempdima
% To ensure hevea \hva compatibility, \hva should expands to nothing
% in mathpar or in inferrule
\let \mpr@hva \empty
%% normal paragraph parametters, should rather be taken dynamically
\def \mpr@savepar {%
\edef \MathparNormalpar
{\noexpand \lineskiplimit \the\lineskiplimit
\noexpand \lineskip \the\lineskip}%
}
\def \mpr@rulelineskip {\lineskiplimit=0.3em\lineskip=0.2em plus 0.1em}
\def \mpr@lesslineskip {\lineskiplimit=0.6em\lineskip=0.5em plus 0.2em}
\def \mpr@lineskip {\lineskiplimit=1.2em\lineskip=1.2em plus 0.2em}
\let \MathparLineskip \mpr@lineskip
\def \mpr@paroptions {\MathparLineskip}
\let \mpr@prebindings \relax
\newskip \mpr@andskip \mpr@andskip 2em plus 0.5fil minus 0.5em
\def \mpr@goodbreakand
{\hskip -\mpr@andskip \penalty -1000\hskip \mpr@andskip}
\def \mpr@and {\hskip \mpr@andskip}
\def \mpr@andcr {\penalty 50\mpr@and}
\def \mpr@cr {\penalty -10000\mpr@and}
\def \mpr@eqno #1{\mpr@andcr #1\hskip 0em plus -1fil \penalty 10}
\def \mpr@bindings {%
\let \and \mpr@andcr
\let \par \mpr@andcr
\let \\\mpr@cr
\let \eqno \mpr@eqno
\let \hva \mpr@hva
}
\let \MathparBindings \mpr@bindings
% \@ifundefined {ignorespacesafterend}
% {\def \ignorespacesafterend {\aftergroup \ignorespaces}
\newenvironment{mathpar}[1][]
{$$\mpr@savepar \parskip 0em \hsize \linewidth \centering
\vbox \bgroup \mpr@prebindings \mpr@paroptions #1\ifmmode $\else
\noindent $\displaystyle\fi
\MathparBindings}
{\unskip \ifmmode $\fi\egroup $$\ignorespacesafterend}
\newenvironment{mathparpagebreakable}[1][]
{\begingroup
\par
\mpr@savepar \parskip 0em \hsize \linewidth \centering
\mpr@prebindings \mpr@paroptions #1%
\vskip \abovedisplayskip \vskip -\lineskip%
\ifmmode \else $\displaystyle\fi
\MathparBindings
}
{\unskip
\ifmmode $\fi \par\endgroup
\vskip \belowdisplayskip
\noindent
\ignorespacesafterend}
% \def \math@mathpar #1{\setbox0 \hbox {$\displaystyle #1$}\ifnum
% \wd0 < \hsize $$\box0$$\else \bmathpar #1\emathpar \fi}
%%% HOV BOXES
\def \mathvbox@ #1{\hbox \bgroup \mpr@normallineskip
\vbox \bgroup \tabskip 0em \let \\ \cr
\halign \bgroup \hfil $##$\hfil\cr #1\crcr \egroup \egroup
\egroup}
\def \mathhvbox@ #1{\setbox0 \hbox {\let \\\qquad $#1$}\ifnum \wd0 < \hsize
\box0\else \mathvbox {#1}\fi}
%% Part II -- operations on lists
\newtoks \mpr@lista
\newtoks \mpr@listb
\long \def\mpr@cons #1\mpr@to#2{\mpr@lista {\\{#1}}\mpr@listb \expandafter
{#2}\edef #2{\the \mpr@lista \the \mpr@listb}}
\long \def\mpr@snoc #1\mpr@to#2{\mpr@lista {\\{#1}}\mpr@listb \expandafter
{#2}\edef #2{\the \mpr@listb\the\mpr@lista}}
\long \def \mpr@concat#1=#2\mpr@to#3{\mpr@lista \expandafter {#2}\mpr@listb
\expandafter {#3}\edef #1{\the \mpr@listb\the\mpr@lista}}
\def \mpr@head #1\mpr@to #2{\expandafter \mpr@head@ #1\mpr@head@ #1#2}
\long \def \mpr@head@ #1#2\mpr@head@ #3#4{\def #4{#1}\def#3{#2}}
\def \mpr@flatten #1\mpr@to #2{\expandafter \mpr@flatten@ #1\mpr@flatten@ #1#2}
\long \def \mpr@flatten@ \\#1\\#2\mpr@flatten@ #3#4{\def #4{#1}\def #3{\\#2}}
\def \mpr@makelist #1\mpr@to #2{\def \mpr@all {#1}%
\mpr@lista {\\}\mpr@listb \expandafter {\mpr@all}\edef \mpr@all {\the
\mpr@lista \the \mpr@listb \the \mpr@lista}\let #2\empty
\def \mpr@stripof ##1##2\mpr@stripend{\def \mpr@stripped{##2}}\loop
\mpr@flatten \mpr@all \mpr@to \mpr@one
\expandafter \mpr@snoc \mpr@one \mpr@to #2\expandafter \mpr@stripof
\mpr@all \mpr@stripend
\ifx \mpr@stripped \empty \let \mpr@isempty 0\else \let \mpr@isempty 1\fi
\ifx 1\mpr@isempty
\repeat
}
\def \mpr@rev #1\mpr@to #2{\let \mpr@tmp \empty
\def \\##1{\mpr@cons ##1\mpr@to \mpr@tmp}#1\let #2\mpr@tmp}
%% Part III -- Type inference rules
\newif \if@premisse
\newbox \mpr@hlist
\newbox \mpr@vlist
\newif \ifmpr@center \mpr@centertrue
\def \mpr@htovlist {%
\setbox \mpr@hlist
\hbox {\strut
\ifmpr@center \hskip -0.5\wd\mpr@hlist\fi
\unhbox \mpr@hlist}%
\setbox \mpr@vlist
\vbox {\if@premisse \box \mpr@hlist \unvbox \mpr@vlist
\else \unvbox \mpr@vlist \box \mpr@hlist
\fi}%
}
% OLD version
% \def \mpr@htovlist {%
% \setbox \mpr@hlist
% \hbox {\strut \hskip -0.5\wd\mpr@hlist \unhbox \mpr@hlist}%
% \setbox \mpr@vlist
% \vbox {\if@premisse \box \mpr@hlist \unvbox \mpr@vlist
% \else \unvbox \mpr@vlist \box \mpr@hlist
% \fi}%
% }
\def \mpr@item #1{$\displaystyle #1$}
\def \mpr@sep{2em}
\def \mpr@blank { }
\def \mpr@hovbox #1#2{\hbox
\bgroup
\ifx #1T\@premissetrue
\else \ifx #1B\@premissefalse
\else
\PackageError{mathpartir}
{Premisse orientation should either be T or B}
{Fatal error in Package}%
\fi \fi
\def \@test {#2}\ifx \@test \mpr@blank\else
\setbox \mpr@hlist \hbox {}%
\setbox \mpr@vlist \vbox {}%
\if@premisse \let \snoc \mpr@cons \else \let \snoc \mpr@snoc \fi
\let \@hvlist \empty \let \@rev \empty
\mpr@tmpdim 0em
\expandafter \mpr@makelist #2\mpr@to \mpr@flat
\if@premisse \mpr@rev \mpr@flat \mpr@to \@rev \else \let \@rev \mpr@flat \fi
\def \\##1{%
\def \@test {##1}\ifx \@test \empty
\mpr@htovlist
\mpr@tmpdim 0em %%% last bug fix not extensively checked
\else
\setbox0 \hbox{\mpr@item {##1}}\relax
\advance \mpr@tmpdim by \wd0
%\mpr@tmpdim 1.02\mpr@tmpdim
\ifnum \mpr@tmpdim < \hsize
\ifnum \wd\mpr@hlist > 0
\if@premisse
\setbox \mpr@hlist
\hbox {\unhbox0 \hskip \mpr@sep \unhbox \mpr@hlist}%
\else
\setbox \mpr@hlist
\hbox {\unhbox \mpr@hlist \hskip \mpr@sep \unhbox0}%
\fi
\else
\setbox \mpr@hlist \hbox {\unhbox0}%
\fi
\else
\ifnum \wd \mpr@hlist > 0
\mpr@htovlist
\mpr@tmpdim \wd0
\fi
\setbox \mpr@hlist \hbox {\unhbox0}%
\fi
\advance \mpr@tmpdim by \mpr@sep
\fi
}%
\@rev
\mpr@htovlist
\ifmpr@center \hskip \wd\mpr@vlist\fi \box \mpr@vlist
\fi
\egroup
}
%%% INFERENCE RULES
\@ifundefined{@@over}{%
\let\@@over\over % fallback if amsmath is not loaded
\let\@@overwithdelims\overwithdelims
\let\@@atop\atop \let\@@atopwithdelims\atopwithdelims
\let\@@above\above \let\@@abovewithdelims\abovewithdelims
}{}
%% The default
\def \mpr@@fraction #1#2{\hbox {\advance \hsize by -0.5em
$\displaystyle {#1\mpr@over #2}$}}
\def \mpr@@nofraction #1#2{\hbox {\advance \hsize by -0.5em
$\displaystyle {#1\@@atop #2}$}}
\let \mpr@fraction \mpr@@fraction
%% A generic solution to arrow
\def \mpr@make@fraction #1#2#3#4#5{\hbox {%
\def \mpr@tail{#1}%
\def \mpr@body{#2}%
\def \mpr@head{#3}%
\setbox1=\hbox{$#4$}\setbox2=\hbox{$#5$}%
\setbox3=\hbox{$\mkern -3mu\mpr@body\mkern -3mu$}%
\setbox3=\hbox{$\mkern -3mu \mpr@body\mkern -3mu$}%
\dimen0=\dp1\advance\dimen0 by \ht3\relax\dp1\dimen0\relax
\dimen0=\ht2\advance\dimen0 by \dp3\relax\ht2\dimen0\relax
\setbox0=\hbox {$\box1 \@@atop \box2$}%
\dimen0=\wd0\box0
\box0 \hskip -\dimen0\relax
\hbox to \dimen0 {$%
\mathrel{\mpr@tail}\joinrel
\xleaders\hbox{\copy3}\hfil\joinrel\mathrel{\mpr@head}%
$}}}
%% Old stuff should be removed in next version
\def \mpr@@nothing #1#2
{$\lower 0.01pt \mpr@@nofraction {#1}{#2}$}
\def \mpr@@reduce #1#2{\hbox
{$\lower 0.01pt \mpr@@fraction {#1}{#2}\mkern -15mu\rightarrow$}}
\def \mpr@@rewrite #1#2#3{\hbox
{$\lower 0.01pt \mpr@@fraction {#2}{#3}\mkern -8mu#1$}}
\def \mpr@infercenter #1{\vcenter {\mpr@hovbox{T}{#1}}}
\def \mpr@empty {}
\def \mpr@inferrule
{\bgroup
\ifnum \linewidth<\hsize \hsize \linewidth\fi
\mpr@rulelineskip
\let \and \qquad
\let \hva \mpr@hva
\let \@rulename \mpr@empty
\let \@rule@options \mpr@empty
\let \mpr@over \@@over
\mpr@inferrule@}
\newcommand {\mpr@inferrule@}[3][]
{\everymath={\displaystyle}%
\def \@test {#2}\ifx \empty \@test
\setbox0 \hbox {$\vcenter {\mpr@hovbox{B}{#3}}$}%
\else
\def \@test {#3}\ifx \empty \@test
\setbox0 \hbox {$\vcenter {\mpr@hovbox{T}{#2}}$}%
\else
\setbox0 \mpr@fraction {\mpr@hovbox{T}{#2}}{\mpr@hovbox{B}{#3}}%
\fi \fi
\def \@test {#1}\ifx \@test\empty \box0
\else \vbox
%%% Suggestion de Francois pour les etiquettes longues
%%% {\hbox to \wd0 {\RefTirName {#1}\hfil}\box0}\fi
{\hbox {\RefTirName {#1}}\box0}\fi
\egroup}
\def \mpr@vdotfil #1{\vbox to #1{\leaders \hbox{$\cdot$} \vfil}}
% They are two forms
% \inferrule [label]{[premisses}{conclusions}
% or
% \inferrule* [options]{[premisses}{conclusions}
%
% Premisses and conclusions are lists of elements separated by \\
% Each \\ produces a break, attempting horizontal breaks if possible,
% and vertical breaks if needed.
%
% An empty element obtained by \\\\ produces a vertical break in all cases.
%
% The former rule is aligned on the fraction bar.
% The optional label appears on top of the rule
% The second form to be used in a derivation tree is aligned on the last
% line of its conclusion
%
% The second form can be parameterized, using the key=val interface. The
% folloiwng keys are recognized:
%
% width set the width of the rule to val
% narrower set the width of the rule to val\hsize
% before execute val at the beginning/left
% lab put a label [Val] on top of the rule
% lskip add negative skip on the right
% left put a left label [Val]
% Left put a left label [Val], ignoring its width
% right put a right label [Val]
% Right put a right label [Val], ignoring its width
% leftskip skip negative space on the left-hand side
% rightskip skip negative space on the right-hand side
% vdots lift the rule by val and fill vertical space with dots
% after execute val at the end/right
%
% Note that most options must come in this order to avoid strange
% typesetting (in particular leftskip must preceed left and Left and
% rightskip must follow Right or right; vdots must come last
% or be only followed by rightskip.
%
%% Keys that make sence in all kinds of rules
\def \mprset #1{\setkeys{mprset}{#1}}
\define@key {mprset}{andskip}[]{\mpr@andskip=#1}
\define@key {mprset}{lineskip}[]{\lineskip=#1}
\define@key {mprset}{flushleft}[]{\mpr@centerfalse}
\define@key {mprset}{center}[]{\mpr@centertrue}
\define@key {mprset}{rewrite}[]{\let \mpr@fraction \mpr@@rewrite}
\define@key {mprset}{atop}[]{\let \mpr@fraction \mpr@@nofraction}
\define@key {mprset}{myfraction}[]{\let \mpr@fraction #1}
\define@key {mprset}{fraction}[]{\def \mpr@fraction {\mpr@make@fraction #1}}
\define@key {mprset}{sep}{\def\mpr@sep{#1}}
\newbox \mpr@right
\define@key {mpr}{flushleft}[]{\mpr@centerfalse}
\define@key {mpr}{center}[]{\mpr@centertrue}
\define@key {mpr}{rewrite}[]{\let \mpr@fraction \mpr@@rewrite}
\define@key {mpr}{myfraction}[]{\let \mpr@fraction #1}
\define@key {mpr}{fraction}[]{\def \mpr@fraction {\mpr@make@fraction #1}}
\define@key {mpr}{left}{\setbox0 \hbox {$\TirName {#1}\;$}\relax
\advance \hsize by -\wd0\box0}
\define@key {mpr}{width}{\hsize #1}
\define@key {mpr}{sep}{\def\mpr@sep{#1}}
\define@key {mpr}{before}{#1}
\define@key {mpr}{lab}{\let \RefTirName \TirName \def \mpr@rulename {#1}}
\define@key {mpr}{Lab}{\let \RefTirName \TirName \def \mpr@rulename {#1}}
\define@key {mpr}{narrower}{\hsize #1\hsize}
\define@key {mpr}{leftskip}{\hskip -#1}
\define@key {mpr}{reduce}[]{\let \mpr@fraction \mpr@@reduce}
\define@key {mpr}{rightskip}
{\setbox \mpr@right \hbox {\unhbox \mpr@right \hskip -#1}}
\define@key {mpr}{LEFT}{\setbox0 \hbox {$#1$}\relax
\advance \hsize by -\wd0\box0}
\define@key {mpr}{left}{\setbox0 \hbox {$\TirName {#1}\;$}\relax
\advance \hsize by -\wd0\box0}
\define@key {mpr}{Left}{\llap{$\TirName {#1}\;$}}
\define@key {mpr}{right}
{\setbox0 \hbox {$\;\TirName {#1}$}\relax \advance \hsize by -\wd0
\setbox \mpr@right \hbox {\unhbox \mpr@right \unhbox0}}
\define@key {mpr}{RIGHT}
{\setbox0 \hbox {$#1$}\relax \advance \hsize by -\wd0
\setbox \mpr@right \hbox {\unhbox \mpr@right \unhbox0}}
\define@key {mpr}{Right}
{\setbox \mpr@right \hbox {\unhbox \mpr@right \rlap {$\;\TirName {#1}$}}}
\define@key {mpr}{vdots}{\def \mpr@vdots {\@@atop \mpr@vdotfil{#1}}}
\define@key {mpr}{after}{\edef \mpr@after {\mpr@after #1}}
\newcommand \mpr@inferstar@ [3][]{\setbox0
\hbox {\let \mpr@rulename \mpr@empty \let \mpr@vdots \relax
\setbox \mpr@right \hbox{}%
$\setkeys{mpr}{#1}%
\ifx \mpr@rulename \mpr@empty \mpr@inferrule {#2}{#3}\else
\mpr@inferrule [{\mpr@rulename}]{#2}{#3}\fi
\box \mpr@right \mpr@vdots$}
\setbox1 \hbox {\strut}
\@tempdima \dp0 \advance \@tempdima by -\dp1
\raise \@tempdima \box0}
\def \mpr@infer {\@ifnextchar *{\mpr@inferstar}{\mpr@inferrule}}
\newcommand \mpr@err@skipargs[3][]{}
\def \mpr@inferstar*{\ifmmode
\let \@do \mpr@inferstar@
\else
\let \@do \mpr@err@skipargs
\PackageError {mathpartir}
{\string\inferrule* can only be used in math mode}{}%
\fi \@do}
%%% Exports
% Envirnonment mathpar
\let \inferrule \mpr@infer
% make a short name \infer is not already defined
\@ifundefined {infer}{\let \infer \mpr@infer}{}
\def \TirNameStyle #1{\small \textsc{#1}}
\def \tir@name #1{\hbox {\small \TirNameStyle{#1}}}
\let \TirName \tir@name
\let \DefTirName \TirName
\let \RefTirName \TirName
%%% Other Exports
% \let \listcons \mpr@cons
% \let \listsnoc \mpr@snoc
% \let \listhead \mpr@head
% \let \listmake \mpr@makelist
\endinput

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,166 @@
%%
%% This is file `mhsetup.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% mhsetup.dtx (with options: `package')
%%
%% It may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3
%% of this license or (at your option) any later version.
%% The latest version of this license is in
%% http://www.latex-project.org/lppl.txt
%% and version 1.3 or later is part of all distributions of LaTeX
%% version 2003/12/01 or later.
%%
%% This work has the LPPL maintenance status "maintained".
%%
%% The Current Maintainer of this work is Morten H\o gholm.
%%
%% This work consists of the files mhsetup.dtx and mhsetup.ins and
%% the derived file mhsetup.sty.
%%
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{mhsetup}
[2004/10/10 v1.0b programming setup (MH)]
\def\MHInternalSyntaxOn{
\edef\MHInternalSyntaxOff{%
\catcode`\noexpand\~=\the\catcode`\~\relax
\catcode`\noexpand\ =\the\catcode`\ \relax
\catcode`\noexpand\^^I=\the\catcode`\^^I\relax
\catcode`\noexpand\@=\the\catcode`\@\relax
\catcode`\noexpand\:=\the\catcode`\:\relax
\catcode`\noexpand\_=\the\catcode`\_\relax
\endlinechar=\the\endlinechar\relax
}%
\catcode`\~=10\relax
\catcode`\ =9\relax
\catcode`\^^I=9\relax
\makeatletter
\catcode`\_=11\relax
\catcode`\:=11\relax
\endlinechar=` %
\relax
}
\MHInternalSyntaxOn
\AtEndOfPackage{\MHInternalSyntaxOff}
\let\MH_let:NwN \let
\def\MH_let:cN #1#2{
\expandafter\MH_let:NwN \csname#1\endcsname#2}
\def\MH_let:cc #1#2{
\expandafter\MH_let:NwN\csname#1\expandafter\endcsname
\csname#2\endcsname}
\def\MH_new_boolean:n #1{
\expandafter\@ifdefinable\csname if_boolean_#1:\endcsname{
\@namedef{boolean_#1_true:}
{\MH_let:cN{if_boolean_#1:}\iftrue}
\@namedef{boolean_#1_false:}
{\MH_let:cN{if_boolean_#1:}\iffalse}
\@nameuse{boolean_#1_false:}%
}
}
\def\MH_set_boolean_F:n #1{ \@nameuse{boolean_#1_false:} }
\def\MH_set_boolean_T:n #1{ \@nameuse{boolean_#1_true:} }
\def\MH_if_boolean:nTF #1{
\@nameuse{if_boolean_#1:}
\expandafter\@firstoftwo
\else:
\expandafter\@secondoftwo
\fi:
}
\def\MH_if_boolean:nT #1{
\@nameuse{if_boolean_#1:}
\expandafter\@firstofone
\else:
\expandafter\@gobble
\fi:
}
\def\MH_if_boolean:nF #1{
\@nameuse{if_boolean_#1:}
\expandafter\@gobble
\else:
\expandafter\@firstofone
\fi:
}
\@ifundefined{if:w}{\MH_let:NwN \if:w =\if}{}
\@ifundefined{if_meaning:NN}{\MH_let:NwN \if_meaning:NN =\ifx}{}
\@ifundefined{else:}{\MH_let:NwN \else:=\else}{}
\@ifundefined{fi:}{\MH_let:NwN \fi:=\fi}{}
\@ifundefined{if_num:w}{\MH_let:NwN \if_num:w =\ifnum}{}
\@ifundefined{if_dim:w}{\MH_let:NwN \if_dim:w =\ifdim}{}
\@ifundefined{if_case:w}{\MH_let:NwN \if_case:w =\ifcase}{}
\@ifundefined{or:}{\MH_let:NwN \or:=\or}{}
\def\MH_cs_to_str:N {\expandafter\@gobble\string}
\@ifundefined{eTeXversion}
{
\MH_let:NwN \MH_protected:\relax
\def\MH_setlength:dn{\setlength}
\def\MH_addtolength:dn{\addtolength}
}
{
\MH_let:NwN \MH_protected:\protected
\def\MH_setlength:dn #1#2{#1=\dimexpr#2\relax\relax}
\def\MH_addtolength:dn #1#2{\advance#1 \dimexpr#2\relax\relax}
}
\def\MH_keyval_alias_with_addon:nnnn #1#2#3#4{
\@namedef{KV@#1@#2}{\@nameuse{KV@#1@#3}#4}
\@namedef{KV@#1@#2@default}{\@nameuse{KV@#1@#3@default}#4}}
\def\MH_keyval_alias:nnn #1#2#3{
\MH_keyval_alias_with_addon:nnnn {#1}{#2}{#3}{}}
\def\MH_use_choice_i:nnnn #1#2#3#4{#1}
\def\MH_use_choice_ii:nnnn #1#2#3#4{#2}
\def\MH_use_choice_iii:nnnn #1#2#3#4{#3}
\def\MH_use_choice_iv:nnnn #1#2#3#4{#4}
\long\def\MH_nospace_ifnextchar:Nnn #1#2#3{
\MH_let:NwN\reserved@d=~#1
\def\reserved@a{#2}
\def\reserved@b{#3}
\futurelet\@let@token\MH_nospace_nextchar:
}
\def\MH_nospace_nextchar:{
\if_meaning:NN \@let@token\reserved@d
\MH_let:NwN \reserved@b\reserved@a
\fi:
\reserved@b
}
\long\def\MH_nospace_testopt:nn #1#2{
\MH_nospace_ifnextchar:Nnn[
{#1}
{#1[{#2}]}
}
\def\MH_nospace_protected_testopt:n #1{
\if_meaning:NN \protect\@typeset@protect
\expandafter\MH_nospace_testopt:nn
\else:
\@x@protect#1
\fi:
}
\@ifundefined{kernel@ifnextchar}
{\MH_let:NwN \kernel@ifnextchar \@ifnextchar}
{}
\MH_let:NwN \MH_kernel_xargdef:nwwn \@xargdef
\long\def\MH_nospace_xargdef:nwwn #1[#2][#3]#4{
\@ifdefinable#1{
\expandafter\def\expandafter#1\expandafter{
\expandafter
\MH_nospace_protected_testopt:n
\expandafter
#1
\csname\string#1\endcsname
{#3}}
\expandafter\@yargdef
\csname\string#1\endcsname
\tw@
{#2}
{#4}}}
\providecommand*\MHPrecedingSpacesOff{
\MH_let:NwN \@xargdef \MH_nospace_xargdef:nwwn
}
\providecommand*\MHPrecedingSpacesOn{
\MH_let:NwN \@xargdef \MH_kernel_xargdef:nwwn
}
\endinput
%%
%% End of file `mhsetup.sty'.

Binary file not shown.

After

Width:  |  Height:  |  Size: 429 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 92 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 150 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 95 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 709 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 141 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 579 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 629 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 346 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

View File

@ -0,0 +1,735 @@
\documentclass[english,11pt,table,handout]{beamer}
\input{dsa-style.tex}
\usepackage{pgf}
\newcommand{\Rule}[2]{\genfrac{}{}{0.7pt}{}{{\setlength{\fboxrule}{0pt}\setlength{\fboxsep}{3mm}\fbox{$#1$}}}{{\setlength{\fboxrule}{0pt}\setlength{\fboxsep}{3mm}\fbox{$#2$}}}}
\newcommand{\Rulee}[3]{\genfrac{}{}{0.7pt}{}{{\setlength{\fboxrule}{0pt}\setlength{\fboxsep}{3mm}\fbox{$#1$}}}{{\setlength{\fboxrule}{0pt}\setlength{\fboxsep}{3mm}\fbox{$#2$}}}[#3]}
\usepackage{url}
\usepackage{qtree}
\usepackage{datetime}
\usepackage{amsfonts}
\usepackage{mathtools}
\usepackage{fancybox}
\usepackage[linesnumbered]{algorithm2e}
\usepackage{ragged2e}
\lecture[7.1]{Edge Detection}{lecture-text}
% \subtitle{Sequence Control}
\date{09 September 2015}
\newcounter{saveenumi}
\usepackage{wrapfig}
\usetikzlibrary{automata,arrows,positioning, chains, shapes.callouts, calc}
\tikzstyle{mnode}=[circle, draw, fill=black, inner sep=0pt, minimum width=4pt]
\tikzstyle{thinking} = [draw=blue, very thick]
\edef\sizetape{1cm}
\tikzstyle{tmtape}=[draw,minimum size=\sizetape]
\tikzstyle{tmhead}=[arrow box,draw,minimum size=.5cm,arrow box
arrows={east:.25cm, west:0.25cm}]
\tikzset{
level/.style = { ultra thick, blue },
connect/.style = { dashed, red },
notice/.style = { draw, rectangle callout, callout relative pointer={#1} },
label/.style = { text width=4cm }
}
\begin{document}
\begin{frame}
\selectlanguage{english}
\maketitle
\end{frame}
\begin{frame}\frametitle<presentation>{Overview}
\tableofcontents
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Point Detection}
\frame
{
\frametitle{Point Detection}
\begin{enumerate}
\item Filter the input image $f(x,y)$ with Laplacian $H_{lap}$, i.e., compute $g(x,y) = f(x,y)*H_{lap}(i,j)$
\item Detect isolated points $(x,y)$ if they satisfy: $|g(x,y)| \ge T$. Where, $T$ is a threshold value.
\end{enumerate}
Laplacian kernel $H_{lap}$:
\centering
$$
H_{lap} = \left[
\begin{array}{rrr}
-1 & -1 & -1 \\
-1 & 8 & -1 \\
-1 & -1 & -1 \\
\end{array}
\right]
$$
}
\section{Line Detection}
\frame
{
\frametitle{Line Detection}
\begin{enumerate}
\item Filter the input image $f(x,y)$ with all following masks for detecting horizontal, vertical, $\pm 45^0$-oriented lines. This process results $g_{i}(x,y), i=1..4$. You can design new masks for other lines with new orientation.
\item Chose a orientation $i$ for point $(x,y)$ by selecting the largest $g_{i}(x,y), i=1..4$.
\item Do thresholding with a certain $T$ (input) to obtain lines.
\end{enumerate}
Some kernels:
\centering
\begin{tabular}{c|c}
$
\left[
\begin{array}{rrr}
-1 & -1 & -1 \\
2 & 2 & 2 \\
-1 & -1 & -1 \\
\end{array}
\right]
$ &
$
\left[
\begin{array}{rrr}
-1 & 2 & -1 \\
-1 & 2 & -1 \\
-1 & 2 & -1 \\
\end{array}
\right]
$
\\
Horizontal & Vertical
\\
\hline
$
\left[
\begin{array}{rrr}
-1 & -1 & 2 \\
-1 & 2 & -1 \\
2 & -1 & -1 \\
\end{array}
\right]
$ &
$
\left[
\begin{array}{rrr}
2 & -1 & -1 \\
-1 & 2 & -1 \\
-1 & -1 & 2 \\
\end{array}
\right]
$
\\
$+45^0$ & $-45^0$
\\
\end{tabular}
}
\section{Edge Detection}
\frame{
\frametitle{Edge Detection}
\selectlanguage{english}
\begin{alertblock}{Definition}
Edge is a set of connected pixels that lie on the boundary between two regions.
\end{alertblock}
\begin{block}{Properties}
\begin{enumerate}
\item There is "meaningful" transitions in gray-levels at edge.
\item So, first-order and second-order derivatives can be used to detect the transition.
\end{enumerate}
\end{block}
}
\frame{
\frametitle{Edge Detection}
\selectlanguage{english}
Examples of Derivatives: image, a line profile, first and second-order derivatives.
\begin{figure}[!h]
\includegraphics[height=7.5cm]{edge_derivative.png}
\end{figure}
}
\frame{
\frametitle{Edge Detection}
\selectlanguage{english}
Model of edges:
\begin{figure}[!h]
\includegraphics[width=9cm]{edge_model.png}
\end{figure}
\begin{enumerate}
\item Left: \alert{\textbf{Clear edge or Ideal edge}}, ideally represented as a step
\item Middle: \alert{\textbf{Blurred edge}}, ideally represented as a ramp
\item Right: \alert{\textbf{A blurred bright edge}}, ideally represented as a roof.
\end{enumerate}
}
\frame{
\frametitle{Edge Detection}
\selectlanguage{english}
\begin{figure}[!h]
\includegraphics[height=5cm]{edge_1st_2nd.png}
\end{figure}
\begin{block}{Edge with first-order derivatives}
Edge consists of points where the module of the gradient vector is greater than a threshold.
\begin{itemize}
\item The gradient vector is \alert{\textbf{perpendicular}} with the local edge passing that point
\end{itemize}
\end{block}
}
\frame{
\frametitle{Edge Detection}
\selectlanguage{english}
\begin{figure}[!h]
\includegraphics[height=5cm]{edge_1st_2nd.png}
\end{figure}
\begin{block}{Edge with second-order derivatives}
Edge consists of \alert{\textbf{zero-crossing points}} in image filtered with second-order derivatives.
\begin{itemize}
\item Second-order derivatives create one \alert{\textbf{positive}} response and another \alert{\textbf{negative}} one for ramp edges.
\end{itemize}
\end{block}
}
\frame{
\frametitle{Edge Detection with noise}
\selectlanguage{english}
\begin{figure}[!h]
\includegraphics[height=5cm]{edge_noise_1.png}
\end{figure}
\begin{itemize}
\item Rows: Row 1: no noise; Row 2: with Gaussian noise ($\mu=0, \sigma=0$)
\item Cols: Col 1: a line profile; Col 2: \alert{\textbf{Fist-order derivative}}; Col 3: \alert{\textbf{Second-order derivative}}
\end{itemize}
}
\frame{
\frametitle{Edge Detection with noise}
\selectlanguage{english}
\begin{figure}[!h]
\includegraphics[height=5cm]{edge_noise_2.png}
\end{figure}
\begin{itemize}
\item Rows: Row 1: with Gaussian noise ($\mu=0, \sigma=0.1$); Row 2: with Gaussian noise ($\mu=0, \sigma=1.0$)
\item Cols: Col 1: a line profile; Col 2: \alert{\textbf{Fist-order derivative}}; Col 3: \alert{\textbf{Second-order derivative}}
\end{itemize}
}
\frame{
\frametitle{Edge Detection with noise}
\selectlanguage{english}
\begin{block}{Properties}
\end{block}
\begin{itemize}
\item Second-order derivative is more \alert{\textbf{sensitive to noise}} compared with first-order derivative.
\item However,
\begin{itemize}
\item First-order derivatives provide \alert{\textbf{thick edges}}
\item Second-order derivatives provide \alert{\textbf{thin edges}} (via, zero-crossing)
\end{itemize}
\end{itemize}
}
\frame{
\frametitle{Edge Detection and Laplacian}
\selectlanguage{english}
\begin{alertblock}{Question}
Laplacian can provide the discontinuity in gray-levels. \alert{\textbf{Why is it not used in edge detection? }}
\end{alertblock}
\begin{block}{Reasons}
\begin{enumerate}
\item As a second-order derivative, it is unacceptably sensitive to noise
\item The magnitude of Laplacian provides double edges (one for positive and another one for negative response)
\item Laplacian can not provide edge direction
\end{enumerate}
\end{block}
Therefore, Laplacian is directly suitable for sharpening images only.
}
\frame{
\frametitle{Edge Detection and Laplacian}
\selectlanguage{english}
\begin{itemize}
\item Laplacian can provide thin edges via zeros-crossing detection. However, it is sensitive to noise.
\item What will be happened if we remove noise before taking Laplician and then finding zeros-crossing?
\end{itemize}
\begin{alertblock}{Laplacian in edge detection}
\begin{enumerate}
\item Perform noise removal will a Gaussian low-pass filter. The input image will be blurred.
\item Apply Laplacian to the resulting image.
\item Detect zero-crossing points to obtain edge points.
\end{enumerate}
\end{alertblock}
\begin{block}{Laplacian of Gaussian (LoG)}
\alert{\textbf{Step $1$ and $2$ in the above algorithm is equivalent to filtering image with a LoG mask}}
\end{block}
}
\section{Laplacian of Gaussian (LoG)}
\frame{
\frametitle{Laplacian of Gaussian (LoG)}
\selectlanguage{english}
\begin{alertblock}{A Gaussian function $G(x,y)$}
\begin{align}
\nonumber
G(x,y) &= e^{-\frac{x^2 + y^2}{2\sigma^2}}
\end{align}
\end{alertblock}
\begin{itemize}
\item $\sigma$ : standard deviation. \alert{\textbf{This parameter decides the degree of blurring in output image, if the input image is convoluted with this function}}
\end{itemize}
}
\frame{
\frametitle{Laplacian of Gaussian (LoG)}
\selectlanguage{english}
\begin{alertblock}{Laplacian of Gaussian (LoG)}
\begin{align}
\nonumber
\nabla^2G(r) &= \left[ \frac{x^2 + y^2 - 2\sigma^2}{\sigma^4}\right] e^{-\dfrac{r^2}{2\sigma^2}}
\end{align}
\begin{itemize}
\item LoG $\equiv$ Laplacian of function $G(x,y)$
\item LoG $\equiv$ $\frac{\partial^2G(x,y)}{\partial x^2} + \frac{\partial^2G(x,y)}{\partial y^2}$
\end{itemize}
\end{alertblock}
}
\frame{
\frametitle{Laplacian of Gaussian (LoG)}
\selectlanguage{english}
\begin{figure}[!h]
\includegraphics[height=8cm]{log.png}
\end{figure}
}
\frame{
\frametitle{Laplacian of Gaussian (LoG)}
\selectlanguage{english}
\begin{block}{Properties}
\begin{enumerate}
\item Other name: Mexican hat, because of its shape
\item Zero-crossing point in LoG: $x^2 + y^2 = 2\sigma^2$
\item Radius from the origin to zero-crossing point: $r = \sqrt{2} \sigma$
\item Kernel of LoG given above: just an example. It can be approximated by any size and any coefficients.
\item \alert{\textbf{Sum of all coefficients of the kernel must be $0$}}
\end{enumerate}
\end{block}
\begin{alertblock}{Generation of LoG's kernel}
How can you generate LoG's kernel?
\end{alertblock}
}
\frame{
\frametitle{Laplacian of Gaussian (LoG)}
\selectlanguage{english}
\begin{block}{Properties: Linearity}
\begin{align}
\nonumber
g(x,y) &= \left[\nabla^2G(x,y)\right]*f(x,y)\\
\nonumber
&= \nabla^2 \left[G(x,y)*f(x,y)\right]
\end{align}
\end{block}
}
\frame{
\frametitle{Marr-Hildreth Algorithm}
\selectlanguage{english}
\begin{block}{Marr-Hildreth Algorithm}
\begin{enumerate}
\item \alert{\textbf{Filter}} the input image $f(x,y)$ with Gaussian low-pass filter by kernel size $n \times n$ to obtain the output $g(x,y)$.
\item \alert{\textbf{Compute}} Laplacian of $g(x,y)$ to obtain $g_L(x,y)$
\item \alert{\textbf{Find}} zero-crossing points in $g_L(x,y)$
\end{enumerate}
\end{block}
\begin{alertblock}{LoG}
Step $1$ and $2$ can be implemented as applying LoG on the input image.
\end{alertblock}
}
\frame{
\frametitle{Marr-Hildreth Algorithm}
\selectlanguage{english}
\begin{alertblock}{Power of Marr-Hildreth Algorithm}
Marr-Hildreth Algorithm can remedy the following problems in edge detection:
\begin{enumerate}
\item Intensity changes are not independent of image scale $\Rightarrow$ use different kernel' size.
\item Edges are sensitive to noise, especially true for second-order derivative $\Rightarrow$ use Gaussian low-pass filter
\end{enumerate}
\end{alertblock}
\begin{block}{Questions}
\begin{enumerate}
\item How can you obtain the kernel's size?
\item How can you detect zero-crossing points?
\end{enumerate}
\end{block}
}
\frame{
\frametitle{Marr-Hildreth Algorithm}
\selectlanguage{english}
\begin{alertblock}{How can you obtain the kernel's size?}
\begin{itemize}
\item Volume of a Gaussian function inside of circle $radius = 3\sigma$ is $99.7\%$
\item $\Rightarrow$ Kernel size $n \times n$, where $n$ an odd numer $\ge 6\sigma$
\end{itemize}
\end{alertblock}
}
\frame{
\frametitle{Marr-Hildreth Algorithm}
\selectlanguage{english}
\begin{alertblock}{How can you detect zero-crossing points?}
\begin{enumerate}
\item Perform thresholding of the magnitude of LoG image, i.e. $|g_l(x,y)|$, with a value $T$.
$g_l(x,y) =
\begin{cases}
-1 & \text{if } (g_l(x,y) < 0) \text{ and } |g_l(x,y)| > T \\
1 & \text{if } (g_l(x,y) > 0) \text{ and } |g_l(x,y)| > T \\
0 & \text{ortherwise}
\end{cases}
$
\item Apply a mask $3 \times 3$ at each pixel on $g_l(x,y)$.
\begin{tabular}{|c|c|c|}
\hline
NW & N & NE\\
\hline
W & C & E\\
\hline
SW & S & SE\\
\hline
\end{tabular}
\item Detect the difference on the sign at opposing corners, i.e., (W, E), (N, S), (NW, SE), and (SW, NE).
\item If any pair of corners results a difference on the sign, then $g_l(x,y)$ is an edge point.
\end{enumerate}
\end{alertblock}
}
\frame{
\frametitle{Laplacian of Gaussian (LoG): Illustration}
\selectlanguage{english}
\begin{figure}[!h]
\includegraphics[height=7cm]{log_edge_original.png}
\caption{Original image}
\end{figure}
}
\frame{
\frametitle{Laplacian of Gaussian (LoG): Illustration}
\selectlanguage{english}
\begin{figure}[!h]
\includegraphics[height=7cm]{log_edge_original.png}
\caption{Original image}
\end{figure}
}
\frame{
\frametitle{Laplacian of Gaussian (LoG): Illustration}
\selectlanguage{english}
\begin{figure}[!h]
\begin{tabular}{cc}
\includegraphics[width=4.5cm]{log_edge_step_1_2.png} &
\includegraphics[width=4.5cm]{log_edge_zeros_cross_1.png}\\
(a) & (b) \\
\end{tabular}
\caption{Marr-Hildreth Algorithm: (a): Result of Step $1$ and $2$, (b): Zero-crossing of (a), Threshold $=0$ }
\end{figure}
\begin{itemize}
\item Step $1$ and $2$: $\sigma = 4, n = 25$ (kernel's size: $25 \times 25$)
\item Low threshold $\Rightarrow$ many edge points.
\end{itemize}
}
\frame{
\frametitle{Laplacian of Gaussian (LoG): Illustration}
\selectlanguage{english}
\begin{figure}[!h]
\begin{tabular}{cc}
\includegraphics[width=4.5cm]{log_edge_step_1_2.png} &
\includegraphics[width=4.5cm]{log_edge_zeros_cross_2.png}\\
(a) & (b) \\
\end{tabular}
\caption{Marr-Hildreth Algorithm: (a): Result of Step $1$ and $2$, (b): Zero-crossing of (a), Threshold $= 4\%$ of maximum value in (a) }
\end{figure}
\begin{itemize}
\item Step $1$ and $2$: $\sigma = 4, n = 25$ (kernel's size: $25 \times 25$)
\item Larger threshold $\Rightarrow$ provide strong edge only
\end{itemize}
}
\frame{
\frametitle{Canny Edge Detection}
\selectlanguage{english}
\begin{block}{Canny Edge Detection Algorithm}
\begin{enumerate}
\item Smooth the input image with Gaussian low-pass filter
\item Compute the gradient magnitude angle images
\item Apply nonmaxima suppression to the gradient magnitude image.
\item Use double thresholding and connectivity analysis to detect and link edges
\end{enumerate}
\end{block}
}
\frame{
\frametitle{Canny Edge Detection}
\selectlanguage{english}
\begin{block}{Step 1: Smooth the input image with Gaussian low-pass filter}
\begin{enumerate}
\item Smooth the input image with Gaussian low-pass filter
\item Compute the gradient magnitude angle images
\item Apply nonmaxima suppression to the gradient magnitude image.
\item Use double thresholding to obtain strong and weak edge masks
\item Analyze the connectivity to detect and link edges
\end{enumerate}
\end{block}
}
\frame{
\frametitle{Canny Edge Detection}
\selectlanguage{english}
\begin{block}{Step 1: Smooth the input image with Gaussian low-pass filter}
\end{block}
\begin{align}
\nonumber
G(x,y) &= e^{-\frac{x^2 + y^2}{2\sigma^2}}\\
\nonumber
f_s(x,y) & = f(x,y) * G(x,y)
\end{align}
\begin{itemize}
\item $f_s(x,y)$ : a smoothed version of $f(x,y)$
\item $\sigma$ : decides the degree of smoothing
\item $f_s(x,y)$ : Gaussian noise has been removed
\end{itemize}
}
\frame{
\frametitle{Canny Edge Detection}
\selectlanguage{english}
\begin{block}{Step 2: Compute the gradient magnitude angle images}
\end{block}
\begin{itemize}
\item Compute $g_x(x,y)$ and $g_y(x,y)$
\begin{equation}
\begin{split}
\nonumber
g_x(x,y) & = f_s(x,y) * H_x(x,y)\\
\nonumber
g_y(x,y) & = f_s(x,y) * H_y(x,y)\\
\end{split}
\end{equation}
\begin{itemize}
\item $H_x(x,y)$, $H_y(x,y)$: any first-order derivative kernels, e.g., "standard" approximations kernels, Sobel, Roberts, Prewitts, etc.
\end{itemize}
\item Compute gradient magnitude and angle images
\end{itemize}
\begin{equation}
\begin{split}
\nonumber
M(x,y) = \left[\begin{array}{c}
g_x(x,y) \\
g_y(x,y)
\end{array}\right]\\
\nonumber
\alpha(x,y) = tan^{-1}\left[ \frac{g_y(x,y)}{g_x(x,y)}\right]
\end{split}
\end{equation}
}
\frame{
\frametitle{Canny Edge Detection}
\selectlanguage{english}
\begin{block}{Step 3: Apply nonmaxima suppression to the gradient magnitude image.}
\end{block}
\begin{block}{The underlying idea of \alert{\textbf{nonmaxima suprression}}}
if a point is not a local maxima, then supress (remove, stop, etc) it.
\end{block}
\begin{itemize}
\item Edges will pass points that are \alert{\textbf{local maxima}} in gradient magnitude image, ie., $M(x,y)$.
\item $\Rightarrow$ Remove (supress) points that are not local maxima.
\item $\equiv$ \alert{\textbf{nonmaxima suprression}}
\end{itemize}
}
\frame{
\frametitle{Canny Edge Detection}
\selectlanguage{english}
\begin{block}{Step 3: Apply nonmaxima suppression to the gradient magnitude image.}
\end{block}
\begin{block}{Questions}
What does \alert{\textbf{local}} mean?
\end{block}
\begin{itemize}
\item \alert{\textbf{local}} $\equiv$ local points involving in edge.
\item for a point $(x,y)$ in $M(x,y)$, \alert{\textbf{which neighbor points are edge local points?}}
\item $\Rightarrow$ need gradient angle
\end{itemize}
\begin{alertblock}{}
Gradient vector at a point is \alert{\textbf{perpendicular}} to local edge at that point.
\end{alertblock}
}
\frame{
\frametitle{Canny Edge Detection}
\selectlanguage{english}
\begin{block}{Step 3: Apply nonmaxima suppression to the gradient magnitude image.}
\end{block}
\begin{enumerate}
\item Discrete gradient angle values into small rangles.
\item Find direction $d_k$ that is closest to $\alpha(x,y)$
\item Find local neighbors on edge using $d_k$, referred to as $N_1$ and $N_2$
\item Compute nonmaxima suppressed image $g_N(x,y)$
\end{enumerate}
\begin{equation}
\begin{split}
\nonumber
g_N(x,y) =
\begin{cases}
0 & \text{if } \left[M(x,y) < N_1\right] \& \left[M(x,y) < N_2\right] \\
M(x,y)& \text{otherwise}
\end{cases}
\end{split}
\end{equation}
}
\frame{
\frametitle{Canny Edge Detection}
\selectlanguage{english}
\begin{block}{Step 3: Apply nonmaxima suppression to the gradient magnitude image.}
\end{block}
\begin{figure}[!h]
\includegraphics[height=6cm]{nonmaxima.png}
\caption{Demonstration for 4 directions: horizontal, vertical, $\pm 45^0$}
\end{figure}
}
\frame{
\frametitle{Canny Edge Detection}
\selectlanguage{english}
\begin{block}{Step 4: Use double thresholding to obtain strong and weak edge masks}
\end{block}
\begin{enumerate}
\item Do thresholding with high and low threshold value $T_H$ and $T_L$ respectively.
\begin{equation}
\begin{split}
\nonumber
g_{NH}(x,y) &= g_N(x,y) \ge T_H\\
g_{NL}(x,y) &= g_N(x,y) \ge T_L
\end{split}
\end{equation}
\item Eliminate points in $g_{NL}(x,y)$ that has been indicated in $g_{NH(x,y)}$
\begin{equation}
\begin{split}
\nonumber
g_{NL}(x,y) &= g_{NL}(x,y) - g_{NH}(x,y)
\end{split}
\end{equation}
\begin{itemize}
\item $g_{NH}(x,y)$: strong edge
\item $g_{NL}(x,y)$: weak edge
\end{itemize}
\end{enumerate}
}
\frame{
\frametitle{Canny Edge Detection}
\selectlanguage{english}
\begin{block}{Step 5: Analyze connectivity and to detect and link edges}
\end{block}
\begin{enumerate}
\item Create an \alert{\textbf{edge map}} that marks all non-zeros in $g_{NH}(x,y)$ as valid edge points.
\item For each pixel $p$ that is non-zeros in $g_{NH}(x,y)$, do
\begin{itemize}
\item Find all non-zeros pixels in $g_{NL}(x,y)$ that are connected to $p$ via $4-$ or $8-$connectivity, mark corresponding points in \alert{\textbf{edge map}} as valid pixels.
\end{itemize}
\end{enumerate}
\begin{alertblock}{}
\begin{itemize}
\item \alert{\textbf{edge map}} may contain edges thicker than 1 pixel.
\item Apply edge-thinning algorithm to create thinner edge map, if needed.
\end{itemize}
\end{alertblock}
}
\frame{
\frametitle{Canny Edge Detection: Illustration}
\selectlanguage{english}
\begin{figure}[!h]
\begin{tabular}{cc}
\includegraphics[width=4.5cm]{log_edge_original.png} &
\includegraphics[width=4.5cm]{canny_edge_gradient.png}\\
(a) & (b) \\
\end{tabular}
\caption{Edge detection (a): Original image, (b): Thresholded gradient magnitude image - \alert{\textbf{thick edge}}}
\end{figure}
}
\frame{
\frametitle{Canny Edge Detection: Illustration}
\selectlanguage{english}
\begin{figure}[!h]
\begin{tabular}{cc}
\includegraphics[width=4.5cm]{canny_edge_log.png} &
\includegraphics[width=4.5cm]{canny_edge_canny.png}\\
(a) & (b) \\
\end{tabular}
\caption{Edge detection (a): Marr-Hildreth Method, (b): Canny method - \alert{\textbf{better}}}
\end{figure}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\end{document}

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 87 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 95 KiB

View File

@ -0,0 +1,236 @@
% Copyright 2007 by Till Tantau
%
% This file may be distributed and/or modified
%
% 1. under the LaTeX Project Public License and/or
% 2. under the GNU Public License.
%
% See the file doc/licenses/LICENSE for more details.
% Common packages
\usepackage[utf8x]{inputenc}
\usepackage[vietnam,english]{babel}
\usepackage[utf8]{vietnam}
%\usepackage{times}
\usefonttheme[onlymath]{serif}
\usecolortheme{default}
\usepackage{booktabs}
\usepackage{mathpartir}
\usepackage{listings}
\usepackage{listingsutf8}
\usepackage{pbox}
\mprset{flushleft}
\mode<article>
{
\usepackage{times}
\usepackage{mathptmx}
\usepackage[left=1.5cm,right=6cm,top=1.5cm,bottom=3cm]{geometry}
}
\usepackage{hyperref}
\usepackage{tikz}
\usetikzlibrary{arrows,backgrounds}
%\tikzstyle{mnode}=[circle, draw, fill=black, inner sep=0pt, minimum width=4pt]
\usepackage{colortbl}
%\usepackage{yfonts}
\usepackage{translator} % comment this, if not available
% Common settings for all lectures in this course
\def\lecturename{Image Processing and Computer Vision}
\title{\insertlecture}
\author{\textbf{LE Thanh Sach}}
\institute
{
\textit{Faculty of Computer Science and Engineering}\\
\textit{Ho Chi Minh University of Technology, VNU-HCM}
}
\subject{Lecturer \lecturename}
% Beamer version theme settings
\useoutertheme[height=0pt,width=2cm,right]{sidebar}
\usecolortheme{rose,sidebartab}
\useinnertheme{circles}
\usefonttheme[only large]{structurebold}
\setbeamercolor{sidebar right}{bg=black!15}
\setbeamercolor{structure}{fg=blue}
\setbeamercolor{author}{parent=structure}
\setbeamerfont{title}{series=\normalfont,size=\LARGE}
\setbeamerfont{title in sidebar}{series=\bfseries}
\setbeamerfont{author in sidebar}{series=\bfseries}
\setbeamerfont*{item}{series=}
\setbeamerfont{frametitle}{size=}
\setbeamerfont{block title}{size=\small}
\setbeamerfont{subtitle}{size=\normalsize,series=\normalfont}
\setbeamertemplate{navigation symbols}{}
\setbeamertemplate{bibliography item}[book]
\setbeamertemplate{sidebar right}
{
{\usebeamerfont{title in sidebar}%
\vskip1.5em%
\hskip3pt%
\usebeamercolor[fg]{title in sidebar}%
\insertshorttitle[width=2cm,center,respectlinebreaks]\par%
\vskip1.25em%
}%
{%
\hskip3pt%
\usebeamercolor[fg]{author in sidebar}%
\usebeamerfont{author in sidebar}%
\insertshortauthor[width=2cm,center,respectlinebreaks]\par%
\vskip1.25em%
}%
\hbox to2cm{\hss\insertlogo\hss}
\vskip1.25em%
\insertverticalnavigation{2cm}%
\vfill
\hbox to 2cm{\hfill\usebeamerfont{subsection in
sidebar}\strut\usebeamercolor[fg]{subsection in
sidebar}\insertshortlecture.\insertframenumber\hskip5pt}%
\vskip3pt%
}%
\setbeamertemplate{title page}
{
\vbox{}
\vskip1em
{\huge Chapter \insertshortlecture\par}
{\usebeamercolor[fg]{title}\usebeamerfont{title}\inserttitle\par}%
\ifx\insertsubtitle\@empty%
\else%
\vskip0.25em%
{\usebeamerfont{subtitle}\usebeamercolor[fg]{subtitle}\insertsubtitle\par}%
\fi%
\vskip1em\par
\emph{\lecturename}\
%on \insertdate\par
\vskip3em\par
\leftskip=0pt plus1fill\insertauthor\par
\insertinstitute\vskip1em
}
\logo{\includegraphics[width=1.5cm]{hcmut.png}}
% Article version layout settings
\mode<article>
\makeatletter
\def\@listI{\leftmargin\leftmargini
\parsep 0pt
\topsep 5\p@ \@plus3\p@ \@minus5\p@
\itemsep0pt}
\let\@listi=\@listI
\setbeamertemplate{frametitle}{\paragraph*{\insertframetitle\
\ \small\insertframesubtitle}\ \par
}
\setbeamertemplate{frame end}{%
\marginpar{\scriptsize\hbox to 1cm{\sffamily%
\hfill\strut\insertshortlecture.\insertframenumber}\hrule height .2pt}}
\setlength{\marginparwidth}{1cm}
\setlength{\marginparsep}{4.5cm}
\def\@maketitle{\makechapter}
\def\makechapter{
\newpage
\null
\vskip 2em%
{%
\parindent=0pt
\raggedright
\sffamily
\vskip8pt
{\fontsize{36pt}{36pt}\selectfont Chapter \insertshortlecture \par\vskip2pt}
{\fontsize{24pt}{28pt}\selectfont \color{blue!50!black} \insertlecture\par\vskip4pt}
{\Large\selectfont \color{blue!50!black} \insertsubtitle\par}
\vskip10pt
\normalsize\selectfont Print version of
Lecturer \emph{\lecturename} of \@date\par\vskip1.5em
\hfill Le Thanh Sach and Luong The Nhan, Faculty of CSE, HCMC University of Technology
}
\par
\vskip 1.5em%
}
\let\origstartsection=\@startsection
\def\@startsection#1#2#3#4#5#6{%
\origstartsection{#1}{#2}{#3}{#4}{#5}{#6\normalfont\sffamily\color{blue!50!black}\selectfont}}
\makeatother
\mode
<all>
% Typesetting Listings
\usepackage{listings}
\lstset{language=Java}
\alt<presentation>
{\lstset{%
basicstyle=\footnotesize\ttfamily,
commentstyle=\slshape\color{green!50!black},
keywordstyle=\bfseries\color{blue!50!black},
identifierstyle=\color{blue},
stringstyle=\color{orange},
escapechar=\#,
emphstyle=\color{red}}
}
{
\lstset{%
basicstyle=\ttfamily,
keywordstyle=\bfseries,
commentstyle=\itshape,
escapechar=\#,
emphstyle=\bfseries\color{red}
}
}
% Common theorem-like environments
\theoremstyle{example}
\newtheorem{exercise}[theorem]{\translate{Exercise}}
% New useful definitions:
\newbox\mytempbox
\newdimen\mytempdimen
\newcommand\includegraphicscopyright[3][]{%
\leavevmode\vbox{\vskip3pt\raggedright\setbox\mytempbox=\hbox{\includegraphics[#1]{#2}}%
\mytempdimen=\wd\mytempbox\box\mytempbox\par\vskip1pt%
\fontsize{3}{3.5}\selectfont{\color{black!25}{\vbox{\hsize=\mytempdimen#3}}}\vskip3pt%
}}
\newenvironment{colortabular}[1]{\medskip\rowcolors[]{1}{blue!20}{blue!10}\tabular{#1}\rowcolor{blue!40}}{\endtabular\medskip}
\def\equad{\leavevmode\hbox{}\quad}
\newenvironment{greencolortabular}[1]
{\medskip\rowcolors[]{1}{green!50!black!20}{green!50!black!10}%
\tabular{#1}\rowcolor{green!50!black!40}}%
{\endtabular\medskip}

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 187 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 152 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 547 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 406 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 531 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 KiB

View File

@ -0,0 +1,446 @@
% Mathpartir --- Math Paragraph for Typesetting Inference Rules
%
% Copyright (C) 2001, 2002, 2003, 2004, 2005 Didier R<>my
%
% Author : Didier Remy
% Version : 1.2.0
% Bug Reports : to author
% Web Site : http://pauillac.inria.fr/~remy/latex/
%
% Mathpartir is free software; you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation; either version 2, or (at your option)
% any later version.
%
% Mathpartir is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details
% (http://pauillac.inria.fr/~remy/license/GPL).
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% File mathpartir.sty (LaTeX macros)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{mathpartir}
[2005/12/20 version 1.2.0 Math Paragraph for Typesetting Inference Rules]
%%
%% Identification
%% Preliminary declarations
\RequirePackage {keyval}
%% Options
%% More declarations
%% PART I: Typesetting maths in paragraphe mode
%% \newdimen \mpr@tmpdim
%% Dimens are a precious ressource. Uses seems to be local.
\let \mpr@tmpdim \@tempdima
% To ensure hevea \hva compatibility, \hva should expands to nothing
% in mathpar or in inferrule
\let \mpr@hva \empty
%% normal paragraph parametters, should rather be taken dynamically
\def \mpr@savepar {%
\edef \MathparNormalpar
{\noexpand \lineskiplimit \the\lineskiplimit
\noexpand \lineskip \the\lineskip}%
}
\def \mpr@rulelineskip {\lineskiplimit=0.3em\lineskip=0.2em plus 0.1em}
\def \mpr@lesslineskip {\lineskiplimit=0.6em\lineskip=0.5em plus 0.2em}
\def \mpr@lineskip {\lineskiplimit=1.2em\lineskip=1.2em plus 0.2em}
\let \MathparLineskip \mpr@lineskip
\def \mpr@paroptions {\MathparLineskip}
\let \mpr@prebindings \relax
\newskip \mpr@andskip \mpr@andskip 2em plus 0.5fil minus 0.5em
\def \mpr@goodbreakand
{\hskip -\mpr@andskip \penalty -1000\hskip \mpr@andskip}
\def \mpr@and {\hskip \mpr@andskip}
\def \mpr@andcr {\penalty 50\mpr@and}
\def \mpr@cr {\penalty -10000\mpr@and}
\def \mpr@eqno #1{\mpr@andcr #1\hskip 0em plus -1fil \penalty 10}
\def \mpr@bindings {%
\let \and \mpr@andcr
\let \par \mpr@andcr
\let \\\mpr@cr
\let \eqno \mpr@eqno
\let \hva \mpr@hva
}
\let \MathparBindings \mpr@bindings
% \@ifundefined {ignorespacesafterend}
% {\def \ignorespacesafterend {\aftergroup \ignorespaces}
\newenvironment{mathpar}[1][]
{$$\mpr@savepar \parskip 0em \hsize \linewidth \centering
\vbox \bgroup \mpr@prebindings \mpr@paroptions #1\ifmmode $\else
\noindent $\displaystyle\fi
\MathparBindings}
{\unskip \ifmmode $\fi\egroup $$\ignorespacesafterend}
\newenvironment{mathparpagebreakable}[1][]
{\begingroup
\par
\mpr@savepar \parskip 0em \hsize \linewidth \centering
\mpr@prebindings \mpr@paroptions #1%
\vskip \abovedisplayskip \vskip -\lineskip%
\ifmmode \else $\displaystyle\fi
\MathparBindings
}
{\unskip
\ifmmode $\fi \par\endgroup
\vskip \belowdisplayskip
\noindent
\ignorespacesafterend}
% \def \math@mathpar #1{\setbox0 \hbox {$\displaystyle #1$}\ifnum
% \wd0 < \hsize $$\box0$$\else \bmathpar #1\emathpar \fi}
%%% HOV BOXES
\def \mathvbox@ #1{\hbox \bgroup \mpr@normallineskip
\vbox \bgroup \tabskip 0em \let \\ \cr
\halign \bgroup \hfil $##$\hfil\cr #1\crcr \egroup \egroup
\egroup}
\def \mathhvbox@ #1{\setbox0 \hbox {\let \\\qquad $#1$}\ifnum \wd0 < \hsize
\box0\else \mathvbox {#1}\fi}
%% Part II -- operations on lists
\newtoks \mpr@lista
\newtoks \mpr@listb
\long \def\mpr@cons #1\mpr@to#2{\mpr@lista {\\{#1}}\mpr@listb \expandafter
{#2}\edef #2{\the \mpr@lista \the \mpr@listb}}
\long \def\mpr@snoc #1\mpr@to#2{\mpr@lista {\\{#1}}\mpr@listb \expandafter
{#2}\edef #2{\the \mpr@listb\the\mpr@lista}}
\long \def \mpr@concat#1=#2\mpr@to#3{\mpr@lista \expandafter {#2}\mpr@listb
\expandafter {#3}\edef #1{\the \mpr@listb\the\mpr@lista}}
\def \mpr@head #1\mpr@to #2{\expandafter \mpr@head@ #1\mpr@head@ #1#2}
\long \def \mpr@head@ #1#2\mpr@head@ #3#4{\def #4{#1}\def#3{#2}}
\def \mpr@flatten #1\mpr@to #2{\expandafter \mpr@flatten@ #1\mpr@flatten@ #1#2}
\long \def \mpr@flatten@ \\#1\\#2\mpr@flatten@ #3#4{\def #4{#1}\def #3{\\#2}}
\def \mpr@makelist #1\mpr@to #2{\def \mpr@all {#1}%
\mpr@lista {\\}\mpr@listb \expandafter {\mpr@all}\edef \mpr@all {\the
\mpr@lista \the \mpr@listb \the \mpr@lista}\let #2\empty
\def \mpr@stripof ##1##2\mpr@stripend{\def \mpr@stripped{##2}}\loop
\mpr@flatten \mpr@all \mpr@to \mpr@one
\expandafter \mpr@snoc \mpr@one \mpr@to #2\expandafter \mpr@stripof
\mpr@all \mpr@stripend
\ifx \mpr@stripped \empty \let \mpr@isempty 0\else \let \mpr@isempty 1\fi
\ifx 1\mpr@isempty
\repeat
}
\def \mpr@rev #1\mpr@to #2{\let \mpr@tmp \empty
\def \\##1{\mpr@cons ##1\mpr@to \mpr@tmp}#1\let #2\mpr@tmp}
%% Part III -- Type inference rules
\newif \if@premisse
\newbox \mpr@hlist
\newbox \mpr@vlist
\newif \ifmpr@center \mpr@centertrue
\def \mpr@htovlist {%
\setbox \mpr@hlist
\hbox {\strut
\ifmpr@center \hskip -0.5\wd\mpr@hlist\fi
\unhbox \mpr@hlist}%
\setbox \mpr@vlist
\vbox {\if@premisse \box \mpr@hlist \unvbox \mpr@vlist
\else \unvbox \mpr@vlist \box \mpr@hlist
\fi}%
}
% OLD version
% \def \mpr@htovlist {%
% \setbox \mpr@hlist
% \hbox {\strut \hskip -0.5\wd\mpr@hlist \unhbox \mpr@hlist}%
% \setbox \mpr@vlist
% \vbox {\if@premisse \box \mpr@hlist \unvbox \mpr@vlist
% \else \unvbox \mpr@vlist \box \mpr@hlist
% \fi}%
% }
\def \mpr@item #1{$\displaystyle #1$}
\def \mpr@sep{2em}
\def \mpr@blank { }
\def \mpr@hovbox #1#2{\hbox
\bgroup
\ifx #1T\@premissetrue
\else \ifx #1B\@premissefalse
\else
\PackageError{mathpartir}
{Premisse orientation should either be T or B}
{Fatal error in Package}%
\fi \fi
\def \@test {#2}\ifx \@test \mpr@blank\else
\setbox \mpr@hlist \hbox {}%
\setbox \mpr@vlist \vbox {}%
\if@premisse \let \snoc \mpr@cons \else \let \snoc \mpr@snoc \fi
\let \@hvlist \empty \let \@rev \empty
\mpr@tmpdim 0em
\expandafter \mpr@makelist #2\mpr@to \mpr@flat
\if@premisse \mpr@rev \mpr@flat \mpr@to \@rev \else \let \@rev \mpr@flat \fi
\def \\##1{%
\def \@test {##1}\ifx \@test \empty
\mpr@htovlist
\mpr@tmpdim 0em %%% last bug fix not extensively checked
\else
\setbox0 \hbox{\mpr@item {##1}}\relax
\advance \mpr@tmpdim by \wd0
%\mpr@tmpdim 1.02\mpr@tmpdim
\ifnum \mpr@tmpdim < \hsize
\ifnum \wd\mpr@hlist > 0
\if@premisse
\setbox \mpr@hlist
\hbox {\unhbox0 \hskip \mpr@sep \unhbox \mpr@hlist}%
\else
\setbox \mpr@hlist
\hbox {\unhbox \mpr@hlist \hskip \mpr@sep \unhbox0}%
\fi
\else
\setbox \mpr@hlist \hbox {\unhbox0}%
\fi
\else
\ifnum \wd \mpr@hlist > 0
\mpr@htovlist
\mpr@tmpdim \wd0
\fi
\setbox \mpr@hlist \hbox {\unhbox0}%
\fi
\advance \mpr@tmpdim by \mpr@sep
\fi
}%
\@rev
\mpr@htovlist
\ifmpr@center \hskip \wd\mpr@vlist\fi \box \mpr@vlist
\fi
\egroup
}
%%% INFERENCE RULES
\@ifundefined{@@over}{%
\let\@@over\over % fallback if amsmath is not loaded
\let\@@overwithdelims\overwithdelims
\let\@@atop\atop \let\@@atopwithdelims\atopwithdelims
\let\@@above\above \let\@@abovewithdelims\abovewithdelims
}{}
%% The default
\def \mpr@@fraction #1#2{\hbox {\advance \hsize by -0.5em
$\displaystyle {#1\mpr@over #2}$}}
\def \mpr@@nofraction #1#2{\hbox {\advance \hsize by -0.5em
$\displaystyle {#1\@@atop #2}$}}
\let \mpr@fraction \mpr@@fraction
%% A generic solution to arrow
\def \mpr@make@fraction #1#2#3#4#5{\hbox {%
\def \mpr@tail{#1}%
\def \mpr@body{#2}%
\def \mpr@head{#3}%
\setbox1=\hbox{$#4$}\setbox2=\hbox{$#5$}%
\setbox3=\hbox{$\mkern -3mu\mpr@body\mkern -3mu$}%
\setbox3=\hbox{$\mkern -3mu \mpr@body\mkern -3mu$}%
\dimen0=\dp1\advance\dimen0 by \ht3\relax\dp1\dimen0\relax
\dimen0=\ht2\advance\dimen0 by \dp3\relax\ht2\dimen0\relax
\setbox0=\hbox {$\box1 \@@atop \box2$}%
\dimen0=\wd0\box0
\box0 \hskip -\dimen0\relax
\hbox to \dimen0 {$%
\mathrel{\mpr@tail}\joinrel
\xleaders\hbox{\copy3}\hfil\joinrel\mathrel{\mpr@head}%
$}}}
%% Old stuff should be removed in next version
\def \mpr@@nothing #1#2
{$\lower 0.01pt \mpr@@nofraction {#1}{#2}$}
\def \mpr@@reduce #1#2{\hbox
{$\lower 0.01pt \mpr@@fraction {#1}{#2}\mkern -15mu\rightarrow$}}
\def \mpr@@rewrite #1#2#3{\hbox
{$\lower 0.01pt \mpr@@fraction {#2}{#3}\mkern -8mu#1$}}
\def \mpr@infercenter #1{\vcenter {\mpr@hovbox{T}{#1}}}
\def \mpr@empty {}
\def \mpr@inferrule
{\bgroup
\ifnum \linewidth<\hsize \hsize \linewidth\fi
\mpr@rulelineskip
\let \and \qquad
\let \hva \mpr@hva
\let \@rulename \mpr@empty
\let \@rule@options \mpr@empty
\let \mpr@over \@@over
\mpr@inferrule@}
\newcommand {\mpr@inferrule@}[3][]
{\everymath={\displaystyle}%
\def \@test {#2}\ifx \empty \@test
\setbox0 \hbox {$\vcenter {\mpr@hovbox{B}{#3}}$}%
\else
\def \@test {#3}\ifx \empty \@test
\setbox0 \hbox {$\vcenter {\mpr@hovbox{T}{#2}}$}%
\else
\setbox0 \mpr@fraction {\mpr@hovbox{T}{#2}}{\mpr@hovbox{B}{#3}}%
\fi \fi
\def \@test {#1}\ifx \@test\empty \box0
\else \vbox
%%% Suggestion de Francois pour les etiquettes longues
%%% {\hbox to \wd0 {\RefTirName {#1}\hfil}\box0}\fi
{\hbox {\RefTirName {#1}}\box0}\fi
\egroup}
\def \mpr@vdotfil #1{\vbox to #1{\leaders \hbox{$\cdot$} \vfil}}
% They are two forms
% \inferrule [label]{[premisses}{conclusions}
% or
% \inferrule* [options]{[premisses}{conclusions}
%
% Premisses and conclusions are lists of elements separated by \\
% Each \\ produces a break, attempting horizontal breaks if possible,
% and vertical breaks if needed.
%
% An empty element obtained by \\\\ produces a vertical break in all cases.
%
% The former rule is aligned on the fraction bar.
% The optional label appears on top of the rule
% The second form to be used in a derivation tree is aligned on the last
% line of its conclusion
%
% The second form can be parameterized, using the key=val interface. The
% folloiwng keys are recognized:
%
% width set the width of the rule to val
% narrower set the width of the rule to val\hsize
% before execute val at the beginning/left
% lab put a label [Val] on top of the rule
% lskip add negative skip on the right
% left put a left label [Val]
% Left put a left label [Val], ignoring its width
% right put a right label [Val]
% Right put a right label [Val], ignoring its width
% leftskip skip negative space on the left-hand side
% rightskip skip negative space on the right-hand side
% vdots lift the rule by val and fill vertical space with dots
% after execute val at the end/right
%
% Note that most options must come in this order to avoid strange
% typesetting (in particular leftskip must preceed left and Left and
% rightskip must follow Right or right; vdots must come last
% or be only followed by rightskip.
%
%% Keys that make sence in all kinds of rules
\def \mprset #1{\setkeys{mprset}{#1}}
\define@key {mprset}{andskip}[]{\mpr@andskip=#1}
\define@key {mprset}{lineskip}[]{\lineskip=#1}
\define@key {mprset}{flushleft}[]{\mpr@centerfalse}
\define@key {mprset}{center}[]{\mpr@centertrue}
\define@key {mprset}{rewrite}[]{\let \mpr@fraction \mpr@@rewrite}
\define@key {mprset}{atop}[]{\let \mpr@fraction \mpr@@nofraction}
\define@key {mprset}{myfraction}[]{\let \mpr@fraction #1}
\define@key {mprset}{fraction}[]{\def \mpr@fraction {\mpr@make@fraction #1}}
\define@key {mprset}{sep}{\def\mpr@sep{#1}}
\newbox \mpr@right
\define@key {mpr}{flushleft}[]{\mpr@centerfalse}
\define@key {mpr}{center}[]{\mpr@centertrue}
\define@key {mpr}{rewrite}[]{\let \mpr@fraction \mpr@@rewrite}
\define@key {mpr}{myfraction}[]{\let \mpr@fraction #1}
\define@key {mpr}{fraction}[]{\def \mpr@fraction {\mpr@make@fraction #1}}
\define@key {mpr}{left}{\setbox0 \hbox {$\TirName {#1}\;$}\relax
\advance \hsize by -\wd0\box0}
\define@key {mpr}{width}{\hsize #1}
\define@key {mpr}{sep}{\def\mpr@sep{#1}}
\define@key {mpr}{before}{#1}
\define@key {mpr}{lab}{\let \RefTirName \TirName \def \mpr@rulename {#1}}
\define@key {mpr}{Lab}{\let \RefTirName \TirName \def \mpr@rulename {#1}}
\define@key {mpr}{narrower}{\hsize #1\hsize}
\define@key {mpr}{leftskip}{\hskip -#1}
\define@key {mpr}{reduce}[]{\let \mpr@fraction \mpr@@reduce}
\define@key {mpr}{rightskip}
{\setbox \mpr@right \hbox {\unhbox \mpr@right \hskip -#1}}
\define@key {mpr}{LEFT}{\setbox0 \hbox {$#1$}\relax
\advance \hsize by -\wd0\box0}
\define@key {mpr}{left}{\setbox0 \hbox {$\TirName {#1}\;$}\relax
\advance \hsize by -\wd0\box0}
\define@key {mpr}{Left}{\llap{$\TirName {#1}\;$}}
\define@key {mpr}{right}
{\setbox0 \hbox {$\;\TirName {#1}$}\relax \advance \hsize by -\wd0
\setbox \mpr@right \hbox {\unhbox \mpr@right \unhbox0}}
\define@key {mpr}{RIGHT}
{\setbox0 \hbox {$#1$}\relax \advance \hsize by -\wd0
\setbox \mpr@right \hbox {\unhbox \mpr@right \unhbox0}}
\define@key {mpr}{Right}
{\setbox \mpr@right \hbox {\unhbox \mpr@right \rlap {$\;\TirName {#1}$}}}
\define@key {mpr}{vdots}{\def \mpr@vdots {\@@atop \mpr@vdotfil{#1}}}
\define@key {mpr}{after}{\edef \mpr@after {\mpr@after #1}}
\newcommand \mpr@inferstar@ [3][]{\setbox0
\hbox {\let \mpr@rulename \mpr@empty \let \mpr@vdots \relax
\setbox \mpr@right \hbox{}%
$\setkeys{mpr}{#1}%
\ifx \mpr@rulename \mpr@empty \mpr@inferrule {#2}{#3}\else
\mpr@inferrule [{\mpr@rulename}]{#2}{#3}\fi
\box \mpr@right \mpr@vdots$}
\setbox1 \hbox {\strut}
\@tempdima \dp0 \advance \@tempdima by -\dp1
\raise \@tempdima \box0}
\def \mpr@infer {\@ifnextchar *{\mpr@inferstar}{\mpr@inferrule}}
\newcommand \mpr@err@skipargs[3][]{}
\def \mpr@inferstar*{\ifmmode
\let \@do \mpr@inferstar@
\else
\let \@do \mpr@err@skipargs
\PackageError {mathpartir}
{\string\inferrule* can only be used in math mode}{}%
\fi \@do}
%%% Exports
% Envirnonment mathpar
\let \inferrule \mpr@infer
% make a short name \infer is not already defined
\@ifundefined {infer}{\let \infer \mpr@infer}{}
\def \TirNameStyle #1{\small \textsc{#1}}
\def \tir@name #1{\hbox {\small \TirNameStyle{#1}}}
\let \TirName \tir@name
\let \DefTirName \TirName
\let \RefTirName \TirName
%%% Other Exports
% \let \listcons \mpr@cons
% \let \listsnoc \mpr@snoc
% \let \listhead \mpr@head
% \let \listmake \mpr@makelist
\endinput

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,166 @@
%%
%% This is file `mhsetup.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% mhsetup.dtx (with options: `package')
%%
%% It may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3
%% of this license or (at your option) any later version.
%% The latest version of this license is in
%% http://www.latex-project.org/lppl.txt
%% and version 1.3 or later is part of all distributions of LaTeX
%% version 2003/12/01 or later.
%%
%% This work has the LPPL maintenance status "maintained".
%%
%% The Current Maintainer of this work is Morten H\o gholm.
%%
%% This work consists of the files mhsetup.dtx and mhsetup.ins and
%% the derived file mhsetup.sty.
%%
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{mhsetup}
[2004/10/10 v1.0b programming setup (MH)]
\def\MHInternalSyntaxOn{
\edef\MHInternalSyntaxOff{%
\catcode`\noexpand\~=\the\catcode`\~\relax
\catcode`\noexpand\ =\the\catcode`\ \relax
\catcode`\noexpand\^^I=\the\catcode`\^^I\relax
\catcode`\noexpand\@=\the\catcode`\@\relax
\catcode`\noexpand\:=\the\catcode`\:\relax
\catcode`\noexpand\_=\the\catcode`\_\relax
\endlinechar=\the\endlinechar\relax
}%
\catcode`\~=10\relax
\catcode`\ =9\relax
\catcode`\^^I=9\relax
\makeatletter
\catcode`\_=11\relax
\catcode`\:=11\relax
\endlinechar=` %
\relax
}
\MHInternalSyntaxOn
\AtEndOfPackage{\MHInternalSyntaxOff}
\let\MH_let:NwN \let
\def\MH_let:cN #1#2{
\expandafter\MH_let:NwN \csname#1\endcsname#2}
\def\MH_let:cc #1#2{
\expandafter\MH_let:NwN\csname#1\expandafter\endcsname
\csname#2\endcsname}
\def\MH_new_boolean:n #1{
\expandafter\@ifdefinable\csname if_boolean_#1:\endcsname{
\@namedef{boolean_#1_true:}
{\MH_let:cN{if_boolean_#1:}\iftrue}
\@namedef{boolean_#1_false:}
{\MH_let:cN{if_boolean_#1:}\iffalse}
\@nameuse{boolean_#1_false:}%
}
}
\def\MH_set_boolean_F:n #1{ \@nameuse{boolean_#1_false:} }
\def\MH_set_boolean_T:n #1{ \@nameuse{boolean_#1_true:} }
\def\MH_if_boolean:nTF #1{
\@nameuse{if_boolean_#1:}
\expandafter\@firstoftwo
\else:
\expandafter\@secondoftwo
\fi:
}
\def\MH_if_boolean:nT #1{
\@nameuse{if_boolean_#1:}
\expandafter\@firstofone
\else:
\expandafter\@gobble
\fi:
}
\def\MH_if_boolean:nF #1{
\@nameuse{if_boolean_#1:}
\expandafter\@gobble
\else:
\expandafter\@firstofone
\fi:
}
\@ifundefined{if:w}{\MH_let:NwN \if:w =\if}{}
\@ifundefined{if_meaning:NN}{\MH_let:NwN \if_meaning:NN =\ifx}{}
\@ifundefined{else:}{\MH_let:NwN \else:=\else}{}
\@ifundefined{fi:}{\MH_let:NwN \fi:=\fi}{}
\@ifundefined{if_num:w}{\MH_let:NwN \if_num:w =\ifnum}{}
\@ifundefined{if_dim:w}{\MH_let:NwN \if_dim:w =\ifdim}{}
\@ifundefined{if_case:w}{\MH_let:NwN \if_case:w =\ifcase}{}
\@ifundefined{or:}{\MH_let:NwN \or:=\or}{}
\def\MH_cs_to_str:N {\expandafter\@gobble\string}
\@ifundefined{eTeXversion}
{
\MH_let:NwN \MH_protected:\relax
\def\MH_setlength:dn{\setlength}
\def\MH_addtolength:dn{\addtolength}
}
{
\MH_let:NwN \MH_protected:\protected
\def\MH_setlength:dn #1#2{#1=\dimexpr#2\relax\relax}
\def\MH_addtolength:dn #1#2{\advance#1 \dimexpr#2\relax\relax}
}
\def\MH_keyval_alias_with_addon:nnnn #1#2#3#4{
\@namedef{KV@#1@#2}{\@nameuse{KV@#1@#3}#4}
\@namedef{KV@#1@#2@default}{\@nameuse{KV@#1@#3@default}#4}}
\def\MH_keyval_alias:nnn #1#2#3{
\MH_keyval_alias_with_addon:nnnn {#1}{#2}{#3}{}}
\def\MH_use_choice_i:nnnn #1#2#3#4{#1}
\def\MH_use_choice_ii:nnnn #1#2#3#4{#2}
\def\MH_use_choice_iii:nnnn #1#2#3#4{#3}
\def\MH_use_choice_iv:nnnn #1#2#3#4{#4}
\long\def\MH_nospace_ifnextchar:Nnn #1#2#3{
\MH_let:NwN\reserved@d=~#1
\def\reserved@a{#2}
\def\reserved@b{#3}
\futurelet\@let@token\MH_nospace_nextchar:
}
\def\MH_nospace_nextchar:{
\if_meaning:NN \@let@token\reserved@d
\MH_let:NwN \reserved@b\reserved@a
\fi:
\reserved@b
}
\long\def\MH_nospace_testopt:nn #1#2{
\MH_nospace_ifnextchar:Nnn[
{#1}
{#1[{#2}]}
}
\def\MH_nospace_protected_testopt:n #1{
\if_meaning:NN \protect\@typeset@protect
\expandafter\MH_nospace_testopt:nn
\else:
\@x@protect#1
\fi:
}
\@ifundefined{kernel@ifnextchar}
{\MH_let:NwN \kernel@ifnextchar \@ifnextchar}
{}
\MH_let:NwN \MH_kernel_xargdef:nwwn \@xargdef
\long\def\MH_nospace_xargdef:nwwn #1[#2][#3]#4{
\@ifdefinable#1{
\expandafter\def\expandafter#1\expandafter{
\expandafter
\MH_nospace_protected_testopt:n
\expandafter
#1
\csname\string#1\endcsname
{#3}}
\expandafter\@yargdef
\csname\string#1\endcsname
\tw@
{#2}
{#4}}}
\providecommand*\MHPrecedingSpacesOff{
\MH_let:NwN \@xargdef \MH_nospace_xargdef:nwwn
}
\providecommand*\MHPrecedingSpacesOn{
\MH_let:NwN \@xargdef \MH_kernel_xargdef:nwwn
}
\endinput
%%
%% End of file `mhsetup.sty'.

Binary file not shown.

After

Width:  |  Height:  |  Size: 103 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 629 KiB

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 952 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 737 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 472 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 459 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 478 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 518 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1012 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1015 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 958 KiB

Some files were not shown because too many files have changed in this diff Show More