[ VIGRA Homepage | Function Index | Class Index | Namespaces | File List | Main Page ]
Resampling Convolution Filters |
Functions | |
template<... > | |
void | pyramidExpandBurtFilter (...) |
Two-fold up-sampling for image pyramid reconstruction. More... | |
template<class Image , class Alloc > | |
void | pyramidExpandBurtLaplacian (ImagePyramid< Image, Alloc > &pyramid, int fromLevel, int toLevel, double centerValue=0.4) |
Reconstruct a Laplacian pyramid. More... | |
template<... > | |
void | pyramidReduceBurtFilter (...) |
Two-fold down-sampling for image pyramid construction. More... | |
template<class Image , class Alloc > | |
void | pyramidReduceBurtLaplacian (ImagePyramid< Image, Alloc > &pyramid, int fromLevel, int toLevel, double centerValue=0.4) |
Create a Laplacian pyramid. More... | |
template<... > | |
void | resamplingConvolveImage (...) |
Apply two separable resampling filters successively, the first in x-direction, the second in y-direction. More... | |
template<... > | |
void | resamplingConvolveLine (...) |
Performs a 1-dimensional resampling convolution of the source signal using the given set of kernels. More... | |
template<... > | |
void | resamplingConvolveX (...) |
Apply a resampling filter in the x-direction. More... | |
template<... > | |
void | resamplingConvolveY (...) |
Apply a resampling filter in the y-direction. More... | |
These functions implement the convolution operation when the source and target images have different sizes. This is realized by accessing a continuous kernel at the appropriate non-integer positions. The technique is, for example, described in D. Schumacher: General Filtered Image Rescaling, in: Graphics Gems III, Academic Press, 1992.
void vigra::resamplingConvolveLine | ( | ... | ) |
Performs a 1-dimensional resampling convolution of the source signal using the given set of kernels.
This function is mainly used internally: It is called for each dimension of a higher dimensional array in order to perform a separable resize operation.
Declaration:
#include <vigra/resampling_convolution.hxx>
Namespace: vigra
void vigra::resamplingConvolveX | ( | ... | ) |
Apply a resampling filter in the x-direction.
This function implements a convolution operation in x-direction (i.e. applies a 1D filter to every row) where the width of the source and destination images differ. This is typically used to avoid aliasing if the image is scaled down, or to interpolate smoothly if the image is scaled up. The target coordinates are transformed into source coordinates by
The samplingRatio
and offset
must be given as vigra::Rational in order to avoid rounding errors in this transformation. It is required that for all pixels of the target image, xsource
remains within the range of the source image (i.e. 0 <= xsource <= sourceWidth-1
. Since xsource
is in general not an integer, the kernel
must be a functor that can be accessed at arbitrary (double
) coordinates. It must also provide a member function radius()
which specifies the support (non-zero interval) of the kernel. VIGRA already provides a number of suitable functors, e.g. vigra::Gaussian, vigra::BSpline vigra::CatmullRomSpline, and vigra::CoscotFunction. The function resizeImageSplineInterpolation() is implemented by means of resamplingConvolveX() and resamplingConvolveY().
Declarations:
pass 2D array views:
Usage:
#include <vigra/resampling_convolution.hxx>
Namespace: vigra
void vigra::resamplingConvolveY | ( | ... | ) |
Apply a resampling filter in the y-direction.
This function implements a convolution operation in y-direction (i.e. applies a 1D filter to every column) where the height of the source and destination images differ. This is typically used to avoid aliasing if the image is scaled down, or to interpolate smoothly if the image is scaled up. The target coordinates are transformed into source coordinates by
The samplingRatio
and offset
must be given as vigra::Rational in order to avoid rounding errors in this transformation. It is required that for all pixels of the target image, ysource
remains within the range of the source image (i.e. 0 <= ysource <= sourceHeight-1
. Since ysource
is in general not an integer, the kernel
must be a functor that can be accessed at arbitrary (double
) coordinates. It must also provide a member function radius()
which specifies the support (non-zero interval) of the kernel. VIGRA already provides a number of suitable functors, e.g. vigra::Gaussian, vigra::BSpline vigra::CatmullRomSpline, and vigra::CoscotFunction. The function resizeImageSplineInterpolation() is implemented by means of resamplingConvolveX() and resamplingConvolveY().
Declarations:
pass 2D array views:
Usage:
#include <vigra/resampling_convolution.hxx>
Namespace: vigra
void vigra::resamplingConvolveImage | ( | ... | ) |
Apply two separable resampling filters successively, the first in x-direction, the second in y-direction.
This function is a shorthand for the concatenation of a call to resamplingConvolveX() and resamplingConvolveY() with the given kernels. See there for detailed documentation.
Declarations:
pass 2D array views:
Usage:
#include <vigra/resampling_convolution.hxx>
Namespace: vigra
void vigra::pyramidReduceBurtFilter | ( | ... | ) |
Two-fold down-sampling for image pyramid construction.
This function implements the reduction by one resolution level (first signature) or across several pyramid levels (last signature) of a Gaussian pyramid as described in
P. Burt, E. Adelson: "The Laplacian Pyramid as a Compact Image Code", IEEE Trans. Communications, 9(4):532-540, 1983
That is, it applies the smoothing filter
to the source image and then copies all pixels with even coordinates to the destination image. The destination image shape must be dest_shape = ceil(src_shape / 2.0)
. centerValue
must be between 0.25 and 0.5 and determines the strength of smoothing (bigger values correspond to less smoothing). If toLevel - fromLevel > 1
in the pyramid variant of the function, this process is repeated until toLevel
is reached.
Typically, this functions is used in connection with a vigra::ImagePyramid (last signature below) to perform several levels of reduction in one go.
Declarations:
#include <vigra/resampling_convolution.hxx>
Namespace: vigra
pass 2D array views:
use a vigra::ImagePyramid :
void vigra::pyramidExpandBurtFilter | ( | ... | ) |
Two-fold up-sampling for image pyramid reconstruction.
This function implements the expansion by one resolution level (first signature) or across several pyramid levels (last signature) of a Gaussian pyramid as described in
P. Burt, E. Adelson: "The Laplacian Pyramid as a Compact Image Code", IEEE Trans. Communications, 9(4):532-540, 1983
That is, the function first places the pixel values of the low-resolution image at the even pixel coordinates of the high-resolution image (pixels with at least one odd coordinate are zero-initialized) and then applies the interpolation filter
to the high-resolution image. The source image shape must be src_shape = ceil(dest_shape / 2.0)
. centerValue
must be between 0.25 and 0.5 and determines the sharpness of the interpolation (bigger values correspond to sharper images). If fromLevel - toLevel > 1
in the pyramid variant of the function, this process is repeated until toLevel
is reached.
Typically, this functions is used in connection with a vigra::ImagePyramid (last signature below) to perform several levels of expansion in one go.
Declarations:
#include <vigra/resampling_convolution.hxx>
Namespace: vigra
pass 2D array views:
use a vigra::ImagePyramid :
void vigra::pyramidReduceBurtLaplacian | ( | ImagePyramid< Image, Alloc > & | pyramid, |
int | fromLevel, | ||
int | toLevel, | ||
double | centerValue = 0.4 |
||
) |
Create a Laplacian pyramid.
This function implements the reduction across several resolution levels of a Laplacian pyramid as described in
P. Burt, E. Adelson: "The Laplacian Pyramid as a Compact Image Code", IEEE Trans. Communications, 9(4):532-540, 1983
It first creates a Gaussian pyramid using pyramidReduceBurtFilter(), then upsamples each level once using pyramidExpandBurtFilter(), and finally stores the difference between the upsampled and original versions of each level (i.e. the Laplacian of Gaussian is approximated by a difference of Gaussian).
#include <vigra/resampling_convolution.hxx>
Namespace: vigra
void vigra::pyramidExpandBurtLaplacian | ( | ImagePyramid< Image, Alloc > & | pyramid, |
int | fromLevel, | ||
int | toLevel, | ||
double | centerValue = 0.4 |
||
) |
Reconstruct a Laplacian pyramid.
This function implements the reconstruction of a Gaussian pyramid across several resolution levels of a Laplacian pyramid as described in
P. Burt, E. Adelson: "The Laplacian Pyramid as a Compact Image Code", IEEE Trans. Communications, 9(4):532-540, 1983
At each level starting from fromLevel
, this function calls pyramidExpandBurtFilter() to interpolate the image to the next highest resolution, and then adds the interpolated image to the image stored at the next level.
#include <vigra/resampling_convolution.hxx>
Namespace: vigra
© Ullrich Köthe (ullrich.koethe@iwr.uni-heidelberg.de) |
html generated using doxygen and Python
|