\fixme{THIS SHOULD NOT BE INCLUDED ANYMORE!}
+\inputminted{c++}{../image-restoration/graph.cpp}
+
\end{equation}
\label{def:extended_tv}
\end{definition}
-\nomenclature{$\TVA(u)$}{Anisotropic total variation of image $u$ given
-the anisotropy tensor $A$}%
+\nomenclature{$\TVA(u)$}{Anisotropic total variation of $u$ given
+anisotropy tensor $A$}%
With this extended definition, we have arrived at a minimization problem
where we seek to find a minimizer of the functional
\emph{noise scale}, and it controls the scale at which details are
considered to be noise.
+\begin{figure}
+ \centering{}
+ \begin{subfigure}[b]{0.45\textwidth}
+ \includegraphics[width=\textwidth]{fig/factory/finger/n_q200.png}
+ \end{subfigure}
+ ~
+ \begin{subfigure}[b]{0.45\textwidth}
+ \includegraphics[width=\textwidth]{fig/factory/finger/r_p2_n32_b15000_g150_r20_s3_edge.png}
+ \end{subfigure}
+ \caption[The edge detector $\abs{\nabla f_\sigma(x)}$]{%
+ A noisy fingerprint on the left, and the largest eigenvalue of
+ the structure tensor is $\abs{\nabla f_\sigma(x)}^2$ on the
+ left, which---as we can see---functions as an edge
+ detector.
+ }
+ \label{fig:edges}
+\end{figure}
+
As seen in Figure~\ref{fig:edges}, the edge detector is fine for
detecting edges, but it can not give us information about larger
structures, like corners and textures, which is why we introduce
which affects the structure tensor. Thus it defines the size of the
structures we want our anisotropy tensor to be sensitive to.
-\begin{figure}
- \centering{}
- \begin{subfigure}[b]{0.45\textwidth}
- \includegraphics[width=\textwidth]{fig/factory/finger/n_q200.png}
- \end{subfigure}
- ~
- \begin{subfigure}[b]{0.45\textwidth}
- \includegraphics[width=\textwidth]{fig/factory/finger/r_p2_n32_b15000_g150_r20_s3_edge.png}
- \end{subfigure}
- \caption[The edge detector $\abs{\nabla f_\sigma(x)}$]{%
- A noisy fingerprint on the left, and the largest eigenvalue of
- the structure tensor is $\abs{\nabla f_\sigma(x)}^2$ on the
- left, which---as we can see---functions as an edge
- detector.
- }
- \label{fig:edges}
-\end{figure}
-
The smoothed tensor $S_\rho(x)$ can easily be verified to be symmetric
positive semi-definite, just like $S_0(x)$. In addition, when $\rho >
0$, the elements of $S_\rho$ are smooth maps from $\Omega$ to
\section{Anisotropic coarea formula}
-The anisotropic coarea formula we will present here allows us to write
-the anisotropic total variation as an integral over the levels of the
+The anisotropic coarea formula we present here will allow us to write
+the an\-isotropic total variation as an integral over the levels of the
image. For a similar presentation of the regular coarea formula for all
$f \in \BV(\Omega)$ see \cite{evans1991measure}.
Note that \eqref{eq:positive_int} only holds for non-negative images,
which complicates the proof of the anisotropic coarea formula a little.
-\begin{figure}
- \input{fig/eta_r}
-\end{figure}
-
\begin{theorem}[Anisotropic coarea formula]
Given an image $u \in \BV(\Omega)$, the anisotropic total variation
can be written as an integral over all the levels
\end{cases}
\end{aligned}
\end{equation}
+ \begin{figure}%
+ \input{fig/eta_r}%
+ \end{figure}%
visualized in Figure~\ref{fig:eta_r_both}. By
composing the function $\eta_r$ with our image $u$ and using Green's
formula, for example from \cite[Corollary
integration formula, and the discretization, where an approximation of the
perimeter will be computed using a graph cut machinery.
-\section{Cauchy--Crofton formulas}
+\section{Anisotropic Cauchy--Crofton formula}
\begin{figure}
\input{fig/line_param}
invariant under rotations.
\nomenclature{$\mathcal{L}$}{The set of all straight lines in the
plane}%
-\nomenclature{$\ell_{\phi, \rho}$}{A line given by the angle of the
-normal $\phi$ and the distance to origin $\rho$}%
-\nomenclature{$\ell_{\nu, \rho}$}{A line given by a tangent vector $\nu$
-and the distance to origin $\rho$}%
+\nomenclature{$\ell_{\phi, \rho}$}{Line given by angle of normal
+$\phi$ and distance to origin $\rho$}%
+\nomenclature{$\ell_{\nu, \rho}$}{Line given by tangent vector $\nu$
+and distance to origin $\rho$}%
\begin{theorem}[The Euclidean Cauchy--Crofton formula]
Given a differentiable curve $C$ in $\mathbb{R}^2$, the length of
this curve $\abs{C}$ is related to the set of lines $\mathcal{L}$ as
a curve $\gamma$ parametrized by some parameter $t$ becomes
\nomenclature{$M(x)$}{The metric tensor}%
\nomenclature{$\abs{C}$}{The length of the curve $C$}%
-\nomenclature{$\abs{C}_M$}{The length of the curve $C$ calculated using
+\nomenclature{$\abs{C}_M$}{The length of the curve $C$ using
the metric tensor $M$}%
\begin{equation}
\abs{\gamma}_M = \int_\gamma \sqrt{\langle \dot{\gamma},
\label{chap:discrete}
The whole transformation from the initial functional in
-\eqref{eq:first_anisotropic_functional} through the anisotropic coarea
+\eqref{eq:first_anisotropic_functional}, through the an\-isotropic coarea
formula and the Cauchy--Crofton formula was motivated by the
discrete formulation which will be described here. After discretizing
the functional, we will see how a graph cut approach can be used to find
\begin{equation}
\Delta \rho = \frac{\delta^2}{\norm{e}}.
\end{equation}
+ A visual argument for the same result can be seen in
+ Figure~\ref{fig:area_proof}.
\end{proof}
Inserting $\Delta \rho = \delta^2 / \norm{e}$ and the tensor
approximation of \eqref{eq:tensor_approx} into the curve length
N_x(\lambda)\big) \cdot u_x^\lambda, \\
F_{x,y}^\lambda(u_x^\lambda, u_y^\lambda)
&= \abs{u_x^\lambda - u_y^\lambda} \frac{\det M(e_{xy})
- \norm{e_{xy}}^2 \delta^2 \Delta \phi}{2 \left( e_{xy}^T \cdot
+ \norm{e_{xy}}^2 \, \delta^2 \, \Delta \phi}{2 \left( e_{xy}^T \cdot
M(e_{xy}) \cdot e_{xy} \right)^{\sfrac{3}{2}}}.
\end{aligned}
\label{eq:final_discretization}
neighborhood stencil, to make sure that we get a reasonable
approximation of the perimeter lengths.
-\section{Graph cut formulation}
+\section{Graph cut approach}
The discretization we arrived at in \eqref{eq:final_discretization} can
be minimized using graph cuts. For each level $\lambda$, a minimum graph
with capacity function $c$, one might call it a capacitated graph or a
flow network, but as all our graphs will be capacitated from this point,
we will just call them graphs and we write $G = (V, E, c)$.
-\nomenclature{$G = (V,E,c)$}{A graph given by the set of vertices $V$,
-the set of edges $E$, and the capacity function $c$}%
-\nomenclature{$c(u,v)$}{The capacity function $c : V \times V \to \left[0, \infty \right)$}%
+\nomenclature{$G = (V,E,c)$}{Graph given by the vertices $V$,
+edges $E$, and capacity function $c$}%
+\nomenclature{$c(u,v)$}{Capacity function $c : V \times V \to \left[0, \infty \right)$}%
There are two special vertices in the graph, the source $s$ and the
sink $t$. Contrary to other vertices, which can neither produce nor
their argument and then ignore all pixels except the ones they actually
depend on.
-\subsection{Graph construction}
-\label{sec:graph_construction}
-
-\begin{figure}[t]
+\begin{figure}[h]
\input{fig/norm_subgraph}
\end{figure}
+\subsection{Graph construction}
+\label{sec:graph_construction}
+
We will construct a graph in such a way that if a vertex
$u^\lambda_x$ ends up on the source side of the cut we set $u^\lambda_x
= 1$, and if it ends up on the sink side we set $u^\lambda_x = 0$, as in
the output image close to the original image, and the regularization
term coming from our aim to minimize the total variation.
-\begin{table}[b]
+\subsubsection{Fidelity term}
+
+\begin{table}[t]
\centering
\caption[Graph construction for $F_\lambda^x(u^\lambda_x)$]{Each row
represents one of the two possible values of
\label{tab:fid_energy}
\end{table}
-\subsubsection{Fidelity term}
-
-\begin{figure}[t]
- \input{fig/neigh_subgraph}
-\end{figure}
-
The fidelity term of our discrete functional
\eqref{eq:final_discretization}
simplifies to
energies in \eqref{eq:neigh_energies} are especially simple, the
construction and presentation is simplified.
+\begin{figure}
+ \input{fig/neigh_subgraph}
+\end{figure}
+
Figure~\ref{fig:neigh_subgraph} shows two different ways of how a graph
can be constructed to represent the regularization term.
See Table~\ref{tab:neigh_energy} for an overview of how the values
] (s) at (3, 2.19) {};
\end{tikzpicture}
-\caption[Lower semicontinuous function $f$]{
- A lower semicontinuous function $f : \mathbb{R} \to \mathbb{R}$ can
+\caption[Lower semi-continuous function $f$]{
+ A lower semi-continuous function $f : \mathbb{R} \to \mathbb{R}$ can
have discontinuities, but for a convergent sequence $x_k \to x$ we
always have $f(x) \leq \liminf_{k \to \infty} f(x_k)$.
}
%\mathtoolsset{showonlyrefs=true}
-\newminted{c++}{fontsize=\tiny}
+\newminted{cpp}{fontsize=\tiny}
\usepackage{polyglossia}
\setmainlanguage[variant=american]{english}
+\setotherlanguage{norsk}
\usepackage[hidelinks]{hyperref}
%\usepackage{makeidx}
%\makeindex
+\renewcommand{\nomname}{List of Symbols}
+
\input{commands}
\makenomenclature
\section*{Sammendrag}
-I denne master-avhandlingen ser vi på en spesifikk kant-bevarende
-støyfjerningsalgoritme basert på «total variation». Vi vil ta for oss
+\begin{norsk}
+
+I denne masteroppgaven ser vi på en spesifikk kant-bevarende
+støyfjerningsalgoritme basert på «total variation». Vi tar for oss
at «total variation» i noen tilfeller fører til tap av kontrast i
detaljer og tynne strukturer. For å redusere kontrast-tapet introduserer
-vi en retningsavhengig anisotrop tensor. Denne tensoren kontrollerer
+vi en retningsavhengig anisotropitensor. Denne tensoren kontrollerer
støyfjerningen basert på posisjonen i bildet, og retningen til
-gradienten. Den blir konstruert basert på kant-informasjon fra det
-opprinnelige støyete bildet. Vi optimerer funksjonalen ved hjelp av et
+gradienten i punktet. Den blir konstruert basert på kant-informasjon fra det
+opprinnelige støyete bildet. Vi minimerer den resulterende funksjonalen
+i et
graf-kutt-rammeverk, som er gjort mulig ved hjelp av en coarea- og en
-Cauchy--Crofton-likning. Vi avslutter med en numerisk studie og
-exprimentering på parametrene og diskusjon av resultatene.
+Cauchy--Crofton-likning. Vi avslutter med en numerisk studie,
+eksperimentering med parametrene og diskusjon av resultatene.
+
+\end{norsk}
\vspace*{\fill}
\setlength{\parskip}{0.4cm}
\setlength{\parindent}{0cm}
This master thesis concludes my study at the Applied Physics and
-Mathematics Master's degree programme with specialization in Industrial
+Mathematics Master's degree program with specialization in Industrial
Mathematics at the Norwegian University of Science and Technology
(NTNU).
work with my project and this thesis.
Finally I would like to thank my family for their support, and Mats,
-Lars, Kine, Hager, Henrik and Edvard for productive
+Lars, Kine, Hager, Edvard and Henrik for productive
discussions around the coffee pot.
Bjørn Rustad, \today.
\markboth{\MakeUppercase\nomname}{\MakeUppercase\nomname}
\printnomenclature[2.5cm]
-%\cleardoublepage
-%% En latex-kommando for å si fra at kapitlene/seksjonene fra nå
-%% av skal nummereres med store bokstaver:
-%\appendix
-%
-%\input{appendix}
+\cleardoublepage
+% En latex-kommando for å si fra at kapitlene/seksjonene fra nå
+% av skal nummereres med store bokstaver:
+\appendix
+
+\input{appendix}
% Indeks for rapporten. Ta bort prosenttegn hvis du vil ha det med.
%\printindex
-\chapter{Maximum flow approach}
+\chapter{Maximum flow}
\label{chap:maxflow}
In the previous section we have seen how finding the minimum cut of
constraint and preflow constraint remain satisfied assuming they were
satisfied before the procedure was started.
-\subsection{Putting it all together}
+\subsection{Final algorithm}
+
These basic procedures are then applied to active vertices and admissible
edges until we obtain our minimum cut. We will see later that when there
are no more active vertices, we can extract the minimum cut from the
these edges will increase monotonically with decreasing
$\lambda$ parameter.
\item[Edges from $u$ to $v$\textmd{:}]
- These edges have no $\lambda$-dependence and will remain
+ These edges do not depend on $\lambda$ and will remain
unchanged.
\item[Edges from $v$ to $t$\textmd{:}]
As seen in Figure~\ref{fig:norm_subgraph_pos} the capacity of
Goldfarb and Yin \cite{goldfarb2009parametric} have found that the
divide and conquer approach only yields improved performance when using
-the $L^2$ norm in the fidelity term. This has to do with the fact that
-the fidelity term for the $L^1$ norm only changes once for each pixel,
-as we can see in Figure~\ref{fig:norm_evolution}, reducing the amount of
-work that has to be done in each iteration of the regular parametric
-push-relabel algorithm.
+the $L^2$ norm in the fidelity term.
See \cite{gallo1989fast}, \cite{hochbaum2001efficient} and
\cite{goldfarb2009parametric} for more information.
stay non-negative. The edge from $u_\lambda^x$ to $t$ is non-decreasing
with decreasing $\lambda$ parameter.
-\begin{table}[b]
+\begin{table}[t]
\centering
\caption[Graph construction for $F_\lambda^x(u^\lambda_x)$ in the
Boykov--Kolmogorov algorithm]{
We will assume that the given image $f$ is a combination of an
underlying, actual image $u^*$, and some noise $\delta$. The simplest
-\nomenclature{$\delta$}{Noise}%
+\nomenclature{$\delta$}{Noise function}%
model is additive noise where the assumption is that $f = u^* + \delta$.
\nomenclature{$u^*$}{Usually unknown, actual image without noise}%
There is also multiplicative noise where $f = u^* \cdot \delta$. An
\begin{equation}
u_\sigma := K_\sigma * \tilde{u}
\end{equation}
-\nomenclature{$u_\sigma$}{Edge estimator, image $u$ smoothed with a Gaussian of
-parameter $\sigma$}%
and $\tilde{u}$ is an extension of $u$ from $\Omega$ to $\mathbb{R}^2$
\nomenclature{$\tilde{u}$}{Symmetric extension of $u$ from $\Omega$ to
$\mathbb{R}^2$}%
smoothing across edges, the solution of \eqref{eq:aniso_diff} will still be
infinitely differentiable \cite{weickert1998anisotropic}, i.e.\ $u(T) \in
C^\infty(\Omega)$ for $T > 0$. Thus there are no real discontinuities, and
-\nomenclature{$C^\infty(\Omega)$}{The space of infinitely differentiable
+\nomenclature{$C^\infty(\Omega)$}{Space of infinitely differentiable
functions from $\Omega$ to $\mathbb{R}$.}%
no real edges in the solution.
$\Omega$.
\label{def:tv}
\end{definition}
-\nomenclature{$\TV(u)$}{Total variation of the image $u$}%
-\nomenclature{$C^\infty_c\left(\Omega, \mathbb{R}^2\right)$}{The space of smooth
+\nomenclature{$\TV(u)$}{Total variation of $u$}%
+\nomenclature{$C^\infty_c\left(\Omega, \mathbb{R}^2\right)$}{Space of smooth
functions from $\Omega$ to $\mathbb{R}^2$ with compact support in
$\Omega$}%
-\nomenclature{$\varphi$}{Test function}%
Note that since $\Omega$ is open and bounded, the test functions
$\varphi$ vanish on the boundary of $\Omega$. Thus no variation is
}
\label{fig:n_circle_72}
\end{subfigure}
+ \vspace*{0.1cm}%
\begin{subfigure}[t]{0.30\textwidth}
\centering
}
\label{fig:n_octagon_72}
\end{subfigure}
+ \vspace*{0.1cm}%
\begin{subfigure}[t]{0.30\textwidth}
\centering
Figure~\ref{fig:n_circle_8}. However the stencil of size 72 manages to
keep the circular shape.
-Next, in Figure~\ref{fig:n_octagon}, we see that the stencil of size 8
+In Figure~\ref{fig:n_octagon}, we see that the stencil of size 8
actually favors octagon-like shapes, as the restored shape is the same
octagon, just with some contrast loss.
}
\label{fig:finger_contrast_atv2}
\end{subfigure}
- \caption[Comparison contrast loss in regular an anisotropic restoration]{%
+ \caption[Comparison of contrast loss in regular and anisotropic
+ total variation]{%
A noisy fingerprint restored using both isotropic and
anisotropic total variation to see how the contrast loss
compares. Parameters: $\abs{\mathcal{N}} = 32$, $\sigma = 3$,
-\title{Anisotropic total variation based image restoration using graph
-cuts}
+\title{Anisotropic Total Variation Based Image Restoration Using Graph
+Cuts}
\date{\today}