[ VIGRA Homepage | Function Index | Class Index | Namespaces | File List | Main Page ]
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 DIFFERENCE1 , class DIFFERENCE2 > | |
value_type | operator() (DIFFERENCE1 d1, DIFFERENCE2 const &d2) const |
template<class DIFFERENCE > | |
value_type | operator() (DIFFERENCE const &d) const |
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());
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.
MultiImageAccessor2 | ( | Iter1 | i1, |
Acc1 | a1, | ||
Iter2 | i2, | ||
Acc2 | a2 | ||
) |
Construct from two image iterators and associated accessors.
value_type operator() | ( | DIFFERENCE const & | d | ) | const |
read the current data item
value_type operator() | ( | DIFFERENCE1 | d1, |
DIFFERENCE2 const & | d2 | ||
) | const |
read the data item at an offset
© Ullrich Köthe (ullrich.koethe@iwr.uni-heidelberg.de) |
html generated using doxygen and Python
|