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

| MultiImageAccessor2 Class Template Reference |
--- | --- | ---

Access two images simultaneously. More...

`#include "vigra/accessor.hxx"`

## Public Types

typedef pair< typename Acc1::value_type, typename Acc2::value_type > | value_type

## Public Methods

| MultiImageAccessor2 (Iter1 i1, Acc1 a1, Iter2 i2, Acc2 a2)
template<class DIFFERENCE> value_type | operator() (DIFFERENCE const &d) const
template<class DIFFERENCE1, class DIFFERENCE2> value_type | operator() (DIFFERENCE1 d1, DIFFERENCE2 const &d2) const

## Detailed Description

### template<class Iter1, class Acc1, class Iter2, class Acc2>
class vigra::MultiImageAccessor2< Iter1, Acc1, Iter2, Acc2 >

Access two images simultaneously.

This accessor is used when two images need to be treated as one because an algorithm accepts only one image. For example, seededRegionGrowing() uses only one image two calculate the cost for aggregating each pixel into a region. Somtimes, we need more information to calcuate this cost, for example gray value and local gradient magnitude. These values can be stored in two images, which appear as only one when we pass a `MultiImageAccessor2` to the lagorithms. Of course, the cost functor must accept a `pair` of values for this to work. Instead of an actual image iterator, we pass a CoordinateIterator which selects the right pixels form both images.

Usage:

#include "vigra/accessor.hxx"
Namespace: vigra

        using namespace vigra;

        FImage gray_values(w,h), gradient_magnitude(w,h);
        IImage seeds(w,h), labels(w,h);

        seededRegionGrowing(
            srcIterRange(CoordinateIterator(), CoordinateIterator(w,h),
               MultiImageAccessor2<FImage::iterator, FImage::Accessor,
                                   FImage::iterator, FImage::Accessor>
                                  (gray_values.upperLeft(), gray_values.accessor(),
                                   gradient_magnitude.upperLeft(), gradient_magnitude.accessor())),
            srcImage(seeds),
            destImage(labels),
            SomeCostFunctor());

## Member Typedef Documentation

typedef pair<typename Acc1::value_type, typename Acc2::value_type> value_type

| The accessors value_type: construct a pair that contains the corresponding image values.

## Constructor & Destructor Documentation

MultiImageAccessor2 | ( | Iter1 | i1,
|  | Acc1 | a1,
|  | Iter2 | i2,
|  | Acc2 | a2
| ) | `[inline]`

| Construct from two image iterators and associated accessors.

## Member Function Documentation

value_type operator() | ( | DIFFERENCE1 | d1,
|  | DIFFERENCE2 const & | d2
| ) | const`[inline]`

| read the data item at an offset

value_type operator() | ( | DIFFERENCE const & | d | ) | const`[inline]`

| read the current data item

The documentation for this class was generated from the following file:

- vigra/accessor.hxx

© 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)