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

details Local Minima and Maxima VIGRA

Classes

class  LocalMinmaxOptions
 Options object for localMinima() and localMaxima(). More...
 

Functions

template<... >
void extendedLocalMaxima (...)
 Find local maximal regions in an array. More...
 
template<... >
void extendedLocalMaxima3D (...)
 Find local maximal regions in 3D multi array. More...
 
template<... >
void extendedLocalMinima (...)
 Find local minimal regions (plateaus) in an array. More...
 
template<... >
void extendedLocalMinima3D (...)
 Find local minimal regions in a volume. More...
 
template<... >
void localMaxima (...)
 Find local maxima in an image or multi-dimensional array. More...
 
template<... >
void localMaxima3D (...)
 Find local maxima in a 3D multi array. More...
 
template<... >
void localMinima (...)
 Find local minima in an image or multi-dimensional array. More...
 
template<... >
void localMinima3D (...)
 Find local minima in a 3D multi array. More...
 

Detailed Description

Detect local minima and maxima in a gray level image, including extremal plateaus larger than 1 pixel

Function Documentation

void vigra::localMinima (   ...)

Find local minima in an image or multi-dimensional array.

By default, minima are defined as points which are not at the array border and whose value is lower than the value of all indirect neighbors (i.e. 8-neighbors in 2D, 26-neighbors in 3D, 3N-1 neighbors in N-D). The detected points will be marked with the default value 1 in the destination array.

The defaults can be overridden in various ways by providing LocalMinmaxOptions : you can switch to the direct neighborhood (i.e. 4-neighborhood in 2D, 6-neighborhood in 3D, 2*N neighborhood in N-D), allow minima at the border, discard minima where the function value is not below a given threshold, allow extended minima (i.e. minima that form minimal plateaus rather than isolated pixels – note that this option is only supported for 2D images), and change the marker in the destination image. See usage examples below for details.

There are also variants of the localMinima() function where parameters are passed explicitly rather than via an option object. These versions of the function are deprecated, but will be kept for compatibility.

Declarations:

use arbitrary-dimensional arrays:

namespace vigra {
template <unsigned int N, class T1, class C1, class T2, class C2>
void
localMinima(MultiArrayView<N, T1, C1> src,
MultiArrayView<N, T2, C2> dest,
LocalMinmaxOptions const & options = LocalMinmaxOptions());
}

show deprecated declarations

Usage:

#include <vigra/localminmax.hxx>
#include <vigra/multi_localminmax.hxx>
Namespace: vigra

// 3D examples (other dimensions work likewise)
Shape3 shape(w,h,d);
MultiArray<3, unsigned char> src(shape), minima(shape);
... // fill src
// use default parameterisation
localMinima(src, minima);
// reset destination image
minima = 0;
// use direct neighborhood (i.e. 6-neighborhood since we are in 3D)
// and allow minima at the image border
localMinima(src, minima,
LocalMinmaxOptions().neighborhood(0).allowAtBorder());

show deprecated examples

void vigra::localMinima3D (   ...)

Find local minima in a 3D multi array.

Deprecated, use localMinima() instead.

void vigra::localMaxima (   ...)

Find local maxima in an image or multi-dimensional array.

By default, maxima are defined as points which are not at the array border and whose value is higher than the value of all indirect neighbors (i.e. 8-neighbors in 2D, 26-neighbors in 3D, 3N-1 neighbors in N-D). The detected points will be marked with the default value 1 in the destination array.

The defaults can be overridden in various ways by providing LocalMinmaxOptions : you can switch to the direct neighborhood (i.e. 4-neighborhood in 2D, 6-neighborhood in 3D, 2*N neighborhood in N-D), allow maxima at the border, discard maxima where the function value is not above a given threshold, allow extended maxima (i.e. maxima that form maximal plateaus rather than isolated pixels – note that this option is only supported for 2D images), and change the marker in the destination image. See usage examples below for details.

There are also variants of the localMaxima() function where parameters are passed explicitly rather than via an option object. These versions of the function are deprecated, but will be kept for compatibility.

Declarations:

use arbitrary-dimensional arrays:

namespace vigra {
template <unsigned int N, class T1, class C1, class T2, class C2>
void
localMaxima(MultiArrayView<N, T1, C1> src,
MultiArrayView<N, T2, C2> dest,
LocalMinmaxOptions const & options = LocalMinmaxOptions());
}

show deprecated declarations

Usage:

#include <vigra/localminmax.hxx>
#include <vigra/multi_localminmax.hxx>
Namespace: vigra

// 3D examples (other dimensions work likewise)
Shape3 shape(w,h,d);
MultiArray<3, unsigned char> src(shape), maxima(shape);
... // fill src
// use default parameterisation
localMaxima(src, maxima);
// reset destination image
maxima = 0;
// use direct neighborhood (i.e. 6-neighborhood sine we are in 3D)
// and allow maxima at the image border
localMaxima(src, maxima,
LocalMinmaxOptions().neighborhood(0).allowAtBorder());

show deprecated examples

void vigra::localMaxima3D (   ...)

Find local maxima in a 3D multi array.

Deprecated, use localMaxima() instead.

void vigra::extendedLocalMinima (   ...)

Find local minimal regions (plateaus) in an array.

This function is only needed when you want to pass a non-standard equality predicate via EqualityFunctor. Otherwise (i.e. when equality is defined by the '==' operator of the source value type T1), you can simply call localMinima() with the option LocalMinmaxOptions::allowPlateaus().

This function finds regions of uniform pixel values whose neighboring regions all have larger values, i.e. it finds minimal plateaus of arbitrary size (including size 1). The EqualityFunctor determines when pixels are considered equal, so that one can allow for plateaus that are not quite constant (this is often necessary with float pixel values). Otherwise, the functionality is identical to localMinima().

Declarations:

use arbitrary-dimensional arrays:

namespace vigra {
template <unsigned int N, class T1, class S1,
class T2, class S2,
class EqualityFunctor>
unsigned int
extendedLocalMinima(MultiArrayView<N, T1, S1> const & src,
MultiArrayView<N, T2, S2> dest,
EqualityFunctor const & equal,
LocalMinmaxOptions options = LocalMinmaxOptions());

show deprecated declarations

Usage:

#include <vigra/localminmax.hxx>
Namespace: vigra

// define an equality functor
template <class T>
struct EqualWithToleranceFunctor
{
EqualWithToleranceFunctor(T tolerance)
: t(tolerance)
{}
bool operator()(T l, T r) const
{
return abs(l-r) <= t;
}
T t;
};
MultiArray<2, unsigned char> src(w,h), minima(w,h);
// allow plateaus
localMinima(src, minima, LocalMinmaxOptions().allowPlateaus());
// reset result image
minima.init(0);
// allow plateaus with tolerance (grayvalues may differ by one)
extendedLocalMinima(src, minima, EqualWithToleranceFunctor<unsigned char>(1));

show deprecated examples

void vigra::extendedLocalMinima3D (   ...)

Find local minimal regions in a volume.

See extendedLocalMinima().

void vigra::extendedLocalMaxima (   ...)

Find local maximal regions in an array.

This function is only needed when you want to pass a non-standard equality predicate via EqualityFunctor. Otherwise (i.e. when equality is defined by the '==' operator of the source value type T1), you can simply call localMaxima() with the option LocalMinmaxOptions::allowPlateaus().

This function finds regions of uniform pixel values whose neighboring regions all have smaller values, i.e. it finds maximal plateaus of arbitrary size (including size 1). The EqualityFunctor determines when pixels are considered equal, so that one can allow for plateaus that are not quite constant (this is often necessary with float pixel values). Otherwise, the functionality is identical to localMaxima().

Declarations:

use arbitrary-dimensional arrays:

namespace vigra {
template <unsigned int N, class T1, class S1,
class T2, class S2>
unsigned int // return number of maxima
extendedLocalMaxima(MultiArrayView<N, T1, S1> const & src,
MultiArrayView<N, T2, S2> dest,
LocalMinmaxOptions options = LocalMinmaxOptions());

show deprecated declarations

Usage:

#include <vigra/localminmax.hxx>
Namespace: vigra

// define an equality functor
template <class T>
struct EqualWithToleranceFunctor
{
EqualWithToleranceFunctor(T tolerance)
: t(tolerance)
{}
bool operator()(T l, T r) const
{
return abs(l-r) <= t;
}
T t;
};
MultiArray<2, unsigned char> src(w,h), maxima(w,h);
// allow plateaus
localMaxima(src, maxima, LocalMinmaxOptions().allowPlateaus());
// reset result image
maxima.init(0);
// allow plateaus with tolerance (grayvalues may differ by one)
extendedLocalMaxima(src, maxima, EqualWithToleranceFunctor<unsigned char>(1));

show deprecated examples

void vigra::extendedLocalMaxima3D (   ...)

Find local maximal regions in 3D multi array.

See extendedLocalMaxima().

© Ullrich Köthe (ullrich.koethe@iwr.uni-heidelberg.de)
Heidelberg Collaboratory for Image Processing, University of Heidelberg, Germany

html generated using doxygen and Python
vigra 1.11.1 (Fri May 19 2017)