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
+else? For existence we need coercivity (that we can't go infinitely far
to get a better solution) and weak lower semi-continuity, 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,
stuff. We must also clarify what a perimeter is, and how it relates to a
contour later.
+\section{Cauchy--Crofton formulas}
+
+If we parametrize straight lines as shown in Figure \fixme{ref}, we can
+define the set of all staight lines as $\mathcal{L} = \{ (\phi, \rho) :
+\phi \in [0, 2\pi), \rho \geq 0 \}$. By defining the Lebesgue 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 $\dpdr$ is invariant under rigid motions,
+meaning combinations of translations and rotations.
+\begin{theorem}[The Euclidean Cauchy--Crofton formula]
+ Given a 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}
+ \int_\mathcal{L} n_C(\phi, \rho) \, \dpdr = 2 \abs{C},
+ \end{equation}
+ where $n_C(\phi, \rho)$ is the number of times the line $(\phi,
+ \rho)$ intersects with the curve $C$.
+\end{theorem}
+This elegant formula is very useful when we later will discretize our
+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.
+
+\begin{theorem}[The Riemannian Cauchy--Crofton formula]
+ In the case of a Riemannian geometry, where the scalar product in
+ each point depends on a metric tensor $M(p)$ varying continuously over
+ our space, the Cauchy--Crofton formula becomes
+ \begin{equation}
+ \abs{C}_R = \int_\mathcal{L} n_C(\phi, \rho) \, \frac{\det
+ M(p)}{2 \left( u_L^T \cdot M(p) \cdot u_L \right)} \, \dpdr.
+ \end{equation}
+ Here, $u_L$ is a unit vector along the line currently being
+ integrated over.
+\end{theorem}
+\begin{proof}
+ Assume first that our space is equipped with at constant metric
+ tensor $A$. The length of our curve using this Riemannian metric can
+ then be calculated by transforming the curve back into euclidean
+ space and applying the Euclidean Cauchy--Crofton formula
+ \begin{align}
+ \abs{C}_A &= \abs{A^{\sfrac{1}{2}}C} \\
+ &= \int n(L \cap A^{\sfrac{1}{2}}C) \,
+ d\mathcal{L}(L) \\
+ &= \int n(A^{-\sfrac{1}{2}}L \cap C) \,
+ d\mathcal{L}(L) \\
+ &= \int n(M \cap C) \abs{J(\Ahalf)}\,
+ d\mathcal{L}(M)
+ \end{align}
+ where $J(A^{\sfrac{1}{2}})$ is the Jacobian of our coordinate
+ transformation $M = A^{-\sfrac{1}{2}} L$, which is what we need to
+ find next.
+
+ As $A\in \mathbb{R}^{2\times2}$ is symmetric, so is
+ $A^{\sfrac{1}{2}}$, and it emits an eigendecomposition $\Ahalf
+ = U\Lambda U^T$ where the components correspond to the following
+ coordinate transformations
+ \begin{align}
+ U(\alpha,\rho) &= (\alpha + \xi, \rho), \\
+ U^T(\alpha,\rho) &= (\alpha - \xi, \rho), \\
+ \Lambda &= \begin{pmatrix}
+ \sigma_1 & 0 \\
+ 0 & \sigma_2
+ \end{pmatrix}.
+ \end{align}
+ As $U$ and $U^T$ correspond to rotations they do not contribute to
+ the Jacobian, except for changing the input angle of the $\Lambda$
+ operator. Given a line
+ \begin{equation}
+ L_{\alpha, \rho} = \begin{pmatrix}
+ \rho\cdot \cos \alpha \\
+ \rho\cdot \sin \alpha
+ \end{pmatrix}
+ + \mathbb{R} \begin{pmatrix}
+ -\sin \alpha \\
+ \cos \alpha
+ \end{pmatrix},
+ \end{equation}
+ the $\Lambda$ operator transforms it into
+ \begin{equation}
+ \Lambda L_{\alpha, \rho} = \begin{pmatrix}
+ \sigma_1 \rho\cdot \cos \alpha \\
+ \sigma_2 \rho\cdot \sin \alpha
+ \end{pmatrix}
+ + \mathbb{R} \begin{pmatrix}
+ -\sigma_1 \sin \alpha \\
+ \sigma_2 \cos \alpha
+ \end{pmatrix},
+ \end{equation}
+ which is has parameters
+ \begin{align}
+ \beta &= \arctan \left( \frac{\sigma_1}{\sigma_2} \tan \alpha
+ \right) \\
+ \nu &= \left\langle \begin{pmatrix}
+ \sigma_1 \rho\cdot \cos \alpha \\
+ \sigma_2 \rho\cdot \sin \alpha
+ \end{pmatrix}, \begin{pmatrix}
+ \cos \beta \\
+ \sin \beta
+ \end{pmatrix}
+ \right\rangle.
+ \end{align}
+ As $\partial_\rho \beta = 0$, the Jacobian becomes
+ $\abs{J} = \partial_\alpha\beta \cdot \partial_\rho \nu$. Differentiation
+ yields
+ \begin{align}
+ \partial_\alpha \beta &= \frac{ \frac{\sigma_1}{\sigma_2}
+ \sec^2 \alpha}{1 + \frac{\sigma_1^2}{\sigma_2^2}
+ \tan^2 \alpha}, \\
+ \partial_\rho \nu &= \sigma_1 \cos \alpha \cdot \cos \beta + \sigma_2
+ \sin \alpha \cdot \sin \beta
+ = \frac{\sigma_1 \cos \alpha \left( 1 + \tan^2 \alpha \right)
+ }{\sqrt{1 + \frac{\sigma_1^2}{\sigma_2^2} \tan^2 \alpha}}
+ \end{align}
+ and assuming that $v = (v_x, v_y)^T$ is a unit vector along the line
+ parametrized by the angle $\alpha$ we obtain
+ \begin{equation}
+ \abs{J} = \frac{\frac{\sigma_1}{\sigma_2} \cdot \sigma_1 \left(
+ 1 + \tan^2 \alpha \right)^{\sfrac{3}{2}}}{\left( 1 +
+ \frac{\sigma_1^2}{\sigma_2^2} \tan^2
+ \alpha \right)^{\sfrac{3}{2}}}
+ = \frac{\sigma_1^2 \sigma_2^2 \left( v_x^2 +
+ v_y^2\right)^{\sfrac{3}{2}}}{\left(\sigma_1^2 v_x^2 + \sigma_2^2
+ v_y^2\right)^{\sfrac{3}{2}}}.
+ \end{equation}
+ The angle of the line that $\Lambda$ takes as input has already been
+ rotated by the $U^T$ operator, such that if $u$ is a unit vector
+ along the line being integrated over, then $v = U^Tu$ and
+ \begin{equation}
+ \abs{J} = \frac{\det A}{\left(u^T A u\right)^{\sfrac{3}{2}}}
+ \end{equation}
+ And now we argue that this also holds for a non-constant but
+ continuous metric tensor $M(x)$. By partitioning the domain into
+ disjoint sets $U_i$ such that $\Omega = \cup U_i$, we make a
+ piecewise constant approximation such that $M_\pi(x) = M(x_i)$ for
+ some fixed $x_i \in U_i$. We then approximate the right side of
+ \fixme{ref} by
+ \begin{align}
+ \abs{C}_{M_\pi} &= \sum_i \int_\mathcal{L} n_{C\cap U_i} w_i \,
+ d\mathcal{L} \\
+ &= \sum_i \int_\mathcal{L} \sum_{x\in C\cap U_i \cap
+ \mathcal{L}} w_\pi(\phi, p) \, d\mathcal{L} \\
+ &= \int_\mathcal{L} \sum_{x\in C\cap \mathcal{L}} w_\pi(\phi, p)
+ \, d\mathcal{L}.
+ \end{align}
+ As our partition $\pi$ is refined the weight $w_\pi(x)$ converges
+ pointwise to the continously varying weight $w(x)$. We now want to
+ bound the expression for $w_\pi$.
+ \begin{equation}
+ w_\pi = \frac{\det M(p)}{2 \left(u_L^T \cdot M(p) \cdot
+ u_L\right)^{\sfrac{3}{2}}}
+ \end{equation}
+ If we manage to bound the singular values and keep them away from
+ $0$, that would be great. The singular values \fixme{or eigenvalues}
+ of our tensor is
+ \begin{align}
+ \sigma_1 &= 1 \\
+ \sigma_2 &= \frac{1}{1 + \frac{(s_1 -
+ s_2)^2}{\gamma^2}} \geq \frac{1}{1 + \frac{s_1^2}{\gamma^2}}
+ \geq \Kappa > 0
+ \end{align}
+ and thus we only have to prove that the largest eigenvalue of our
+ structure tensor $s_1$ is finite to show that the singular values of
+ our metric tensor is bounded.
+
+ The structure tensor is made by taking the outer product of the
+ gradient of each point in a smoothed version of the noisy image $f$.
+ This tensor is then again smoothed component-wise with a Gaussian
+ kernel
+ \begin{equation}
+ \nabla f_{\rho_1} \otimes \nabla f_{\rho_1} \mapsto K_{\rho_2} *
+ \left( \nabla f_{\rho_1} \otimes \nabla f_{\rho_1} \right).
+ \end{equation}
+ This is a smooth map from $\bar{\Omega}$ to $\mathbb{R}^{2\times
+ 2}$, and assuming that our original image $f$ is bounded (?), so is
+ this tensor.
+
+ The singular values are the roots of a polynomial which depend
+ continuously on the coefficients of the polynomial which depend
+ continuously on the entries of the tensor. Thusly, the singular
+ values are also bounded.
+\end{proof}
+
\chapter{Discrete formulation}
This is where we discretize! It will also be an important chapter, as
to verify that all the approximations work, and that it indeed converges
also in this case.
+\subsection{Discrete Riemannian Cauchy--Crofton formula}
+
+By approximating the integral in \fixme{REF} by a discrete sum we obtain
+the approximation
+\begin{align}
+ \abs{C}_R &= \int_\mathcal{L} n_C \, \frac{\det M(p)}{2\left(u_L^T
+ \cdot M(p) \cdot u_L\right)^{\sfrac{3}{2}}} \, d\mathcal{L} \\
+ &\approx \sum_{\mathcal{L}_D} n_C \, \frac{\det M(p)}{2\left(u_L^T
+ \cdot M(p) \cdot u_L\right)^{\sfrac{3}{2}}} \, \Delta\phi \,
+ \Delta\rho \\
+\end{align}
+where $\mathcal{L}_D$ is a discretization of the set of lines in the
+plane $\mathcal{L}$ \fixme{figure}.
+\begin{align}
+ \abs{C}_R &\approx \sum_{e} n_C(e) \, \frac{\det M(e)}{2\left(e^T
+ \cdot M(e) \cdot e\right)^{\sfrac{3}{2}}} \, \Delta\phi \,
+ \Delta\rho
+\end{align}
+
\section{Graph cut formulation}
Maybe this is more tightly connected with the previous section, but the