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

| Euclidean distance transform for multi-dimensional arrays. |

## Functions

template<... >
void | separableMultiDistance (...)
| Euclidean distance on multi-dimensional arrays.
template<... >
void | separableMultiDistSquared (...)
| Euclidean distance squared on multi-dimensional arrays.

## Detailed Description

These functions perform the Euclidean distance transform an arbitrary dimensional array that is specified by iterators (compatible to Multi-dimensional Array Iterators) and shape objects. It can therefore be applied to a wide range of data structures (vigra::MultiArrayView, vigra::MultiArray etc.).

## Function Documentation

template<... >
void vigra::separableMultiDistSquared | ( |  | ... | ) |

Euclidean distance squared on multi-dimensional arrays.

Declarations:

pass arguments explicitly:

        namespace vigra {
            // apply the same kernel to all dimensions
            template <class SrcIterator, class SrcShape, class SrcAccessor,
                      class DestIterator, class DestAccessor>
            void
            separableMultiDistSquared(SrcIterator siter, SrcShape const & shape, SrcAccessor src,
                                        DestIterator diter, DestAccessor dest, bool background);

        }

use argument objects in conjunction with Argument Object Factories :

        namespace vigra {
            template <class SrcIterator, class SrcShape, class SrcAccessor,
                      class DestIterator, class DestAccessor>
            void
            separableMultiDistance(triple<SrcIterator, SrcShape, SrcAccessor> const & source,
                                        pair<DestIterator, DestAccessor> const & dest,
                                        bool background);

        }

This function performs a Euclidean distance squared transform on the given multi-dimensional array. Both source and destination arrays are represented by iterators, shape objects and accessors. The destination array is required to already have the correct size.

This function expects a mask as its source, where background pixels are marked as zero, and non-background pixels as non-zero. If the parameter background is true, then the squared distance of all background pixels to the nearest object is calculated. Otherwise, the distance of all object pixels to the nearest background pixel is calculated.

This function may work in-place, which means that `siter == diter` is allowed. A full-sized internal array is only allocated if working on the destination array directly would cause overflow errors (i.e. if `typeid(typename DestAccessor::value_type) < N * M*M`, where M is the size of the largest dimension of the array.

Usage:

#include <vigra/multi_distance.hxx>

        MultiArray<3, unsigned char>::size_type shape(width, height, depth);
        MultiArray<3, unsigned char> source(shape);
        MultiArray<3, unsigned int> dest(shape);
        ...

        // Calculate Euclidean distance squared for all background pixels
        separableMultiDistSquared(srcMultiArrayRange(source), destMultiArray(dest), true);

See also:
  vigra::distanceTransform()

template<... >
void vigra::separableMultiDistance | ( |  | ... | ) |

Euclidean distance on multi-dimensional arrays.

Declarations:

pass arguments explicitly:

        namespace vigra {
            // apply the same kernel to all dimensions
            template <class SrcIterator, class SrcShape, class SrcAccessor,
                      class DestIterator, class DestAccessor>
            void
            separableMultiDistance(SrcIterator siter, SrcShape const & shape, SrcAccessor src,
                                        DestIterator diter, DestAccessor dest, bool background);

        }

use argument objects in conjunction with Argument Object Factories :

        namespace vigra {
            template <class SrcIterator, class SrcShape, class SrcAccessor,
                      class DestIterator, class DestAccessor>
            void
            separableMultiDistance(triple<SrcIterator, SrcShape, SrcAccessor> const & source,
                                        pair<DestIterator, DestAccessor> const & dest,
                                        bool background);

        }

This function performs a Euclidean distance transform on the given multi-dimensional array. Both source and destination arrays are represented by iterators, shape objects and accessors. The destination array is required to already have the correct size.

This function expects a mask as its source, where background pixels are marked as zero, and non-background pixels as non-zero. If the parameter background is true, then the squared distance of all background pixels to the nearest object is calculated. Otherwise, the distance of all object pixels to the nearest background pixel is calculated.

This function may work in-place, which means that `siter == diter` is allowed. A full-sized internal array is only allocated if working on the destination array directly would cause overflow errors (i.e. if `typeid(typename DestAccessor::value_type) < N * M*M`, where M is the size of the largest dimension of the array.

Usage:

#include <vigra/multi_distance.hxx>

        MultiArray<3, unsigned char>::size_type shape(width, height, depth);
        MultiArray<3, unsigned char> source(shape);
        MultiArray<3, unsigned float> dest(shape);
        ...

        // Calculate Euclidean distance squared for all background pixels
        separableMultiDistance(srcMultiArrayRange(source), destMultiArray(dest), true);

See also:
  vigra::distanceTransform()

© 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.6.0 (13 Aug 2008)