Functions
contrib/mul/vil3d/algo/vil3d_convolve_1d.h File Reference

1D Convolution with cunning boundary options More...

#include <vcl_cassert.h>
#include <vil/algo/vil_convolve_1d.h>
#include <vil3d/vil3d_image_view.h>

Go to the source code of this file.

Functions

template<class srcT , class destT , class kernelT , class accumT >
void vil3d_convolve_1d (const vil3d_image_view< srcT > &src_im, vil3d_image_view< destT > &dest_im, const kernelT *kernel, vcl_ptrdiff_t k_lo, vcl_ptrdiff_t k_hi, accumT ac, enum vil_convolve_boundary_option start_option, enum vil_convolve_boundary_option end_option)
 Convolve kernel[i] (i in [k_lo,k_hi]) with srcT in i-direction.

Detailed Description

1D Convolution with cunning boundary options

Author:
Ian Scott

Note. The convolution operation is defined by $(f*g)(x) = \int f(x-y) g(y) dy$ i.e. the kernel g is reflected before the integration is performed. If you don't want this to happen, the behaviour you want is not called "convolution".

Definition in file vil3d_convolve_1d.h.


Function Documentation

template<class srcT , class destT , class kernelT , class accumT >
void vil3d_convolve_1d ( const vil3d_image_view< srcT > &  src_im,
vil3d_image_view< destT > &  dest_im,
const kernelT *  kernel,
vcl_ptrdiff_t  k_lo,
vcl_ptrdiff_t  k_hi,
accumT  ac,
enum vil_convolve_boundary_option  start_option,
enum vil_convolve_boundary_option  end_option 
) [inline]

Convolve kernel[i] (i in [k_lo,k_hi]) with srcT in i-direction.

On exit dest_im(i,j) = sum src_m(i-x,j)*kernel(x) (x=k_lo..k_hi)

Note:
This function reverses the kernel. If you don't want the kernel reversed, use vil_correlate_1d instead. The kernel must not be larger than src_im.ni()
Parameters:
kernelshould point to tap 0.
dest_imwill be resized to size of src_im.

If you want to convolve in all three directions, use the following approach: verbatim vil3d_convolve_1d( src, smoothed1, ... );

vil3d_convolve_1d(vil3d_switch_axes_jki(smoothed1), smoothed2, ... ); smoothed2_im = vil3d_switch_axes_kij(smoothed2);

vil3d_convolve_1d(vil3d_switch_axes_kij(smoothed2), smoothed3, ... ); smoothed3_im = vil3d_switch_axes_jki(smoothed3);

Definition at line 41 of file vil3d_convolve_1d.h.