RecFilter
iir_coeff.h File Reference
#include <cmath>
#include <complex>
#include <iostream>
#include <Halide.h>

Go to the source code of this file.

Functions

std::vector< float > overlap_feedback_coeff (std::vector< float > a, std::vector< float > b)
 Compute the coefficients of a higher order filter that is equivalent to two cascaded lower order filters of given coefficients. More...
 
std::vector< float > integral_image_coeff (int iterations)
 Feed forward and feedback coefficients for computing n integrals of image, single intergal is summed area table and multiple integrals are multiple applications of summed area table. More...
 
std::vector< float > gaussian_weights (float sigma, int order)
 Wrapper to compute third order recursive filter weights for Gaussian blur. More...
 
int gaussian_box_filter (int iterations, float sigma)
 Compute the size of a box filter that approximates a Gaussian. More...
 
template<typename T >
Halide::Image< T > reference_gaussian (Halide::Image< T > in, T sigma)
 Apply Gaussian filter on an input image. More...
 
Compute the Gaussian, derivative of Gaussian and integral of Gaussian
Parameters
[in]xinput (float or Halide::Expr)
[in]mumean of the Gaussian function
[in]sigmasigma support of the true Gaussian filter
float gaussian (float x, float mu, float sigma)
 
float gaussDerivative (float x, float mu, float sigma)
 
float gaussIntegral (float x, float mu, float sigma)
 
Halide::Expr gaussian (Halide::Expr x, float mu, float sigma)
 
Halide::Expr gaussDerivative (Halide::Expr x, float mu, float sigma)
 
Halide::Expr gaussIntegral (Halide::Expr x, float mu, float sigma)
 

Function Documentation

std::vector<float> overlap_feedback_coeff ( std::vector< float >  a,
std::vector< float >  b 
)

Compute the coefficients of a higher order filter that is equivalent to two cascaded lower order filters of given coefficients.

Todo:
This function is only partially tested and may be unstable
Parameters
[in]acoefficients of first lower order filter
[in]bcoefficients of second lower order filter
Returns
coefficients of higher order filter
std::vector<float> integral_image_coeff ( int  iterations)

Feed forward and feedback coefficients for computing n integrals of image, single intergal is summed area table and multiple integrals are multiple applications of summed area table.

Parameters
[in]iterationsnumber of integrals
Returns
coeff of IIR filter that computes multiple integrals
float gaussian ( float  x,
float  mu,
float  sigma 
)

Referenced by reference_gaussian().

float gaussDerivative ( float  x,
float  mu,
float  sigma 
)
float gaussIntegral ( float  x,
float  mu,
float  sigma 
)
Halide::Expr gaussian ( Halide::Expr  x,
float  mu,
float  sigma 
)
Halide::Expr gaussDerivative ( Halide::Expr  x,
float  mu,
float  sigma 
)
Halide::Expr gaussIntegral ( Halide::Expr  x,
float  mu,
float  sigma 
)
std::vector<float> gaussian_weights ( float  sigma,
int  order 
)

Wrapper to compute third order recursive filter weights for Gaussian blur.

Third order filter can be approximated by cascaded first and second order filters

Parameters
[in]orderorder of recursive filter for approximation
[in]sigmasigma of Gaussian filter
Returns
vector with feedforward coeff as first element and rest feedback coeff
int gaussian_box_filter ( int  iterations,
float  sigma 
)

Compute the size of a box filter that approximates a Gaussian.

Source: "Efficient Approximation of Gaussian Filters" Rau and McClellan, IEEE Trans. on Signal Processing 1997 http://ieeexplore.ieee.org/xpl/articleDetails.jsp?arnumber=554310

Parameters
[in]iterationsnumber of repeated applications of box filter
[in]sigmasigma support of the true Gaussian filter
Returns
box filter width
template<typename T >
Halide::Image<T> reference_gaussian ( Halide::Image< T >  in,
sigma 
)

Apply Gaussian filter on an input image.

Parameters
[in]ininput single channel image
[in]sigmasigma support of the true Gaussian filter
Returns
filtered image

Definition at line 80 of file iir_coeff.h.

References gaussian().