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

details Algorithms to Transform Images VIGRA

Functions

template<... >
void gradientBasedTransform (...)
 Calculate a function of the image gradient. More...
 
template<... >
void transformImage (...)
 Apply unary point transformation to each pixel. More...
 
template<... >
void transformImageIf (...)
 Apply unary point transformation to each pixel within the ROI (i.e., where the mask is non-zero). More...
 

Detailed Description

Apply functor to calculate a pixelwise transformation of one image

Function Documentation

void vigra::transformImage (   ...)

Apply unary point transformation to each pixel.

After the introduction of arithmetic and algebraic array expressions, this function is rarely needed. Moreover, transformMultiArray() provides the same functionality for arbitrary dimensional arrays.

The transformation given by the functor is applied to every source pixel and the result written into the corresponding destination pixel. Note that the unary functors of the STL can be used in addition to the functors specifically defined in Functors to Transform Images. Creation of new functors is easiest by using Functor Expressions.

Declarations:

pass 2D array views:

namespace vigra {
template <class T1, class S1,
class T2, class S2, class Functor>
void
transformImage(MultiArrayView<2, T1, S1> const & src,
MultiArrayView<2, T2, S2> dest,
Functor const & f);
}

show deprecated declarations

Usage:

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

#include <cmath> // for sqrt()
MultiArray<2, float> src(100, 200),
dest(100, 200);
...
transformImage(src, dest, &std::sqrt );

show deprecated examples

See Also
Functors to Transform Images, vigra::multi_math, Functor Expressions
Examples:
invert.cxx, and watershed.cxx.
void vigra::transformImageIf (   ...)

Apply unary point transformation to each pixel within the ROI (i.e., where the mask is non-zero).

After the introduction of arithmetic and algebraic array expressions, this function is rarely needed. Moreover, combineTwoMultiArrays() provides the same functionality for arbitrary dimensional arrays.

The transformation given by the functor is applied to every source pixel in the ROI (i.e. when the return value of the mask's accessor is not zero) and the result is written into the corresponding destination pixel. The function uses accessors to access the pixel data. Note that the unary functors of the STL can be used in addition to the functors specifically defined in Functors to Transform Images. Creation of new functors is easiest by using Functor Expressions.

Declarations:

pass 2D array views:

namespace vigra {
template <class T1, class S1,
class TM, class SM,
class T2, class S2,
class Functor>
void
transformImageIf(MultiArrayView<2, T1, S1> const & src,
MultiArrayView<2, TM, SM> const & mask,
MultiArrayView<2, T2, S2> dest,
Functor const & f);
}

show deprecated declarations

Usage:

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

#include <cmath> // for sqrt()
MultiArray<2, unsigned char> mask(100, 200),
MultiArray<2, float> src(100, 200),
dest(100, 200);
... // fill src and mask
transformImageIf(src, mask, dest, &std::sqrt );

show deprecated examples

See Also
Functors to Transform Images, vigra::multi_math, Functor Expressions
void vigra::gradientBasedTransform (   ...)

Calculate a function of the image gradient.

The gradient and the function represented by Functor f are calculated in one go: for each location, the symmetric difference in x- and y-directions (asymmetric difference at the image borders) are passed to the given functor, and the result is written to the destination image. Functors to be used with this function include MagnitudeFunctor and RGBGradientMagnitudeFunctor.

Declarations:

pass 2D array views:

namespace vigra {
template <class T1, class S1,
class T2, class S2,
class Functor>
void
gradientBasedTransform(MultiArrayView<2, T1, S1> const & src,
MultiArrayView<2, T2, S2> dest,
Functor const & grad);
}

show deprecated declarations

Usage:

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

MultiArray<2, float> src(w,h), magnitude(w,h);
...
gradientBasedTransform(src, magnitude,
MagnitudeFunctor<float>());

show deprecated examples

See Also
Functors to Transform Images, vigra::multi_math, Functor Expressions

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