[ VIGRA Homepage | Function Index | Class Index | Namespaces | File List | Main Page ]
![]() |
Common Filters | ![]() |
Functions | |
template<... > | |
void | convolveImage (...) |
Convolve an image with the given kernel(s). More... | |
template<... > | |
void | convolveImageWithMask (...) |
Deprecated name of 2-dimensional normalized convolution, i.e. convolution with a mask image. More... | |
template<... > | |
void | gaussianGradient (...) |
Calculate the gradient vector by means of a 1st derivatives of Gaussian filter. More... | |
template<... > | |
void | gaussianGradientMagnitude (...) |
Calculate the gradient magnitude by means of a 1st derivatives of Gaussian filter. More... | |
template<... > | |
void | gaussianSharpening (...) |
Perform sharpening function with gaussian filter. More... | |
template<... > | |
void | gaussianSmoothing (...) |
Perform isotropic Gaussian convolution. More... | |
template<... > | |
void | hessianMatrixOfGaussian (...) |
Filter image with the 2nd derivatives of the Gaussian at the given scale to get the Hessian matrix. More... | |
template<... > | |
void | laplacianOfGaussian (...) |
Filter image with the Laplacian of Gaussian operator at the given scale. More... | |
template<... > | |
void | normalizedConvolveImage (...) |
Performs a 2-dimensional normalized convolution, i.e. convolution with a mask image. More... | |
template<... > | |
void | rieszTransformOfLOG (...) |
Calculate Riesz transforms of the Laplacian of Gaussian. More... | |
template<... > | |
void | simpleSharpening (...) |
Perform simple sharpening function. More... | |
template<... > | |
void | structureTensor (...) |
Calculate the Structure Tensor for each pixel of and image, using Gaussian (derivative) filters. More... | |
These functions calculate common filters by appropriate sequences of calls to separableConvolveX() and separableConvolveY() or explicit 2-dimensional convolution.
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 2D array views:
Usage:
#include <vigra/boundarytensor.hxx>
Namespace: vigra
void vigra::convolveImage | ( | ... | ) |
Convolve an image with the given kernel(s).
If you pass vigra::Kernel2D to this function, it will perform an explicit 2-dimensional convolution. If you pass a single vigra::Kernel1D, it performs a separable convolution, i.e. it concatenates two 1D convolutions (along the x-axis and along the y-axis) with the same kernel via internal calls to separableConvolveX() and separableConvolveY(). If two 1D kernels are specified, separable convolution uses different kernels for the x- and y-axis.
All border treatment modes are supported.
The input pixel type T1
must be a linear space over the kernel's value_type T
, i.e. addition of source values, multiplication with kernel values, and NumericTraits must be defined. The kernel's value_type must be an algebraic field, i.e. the arithmetic operations (+, -, *, /) and NumericTraits must be defined. Typically, you will use double
for the kernel type.
Declarations:
pass 2D array views:
Usage:
#include <vigra/convolution.hxx>
Namespace: vigra
Preconditions:
The image must be larger than the kernel radius.
w > std::max(xkernel.right(), -xkernel.keft())
and h > std::max(ykernel.right(), -ykernel.left())
are required. w > std::max(kernel.lowerRight().x, -kernel.upperLeft().x)
and h > std::max(kernel.lowerRight().y, -kernel.upperLeft().y)
are required. If BORDER_TREATMENT_CLIP
is requested: the sum of kernel elements must be != 0.
void vigra::simpleSharpening | ( | ... | ) |
Perform simple sharpening function.
This function uses convolveImage() with the following 3x3 filter:
and uses BORDER_TREATMENT_REFLECT
as border treatment mode.
Preconditions:
Declarations:
pass 2D array views:
Usage:
#include <vigra/convolution.hxx>
Namespace: vigra
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
Preconditions:
Declarations:
pass 2D array views:
Usage:
#include <vigra/convolution.hxx>
Namespace: vigra
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
.
Function gaussianSmoothMultiArray() performs the same filter operation on arbitrary dimensional arrays.
Declarations:
pass 2D array views:
Usage:
#include <vigra/convolution.hxx>
Namespace: vigra
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).
Function gaussianGradientMultiArray() performs the same filter operation on arbitrary dimensional arrays.
Declarations:
pass 2D array views:
Usage:
#include <vigra/convolution.hxx>
Namespace: vigra
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.
Anisotropic data should be provided with appropriate vigra::ConvolutionOptions to adjust the filter sizes for the resolution of each axis. Otherwise, the parameter opt
is optional unless the parameter sigma
is omitted.
If you pass vigra::BlockwiseConvolutionOptions instead, the algorithm will be executed in parallel on data blocks of a certain size. The block size can be customized via BlockwiseConvolutionOptions::blockShape()
, but the defaults usually work reasonably. By default, the number of threads equals the capabilities of your hardware, but you can change this via BlockwiseConvolutionOptions::numThreads()
.
Declarations:
use arbitrary-dimensional arrays:
Here, the input element types T1
and MT
can be arbitrary scalar types, and T1
may also be TinyVector
or RGBValue
. The output element type T2
should be the corresponding norm type (see NormTraits). In the Multiband<MT>
-version, the input array's right-most dimension is interpreted as a channel axis, therefore it must have one dimension more than the output array.
Usage:
#include <vigra/multi_convolution.hxx> (sequential version)
#include <vigra/multi_blockwise.hxx> (parallel version)
#include <vigra/convolution.hxx> (deprecated API version)
Namespace: vigra
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.
Function laplacianOfGaussianMultiArray() performs the same filter operation on arbitrary dimensional arrays.
Declarations:
pass 2D array views:
Usage:
#include <vigra/convolution.hxx>
Namespace: vigra
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.
Function hessianOfGaussianMultiArray() performs the same filter operation on arbitrary dimensional arrays.
Declarations:
pass 2D array views:
Usage:
#include <vigra/convolution.hxx>
Namespace: vigra
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.
Function structureTensorMultiArray() performs the same filter operation on arbitrary dimensional arrays.
Declarations:
pass 2D array views:
Usage:
#include <vigra/convolution.hxx>
Namespace: vigra
void vigra::normalizedConvolveImage | ( | ... | ) |
Performs a 2-dimensional normalized convolution, i.e. convolution with a mask image.
This functions computes normalized convolution as defined in Knutsson, H. and Westin, C-F.: Normalized and differential convolution: Methods for Interpolation and Filtering of incomplete and uncertain data. Proc. of the IEEE Conf. on Computer Vision and Pattern Recognition, 1993, 515-523.
The mask image must be binary and encodes which pixels of the original image are valid. It is used as follows: Only pixel under the mask are used in the calculations. Whenever a part of the kernel lies outside the mask, it is ignored, and the kernel is renormalized to its original norm (analogous to the CLIP BorderTreatmentMode). Thus, a useful convolution result is computed whenever at least one valid pixel is within the current window Thus, destination pixels not under the mask still receive a value if they are near the mask. Therefore, this algorithm is useful as an interpolator of sparse input data. If you are only interested in the destination values under the mask, you can perform a subsequent copyImageIf().
The KernelIterator must point to the center of the kernel, and the kernel's size is given by its upper left (x and y of distance <= 0) and lower right (distance >= 0) corners. The image must always be larger than the kernel. At those positions where the kernel does not completely fit into the image, the specified BorderTreatmentMode is applied. Only BORDER_TREATMENT_CLIP and BORDER_TREATMENT_AVOID are currently supported.
The images's pixel type (SrcAccessor::value_type) must be a linear space over the kernel's value_type (KernelAccessor::value_type), i.e. addition of source values, multiplication with kernel values, and NumericTraits must be defined. The kernel's value_type must be an algebraic field, i.e. the arithmetic operations (+, -, *, /) and NumericTraits must be defined.
Declarations:
pass 2D array views:
Usage:
#include <vigra/stdconvolution.hxx>
Namespace: vigra
Preconditions:
w > std::max(kernel.lowerRight().x, -kernel.upperLeft().x)
and h > std::max(kernel.lowerRight().y, -kernel.upperLeft().y)
. border == BORDER_TREATMENT_CLIP || border == BORDER_TREATMENT_AVOID
void vigra::convolveImageWithMask | ( | ... | ) |
Deprecated name of 2-dimensional normalized convolution, i.e. convolution with a mask image.
See normalizedConvolveImage() for documentation.
Declarations:
pass 2D array views:
© Ullrich Köthe (ullrich.koethe@iwr.uni-heidelberg.de) |
html generated using doxygen and Python
|