3
$\begingroup$

Say we have a continuous function $u(x,y) : \mathbb{R}^2 \rightarrow \mathbb{R}$.

I have seen several textbooks that make the following assertion:

The length/area element of the zero level set of $u$ is given by $\lvert\nabla H\left(u\right)\rvert = \delta(u)\lvert\lvert\nabla u\rvert\rvert$, where $H\left(u\right)$ is the Heaviside step function, $\delta(u)= \partial H(u) / \partial u $ is the Dirac delta function.

We can measure the length of the zero level set as $ \int\int \lvert \nabla H(x,y)\rvert dx dy = \int\int \delta (u(x,y))\lvert \nabla u (x,y)\rvert dx dy$

I fail to see this. Why is the length (or/and area) element of the zero level set of $u$ given by $\lvert\nabla H\left(u\right)\rvert $ or $\delta(u)\lvert\lvert\nabla u\rvert\rvert$?

Some papers and textbooks that make this assertion:

  • Zhao, H.K. et al., 1996. A Variational Level Set Approach to Multiphase Motion (available online). Journal of Computational Physics, 127(1), p.179-195 (page 2, Equations 2.2a and 2.2b)
  • Geometric Partial Differential Equations and Image Analysis. Guillermo Sapiro. Cambridge University Press 2001 (e.g. page 92).

  • Image Processing and Analysis. Variational, PDE, Wavelet, and stochastic methods. Tony Chan and Jianhong Shen. SIAM 2005 (e.g. page 46)

  • 0
    Christian's answer is nice. I just want to point out that the paper by Zhao et al. does cite an reference which is said to contain the proof.2012-04-11

2 Answers 2

5

Assume that $\phi:\ (x,y)\mapsto\phi(x,y)$ is a smooth real-valued function, and assume that the set $\Omega\subset{\mathbb R}^2$ defined by $\Omega:=\bigl\{(x,y)\ \bigm|\ \phi(x,y)>0\bigr\}$ is bounded. Then the area $A(\Omega)$ is obviously given by $A(\Omega)=\int 1_\Omega(x,y)\ {\rm d}(x,y)=\int H\bigl(\phi(x,y)\bigr)\ {\rm d}(x,y)\ .$ This is formula 2.2b of the quoted source.

The formula 2.2a for the length of $\partial\Omega$ is another matter. It reads as follows: $L(\partial\Omega)\ =\ \int\delta\bigl(\phi(x,y)\bigr)\,\bigl|\nabla\phi(x,y)\bigr|\ {\rm d}(x,y)\ .\qquad(1)$ I can only give a heuristic argument why such a formula might hold. In any case, this argument does not lead to a "length element", it only gives an interpretation for the integral appearing on the right of $(1)$.

Replace the $\delta$-function by the function \delta_N(t):=\cases{N & $\Bigl(|t|\leq{1\over 2N}\Bigr)$ \cr 0 & $\Bigl(|t|>{1\over 2N}\Bigr)$\cr}\ , where $N\gg1$. Then $\int\delta\bigl(\phi(x,y)\bigr)\,\bigl|\nabla\phi(x,y)\bigr|\ {\rm d}(x,y) \doteq N\ \int_{B_N}\bigl|\nabla\phi(x,y)\bigr|\ {\rm d}(x,y)\ ,\qquad(2)$ where $B_N$ is the narrow band defined by $B_N:=\bigl\{(x,y)\ \bigm|\ |\phi(x,y)|\leq{1\over 2N}\bigr\}\ .$ The "centerline" of this band is the curve $\partial\Omega:\ \phi(x,y)=0$, resp. $\partial\Omega:\quad s\mapsto{\bf z}(s)\qquad\bigl(0\leq s\leq L:=L(\partial\Omega)\bigr)$ (parametrized by arc length $s$). Consider a point ${\bf p}:={\bf z}(s)\in\partial\Omega$. The direction of the band there is $\dot{\bf z}(s)$, and ${\bf n}:=\nabla\phi\bigl({\bf z}(s)\bigr)$ points into the normal direction. Starting at ${\bf p}$ in direction ${\bf n}$ we reach the boundary of $B_N$ when we have traversed the length $h>0$ such that $|{\bf n}|\, h={1\over 2N}$. It follows that near ${\bf z}(s)$ the width $\rho(s)$ of this band is approximately given by $\rho(s)=2 h={1 \over N\,|{\bf n}|}= {1\over N\, \bigl|\nabla\phi\bigl({\bf z}(s)\bigr)\bigr|}\ .$ Therefore we have $N\ \int_{B_N}\bigl|\nabla\phi(x,y)\bigr|\ {\rm d}(x,y)\doteq N\ \int_0^L \rho(s) \bigl|\nabla\phi\bigl({\bf z}(s)\bigr)\bigr|\ ds=\int_0^L ds =L(\partial\Omega)\ .$ When we enter this in (2) we obtain the quoted formula $(1)$.

  • 1
    @roseck: See my edit. (I too have learnt something in this process!)2012-04-11
2

I wanted to remark that the answer above is only true when $\phi$ is a distance function, that is to say $||\nabla \phi|| = 1$ almost everywhere. In the heuristic argument in the accepted answer, the following equality $1/2N = |\mathbf{n}(s)| h = h = \textrm{"the distance to $\partial \Omega$"}$

is precisely true when $|\mathbf n(s)| = 1$. As noted in Christian's original comments, the scaling of $\phi$ will affect the so-called length element.

I, too, have noticed that there is lack of justification for this definition in the literature, but found the tutorial on Chan-Vese segmentation by Pascal Getreuer mentioned this distance function stipulation. I know for the Chan-Vese model imposing that $\phi$ be distance function is often overlooked because it comes at a computational cost and slows convergence to "reasonable" answers.

Interestingly, there was a lot of research on the "reinitialization" of level set functions so that an arbitrary level set function could be transformed away from it's interface (zero level set) into a distance function. I believe this was originally done here:

Sussman, Mark, Peter Smereka, and Stanley Osher. "A level set approach for computing solutions to incompressible two-phase flow." Journal of Computational physics 114.1 (1994): 146-159.

I found some sample code for it here: http://www.math.lsa.umich.edu/~psmereka/LEVELSET/LSCODES/reint2d.m

I have no idea how much in practice the approximate length element differs from a better guess using a distance function.