From: Bjørn Rustad Date: Sat, 15 Mar 2014 15:35:33 +0000 (+0100) Subject: Some more theory X-Git-Url: http://git.rustad.me/?a=commitdiff_plain;h=85b00605dbb2df43de62be76788c58be3b0dbc61;p=prosjektoppgave Some more theory --- diff --git a/bib.bib b/bib.bib index fb93e21..e500e57 100644 --- a/bib.bib +++ b/bib.bib @@ -121,4 +121,12 @@ organization={IEEE} } +@book{weickert1998anisotropic, + title={Anisotropic diffusion in image processing}, + author={Weickert, Joachim}, + volume={1}, + year={1998}, + publisher={Teubner Stuttgart} +} + diff --git a/methods.tex b/methods.tex index 7c1a404..227317a 100644 --- a/methods.tex +++ b/methods.tex @@ -4,7 +4,7 @@ Gaussian filtering, or Gaussian blur is a straight forward kind of method where the image is convolved with the Gaussian function \begin{equation} - G(x, y) = \frac{1}{2 \pi \sigma^2}\exp\left(-\frac{x^2 + + G_\sigma(x, y) = \frac{1}{2 \pi \sigma^2}\exp\left(-\frac{x^2 + y^2}{2\sigma^2}\right). \end{equation} In the discrete case this amounts to setting each pixel value as the @@ -14,23 +14,68 @@ details from the image. The Gaussian function is also the fundamental solution of the heat equation $\partial_t u = \Delta u$, so convolving with it is equivalent to -solving the heat equation with the original image as initial condition, -and boundary conditions \fixme{??}. +solving the heat equation with the original image as initial value. Care +must of course be taken on the boundary, and it is normal to +symmetrically extend the image in all directions. -\subsection{Anistropic diffusion} +By basic fourier analysis it is possible to show that the Gaussian +filter is a low-pass filter which attenuates high frequencies +\fixme{Cite Weickert for example?} + +\subsection{Anisotropic diffusion} Since the Gaussian filter will blur out both noise and details of the image, it would be nice to somehow reduce the amount of blur it adds -around edges, or what we beleive to be edges, in the image. This can be -done by controlling the conductivity $a(u)$ of the image in the heat -equation +in areas with edges, or what we beleive to be edges, in the image. This +can be done by controlling the thermal diffusivity $\alpha(u)$ of the +image in the heat equation +\begin{equation} + \partial_t u = \mathrm{div} \big( a(u) \nabla u\big). +\end{equation} +The problem is then, how to detect the edges such that we can reduce +$\alpha(u)$ in those areas. + +Perona and Malik proposed a modified heat equation +\begin{equation} + \partial_t u = \mathrm{div} \left( \frac{\nabla u}{1 + + \frac{\abs{\nabla u}^2}{\lambda^2}} \right) +\end{equation} +which is actually related to the way brightness is percepted by the +human visual system. At edges, $\abs{\nabla u}$ is big, and the thermal +diffusivity will be small, while at already smooth portions of the +image, the amount of applied smoothing will also be higher. The model +has some theoretical problems related to well-posedness, for more +information see \cite{weickert1998anisotropic}. + +A different kind of anisotropic diffusion model is the total variation +flow model which is related to the model considered in this project. +It can be formulated as +\begin{equation} + \partial_t u = \mathrm{div} \frac{\nabla u}{\abs{\nabla u}} +\end{equation} +aaaaaaaaand? + +An other approach is to let the thermal diffusivity be a matrix $A(u)$ +in the equation \begin{equation} - \partial_t u = \mathrm{div} \big( a(u) \nabla u\big) + \partial_t u = \mathrm{div} \big(A(u) \cdot \nabla u\big). \end{equation} +This way, it is possible to have a small diffusivity \emph{across} +edges, and at the same time a big diffusivity \emph{along} the edges. \subsection{Non-local means} -Somehow averaging over all the pixels in the image. Has a very good -method noise. +The non-local means method of image restoration takes into account the +fact that two separate parts of an image might be very similar, for +example in the case of a regular texture. One defines some neighborhood +for each pixel, and when restoring a pixel, one considers \emph{all} +other pixels which has similiar neighborhoods as the current pixel, for +some notion of similiar. One then averages all these pixels to obtain +the new pixel value. \subsection{Other filters} -Median filter for example. +A different filter much used in real-world image processing is the +median filter. It replaces the value of each pixel with the median of +the values of the surrounding pixels. As with other methods, one has to +choose what the neighborhood of each pixel should be. It can perform +very well, especially with salt and pepper noise or images where some +pixels are missing. diff --git a/total.tex b/total.tex index 2140733..95f9caa 100644 --- a/total.tex +++ b/total.tex @@ -18,18 +18,23 @@ minimizing the energy function \end{equation} where $v$ is the original image, and $\Omega$ is the image domain, in our case an open subset of $\mathbb{R}^2$. Normally, $p$ is chosen to be -1 or 2. The model can be grounded on spatial statistics by introducing +1 or 2. + +\subsection{Probabilistic background} +The model can be grounded on spatial statistics by introducing and maximizing the likelihood $p(u \mid v) \cdot p(u)$. This is -equivalent to minimizing +equivalent to the formulation \begin{equation} - -\ln p(u \mid v) - \ln p(u). + \min_u \big( - \ln p(u \mid v) - \ln p(u) \big). \end{equation} If the noise term $p(u \mid v)$ is modeled to be independently and -identically distributed Gaussian noise on each pixel, we will end up -with a term proportional to +identically distributed Gaussian noise on each pixel, we have +\begin{equation} + p(u \mid v) \propto \exp \left( \frac{(u - v)^2}{2\sigma^2} \right) +\end{equation} -\fixme{Why? Theoretical niceness? Models the real world? There - are also other norms describing other noise models?} +\subsection{Functional analysis} +\fixme{Meh heading.} The term $\TV(u)$ is the total variation of the image, and is defined as follows: