]> git.rustad.me Git - master/commitdiff
Some more theory
authorBjørn Rustad <bjorn@rustad.me>
Mon, 3 Nov 2014 16:52:40 +0000 (17:52 +0100)
committerBjørn Rustad <bjorn@rustad.me>
Mon, 3 Nov 2014 16:52:40 +0000 (17:52 +0100)
bib.bib
commands.tex
theory.tex

diff --git a/bib.bib b/bib.bib
index 9498a6a2c8aa3c5347e56129c0388c3258517565..299f44414a63db0a22bc7a81158b973831cfc894 100644 (file)
--- a/bib.bib
+++ b/bib.bib
        URL = {http://dx.doi.org/10.1007/s00245-010-9105-x},\r
 }\r
 \r
+@INPROCEEDINGS{olsson2009extending,\r
+       author={Olsson, C. and Byrod, M. and Overgaard, N.C. and Kahl, F.}, \r
+       booktitle={Computer Vision, 2009 IEEE 12th International Conference on}, \r
+       title={Extending continuous cuts: Anisotropic metrics and expansion moves}, \r
+       year={2009}, \r
+       month={Sept}, \r
+       pages={405-412}, \r
+       doi={10.1109/ICCV.2009.5459206}, \r
+       ISSN={1550-5499},\r
+}\r
+\r
 </bibtex>\r
index 6110fdbf27f9f08c795ebbc3e8f10a0ffc538190..3feb5b36d7a75a99bcf2582ab4b813171be5d821 100644 (file)
@@ -2,10 +2,10 @@
 \newcommand{\norm}[1]{\lVert #1 \rVert}
 \newcommand{\diver}{\mathop{\mathrm{div}}\nolimits}
 \newcommand{\TV}{\mathrm{TV}}
-\newcommand{\TVM}{\mathrm{TV}_M}
+\newcommand{\TVA}{\mathrm{TV}_A}
 \newcommand{\BV}{\mathrm{BV}}
 \newcommand{\Per}{\mathrm{Per}}
-\newcommand{\PerM}{\mathrm{Per}_M}
+\newcommand{\PerA}{\mathrm{Per}_A}
 \newcommand{\idfun}{\chi}
 \newcommand{\dpdr}{d\phi \, d\rho}
 \newcommand{\Ahalf}{A^{\sfrac{1}{2}}}
index 44adc3dd6a299dbcd86ac7019b33728e980ddd37..0997e59fe0ea0dcef382d3ce3a6a402a700ffc37 100644 (file)
@@ -1,11 +1,14 @@
 \chapter{Continous formulation}
 
-This is the chapter containing all the theory of the presented
-restoration method. The order in which everything is presented is not
-fixed. For example how much should we discuss the details of the
-anisotropy matrix $M$ before introducing the coarea and perimiter
-theory? Because the coarea formula \emph{can} be presented in a very
-general form. We will figure that out as we go.
+From the introduction we see that there are many different approaches to
+the image restoration problem, all with their own strengths and
+weaknesses. The method considered in this thesis is an anisotropic total
+variation formulation, and the hope is that we keep the strengths of the
+anisotropic diffusion and total variation methods, while eliminating
+some of their weaknesses. This chapter will be devoted to the continuous
+formulation of the method. We will look at the functional we
+want to minimize, briefly discuss its well-posedness, and through some
+important theorems, transform it into a form that is easy to discretize.
 
 \section{Anisotropic total variation}
 
@@ -13,34 +16,41 @@ From anisotropic diffusion in \fixme{ref} we borrow the idea of
 making the regularization in each point directionally dependant. We
 introduce the anisotropic total variation
 \begin{equation}
-    \TVM(u) = \int_\Omega \sqrt{\nabla u(x)^T M(x) \nabla u(x)} \, dx
+    \TVA(u) = \int_\Omega \sqrt{\nabla u(x)^T A(x) \nabla u(x)} \, dx
 \end{equation}
-\fixme{To differential or not to differential.}
-for all $u \in C_c^1(\Omega)$. We see that if $M(x)$ is the identity
-matrix we get the normal total variation from \fixme{ref}, but our goal
-is to control $M(x)$ such that $\nabla u(x)$ is weighted down across
-edges, and thus edges will be regularized less.
-\fixme{Why compact support?}
-
-Before introducing the anisotropic coarea formula, we extend the
-definition of this functional to the space $\BV(\Omega)$. Being
-symmetric positive definite, the matrix $A(x)$ can be factored into two
-symmetric matrices as $A(x) = Q(x) Q(x)$. We can then write
+for all $u \in C_c^1(\Omega)$. We see that if $A(x)$ is the identity
+matrix we get the usual total variation from \fixme{ref}. Our goal
+is to control $A(x)$ such that $\nabla u(x)$ is weighted down across
+edges, and thus the smoothing across the edges will be reduced.
+\fixme{Why compact support? They assume this in the anisotropic coarea
+formula paper, but I think it is enough to assume it for the test
+functions?}
+
+As we will not always be working with differentiable images, we extend
+the definition of the total variation functional to the space
+$\BV(\Omega)$. Being symmetric positive definite, the matrix $A(x)$ can
+be factored into two symmetric matrices as $A(x) = \Ahalf(x) \Ahalf(x)$. We can
+then write
 \begin{align}
-    \TVM(u) &= \int_\Omega \abs{Q \nabla u} \, dx \\
+    \TVA(u) &= \int_\Omega \abs{\Ahalf \nabla u} \, dx \\
            &= \sup_{\abs{\xi(x)}
-    \leq 1} \int_\Omega (Q \nabla u)^T \xi \, dx \\
-    &= \sup_{\abs{\xi(x)}\leq 1} \int_\Omega \nabla u \cdot Q\xi \, dx
+    \leq 1} \int_\Omega (\Ahalf \nabla u)^T \xi \, dx \\
+    &= \sup_{\abs{\xi(x)}\leq 1} \int_\Omega \nabla u \cdot \Ahalf\xi \, dx
     \\
-    &= \sup_{\abs{\xi(x)}\leq 1} \int_\Omega -u \diver (Q\xi) \, dx \\
-    &= \sup_{\eta^T A^{-1} \eta \leq 1} \int_\Omega -u \diver \eta \,
-    dx.
+    &= \sup_{\abs{\xi(x)}\leq 1} \int_\Omega u \diver (\Ahalf\xi) \, dx \\
+    &= \sup_{\eta^T A^{-1} \eta \leq 1} \int_\Omega u \diver \eta \,
+    dx,
 \end{align}
+where $\xi$ and $\eta$ are in $C_c^1(\Omega, \mathbb{R^2})$ the $C^1$
+vector fields with compact support. \fixme{Normally it's $C_c^\infty$ for
+the test functions, but maybe that can be fixed with some density
+argument?}
 If we let $\norm{\xi}_A = \sqrt{\xi^T A \xi}$ and $\norm{\eta}_A^* =
 \sqrt{\eta^T A^{-1} \eta}$, then our new extended definition reads
 \begin{equation}
-    \TVM(u) = \sup_{\substack{\xi \in C_c^1(\Omega; \mathbb{R}^N) \\
-    \norm{\xi(x)}_A^* \leq 1}} \int_\Omega -u \diver \xi \, dx.
+    \TVA(u) = \sup_{\norm{\xi}_A^* \leq 1} \int_\Omega u \diver \xi \,
+    dx.
+    \label{eq:extended_tv}
 \end{equation}
 
 \fixme{Energy function here?}
@@ -49,45 +59,64 @@ equation \cite{grasmair2010anisotropic}. This is only without the square
 root.}
 \fixme{Extend the functional}
 
-\section{Anisotropy tensor}
+\subsection{Anisotropy tensor}
 
 \fixme{
-    We discuss what kind of properties we want from the anisotropy
-    tensor, and also introduce the structure tensor (?) described by
-    Weickert. This tensor can be visualized, and can be used for edge
+    This tensor can be visualized, and can be used for edge
     detection. There is probably a bit to be said about the smoothing we
     do. We also discuss whether to use the noisy image (yes, probably),
     or the smoothed image (implicitly, complicated, possible
-    iteratively) in the structure tensor.  We then describe how the
+    iteratively) in the structure tensor. We then describe how the
     structure tensor is decomposed and transformed into our anisotropy
     tensor. Then there are some problems related to stability which we
     can discuss here, or maybe we should leave it for a later, more
     implementation-focused chapter.
 }
 
-There are many possible choices for the \fixme{metric} tensor $M(x)$, as
+There are many possible choices for the anisotropy tensor $A(x)$, as
 long as one fulfills the assumptions of \fixme{ref}. Additionally we
-will later need the eigenvalues to be finite and bounded away from zero
-(?).
+will later need the eigenvalues to be bounded above and bounded away
+from zero.
 
 Our wish for the metric tensor is that it down-weighs the variation
-across edges. We do not want the tensor to be sensitive to noise in the
-image. \fixme{Maybe refer to some figure}
-
-\fixme{A little more motivation.}
-A good starting point is the structure tensor
+across true edge in the image, meaning that true edges do not contribute
+as much in the total variation as they normally would. This in turn
+means that these edges will be less regularized. By true edges we mean
+that we do not want the tensor to be sensitive to noise in the image, so
+we somehow want to be sure about the edges we find. \fixme{Maybe refer
+to some figure}
+
+Edges can be found in many different ways, but as suggested by Weickert
+in his book on Anisotropic Diffusion \cite{weickert1998anisotropic}, a
+good starting point is the structure tensor
 \begin{equation}
-    S(x) := K_\rho * \left( \nabla u_\sigma(x) \otimes
-    \nabla u_\sigma(x) \right),
+    S(x) := K_\rho * \left( \nabla \tilde{f}_\sigma(x) \otimes
+    \nabla \tilde{f}_\sigma(x) \right),
     \label{eq:s_def}
 \end{equation}
-where the convolution is done componentwise. As this matrix is real and
-symmetric, it can be decomposed into
+where $\tilde{f}$ is the \fixme{symmetric} extension of the initial
+image from $\Omega$ to $\mathbb{R}^2$ and the $\sigma$ signifies a
+Gaussian smoothing $\tilde{f}_\sigma = K_\sigma * \tilde{f}$. The
+initial smoothing parameter $\sigma$, called the \emph{noise scale} by
+Weickert, will control how sensitive we are to noise and small details.
+
+The convolution with $K_\rho$ is done componentwise, and $\rho$, the
+\emph{integration scale} thus controls the size of the neighborhood from
+which the structure tensor is computed. It controls the size of the
+structures we want our anisotropy tensor to consider.
+
+But we can not use the structure tensor $S(x)$ directly as our
+anisotropy tensor $A(x)$, because $S(x)$ will be an operator with its
+\fixme{principal direction} in the direction of $\nabla
+\tilde{f}_\sigma$ which is the opposite of what we want. \fixme{more
+inspiration from weickert here, he has some good stuff.} The structure
+tensor $S(x)$ is real and symmetric, so it admits an eigendecomposition
 \begin{equation}
     S(x) = U(x) \Lambda(x) U(x)^T,
 \end{equation}
 where $\Lambda(x)$ is a matrix with the eigenvalues of $S(x)$ on the
-diagonal, while $U(x)$ has the eigenvectors of $S(x)$ as its columns.
+diagonal, while $U(x)$ is a rotation matrix and has the eigenvectors of
+$S(x)$ as its columns.
 
 If we consider the structure tensor of \eqref{eq:s_def} before
 convolving with the Gaussian function, it is clear that there will be
@@ -121,7 +150,7 @@ If the eigen-decomposition gave us
         0 & \lambda_2
     \end{pmatrix}
 \end{equation}
-where $\lambda_1 \geq \lambda_2$, then we construct a new matrix $M(x) =
+where $\lambda_1 \geq \lambda_2$, then we construct a new matrix $A(x) =
 U(x) \Sigma(x) U(x)^T$ where
 \begin{equation}
     \Sigma(x) = \begin{pmatrix}
@@ -150,116 +179,230 @@ regular total variation.
     here. The eigenvalues are extracted such that
 }
 
-\section{Analysis}
+\section{Well-posedness}
 
-\fixme{Section heading!}
+The theory of existence and uniqueness for these kinds of variational
+methods is a minefield of more or less subtle problems. Even if we
+restrict ourself to a nice space such as $L^2(\Omega)$ we will at some
+point run into problems. The discussion here is not meant to give the
+most rigorous background, but rather an overview of what needs to be
+shown. Some problems will be worked around, while other will be skipped
+with a reference to further theory.
 
-\fixme{
-    Existence and uniqueness should probably be mentioned here as well?
-    But how much do we say about it? Grasmair is an OK reference.  OK,
-    talked to Markus about it, it is very technical and does not give
-    much to do it properly, but should be discussed. Did he say that it
-    could be done in some smaller space $C^1$ or $C^2$ and then we could
-    leave the extension to someone else? For existence we need
-    coercivity (that we can't go infinitely far to get a better
-    solution) and weak lower semi-continuity (the lowest point always
-    exists at discontinuities), which means we consider the weak
-    topology induced by the weak convergence (?). We do some kind of
-    extension with $+\infty$ for functions outside our space, but that
-    means we lose coercivity, which we have to fix again. Uniqueness is
-    related to convexity. When the anisotropy tensor uses the smoothed
-    initial value, this is trivial (?), but not so much if we use the
-    output image in the anisotropy tensor. For us though, this will not
-    be the case.
-}
+The basic things we ask of our functional are lower semicontinuity
+and coercivity for existence and convexity for uniqueness. We restrict
+ourself to $L^2(\Omega)$, and leave the extension to $\BV(\Omega)$ to
+someone else \fixme{ref}.
 
-Earlier we had
+\subsection{Convexity}
+
+We start with convexity as it is the easiest to show. The fidelity term
+of our functional
 \begin{equation}
-    \abs{Du} = \int_{-\infty}^{+\infty} P(\{u \geq t\}) \, dt
+    \int_\Omega (u - v)^2 \, dx
 \end{equation}
-(or something like that) but now we have to change it up a little bit.
-Grasmair has a very general one in his coarea formula paper, which in
-the and gives
+is obviously strictly convex, as it is $0$ for $u = v$ and positive
+elsewhere. The anisotropic total variation
 \begin{equation}
-    \int_\Omega \alpha(Du) = \int_{-\infty}^{+\infty} P(\{u \geq
-    t\};\alpha;\Omega) \, dt = \int_{\partial^* U \cap \Omega}
-    \alpha\big(x,\nu_U(x)\big) \, d\mathcal{H}^{n-1}.
+    \TVA(u) = \sup_{\norm{\xi}_A^* \leq 1} \int_\Omega u \diver \xi \,
+    dx
 \end{equation}
-This might be where we discuss the Ciaccoppolini sets and all that
-stuff. We must also clarify what a perimeter is, and how it relates to a
-contour later.
+can be thought of as a norm, and is therefore convex. The sum of the two
+is thus strictly convex, which, given the existence of a minimizer,
+implies uniqueness.
 
-\section{Anisotropic coarea formula}
+\subsection{Coercivity}
+
+We need coercivity to show that we cannot go further and further away to
+obtain a better and better solution. This means that as $\norm{u}_{L^2}
+\to \infty$ should imply that $F(u) \to \infty$, which is obvious from
+the fidelity term for some fixed $v \in L^2(\Omega)$.
+
+From the coercivity we can conclude that we should be able to find some
+near-minimal solutions somewhere in $L^2(\Omega)$ without going too far
+away.
 
-We define the thresholded image at level $s$ as
+\begin{figure}
+    \input{fig/lower_semicont}
+\end{figure}
+
+\subsection{Lower semicontinuity}
+
+The lower semicontinuity is the most tricky part, and this is where we
+will take some shortcuts. Lower semicontinuity for a functional $F$ at a
+point $u$ means that at points $u_\epsilon$ close to $u$, the functional
+takes values either close to or above $F(u)$. More specifically, for a
+sequence $u_k$ converging to $u$, we have $F(u) \leq \liminf_k F(u_k)$.
+For a function $f : \mathbb{R} \to \mathbb{R}$ this can be visualized as
+in Figure \ref{fig:lower_semicont}. 
+
+\fixme{We consider the weak topology. Because it is convenient?}
+
+We say that a sequence $f_n$ in $L^2(\Omega)$ converges weakly to $f$ if
 \begin{equation}
-    u^s(x) = \begin{cases}
-        1 & \text{if } u(x) > s, \\
-        0 & \text{otherwise}.
-    \end{cases}
+    \lim_{n \to \infty} \int_\Omega f_n \, \xi \, dx = \int_\Omega f \, \xi \,
+    dx
 \end{equation}
-This allows us to write a non-negative image $u \geq 0$ as an integral
-over all the layers
+for all $\xi \in L^2(\Omega)$ and we write $f_n \rightharpoonup f$. The
+weak topology is characterized by the fact that all weakly convergent
+sequences also converge in the weak topology. Thus the mapping $u
+\mapsto \int_\Omega \xi u \, dx$ is weakly continuous for all $\xi \in
+L^2(\Omega)$. \fixme{some nets and stuff.}
+
+Before arguing that our own functional is weakly lower semi-continous, we
+present a much needed result.
+\begin{lemma}
+    Assume that the functional $F : L^2(\Omega) \to \mathbb{R}$ is
+    defined by
+    \begin{equation}
+        F = \sup_i F_i
+    \end{equation}
+    where all the $F_i$ are weakly lower semi-coninuous, then $F$ is
+    weakly lower semi-continuous, meaning that for any sequence $u_k
+    \rightharpoonup u$ we have $F(u) \leq \liminf_k F(u_k)$.
+\end{lemma}
+\begin{proof}
+    For any sequence $u_k \rightharpoonup u$ in $L^2(\Omega)$ we have
+    \begin{equation}
+        F(u) = \sup_i F_i(u) \leq \sup_i \liminf_{k \to \infty} F_i(u_k)
+    \end{equation}
+    from the weak lower semi-continuity of $F_i$. Using that $\liminf_{k
+    \to \infty} = \sup_k \inf_{k \leq l}$, we obtain
+    \begin{equation}
+        \begin{aligned}
+            F(u) &\leq \sup_i \sup_k \inf_{k \leq l} F_i(u_k) \\
+                 &= \sup_k \sup_i \inf_{k \leq l} F_i(u_k) \\
+                 &\leq \sup_k \inf_{k \leq l} \sup_i F_i(u_k) \\
+                 &= \liminf_{k \to \infty} F(u_k)
+        \end{aligned}
+    \end{equation}
+    which proves that $F$ is weakly lower semi-continuous.
+\end{proof}
+\fixme{This proof is not technically correct, as we have ignored the fact that
+in the weak topology, considering sequences is not really enough, and
+one should consider \emph{nets}. But we accept it for now and refer to
+(?) for further theory.}
+
+For our functional in \fixme{ref}, we first consider the fidelity term
+\begin{equation}
+    \int_\Omega (u - v)^2 \, dx = \sup_{\substack{\xi \in L^2(\Omega) \\
+    \norm{\xi}_{L^2} \leq \norm{u-v}_{L^2}}} \int_\Omega (u - v) \, \xi
+    \, dx.
+\end{equation}
+As the map $u \mapsto \int_\Omega (u - v) \xi\, dx$ is continous in the
+weak topology, the fidelity term is then a supremum of weakly continous
+functionals, and is thus weakly lower semi-continuous.
+
+For the regularization term the approach is similar. With our extended
+definition from \eqref{eq:extended_tv}, we have
+\begin{equation}
+    \TVA(u) = \sup_{\norm{\xi}_A^* \leq 1} \int_\Omega u \, \diver \xi \,
+    dx
+\end{equation}
+where $\xi \in C_c^\infty(\Omega, \mathbb{R}^2)$. This is again is a
+supremum of weakly continuous functionals. Thus the regularization term
+is also weakly lower semi-continuous.
+
+The usual ways of going from coercivity and lower semicontinuity do not
+work in infinite dimensions. See for example \fixme{Theorem 5.1 in
+\cite{scherzer2008variational}}. \fixme{And probably some other
+references to fix all the small inaccuracies}
+
+\section{Anisotropic coarea formula}
+
+The anisotropic coarea formula we will present here allows us, as in the
+Euclidean case, to write the anisotropic total variation as an integral
+over the levels of the image. First we define the thresholded image at
+level $s$.
+\begin{definition}[Thresholded image]
+    The thresholded image at level $s$ is the function
+    \begin{equation}
+        u^s(x) = \begin{cases}
+            1 & \text{if } u(x) > s, \\
+            0 & \text{otherwise.}
+        \end{cases}
+    \end{equation}
+    \label{def:thresholded_image}
+\end{definition}
+This will be used throughout the rest of the thesis and allows us to
+write a non-negative image $u \geq 0$ as an integral over all the layers
 \begin{equation}
     u = \int_0^\infty u^s \, ds.
+    \label{eq:positive_int}
 \end{equation}
+Note that it only holds for positive image, something which has to be
+worked around in the proof of the coarea formula. For the proof we will
+avoid measure theory and follow a proof given in
+\cite{olsson2009extending}.
+
+\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
     \begin{equation}
-        \TVM(u) = \int_{-\infty}^\infty \TVM(u^s) \, ds.
+        \TVA(u) = \int_{-\infty}^\infty \TVA(u^s) \, ds.
     \end{equation}
+    \label{thm:anisotropic_coarea}
 \end{theorem}
 \begin{proof}
-    Assume that $u \in C^1(\Omega) \cap \BV(\Omega)$. \fixme{Something
-    about the approximation arguments.}
-    \paragraph{First we prove that $\TVM(u) \leq \int_{-\infty}^\infty
-    \TVM(u^s) \, ds$.}
-    Assume that $u \geq 0$ such that the integral in \fixme{ref} holds,
-    then inserting \fixme{ref} into \fixme{ref} gives
+    Assume that $u \in C^1(\Omega) \cap \BV(\Omega)$. The extension to
+    all functions $u \in \BV(\Omega)$ complicates things and will not be
+    considered here.
+
+    \paragraph{First we prove that $\TVA(u) \leq \int_{-\infty}^\infty
+    \TVA(u^s) \, ds$.}
+    Assume that $u \geq 0$ such that the integral in
+    \eqref{eq:positive_int} holds, then inserting into the extended
+    total variation definition in \eqref{eq:extended_tv} gives
     \begin{align}
-        \TVM(u) &= \sup_{\norm{\xi}_A^* \leq 1} \int_\Omega -\left(
+        \TVA(u) &= \sup_{\norm{\xi}_A^* \leq 1} \int_\Omega \left(
         \int_0^\infty u^s ds \right) \diver \xi \, dx
-        = \sup_{\norm{\xi}_A^* \leq 1} \int_\Omega \int_0^\infty -u^s
+        = \sup_{\norm{\xi}_A^* \leq 1} \int_\Omega \int_0^\infty u^s
         \diver \xi \, ds \, dx \\
-        &\leq \int_0^\infty \left( \sup_{\norm{\xi}_A^*} \int_\Omega
-        -u^s \diver \xi \, dx \right) \, ds
-        = \int_0^\infty \TVM(u^s) \, ds.
+        &\leq \int_0^\infty \left( \sup_{\norm{\xi}_A^* \leq 1}
+        \int_\Omega u^s \diver \xi \, dx \right) \, ds
+        = \int_0^\infty \TVA(u^s) \, ds.
     \end{align}
-    For $u \leq 0$ we use that $\TVM(-v) = \TVM(v)$ and that $\TVM(c + v) =
-    \TVM(v)$ for any constant $c$. This allows us to show that
-    \fixme{also something about $u^{-r}$}
+    For $u \leq 0$ we use that $\TVA(-v) = \TVA(v)$ and that $\TVA(c + v) =
+    \TVA(v)$ for any constant $c$. Note that $-u \geq 0$ and that its
+    thresholded image $(-u)^s$ will be exactly the opposite of $u^{-s}$.
+    This allows us to show that
     \begin{align}
-        \TVM(u) &= \TVM(-u) \leq \int_0^\infty \TVM \big( (-u)^r \big) \,
+        \TVA(u) &= \TVA(-u) \leq \int_0^\infty \TVA \big( (-u)^r \big) \,
         dr \\
-        &= \int_0^\infty \TVM(1 - u^{-r}) \, dr = \int_0^\infty
-        \TVM(u^{-r}) \, dr = \int_{-\infty}^0 \TVM(u^s) \, ds.
+        &= \int_0^\infty \TVA(1 - u^{-r}) \, dr = \int_0^\infty
+        \TVA(u^{-r}) \, dr = \int_{-\infty}^0 \TVA(u^s) \, ds.
     \end{align}
     Next, we write a general $u$ as a difference between two positive
-    function $u = u_+ - u_-$ \fixme{They will not be differentiable
-    everywhere, but a.e.\ ?} and conclude that
+    functions $u = u_+ - u_-$ and conclude that
     \begin{align}
-        \TVM(u) &\leq \TVM(u_-) + \TVM(u_+) \\
-               &\leq \int_{-\infty}^0 \TVM\big((-u_-)^s\big) \, ds +
-        \int_0^\infty \TVM(u_+^s) \, ds\\
-        &= \int_{-\infty}^0 \TVM(u^s) \, ds + \int_0^\infty \TVM(u^s) \,
-        ds = \int_{-\infty}^\infty \TVM(u^s) \, ds
+        \TVA(u) &\leq \TVA(u_-) + \TVA(u_+) = \TVA(-u_-) + \TVA(u_+) \\
+               &\leq \int_{-\infty}^0 \TVA\big((-u_-)^s\big) \, ds +
+        \int_0^\infty \TVA(u_+^s) \, ds \\
+        &= \int_{-\infty}^0 \TVA(u^s) \, ds + \int_0^\infty \TVA(u^s) \,
+        ds = \int_{-\infty}^\infty \TVA(u^s) \, ds.
     \end{align}
-    \paragraph{Then we prove that $\TVM(u) \geq \int_{-\infty}^\infty
-    \TVM(u^s) \, ds$.}
+    Note that $u_+$ and $u_-$ will not be differentiable everywhere, but
+    we did not use the differentiability of $u$ in this part of the
+    proof.
+
+    \paragraph{Next we prove that $\TVA(u) \geq \int_{-\infty}^\infty
+    \TVA(u^s) \, ds$.}
     Define the function
     \begin{equation}
         m(t) = \int_{\{ x \in \Omega : u(x) \leq t\}} \norm{\nabla u}_A
         \, dx,
     \end{equation}
-    and note that $m(\infty) = \TVM(u)$. Since $m(t)$ is non-decreasing
+    and note that $m(\infty) = \TVA(u)$. Since $m(t)$ is non-decreasing
     with $t$, we can apply the existence theorem of Lebesgue \fixme{ref}
-    to conclude that $m'(t)$ exists a.e.\ (w.r.t.\ Lebesgue measure) and
-    that Lebesgue's inequality holds:
+    to conclude that $m'(t)$ exists almost everywhere and that
+    Lebesgue's inequality holds:
     \begin{equation}
         \int_{-\infty}^\infty m'(t)\, dt \leq m(\infty) - m(-\infty) =
-        \TVM(u).
+        \TVA(u).
     \end{equation}
     Next, fix an $s \in \mathbb{R}$ and define the function
     \begin{equation}
@@ -269,14 +412,16 @@ over all the layers
             1 & \text{if } t > s + r
         \end{cases}
     \end{equation}
-    visualized in Figure \fixme{fig} such that its derivative takes the
-    form shown in Figure \fixme{fig2}. We then have
+    visualized in Figure \ref{fig:eta_r} such that its derivative takes the
+    form shown in Figure \ref{fig:eta_r_diff}. By composing the function
+    $\eta_r$ with our image $u$ and Green's identity we obtain
     \begin{equation}
         \int_\Omega - \eta_r(u) \diver \xi \, dx
         = \int_\Omega \eta_r'(u) \nabla u\cdot \xi \, dx
         = \frac{1}{r} \int_{\{ s \leq u \leq s + r \}} \nabla u\cdot \xi
-        \, dx.
+        \, dx,
     \end{equation}
+    for all vector fields $\xi \in C_c^\infty(\Omega, \mathbb{R}^2)$.
     Assuming that $\norm{\xi}_A^* \leq 1$ we have
     \begin{align}
         \frac{m(s+r) - m(s)}{r}
@@ -286,65 +431,84 @@ over all the layers
         \xi \, dx
         = \int_\Omega -\eta_r(u) \diver \xi \, dx.
     \end{align}
-    As the limit of the left-hand side as $r \to 0$ exists almost
+    As the limit of the left-hand side when $r \to 0$ exists almost
     everywhere, suppose it exists at $s \in \mathbb{R}$, then
     \begin{equation}
         m'(s) \geq - \int_\Omega u^s \diver \xi \, dx
     \end{equation}
     since $\eta_r(u) \to u^s$ when $r \to 0$. As this holds for any
-    $\norm{\xi}_A^* \leq 1$, we get from \fixme{ref def} that $m'(s)
-    \geq \TVM(u_s)$ almost everywhere and conclude
+    $\norm{\xi}_A^* \leq 1$, we get from the extended total variation
+    definition in \eqref{eq:extended_tv} that $m'(s) \geq \TVA(u_s)$
+    almost everywhere and conclude that
     \begin{equation}
-        \TVM(u) \geq \int_{-\infty}^\infty m'(t) \, dt \geq
-        \int_{-\infty}^\infty \TVM(u^s) \, ds.
+        \TVA(u) \geq \int_{-\infty}^\infty m'(t) \, dt \geq
+        \int_{-\infty}^\infty \TVA(u^s) \, ds.
     \end{equation}
-    \fixme{something something set of measure zero, lebesgue integral
-    something something}
+    Thus the inequality have been proved in both directions, and we have
+    equality.
 \end{proof}
-This is where we magically introduce the perimeter, or more specifically
-\begin{equation}
-    \PerM(U;\Omega) = \TVM(\idfun_U).
-\end{equation}
-This is just a definition, the magic lies in the fact that we can
-measure this perimeter as usual, just making sure to take the metric
-tensor into account
-\begin{equation}
-    \PerM(U;\Omega) = \int_{\partial^*U \cap \Omega} \sqrt{\nu_U(x)^T
-    A(x) \nu_U(x)} \, d \mathcal{H}^{n-1}.
-\end{equation}
-And then we say a little bit about this reduced boundary. It is a bit
-wierd that we here consider the normal vector $\nu_U$ while when
-calculating the length of a curve in a Riemannian metric space we use
-the tangent vector
-\begin{equation}
-    L_a^b(c) = \int_a^b \norm{c'(t)}_A \, dt
-\end{equation}
-where $c: [a,b] \to \Omega$ is a parametrized curve, such that $c'(t)$
-is a tangent vector.
+This coarea formula is our first step in transforming the anisotropic
+total variation into an easily discretizisable expression.
 
-We are now left with finding $u \in BV(\Omega)$ that minimizes
+This is where we introduce the perimeter, or more specifically
+\begin{definition}[The anisotropic set perimeter]
+    Given an anisotropy tensor $A$ the anisotropic perimeter of a set
+    $U$ is defined as
+    \begin{equation}
+        \PerA(U;\Omega) = \TVA(\idfun_U).
+    \end{equation}
+    A measurable set $U \subset \Omega$ is of finite anisotropic
+    perimeter in $\Omega$ if $\idfun_U \in \BV(\Omega)$.
+\end{definition}
+The anisotropic set perimeter is not like the regular set perimeter and
+does not measure the length of the boundary of the set, but it can be
+calculated in the following way
 \begin{equation}
-    E_v(u) =
-    \int_\Omega (u - v)^2 \, dx
-    + \int_{-\infty}^\infty \PerM( \{ u >
-    \lambda \}; \Omega) \, d\lambda.
-    \label{eq:continuous_energy}
+    \begin{aligned}
+        \PerA(\{ u > s \}; \Omega) = \TVA(u^s) &= \sup_{\norm{\xi}_A^* \leq 1}
+        \int_\Omega u^s \diver \xi \, dx \\
+        &= \sup_{\norm{\xi}_A^* \leq 1} \int_{\{ u > s \}} \diver \xi \,
+        dx \\
+        &= \sup_{\norm{\xi}_A^* \leq 1} \int_{\partial \{ u > s\} } \nu_s
+        \cdot \xi \, dt \\
+        &= \sup_{\norm{\eta} \leq 1} \int_{\partial \{ u > s\} } \nu_s
+        \cdot \Ahalf \eta \, dt \\
+        &= \int_{\partial \{ u > s\} } \sqrt{\nu_s A \nu_s} \, dt.
+    \end{aligned}
 \end{equation}
+Here, $\nu_s$ is the unit normal of the level set $\{ u > s \}$ and by
+applying the divergence theorem we have assumed that the boundary is
+piecewise smooth, which holds for almost all level sets if $u$ is
+differentiable. A consideration of the perimeter of level sets of any
+function $u \in \BV(\Omega)$ would be heavy on measure theory, and can
+be found in for example \fixme{ref, markus-note? one of the books?}
+Further note that this is an integral of the anisotropic norm of the
+unit normal vector. The length of the boundary would normally be
+calculated by integrating the norm of the tangent vector. The connection
+will be made after the Cauchy--Crofton formulas have been introduced.
+\fixme{well, if we assumed differentiability, we wouldn't need the sup
+definition of the TV...}
+
+\fixme{and then some conclusion on where we are at.}
 
 \section{Cauchy--Crofton formulas}
 
-If we parametrize straight lines as shown in Figure \fixme{ref}, we can
+\begin{figure}
+    \input{fig/line_param}
+\end{figure}
+
+If we parametrize straight lines as shown in Figure \ref{fig:line_param}, we can
 define the set of all staight lines as $\mathcal{L} = \{ (\phi, \rho) :
 \phi \in [0, 2\pi), \rho \geq 0 \}$. We will write a line $l_{\phi,
 \rho} = l_{\nu, \rho}$ where $\nu$ is a unit vector along the line,
-i.e.\ $\nu = (\sin \phi, -\cos \phi)^T$. By defining the
+i.e.\ $\nu = (-\sin \phi, \cos \phi)^T$. By defining the
 measure on this set $d\mathcal{L} = \dpdr$ we are ready to introduce the
 Cauchy--Crofton formula, which gives us a way to calculate the length of
 a curve by looking at the measure of the set of lines that intersect the
 curve. Note that the measure $d\mathcal{L}$ is invariant under rigid
 motions, meaning combinations of translations and rotations.
 \begin{theorem}[The Euclidean Cauchy--Crofton formula]
-    Given a curve differentiable $C$ in $\mathbb{R}^2$, the length of
+    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
     follows
     \begin{equation}
@@ -360,13 +524,13 @@ energy function. The set of lines $\mathcal{L}$ is then discretized
 depending on our choice of neighborhood, and the length of the curve $C$
 can be approximated by a sum.
 
-Our space is equipped with a metric tensor $M(p)$ such that the inner
-product of two vectors in a point $p$ is calculated as $\langle a,
-b\rangle_M = \langle a, M(p) b \rangle$. The length of a curve $\gamma$
-parametrized by some parameter $t$ then becomes
+If our space is equipped with a metric tensor $M(x)$ such that the inner
+product of two vectors $a$ and $b$ in a point $x$ is calculated as
+$\langle a, b\rangle_M = \langle a, M(x) b \rangle$, then the length of
+a curve $\gamma$ parametrized by some parameter $t$ becomes
 \begin{equation}
     \abs{\gamma}_M = \int_\gamma \sqrt{\langle \dot{\gamma},
-    M\big(\gamma(t)\big) \, \dot{\gamma} \rangle} \, dt
+    M\big(\gamma(t)\big) \, \dot{\gamma} \rangle} \, dt.
     \label{eq:riemannian_length}
 \end{equation}
 We will now prove a Cauchy--Crofton formula in this case where we have a
@@ -390,13 +554,13 @@ Before proving this we present an important result from measure theory
 that we will need.
 \begin{theorem}[The Dominated Convergence theorem]
     Let $\{ f_n \}$ be a sequence of real-valued measurable functions on
-    a complete measure space $(S, \Sigma, \mu)$. Suppose that the
-    sequence converges pointwise to a function $f$ and is dominated by
-    some integrable function $g$ in the sense that
+    a measure space $(S, \Sigma, \mu)$. Suppose that the sequence
+    converges pointwise to a function $f$ and is dominated by some
+    integrable function $g$ in the sense that
     \begin{equation}
         \abs{f_n(x)} \leq g(x)
     \end{equation}
-    for all $n$ and almost all $x \in S$. Then $f$ is integrable and
+    for all $n$ and all $x \in S$. Then $f$ is integrable and
     \begin{equation}
         \lim_{n \to \infty} \int_S \abs{f_n - f} \, d\mu = 0
     \end{equation}
@@ -406,7 +570,7 @@ that we will need.
     \end{equation}
 \end{theorem}
 For a proof and further background on measure theory and Lebesgue
-integration theory see for example \fixme{ref}
+integration theory see for example \fixme{ref that is not wikipedia}
 \begin{proof}[Proof of the Riemannian Cauchy--Crofton formula]
     Assume first that our space is equipped with at constant metric
     tensor $M$. The length of our curve using this tensor can be
@@ -521,7 +685,7 @@ integration theory see for example \fixme{ref}
     all that is left to do is insert $U^T l_{\nu, \rho}$ to obtain
     \begin{equation}
         \abs{J_M(l_{\nu, \rho})} = \abs{J_{\Sigma^2}(U^T l_{\nu, \rho})}
-        = \frac{\det M}{\left(\nu^T \cdot U \Sigma^2 U^T \cdot
+        = \frac{\det M}{\left(\nu^T U \cdot \Sigma^2 \cdot U^T
         \nu\right)^{\sfrac{3}{2}}}
         = \frac{\det M}{\left(\nu^T \cdot M \cdot \nu\right)^{\sfrac{3}{2}}}
     \end{equation}
@@ -548,8 +712,7 @@ integration theory see for example \fixme{ref}
         C \cap U_i) \, w_i(\nu) \, d\mathcal{L}(l_{\nu, \rho})
         \label{eq:mpi_approx}
     \end{equation}
-    where $w_i$ is the weight-function used in the set $U_i$ which can
-    be written
+    where $w_i$ is the weight-function used in the set $U_i$
     \begin{equation}
         w_i(\nu) = \frac{\det M(x_i)}{\left(\nu^T \cdot M(x_i) \cdot \nu
         \right)^{\sfrac{3}{2}}}.
@@ -566,14 +729,16 @@ integration theory see for example \fixme{ref}
     over the partition $i$ and form a sum of all intersection point of
     $C$ and the line $l_{\nu, \rho}$ currently being integrated over.
     The approximation becomes
-    \begin{align}
-        \abs{C}_{M_\pi} &=
-        \sum_i \int_\mathcal{L} \sum_{x \in l_{\nu, \rho} \cap C \cap
-        U_i} w_\pi(\nu, x) \, d\mathcal{L}(l_{\nu, \rho}) \\
-        &= \int_\mathcal{L} \sum_{x \in l_{\nu, \rho} \cap C}
-        w_\pi(\nu, x) \, d\mathcal{L}(l_{\nu, \rho}).
+    \begin{equation}
+        \begin{aligned}
+            \abs{C}_{M_\pi} &=
+            \sum_i \int_\mathcal{L} \sum_{x \in l_{\nu, \rho} \cap C \cap
+            U_i} w_\pi(\nu, x) \, d\mathcal{L}(l_{\nu, \rho}) \\
+            &= \int_\mathcal{L} \sum_{x \in l_{\nu, \rho} \cap C}
+            w_\pi(\nu, x) \, d\mathcal{L}(l_{\nu, \rho}).
+        \end{aligned}
         \label{eq:riemannian_segments}
-    \end{align}
+    \end{equation}
     As our partition $\pi$ is refined the weight $w_\pi(x)$ converges
     pointwise to the continously varying weight
     \begin{equation}
@@ -589,15 +754,15 @@ integration theory see for example \fixme{ref}
     calculated as
     \begin{equation}
         \abs{C}_{M_\pi}
-        = \int_C \abs{\dot{C}}_{M_\pi} \, dt
+        = \int_C \abs{\dot{C}(t)}_{M_\pi} \, dt
         = \int_C \sqrt{ \dot{C}(t)^T M_\pi\big( C(t) \big) \dot{C}(t) }
         \, dt.
     \end{equation}
     We know that $M_\pi(x)$ converges pointwise to $M(x)$, and thus
-    $\abs{\dot{C}(x)}_{M_\pi}$ converges pointwise to
-    $\abs{\dot{C}(x)}_M$. We have assumed bounds on the eigenvalues
+    $\abs{\dot{C}(t)}_{M_\pi}$ converges pointwise to
+    $\abs{\dot{C}(t)}_M$. We have assumed bounds on the eigenvalues
     of $M(x)$, and we can parametrize $C$ by its arc length such that
-    $\abs{\dot{C}(x)} = 1$, and thus the integrand is bounded and we can
+    $\abs{\dot{C}(t)} = 1$, and thus the integrand is bounded and we can
     apply Lebesgue's dominated convergence theorem to see that
     $\abs{C}_{M_\pi} \to \abs{C}_M$.
 
@@ -614,7 +779,7 @@ integration theory see for example \fixme{ref}
     \begin{equation}
         \lambda_2 = \min_{\norm{\xi} = 1} \sqrt{\xi^T M_\pi(x) \xi}
     \end{equation}
-    and thus $\nu^T M_\pi(x) \nu \geq \lambda_2 \geq k$. The weight
+    and thus $\nu^T M_\pi(x) \nu \geq \lambda_2^2 \geq k^2$. The weight
     function $w_\pi$ is then bounded, but not neccesarily the sum
     \begin{equation}
         \sum_{\mathclap{x \in l_{\nu, \rho} \cap C}} w_\pi(\nu, x).
@@ -622,9 +787,9 @@ integration theory see for example \fixme{ref}
     However, if the $l_{\nu, \rho} \cap C$ is infinite for a set of
     lines with measure greater than zero, the Euclidean Cauchy--Crofton
     formula in Theorem \ref{thm:euclidean_cauchy_crofton} implies that
-    the curve is infinitely long \fixme{which we have assumed it is
-    not?} As the sum is also bounded we can apply Lebesgue's dominated
-    convergence theorem again and conclude that
+    the curve is infinitely long which we have assumed it is not. So as
+    the sum is bounded almost everywhere we can apply Lebesgue's
+    dominated convergence theorem again and conclude that
     \begin{equation}
         \int_\mathcal{L} \sum_{x \in l_{\nu, \rho} \cap C}
         w_\pi(\nu, x) \, d\mathcal{L}(l_{\nu, \rho})
@@ -639,13 +804,51 @@ integration theory see for example \fixme{ref}
         \int_\mathcal{L} \sum_{x \in l_{\nu, \rho} \cap C}
         \frac{\det M(x)}{2 \left( \nu^T \cdot M(x) \cdot \nu
         \right)^{\sfrac{3}{2}}} \,
-        d\mathcal{L}(l_{\nu, \rho})
+        d\mathcal{L}(l_{\nu, \rho}).
     \end{equation}
 \end{proof}
 
 \section{Yeeep}
 
-Here we finish up the consideration of the contiuous problem, woop.
+With the anisotropic coarea formula in Theorem
+\ref{thm:anisotropic_coarea} we have a way to calculate the anisotropic
+total variation by integrating the anisotropic perimeter of each level
+set of the image. In the Euclidean case, which here would amount to
+setting the anisotropy tensor $A$ equal to the identity matrix $I$, the
+perimeter coincides nicely with the length of the boundary curve,
+assuming some regularity for the boundary. In the general case we need
+to be more careful. As can be seen in \fixme{ref}, the anisotropic
+perimeter is calculated by integrating the norm of the \emph{normal
+vector} around the boundary, while the anisotropic curve length in
+\eqref{eq:riemannian_length} is the integral of the norm of the
+\emph{tangent vector} of the curve. If $P$ is a 90\textdegree{} rotation
+matrix and we assume an arclength parametrisation of our curve we have
+\begin{equation}
+    \begin{aligned}
+        \PerA(U; \Omega) &= \int_{\partial U} \sqrt{ \langle
+        \nu_{\partial U}, A(x) \nu_{\partial U} \rangle} \, dt \\
+        &= \int_{\partial U} \sqrt{ \langle P \nu_{\partial U}, P A(x)
+        P^T \, P \nu_{\partial U} \rangle } \, dt.
+        %&\stackrel{\mathclap{\gamma \hskip 0.07em = \hskip 0.07em
+        %\partial U}}{=}
+        %\int_{\gamma} \sqrt{ \langle \dot{\gamma}, M(x) \,
+        %\dot{\gamma} \rangle } \, dt.
+    \end{aligned}
+    \label{eq:per_to_length1}
+\end{equation}
+Before applying the Cauchy--Crofton formula we simplify the equation by
+defining the metric tensor $M(x) = P A(x) P^T$ and $\gamma = \partial U$
+and observing that a 90\textdegree{} rotation of the normal $\nu_{\partial
+U}$ gives us the tangent $\pm \dot{\gamma}$. This yields
+\begin{equation}
+    \PerA(U; \Omega) = \int_\gamma \sqrt{ \langle \dot{\gamma}, M(x) \,
+    \dot{\gamma} \rangle }.
+    \label{eq:per_to_length2}
+\end{equation}
+\fixme{what about the boundary of $\Omega$?}
+Now we make sure that all the assumptions of the Riemannian
+Cauchy--Crofton formula in Theorem \ref{thm:riemannian_cauchy_crofton}
+are fulfilled so that it can be applied.
 
 The structure tensor is constructed as described in \fixme{ref}
 \begin{equation}
@@ -663,18 +866,37 @@ the structure tensor $S(x)$. The extreme value theorem \fixme{ref}
 states that a continuous real-valued function on a nonempty compact
 space is bounded above. Thus the eigenvalues $s_1$ and $s_2$ of $S(x)$
 are bounded from above and by construction the smallest eigenvalue of
-our metric tensor $M(x)$ is bounded away from zero as
+our anisotropy tensor $A(x)$ is bounded away from zero as
 \begin{equation}
     \lambda_2 = \left(1
     + \frac{(s_1 - s_2)^2}{\gamma^2}\right)^{-1} \geq \left(1 +
     \frac{s_1^2}{\gamma^2}\right)^{-1} \geq Q > 0.
 \end{equation} 
-Hence, our metric tensor $M(x)$ fulfills all the assumptions of Theorem
+\fixme{bah, now gamma is a curve...}
+Hence, our metric tensor $M(x) = P A(x) P^T$ in
+\eqref{eq:per_to_length2} fulfills all the assumptions of Theorem
 \ref{thm:riemannian_cauchy_crofton}. \fixme{did we argue for
-continuous?}
-
-And here we write something about the perimeter not being the length of
-the boundary and all that stuff. We really tie the room together.
+continuous?} Inserting the Cauchy--Crofton formula, we obtain the final
+expression for the continuous anisotropic total variation
+\begin{equation}
+    \TVA(u) = \int_{-\infty}^{\infty} \int_\mathcal{L} \sum_{x \in
+    l_{\nu, \rho} \cap \gamma_s } \frac{\det M(x)}
+    {2 \left( \nu^T \cdot M(x) \cdot \nu \right)^{\sfrac{3}{2}}}
+    \, d\mathcal{L}(l_{\nu, \rho}) \, ds,
+\end{equation}
+where $\gamma_s = \partial \{ u > s \}$ is the boundary of the level set
+for level $s$. Note that $P$ does not affect the determinant, i.e.\
+$\det A = \det PAP^T = \det M$, and from our eigendecomposition in
+\fixme{ref} we see that the transformation $PAP^T \to M$ actually
+amounts to switching the two eigenvalues $\sigma_1$ and $\sigma_2$ in
+$\Sigma$.
+
+The whole transformation from the initial formulation in \fixme{ref}
+through the coarea formula and the Cauchy--Crofton formula was motivated
+by the discretization wich will be described next. We will see that we
+can minimize the energy functional for each level separately, and that
+the integral over all lines $\mathcal{L}$ can be approximated by a sum
+over some discrete set of lines.
 
 \chapter{Discrete formulation}
 
@@ -734,8 +956,8 @@ rewrite \eqref{eq:fidelity_approx_1} and obtain
 Discretizing the regularization term is more challenging. We introduce
 the discrete levels to get
 \begin{equation}
-    \int_{-\infty}^\infty \PerM( \{ u > \lambda \}; \Omega) \, d\lambda
-    \approx \sum_{\lambda = 0}^{L-2} \PerM( \{ u > \lambda \}; \Omega).
+    \int_{-\infty}^\infty \PerA( \{ u > \lambda \}; \Omega) \, d\lambda
+    \approx \sum_{\lambda = 0}^{L-2} \PerA( \{ u > \lambda \}; \Omega).
 \end{equation}
 Note that we do not include any $\Delta \lambda$ difference, as we can
 just absorb this into the $\beta$ parameter. The perimeter is then
@@ -846,7 +1068,7 @@ $e \cap C$ -- are exactly those edges with one terminal inside $X$ and
 the other terminal outside $X$. \fixme{Terminal?}. This means we can
 write the discrete regularization energy term as
 \begin{equation}
-    \sum_{\lambda = 0}^{L-2} \PerM( \{ u > \lambda \}; \Omega)
+    \sum_{\lambda = 0}^{L-2} \PerA( \{ u > \lambda \}; \Omega)
     \approx \sum_{\lambda = 0}^{L-2} \sum_{e} w_e
     \abs{u_{\delta_1(e)}^\lambda - u_{\delta_2(e)}^\lambda}
 \end{equation}