Functions to smooth an image. More...
#include "vil_gauss_filter.h"
#include <vcl_cmath.h>
#include <vcl_cassert.h>
#include <vcl_algorithm.h>
#include <vcl_functional.h>
#include <vnl/vnl_erf.h>
#include <vnl/vnl_double_2.h>
#include <vnl/vnl_real_polynomial.h>
Go to the source code of this file.
Functions | |
void | vil_gauss_filter_gen_ntap (double sd, unsigned diff, vcl_vector< double > &filter) |
Generate an n-tap FIR filter from a Gaussian function. |
Functions to smooth an image.
Definition in file vil_gauss_filter.cxx.
void vil_gauss_filter_gen_ntap | ( | double | sd, |
unsigned | diff, | ||
vcl_vector< double > & | filter | ||
) |
Generate an n-tap FIR filter from a Gaussian function.
The filter uses the equation , where D is the differential operator, and k is a normalising constant.
diff | The number of differential operators to apply to the filter. If you want just a normal gaussian, set diff to 0. |
sd | The width of the gaussian. |
The taps will be calculated using the integral of the above equation over the pixel width. However, aliasing will reduce the meaningfulness of your filter when sd << (diff+1). In most applications you will want filter.size() ~= sd*7, which will avoid significant truncation, without wasting the outer taps on near-zero values.
Definition at line 65 of file vil_gauss_filter.cxx.