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

MultiImageAccessor2< Iter1, Acc1, Iter2, Acc2 > 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 Member Functions

| MultiImageAccessor2 (Iter1 i1, Acc1 a1, Iter2 i2, Acc2 a2)
template<class OFFSET >
value_type | operator() (OFFSET const &d) const
template<class OFFSET1 , class OFFSET2 >
value_type | operator() (OFFSET1 d1, OFFSET2 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. Sometimes, we need more information to calculate 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 algorithms. 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());
vigra::BasicImage< float >
vigra::MultiImageAccessor2
Access two images simultaneously.
Definition accessor.hxx:872
vigra::RGBValue
Class for a single RGB value.
Definition rgbvalue.hxx:128
vigra
vigra::seededRegionGrowing
void seededRegionGrowing(...)
Region Segmentation by means of Seeded Region Growing.
vigra::CoordinateIterator
Diff2D CoordinateIterator
Simulate an image where each pixel contains its coordinate.
Definition imageiterator.hxx:1558

## Member Typedef Documentation

## ◆ value_type

template<class Iter1 , class Acc1 , class Iter2 , class Acc2 >

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

template<class Iter1 , class Acc1 , class Iter2 , class Acc2 >

MultiImageAccessor2 | ( | Iter1 | i1,
|  | Acc1 | a1,
|  | Iter2 | i2,
|  | Acc2 | a2
| ) |  |

Construct from two image iterators and associated accessors.

## Member Function Documentation

## ◆ operator()() [1/2]

template<class Iter1 , class Acc1 , class Iter2 , class Acc2 >
template<class OFFSET >

value_type operator() | ( | OFFSET const & | d | ) | const

read the current data item

## ◆ operator()() [2/2]

template<class Iter1 , class Acc1 , class Iter2 , class Acc2 >
template<class OFFSET1 , class OFFSET2 >

value_type operator() | ( | OFFSET1 | d1,
|  | OFFSET2 const & | d2
| ) |  | const

read the data item at an offset

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

- vigra/accessor.hxx

© 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