[ VIGRA Homepage | Class Index | Function Index | File Index | Main Page ]

| Non-linear Diffusion |
--- | --- | ---

## Classes

class | DiffusivityFunctor
| Diffusivity functor for non-linear diffusion. More...

## Functions

template<...> void | nonlinearDiffusion (SrcIterator sul, SrcIterator slr, SrcAccessor as, DestIterator dul, DestAccessor ad, DiffusivityFunc const &weight, double scale)
| Perform edge-preserving smoothing at the given scale.

## Detailed Description

Perform edge-preserving smoothing.

## Function Documentation

void nonlinearDiffusion (...)

Perform edge-preserving smoothing at the given scale.

The algorithm solves the non-linear diffusion equation

where t is the time, x is the location vector, u( x , t) is the smoothed image at time t, and g(.) is the location dependent diffusivity. At time zero, the image u( x , 0) is simply the original image. The time is propotional to the square of the scale parameter: . The diffusion equation is solved iteratively according to the Additive Operator Splitting Scheme (AOS) from

J. Weickert: "Recursive Separable Schemes for Nonlinear Diffusion Filters", in: B. ter Haar Romeny, L. Florack, J. Koenderingk, M. Viergever (eds.): 1st Intl. Conf. on Scale-Space Theory in Computer Vision 1997, Springer LNCS 1252

`DiffusivityFunctor` implements the gradient dependent local diffusivity. It is passed as an argument to gradientBasedTransform(). The return value must be between 0 and 1 and determines the weight a pixel gets when its neighbors are smoothed. Weickert recommends the use of the diffusivity implemented by class DiffusivityFunctor. It's also possible to use other functors, for example one that always returns 1, in which case we obtain the solution to the linear diffusion equation, i.e. Gaussian convolution.

The source value type must be a linear space with internal addition, scalar multiplication, and NumericTraits defined. The value_type of the DiffusivityFunctor must be the scalar field over wich the source value type's linear space is defined.

In addition to `nonlinearDiffusion()`, there is an algorithm `nonlinearDiffusionExplicit()` which implements the Explicit Scheme described in the above article. Both algorithms have the same interface, but the explicit scheme gives slightly more accurate approximations of the diffusion process at the cost of much slower processing.

Declarations:

pass arguments explicitly:

        namespace vigra {
            template <class SrcIterator, class SrcAccessor,
                      class DestIterator, class DestAccessor,
                      class DiffusivityFunctor>
            void nonlinearDiffusion(SrcIterator sul, SrcIterator slr, SrcAccessor as,
                               DestIterator dul, DestAccessor ad,
                               DiffusivityFunctor const & weight, double scale);
        }

use argument objects in conjunction with Argument Object Factories:

        namespace vigra {
            template <class SrcIterator, class SrcAccessor,
                      class DestIterator, class DestAccessor,
                      class DiffusivityFunctor>
            void nonlinearDiffusion(
                triple<SrcIterator, SrcIterator, SrcAccessor> src,
                pair<DestIterator, DestAccessor> dest,
                DiffusivityFunctor const & weight, double scale);
        }

Usage:

#include "vigra/nonlineardiffusion.hxx"

        FImage src(w,h), dest(w,h);
        float edge_threshold, scale;
        ...

        nonlinearDiffusion(srcImageRange(src), destImage(dest),
                           DiffusivityFunctor<float>(edge_threshold), scale);

Required Interface:

- `SrcIterator` and `DestIterator` are models of ImageIterator
- `SrcAccessor` and `DestAccessor` are models of StandardAccessor
- `SrcAccessor::value_type` is a linear space
- `DiffusivityFunctor` conforms to the requirements of gradientBasedTransform(). Its range is between 0 and 1.
- `DiffusivityFunctor::value_type` is an algebraic field

Precondition:

`scale > 0`

© Ullrich Köthe (koethe@informatik.uni-hamburg.de) Cognitive Systems Group, University of Hamburg, Germany | html generated using doxygen and Python VIGRA 1.4.0 (21 Dec 2005)