\documentclass[11pt]{article} 

\def\rit{ \hbox{\it I\hskip -2pt R} }
\def\nit{ \hbox{\it I\hskip -2pt N} }
\def\zit{ \hbox{\it I\hskip -2pt Z} }


\textheight=8.5in
\topmargin=0.0in 

\begin{document} 

{\bf Math 285J, Assignment 5:} Due on Friday, December 4, or during the week of finals (no later than Friday, December 11 !). 

\bigbreak 

{\bf I.} Consider the binary segmentation model based on the minimal variance in a level set formulation: 

$$\inf_{c_1,c_2,\phi}F(c_1,c_2,\phi)$$
$$=\lambda_1\int_{\Omega}(c_1-f)^2H(\phi)dxdy +\lambda_2\int_{\Omega}(c_2-f)^2(1-H(\phi))dxdy +\mu\int_{\Omega}|\nabla H(\phi)|dxdy,$$
where $f:\Omega\rightarrow \rit $ is the given image data to be segmented, $\lambda_1,\lambda_2,\mu>0$ are tuning parameters (usually, we may take $\lambda_1=\lambda_2=1$), and $H$ is the 1D Heaviside function. 

$\bullet$ For fixed level set function $\phi$, find explicit expressions for $c_1$, $c_2$ minimizers of the functional $F$. 

$\bullet$ For fixed $c_1$, $c_2$, give the time-dependent Euler-Lagrange equation in $\phi$, associated with the minimization. Thus $\phi=\phi(t,x,y)$ solves a PDE. Simplify this equation if possible by using cancellations (you may need to assume that the Heaviside function $H$ has been substituted by a smooth approximation). 

$\bullet$ Show that $F(c_1(t),c_2(t),\phi(t,\cdot,\cdot))$ is decreasing in time if $c_1$, $c_2$ and $\phi$ satisfy the obtained equations. 

$\bullet$ Implement the time-dependent pde in $\phi$ together with the expressions for $c_1$ and $c_2$ and segment the image given on the class webpage. You need to start with an initial guess for the  level set function (for example the signed distance function to a circle). Visualize the evolving curve (zero level line of $\phi$) at intermediate steps and at steady state, and the binary segmented image given by $u=c_1H(\phi)+c_2(1-H(\phi))$. Use a special approximation to the Heaviside function and to its derivative $\delta$, given by 
$$H_{\epsilon}(z)=\frac{1}{2}\Big(1+\frac{2}{\pi}\arctan \Big(\frac{z}{\epsilon}\Big)\Big),\ \ \ \delta_{\epsilon}(z)=H'_{\epsilon}(z).$$

Usually you can take $\epsilon=\triangle x =\triangle y =1$. You can keep $\lambda_1=\lambda_2=1$ and vary only $\mu$ to get the desired result. For more details, see the manuscript ``Active contours without edges'' from the class webpage. 

\bigbreak 

{\bf II.} Using the notations from the lecture, find a geometric time-dependent gradient descent evolution that minimizes the robust alignment term 
$$E(C):=\int_{0}^1 \Big|\Big\langle V,\vec{N}\Big\rangle \Big| |C_q|dq,$$
where $V=(u,v)$ is a given vector field and 
$\vec{N}=\frac{(-\frac{\partial C_2}{\partial q},\frac{\partial C_1}{\partial q})}{|C_q|}$ 
is the unit normal. Particularize this to the case $V=\nabla I$. 





\end{document} 
