Note. The convolution operation is defined by
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". So don't break the convolution routines in that particular way.
Definition in file vil_convolve_1d.h.
#include <vcl_compiler.h>
#include <vcl_algorithm.h>
#include <vcl_cstdlib.h>
#include <vcl_cstring.h>
#include <vcl_cassert.h>
#include <vcl_iostream.h>
#include <vil/vil_image_view.h>
#include <vil/vil_image_resource.h>
#include <vil/vil_property.h>
Go to the source code of this file.
Classes | |
| class | vil_convolve_1d_resource< kernelT, accumT, destT > |
| A resource adaptor that behaves like a convolved version of its input. More... | |
Defines | |
| #define | macro(F, T) |
Enumerations | |
| enum | vil_convolve_boundary_option { vil_convolve_ignore_edge, vil_convolve_no_extend, vil_convolve_zero_extend, vil_convolve_constant_extend, vil_convolve_periodic_extend, vil_convolve_reflect_extend, vil_convolve_trim } |
| Available options for boundary behavior. More... | |
Functions | |
| template<class srcT, class destT, class kernelT, class accumT> | |
| void | vil_convolve_edge_1d (const srcT *src, unsigned n, vcl_ptrdiff_t s_step, destT *dest, vcl_ptrdiff_t d_step, const kernelT *kernel, vcl_ptrdiff_t k_lo, vcl_ptrdiff_t k_hi, vcl_ptrdiff_t kstep, accumT, vil_convolve_boundary_option option) |
| Convolve edge with kernel[x*kstep] x in [k_lo,k_hi] (k_hi>=0). | |
| template<class srcT, class destT, class kernelT, class accumT> | |
| void | vil_convolve_1d (const srcT *src0, unsigned nx, vcl_ptrdiff_t s_step, destT *dest0, vcl_ptrdiff_t d_step, const kernelT *kernel, vcl_ptrdiff_t k_lo, vcl_ptrdiff_t k_hi, accumT ac, vil_convolve_boundary_option start_option, vil_convolve_boundary_option end_option) |
| Convolve kernel[x] (x in [k_lo,k_hi]) with srcT. | |
| template<class destT, class kernelT, class accumT> | |
| vil_image_resource_sptr | vil_convolve_1d (const vil_image_resource_sptr &src_im, const destT dt, const kernelT *kernel, int k_lo, int k_hi, const accumT ac, vil_convolve_boundary_option start_option, vil_convolve_boundary_option end_option) |
| #define macro | ( | F, | |||
| T | ) |
Value:
case F : \ vil_convolve_1d(static_cast<vil_image_view<T >&>(*vs),dest, \ kernel_, klo_, khi_, accumT(), start_option_, end_option_); \ return new vil_image_view<destT>(vil_crop(dest, lboundary, n_i, 0, n_j));
Available options for boundary behavior.
When convolving a finite signal the boundaries may be treated in various ways which can often be expressed in terms of ways to extend the signal outside its original range.
Definition at line 31 of file vil_convolve_1d.h.
| vil_image_resource_sptr vil_convolve_1d | ( | const vil_image_resource_sptr & | src_im, | |
| const destT | dt, | |||
| const kernelT * | kernel, | |||
| int | k_lo, | |||
| int | k_hi, | |||
| const accumT | ac, | |||
| vil_convolve_boundary_option | start_option, | |||
| vil_convolve_boundary_option | end_option | |||
| ) | [related] |
| void vil_convolve_1d | ( | const srcT * | src0, | |
| unsigned | nx, | |||
| vcl_ptrdiff_t | s_step, | |||
| destT * | dest0, | |||
| vcl_ptrdiff_t | d_step, | |||
| const kernelT * | kernel, | |||
| vcl_ptrdiff_t | k_lo, | |||
| vcl_ptrdiff_t | k_hi, | |||
| accumT | ac, | |||
| vil_convolve_boundary_option | start_option, | |||
| vil_convolve_boundary_option | end_option | |||
| ) | [inline] |
Convolve kernel[x] (x in [k_lo,k_hi]) with srcT.
Assumes dest and src same size (nx) Kernel must not be larger than nx;
Definition at line 201 of file vil_convolve_1d.h.
| void vil_convolve_edge_1d | ( | const srcT * | src, | |
| unsigned | n, | |||
| vcl_ptrdiff_t | s_step, | |||
| destT * | dest, | |||
| vcl_ptrdiff_t | d_step, | |||
| const kernelT * | kernel, | |||
| vcl_ptrdiff_t | k_lo, | |||
| vcl_ptrdiff_t | k_hi, | |||
| vcl_ptrdiff_t | kstep, | |||
| accumT | , | |||
| vil_convolve_boundary_option | option | |||
| ) | [inline] |
Convolve edge with kernel[x*kstep] x in [k_lo,k_hi] (k_hi>=0).
Fills only edge: dest[i], i=0..(k_hi-1)
Definition at line 94 of file vil_convolve_1d.h.
1.5.1