A Survey of Gaussian Convolution Algorithms

Convolution via multiplication in the DCT domain. More...
Convolution via multiplication in the DCT domain.
Via the convolutionmultiplication property, discrete cosine transforms (DCTs) are an effective way to implement Gaussian convolution. We follow Martucci's use of DCTs to perform convolution with halfsample symmetric boundary handling,
where and denote respectively the DCTI and DCTII transforms of the same period length. This DCTbased convolution is equivalent to (but is faster and uses less memory) than FFTbased convolution with the symmetrized signal .
The FFTW library is used to compute the DCT transforms.
The process to use these functions is the following:
Data Structures  
struct  dct_coeffs_ 
FFTW plans and coefficients for DCTbased Gaussian convolution. More...  
Typedefs  
typedef struct dct_coeffs_  dct_coeffs 
FFTW plans and coefficients for DCTbased Gaussian convolution.  
Functions  
int  dct_precomp (dct_coeffs *c, num *dest, const num *src, long N, long stride, double sigma) 
DCT precomputations for Gaussian convolution. More...  
int  dct_precomp_image (dct_coeffs *c, num *dest, const num *src, int width, int height, int num_channels, double sigma) 
DCT precomputations for 2D Gaussian convolution. More...  
void  dct_free (dct_coeffs *c) 
Release FFTW plans associated with a dct_coeffs struct. More...  
void  dct_gaussian_conv (dct_coeffs c) 
Perform DCTbased Gaussian convolution. More...  
void dct_free  (  dct_coeffs *  c  ) 
Release FFTW plans associated with a dct_coeffs struct.
c  dct_coeffs created by dct_precomp() or dct_precomp_image() 
Definition at line 203 of file gaussian_conv_dct.c.
void dct_gaussian_conv  (  dct_coeffs  c  ) 
Perform DCTbased Gaussian convolution.
c  dct_coeffs created by dct_precomp() or dct_precomp_image() 
This routine performs 1D and 2D Gaussian convolution with symmetric boundary handling using DCT transforms,
where and denote respectively the DCTI and DCTII transforms of the same period length.
In one dimension, the DCTI transform of the Gaussian is
The DCTII transforms of the signal are performed using the FFTW library, and the plans are prepared by dct_precomp() or dct_precomp_image().
Definition at line 156 of file gaussian_conv_dct.c.
int dct_precomp  (  dct_coeffs *  c, 
num *  dest,  
const num *  src,  
long  N,  
long  stride,  
double  sigma  
) 
DCT precomputations for Gaussian convolution.
c  dct_coeffs pointer to hold precomputations 
dest  output convolved data 
src  data to be convolved, modified inplace if src = dest 
N  number of samples 
stride  stride between successive samples 
sigma  standard deviation of the Gaussian in pixels 
This routine performs precomputations for 1D DCTbased Gaussian convolution, to be used in dct_gaussian_conv(). FFTW transform plans are prepared for the forward and inverse DCTII transform and the value is precomputed.
The convolution can be performed inplace by setting src = dest (the source array is overwritten with the result).
FFT(functionname)
expands to fftw_functionname
if num is double or fftwf_functionname
if num is float. Definition at line 53 of file gaussian_conv_dct.c.
int dct_precomp_image  (  dct_coeffs *  c, 
num *  dest,  
const num *  src,  
int  width,  
int  height,  
int  num_channels,  
double  sigma  
) 
DCT precomputations for 2D Gaussian convolution.
c  dct_coeffs pointer to hold precomputations 
dest  output convolved image 
src  input image, modified inplace if src = dest 
width  image width 
height  image height 
num_channels  number of image channels 
sigma  standard deviation of the Gaussian in pixels 
Similar to dct_precomp(), this routine performs precomputations for 2D DCTbased Gaussian convolution, to be used in dct_gaussian_conv().
The convolution can be performed inplace by setting src
= dest
(the source array is overwritten with the result).
Definition at line 100 of file gaussian_conv_dct.c.