[ VIGRA Homepage | Function Index | Class Index | Namespaces | File List | Main Page ]
![]() |
Common Filters | ![]() |
Functions | |
template<class SrcIterator , class SrcAccessor , class DestIterator , class DestAccessor , class T > | |
void | convolveImage (SrcIterator supperleft, SrcIterator slowerright, SrcAccessor sa, DestIterator dupperleft, DestAccessor da, Kernel1D< T > const &kx, Kernel1D< T > const &ky) |
Apply two separable filters successively, the first in x-direction, the second in y-direction. | |
template<... > | |
void | gaussianGradient (...) |
Calculate the gradient vector by means of a 1st derivatives of Gaussian filter. | |
template<... > | |
void | gaussianGradientMagnitude (...) |
Calculate the gradient magnitude by means of a 1st derivatives of Gaussian filter. | |
template<... > | |
void | gaussianSharpening (...) |
Perform sharpening function with gaussian filter. | |
template<... > | |
void | gaussianSmoothing (...) |
Perform isotropic Gaussian convolution. | |
template<... > | |
void | hessianMatrixOfGaussian (...) |
Filter image with the 2nd derivatives of the Gaussian at the given scale to get the Hessian matrix. | |
template<... > | |
void | laplacianOfGaussian (...) |
Filter image with the Laplacian of Gaussian operator at the given scale. | |
template<... > | |
void | rieszTransformOfLOG (...) |
Calculate Riesz transforms of the Laplacian of Gaussian. | |
template<... > | |
void | simpleSharpening (...) |
Perform simple sharpening function. | |
template<... > | |
void | structureTensor (...) |
Calculate the Structure Tensor for each pixel of and image, using Gaussian (derivative) filters. |
These functions calculate common filters by appropriate sequences of calls to separableConvolveX() and separableConvolveY().
void vigra::rieszTransformOfLOG | ( | ... | ) |
Calculate Riesz transforms of the Laplacian of Gaussian.
The Riesz transforms of the Laplacian of Gaussian have the following transfer functions (defined in a polar coordinate representation of the frequency domain):
where n = xorder
and m = yorder
determine th e order of the transform, and sigma > 0
is the scale of the Laplacian of Gaussian. This function computes a good spatial domain approximation of these transforms for xorder + yorder <= 2
. The filter responses may be used to calculate the monogenic signal or the boundary tensor.
Declarations:
pass arguments explicitly:
namespace vigra { template <class SrcIterator, class SrcAccessor, class DestIterator, class DestAccessor> void rieszTransformOfLOG(SrcIterator supperleft, SrcIterator slowerright, SrcAccessor src, DestIterator dupperleft, DestAccessor dest, double scale, unsigned int xorder, unsigned int yorder); }
use argument objects in conjunction with Argument Object Factories :
namespace vigra { template <class SrcIterator, class SrcAccessor, class DestIterator, class DestAccessor> void rieszTransformOfLOG(triple<SrcIterator, SrcIterator, SrcAccessor> src, pair<DestIterator, DestAccessor> dest, double scale, unsigned int xorder, unsigned int yorder); }
Usage:
#include <vigra/boundarytensor.hxx>
FImage impulse(17,17), res(17, 17); impulse(8,8) = 1.0; // calculate the impulse response of the first order Riesz transform in x-direction rieszTransformOfLOG(srcImageRange(impulse), destImage(res), 2.0, 1, 0);
void vigra::convolveImage | ( | SrcIterator | supperleft, | |
SrcIterator | slowerright, | |||
SrcAccessor | sa, | |||
DestIterator | dupperleft, | |||
DestAccessor | da, | |||
Kernel1D< T > const & | kx, | |||
Kernel1D< T > const & | ky | |||
) |
Apply two separable filters successively, the first in x-direction, the second in y-direction.
This function is a shorthand for the concatenation of a call to separableConvolveX() and separableConvolveY() with the given kernels.
Declarations:
pass arguments explicitly:
namespace vigra { template <class SrcIterator, class SrcAccessor, class DestIterator, class DestAccessor, class T> void convolveImage(SrcIterator supperleft, SrcIterator slowerright, SrcAccessor sa, DestIterator dupperleft, DestAccessor da, Kernel1D<T> const & kx, Kernel1D<T> const & ky); }
use argument objects in conjunction with Argument Object Factories :
namespace vigra { template <class SrcIterator, class SrcAccessor, class DestIterator, class DestAccessor, class T> inline void convolveImage(triple<SrcIterator, SrcIterator, SrcAccessor> src, pair<DestIterator, DestAccessor> dest, Kernel1D<T> const & kx, Kernel1D<T> const & ky); }
Usage:
#include <vigra/convolution.hxx>
vigra::FImage src(w,h), dest(w,h); ... // implement sobel filter in x-direction Kernel1D<double> kx, ky; kx.initSymmetricGradient(); ky.initBinomial(1); vigra::convolveImage(srcImageRange(src), destImage(dest), kx, ky);
void vigra::simpleSharpening | ( | ... | ) |
Perform simple sharpening function.
This function uses convolveImage() with the following filter:
-sharpening_factor/16.0, -sharpening_factor/8.0, -sharpening_factor/16.0, -sharpening_factor/8.0, 1.0+sharpening_factor*0.75, -sharpening_factor/8.0, -sharpening_factor/16.0, -sharpening_factor/8.0, -sharpening_factor/16.0;
and uses BORDER_TREATMENT_REFLECT
as border treatment mode.
Preconditions:
1. sharpening_factor >= 0 2. scale >= 0
Declarations:
Declarations:
pass arguments explicitly:
namespace vigra { template <class SrcIterator, class SrcAccessor, class DestIterator, class DestAccessor> void simpleSharpening(SrcIterator src_ul, SrcIterator src_lr, SrcAccessor src_acc, DestIterator dest_ul, DestAccessor dest_acc, double sharpening_factor) }
use argument objects in conjunction with Argument Object Factories :
namespace vigra { template <class SrcIterator, class SrcAccessor, class DestIterator, class DestAccessor> inline void simpleSharpening(triple<SrcIterator, SrcIterator, SrcAccessor> src, pair<DestIterator, DestAccessor> dest, double sharpening_factor) { simpleSharpening(src.first, src.second, src.third, dest.first, dest.second, sharpening_factor); } }
Usage:
#include <vigra/convolution.hxx>
vigra::FImage src(w,h), dest(w,h); ... // sharpening with sharpening_factor = 0.1 vigra::simpleSharpening(srcImageRange(src), destImage(dest), 0.1);
void vigra::gaussianSharpening | ( | ... | ) |
Perform sharpening function with gaussian filter.
This function uses gaussianSmoothing() at the given scale to create a temporary image 'smooth' and than blends the original and smoothed image according to the formula
dest = (1 + sharpening_factor)*src - sharpening_factor*smooth
Preconditions:
1. sharpening_factor >= 0 2. scale >= 0
Declarations:
pass arguments explicitly:
namespace vigra { template <class SrcIterator, class SrcAccessor, class DestIterator, class DestAccessor> void gaussianSharpening(SrcIterator src_ul, SrcIterator src_lr, SrcAccessor src_acc, DestIterator dest_ul, DestAccessor dest_acc, double sharpening_factor, double scale) }
use argument objects in conjunction with Argument Object Factories :
namespace vigra { template <class SrcIterator, class SrcAccessor, class DestIterator, class DestAccessor> void gaussianSharpening(triple<SrcIterator, SrcIterator, SrcAccessor> src, pair<DestIterator, DestAccessor> dest, double sharpening_factor, double scale) }
Usage:
#include <vigra/convolution.hxx>
vigra::FImage src(w,h), dest(w,h); ... // sharpening with sharpening_factor = 3.0 // smoothing with scale = 0.5 vigra::gaussianSmoothing(srcImageRange(src), destImage(dest), 3.0, 0.5);
void vigra::gaussianSmoothing | ( | ... | ) |
Perform isotropic Gaussian convolution.
This function is a shorthand for the concatenation of a call to separableConvolveX() and separableConvolveY() with a Gaussian kernel of the given scale. If two scales are provided, smoothing in x and y direction will have different strength. The function uses BORDER_TREATMENT_REFLECT
.
Declarations:
pass arguments explicitly:
namespace vigra { template <class SrcIterator, class SrcAccessor, class DestIterator, class DestAccessor> void gaussianSmoothing(SrcIterator supperleft, SrcIterator slowerright, SrcAccessor sa, DestIterator dupperleft, DestAccessor da, double scale_x, double scale_y = scale_x); }
use argument objects in conjunction with Argument Object Factories :
namespace vigra { template <class SrcIterator, class SrcAccessor, class DestIterator, class DestAccessor> inline void gaussianSmoothing(triple<SrcIterator, SrcIterator, SrcAccessor> src, pair<DestIterator, DestAccessor> dest, double scale_x, double scale_y = scale_x); }
Usage:
#include <vigra/convolution.hxx>
vigra::FImage src(w,h), dest(w,h); ... // smooth with scale = 3.0 vigra::gaussianSmoothing(srcImageRange(src), destImage(dest), 3.0);
void vigra::gaussianGradient | ( | ... | ) |
Calculate the gradient vector by means of a 1st derivatives of Gaussian filter.
This function is a shorthand for the concatenation of a call to separableConvolveX() and separableConvolveY() with the appropriate kernels at the given scale. Note that this function can either produce two separate result images for the x- and y-components of the gradient, or write into a vector valued image (with at least two components).
Declarations:
pass arguments explicitly:
namespace vigra { // write x and y component of the gradient into separate images template <class SrcIterator, class SrcAccessor, class DestIteratorX, class DestAccessorX, class DestIteratorY, class DestAccessorY> void gaussianGradient(SrcIterator supperleft, SrcIterator slowerright, SrcAccessor sa, DestIteratorX dupperleftx, DestAccessorX dax, DestIteratorY dupperlefty, DestAccessorY day, double scale); // write x and y component of the gradient into a vector-valued image template <class SrcIterator, class SrcAccessor, class DestIterator, class DestAccessor> void gaussianGradient(SrcIterator supperleft, SrcIterator slowerright, SrcAccessor src, DestIterator dupperleft, DestAccessor dest, double scale); }
use argument objects in conjunction with Argument Object Factories :
namespace vigra { // write x and y component of the gradient into separate images template <class SrcIterator, class SrcAccessor, class DestIteratorX, class DestAccessorX, class DestIteratorY, class DestAccessorY> void gaussianGradient(triple<SrcIterator, SrcIterator, SrcAccessor> src, pair<DestIteratorX, DestAccessorX> destx, pair<DestIteratorY, DestAccessorY> desty, double scale); // write x and y component of the gradient into a vector-valued image template <class SrcIterator, class SrcAccessor, class DestIterator, class DestAccessor> void gaussianGradient(triple<SrcIterator, SrcIterator, SrcAccessor> src, pair<DestIterator, DestAccessor> dest, double scale); }
Usage:
#include <vigra/convolution.hxx>
vigra::FImage src(w,h), gradx(w,h), grady(w,h); ... // calculate gradient vector at scale = 3.0 vigra::gaussianGradient(srcImageRange(src), destImage(gradx), destImage(grady), 3.0);
void vigra::gaussianGradientMagnitude | ( | ... | ) |
Calculate the gradient magnitude by means of a 1st derivatives of Gaussian filter.
This function calls gaussianGradient() and returns the pixel-wise magnitude of the resulting gradient vectors. If the original image has multiple bands, the squared gradient magnitude is computed for each band separately, and the return value is the square root of the sum of these squared magnitudes.
Declarations:
pass arguments explicitly:
namespace vigra { template <class SrcIterator, class SrcAccessor, class DestIterator, class DestAccessor> void gaussianGradientMagnitude(SrcIterator sul, SrcIterator slr, SrcAccessor src, DestIterator dupperleft, DestAccessor dest, double scale); }
use argument objects in conjunction with Argument Object Factories :
namespace vigra { template <class SrcIterator, class SrcAccessor, class DestIterator, class DestAccessor> void gaussianGradientMagnitude(triple<SrcIterator, SrcIterator, SrcAccessor> src, pair<DestIterator, DestAccessor> dest, double scale); }
Usage:
#include <vigra/convolution.hxx>
vigra::FImage src(w,h), grad(w,h); ... // calculate gradient magnitude at scale = 3.0 vigra::gaussianGradientMagnitude(srcImageRange(src), destImage(grad), 3.0);
void vigra::laplacianOfGaussian | ( | ... | ) |
Filter image with the Laplacian of Gaussian operator at the given scale.
This function calls separableConvolveX() and separableConvolveY() with the appropriate 2nd derivative of Gaussian kernels in x- and y-direction and then sums the results to get the Laplacian.
Declarations:
pass arguments explicitly:
namespace vigra { template <class SrcIterator, class SrcAccessor, class DestIterator, class DestAccessor> void laplacianOfGaussian(SrcIterator supperleft, SrcIterator slowerright, SrcAccessor sa, DestIterator dupperleft, DestAccessor da, double scale); }
use argument objects in conjunction with Argument Object Factories :
namespace vigra { template <class SrcIterator, class SrcAccessor, class DestIterator, class DestAccessor> inline void laplacianOfGaussian(triple<SrcIterator, SrcIterator, SrcAccessor> src, pair<DestIterator, DestAccessor> dest, double scale); }
Usage:
#include <vigra/convolution.hxx>
vigra::FImage src(w,h), dest(w,h); ... // calculate Laplacian of Gaussian at scale = 3.0 vigra::laplacianOfGaussian(srcImageRange(src), destImage(dest), 3.0);
void vigra::hessianMatrixOfGaussian | ( | ... | ) |
Filter image with the 2nd derivatives of the Gaussian at the given scale to get the Hessian matrix.
The Hessian matrix is a symmetric matrix defined as:
where denote 2nd derivatives of Gaussians at the given scale, and
is the convolution symbol. This function calls separableConvolveX() and separableConvolveY() with the appropriate 2nd derivative of Gaussian kernels and puts the results in the three destination images. The first destination image will contain the second derivative in x-direction, the second one the mixed derivative, and the third one holds the derivative in y-direction.
Declarations:
pass arguments explicitly:
namespace vigra { template <class SrcIterator, class SrcAccessor, class DestIteratorX, class DestAccessorX, class DestIteratorXY, class DestAccessorXY, class DestIteratorY, class DestAccessorY> void hessianMatrixOfGaussian(SrcIterator supperleft, SrcIterator slowerright, SrcAccessor sa, DestIteratorX dupperleftx, DestAccessorX dax, DestIteratorXY dupperleftxy, DestAccessorXY daxy, DestIteratorY dupperlefty, DestAccessorY day, double scale); }
use argument objects in conjunction with Argument Object Factories :
namespace vigra { template <class SrcIterator, class SrcAccessor, class DestIteratorX, class DestAccessorX, class DestIteratorXY, class DestAccessorXY, class DestIteratorY, class DestAccessorY> inline void hessianMatrixOfGaussian(triple<SrcIterator, SrcIterator, SrcAccessor> src, pair<DestIteratorX, DestAccessorX> destx, pair<DestIteratorXY, DestAccessorXY> destxy, pair<DestIteratorY, DestAccessorY> desty, double scale); }
Usage:
#include <vigra/convolution.hxx>
vigra::FImage src(w,h), hxx(w,h), hxy(w,h), hyy(w,h); ... // calculate Hessian of Gaussian at scale = 3.0 vigra::hessianMatrixOfGaussian(srcImageRange(src), destImage(hxx), destImage(hxy), destImage(hyy), 3.0);
void vigra::structureTensor | ( | ... | ) |
Calculate the Structure Tensor for each pixel of and image, using Gaussian (derivative) filters.
The Structure Tensor is is a smoothed version of the Euclidean product of the gradient vector with itself. I.e. it's a symmetric matrix defined as:
where denotes Gaussian smoothing at the outer scale,
are the gradient components taken at the inner scale,
is the convolution symbol, and
etc. are pixelwise products of the 1st derivative images. This function calls separableConvolveX() and separableConvolveY() with the appropriate Gaussian kernels and puts the results in the three separate destination images (where the first one will contain
, the second one
, and the third one holds
), or into a single 3-band image (where the bands hold the result in the same order as above). The latter form is also applicable when the source image is a multi-band image (e.g. RGB). In this case, tensors are first computed for each band separately, and then summed up to get a single result tensor.
Declarations:
pass arguments explicitly:
namespace vigra { // create three separate destination images template <class SrcIterator, class SrcAccessor, class DestIteratorX, class DestAccessorX, class DestIteratorXY, class DestAccessorXY, class DestIteratorY, class DestAccessorY> void structureTensor(SrcIterator supperleft, SrcIterator slowerright, SrcAccessor sa, DestIteratorX dupperleftx, DestAccessorX dax, DestIteratorXY dupperleftxy, DestAccessorXY daxy, DestIteratorY dupperlefty, DestAccessorY day, double inner_scale, double outer_scale); // create a single 3-band destination image template <class SrcIterator, class SrcAccessor, class DestIterator, class DestAccessor> void structureTensor(SrcIterator supperleft, SrcIterator slowerright, SrcAccessor sa, DestIterator dupperleft, DestAccessor da, double inner_scale, double outer_scale); }
use argument objects in conjunction with Argument Object Factories :
namespace vigra { // create three separate destination images template <class SrcIterator, class SrcAccessor, class DestIteratorX, class DestAccessorX, class DestIteratorXY, class DestAccessorXY, class DestIteratorY, class DestAccessorY> void structureTensor(triple<SrcIterator, SrcIterator, SrcAccessor> src, pair<DestIteratorX, DestAccessorX> destx, pair<DestIteratorXY, DestAccessorXY> destxy, pair<DestIteratorY, DestAccessorY> desty, double nner_scale, double outer_scale); // create a single 3-band destination image template <class SrcIterator, class SrcAccessor, class DestIterator, class DestAccessor> void structureTensor(triple<SrcIterator, SrcIterator, SrcAccessor> src, pair<DestIterator, DestAccessor> dest, double nner_scale, double outer_scale); }
Usage:
#include <vigra/convolution.hxx>
vigra::FImage src(w,h), stxx(w,h), stxy(w,h), styy(w,h); vigra::BasicImage<TinyVector<float, 3> > st(w,h); ... // calculate Structure Tensor at inner scale = 1.0 and outer scale = 3.0 vigra::structureTensor(srcImageRange(src), destImage(stxx), destImage(stxy), destImage(styy), 1.0, 3.0); // dto. with a single 3-band destination image vigra::structureTensor(srcImageRange(src), destImage(st), 1.0, 3.0);
© Ullrich Köthe (ullrich.koethe@iwr.uni-heidelberg.de) |
html generated using doxygen and Python
|