From: Bjørn Rustad Date: Tue, 14 Oct 2014 12:18:17 +0000 (+0200) Subject: Placeholder figures and theory X-Git-Url: http://git.rustad.me/?a=commitdiff_plain;h=fe552e3d86576bf15b6188dcc238e4d7d640fe7c;p=master Placeholder figures and theory --- diff --git a/commands.tex b/commands.tex index a457dbd..8ae3d9e 100644 --- a/commands.tex +++ b/commands.tex @@ -1,5 +1,6 @@ \newcommand{\abs}[1]{\lvert #1 \rvert} \newcommand{\norm}[1]{\lVert #1 \rVert} +\newcommand{\diver}{\mathop{\mathrm{div}}\nolimits} \newcommand{\TV}{\mathit{TV}} \newcommand{\BV}{\mathit{BV}} \newcommand{\idfun}{\chi} diff --git a/fig/area_argument.png b/fig/area_argument.png new file mode 100644 index 0000000..e83a2d0 Binary files /dev/null and b/fig/area_argument.png differ diff --git a/fig/neigh_lines.png b/fig/neigh_lines.png new file mode 100644 index 0000000..8b8b08e Binary files /dev/null and b/fig/neigh_lines.png differ diff --git a/theory.tex b/theory.tex index a16246c..3e92599 100644 --- a/theory.tex +++ b/theory.tex @@ -119,6 +119,146 @@ 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. +\section{Anisotropic coarea formula} + +We define the thresholded image at level $s$ as +\begin{equation} + u^s(x) = \begin{cases} + 1 & \text{if } u(x) > s, \\ + 0 & \text{otherwise}. + \end{cases} +\end{equation} +This 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. +\end{equation} + +For any image $u \in C^1_c(\Omega)$ define the anisotropic total +variation functional +\begin{equation} + J_A(u) = \int_\Omega \sqrt{\nabla u(x)^T A(x) \nabla u(x)} \, dx. +\end{equation} +\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 +\begin{align} + J_A(u) &= \int_\Omega \abs{Q \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 + \\ + &= \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. +\end{align} +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} + J_A(u) = \sup_{\substack{\xi \in C_c^1(\Omega; \mathbb{R}^N) \\ + \norm{\xi(x)}_A^* \leq 1}} \int_\Omega -u \diver \xi \, dx. +\end{equation} + +\begin{theorem}[Anisotropic coarea formula] + Given an image $u \in \BV(\Omega)$, the anisotropic total variation + can be calculated written as an integral over all the levels + \begin{equation} + J_A(u) = \int_{-\infty}^\infty J_A(u^s) \, ds. + \end{equation} +\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 $J_A(u) \leq \int_{-\infty}^\infty + J_A(u^s) \, ds$.} + Assume that $u \geq 0$ such that the integral in \fixme{ref} holds, + then inserting \fixme{ref} into \fixme{ref} gives + \begin{align} + J_A(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 + \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 J_A(u^s) \, ds. + \end{align} + For $u \leq 0$ we use that $J_A(-v) = J_A(v)$ and that $J_A(c + v) = + J_A(v)$ for any constant $c$. This allows us to show that + \fixme{also something about $u^{-r}$} + \begin{align} + J_A(u) &= J_A(-u) \leq \int_0^\infty J_A \big( (-u)^r \big) \, + dr \\ + &= \int_0^\infty J_A(1 - u^{-r}) \, dr = \int_0^\infty + J_A(u^{-r}) \, dr = \int_{-\infty}^0 J_A(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 + \begin{align} + J_A(u) &\leq J_A(u_-) + J_A(u_+) \\ + &\leq \int_{-\infty}^0 J_A\big((-u_-)^s\big) \, ds + + \int_0^\infty J_A(u_+^s) \, ds\\ + &= \int_{-\infty}^0 J_A(u^s) \, ds + \int_0^\infty J_A(u^s) \, + ds = \int_{-\infty}^\infty J_A(u^s) \, ds + \end{align} + \paragraph{Then we prove that $J_A(u) \geq \int_{-\infty}^\infty + J_A(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) = J_A(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: + \begin{equation} + \int_{-infty}^\infty m'(t)\, dt \leq m(\infty) - m(-\infty) = + J_A(u). + \end{equation} + Next, fix an $s \in \mathbb{R}$ and define the function + \begin{equation} + \eta_r(t) = \begin{cases} + 0 & \text{if } t < s \\ + (t - s)/r & \text{if } s \leq t < s + r \\ + 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 + \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. + \end{equation} + Assuming that $\norm{\xi}_A^* \leq 1$ we have + \begin{align} + \frac{m(s+r) - m(s)}{r} + &= \frac{1}{r} \int_{\{ s \leq u \leq s+r \}} \norm{\nabla u}_A + \, dx \\ + &\geq \frac{1}{r} \int_{\{ s \leq u \leq s + r\}} \nabla u \cdot + \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 + 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 J_A(u_s)$ almost everywhere and conclude + \begin{equation} + J_A(u) \geq \int_{-\infty}^\infty m'(t) \, dt \geq + \int_{-\infty}^\infty J_A(u^s) \, ds. + \end{equation} + \fixme{something something set of measure zero, lebesgue integral + something something} +\end{proof} + \section{Cauchy--Crofton formulas} If we parametrize straight lines as shown in Figure \fixme{ref}, we can @@ -299,7 +439,14 @@ can be approximated by a sum. 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. + values are also bounded and the eigenvalues of our metric tensor is + greater than $0$. + + According to the Rayleigh principle \fixme{REF} + \begin{equation} + \sigma_2 = \min_{\norm{x} = 1} \sqrt{x^T A x}, + \end{equation} + so the denominator of \fixme{ref} is greater than $0$. \end{proof} \chapter{Discrete formulation} @@ -319,6 +466,21 @@ also in this case. \subsection{Discrete Riemannian Cauchy--Crofton formula} +\begin{figure} + \centering + \includegraphics[width=0.7\textwidth]{fig/neigh_lines.png} + \caption{ + The set of lines $\mathcal{L}$ is discretized to $\mathcal{L}_D$ + where each line belongs to a family given by the angle $\phi$ + parameter. In the figure to the left we see a visualization of + \fixme{almost} all the families as a neighborhood. \fixme{Note + that the angle $\phi$ is normally taken as a parameter + giving the normal to the actual line, but since we only + consider the difference $\Delta\phi$, this does not matter?} + To the right we see all the lines of one family. + } + \label{fig:neigh_lines} +\end{figure} By approximating the integral in \fixme{REF} by a discrete sum we obtain the approximation \begin{align} @@ -329,12 +491,48 @@ the approximation \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} +plane $\mathcal{L}$ \fixme{figure}. Since the final goal is to work with +digital images, it makes sense to discretize our domain $\Omega$ as a +regular (?) lattice? $\mathcal{S}$. The set of lines $\mathcal{L}_D$ can +then be made up of lines through points on this lattice as shown in +Figure \fixme{some figure with lines}. Further working towards our graph +cut representation of the problem later, each line is made up of +\emph{edges} going between the points in the lattice. We will denote an +edge by $e$. The curve length can then be approximated by +\begin{equation} + \abs{C}_R \approx \sum_{e} n_C(e) \, \frac{\norm{e}^3 \det M(e)}{2 + \left(e^T \cdot M(e) \cdot e\right)^{\sfrac{3}{2}}} \, \Delta\phi \, + \Delta\rho. +\end{equation} +\begin{figure} + \centering + \includegraphics[width=0.7\textwidth]{fig/area_argument.png} + \caption{ + We see that for any reasonable family of lines (i.e.\ we do + not leave any unneccessary gaps), the area covered by a blue + square, $\delta^2$ is equal to the area covered by a red + rectangle $\Delta \rho \norm{e_k}$, as there will be the same + number of blue squares and red rectangles if we cover the whole + plane. + } + \label{fig:area_argument} +\end{figure} +Assuming some regularity on our curve, and that our discretization is +somehow fine, we approximate $n_C(e)$ by a function which is $1$ if $C$ +crosses $e$ an odd number of times, and $0$ if not, meaning that we +ignore multiple passes across $e$ and only care about if $C$ goes from +one side of $e$ to the other. Further, as can be seen in Figure +\fixme{some figure with lines etc.}, the distance between lines in line +family $k$ is $\Delta \rho_k = \delta^2 / \norm{e_k}$. Thus the curve +length is approximated by +\begin{equation} + \abs{C}_R \approx \sum_{e} n_C(e) \, \frac{\norm{e}^2 \det M(e) + \, \delta^2 \, \Delta\phi}{2 \left(e^T \cdot M(e) \cdot + e\right)^{\sfrac{3}{2}}}. +\end{equation} + +\fixme{We now have the problem that $C$ is a curve, but later we want it +to be a cut...} \section{Graph cut formulation}