2 #ifndef vil_gauss_filter_h_ 3 #define vil_gauss_filter_h_ 11 # include <vcl_msvc_warnings.h> 75 template <
class srcT,
class destT>
77 unsigned ni,
unsigned nj,
78 destT* dest_im, std::ptrdiff_t dest_ystep,
84 template <
class srcT,
class destT>
93 template <
class srcT,
class destT>
116 std::vector<double> &filter_dest);
122 template <
class srcT,
class destT>
125 double sd,
unsigned half_width)
127 std::vector<double> filter(2*half_width+1);
129 vil_convolve_1d(src_im,dest_im,&filter[half_width],-
int(half_width),half_width,
138 template <
class srcT,
class destT>
141 double sd,
unsigned half_width,
145 std::vector<double> filter(2*half_width+1);
150 vil_convolve_1d(src_im,work_im,&filter[half_width],-
int(half_width),half_width,
151 float(), boundary, boundary);
159 &filter[half_width],-
int(half_width),half_width,
160 float(), boundary, boundary);
169 template <
class srcT,
class destT>
172 double sd_i,
unsigned half_width_i,
173 double sd_j,
unsigned half_width_j,
177 std::vector<double> filter_i(2*half_width_i+1);
182 vil_convolve_1d(src_im,work_im,&filter_i[half_width_i],-
int(half_width_i),half_width_i,
183 float(), boundary, boundary);
191 std::vector<double> filter_j(2*half_width_j+1);
195 &filter_j[half_width_j],-
int(half_width_j),half_width_j,
196 float(), boundary, boundary);
200 #endif // vil_gauss_filter_h_ double filt1() const
Filter tap value.
vil_gauss_filter_5tap_params(double sigma_)
Set the.
Concrete view of image data of type T held in memory.
double sigma() const
The width of the Gaussian.
void vil_gauss_filter_5tap(const srcT *src_im, std::ptrdiff_t src_ystep, unsigned ni, unsigned nj, destT *dest_im, std::ptrdiff_t dest_ystep, const vil_gauss_filter_5tap_params ¶ms, destT *work)
Smooth a single plane src_im to produce dest_im.
double filt_edge0() const
Filter tap value.
double filt2() const
Filter tap value.
void set_size(unsigned ni, unsigned nj) override
resize current planes to ni x nj.
vil_convolve_boundary_option
Available options for boundary behavior.
unsigned ni() const
Width.
unsigned nj() const
Height.
void vil_gauss_filter_gen_ntap(double sd, unsigned diff, std::vector< double > &filter_dest)
Generate an n-tap FIR filter from a Gaussian function.
double filt_pen_edge0() const
Filter tap value.
double filt_pen_edge2() const
Filter tap value.
double filt_edge1() const
Filter tap value.
double filt0() const
Filter tap value.
A base class reference-counting view of some image data.
double filt_pen_edge1() const
Filter tap value.
double filt_pen_edge_n1() const
Filter tap value.
void vil_convolve_1d(const vil_image_view< srcT > &src_im, vil_image_view< destT > &dest_im, const kernelT *kernel, std::ptrdiff_t k_lo, std::ptrdiff_t k_hi, accumT ac, vil_convolve_boundary_option start_option, vil_convolve_boundary_option end_option)
Convolve kernel[i] (i in [k_lo,k_hi]) with srcT in i-direction.
Zero-extend the input signal beyond the boundary.
void vil_gauss_filter_1d(const vil_image_view< srcT > &src_im, vil_image_view< destT > &dest_im, double sd, unsigned half_width)
Smooth a src_im to produce dest_im with gaussian of width sd.
unsigned nplanes() const
Number of planes.
void vil_gauss_filter_2d(const vil_image_view< srcT > &src_im, vil_image_view< destT > &dest_im, double sd, unsigned half_width, vil_convolve_boundary_option boundary=vil_convolve_zero_extend)
Smooth a src_im to produce dest_im with gaussian of width sd.
double filt_edge2() const
Filter tap value.
1D Convolution with cunning boundary options
vil_image_view< T > vil_transpose(const vil_image_view< T > &v)
Create a view which appears as the transpose of this view.