00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef CONVOLUTION_H_
00024 #define CONVOLUTION_H_
00025
00026 #include <vector>
00027 #include <cmath>
00028 #include <boost/math/special_functions/bessel.hpp>
00029 #include <iostream>
00030
00041 enum ConvolutionPadding{
00042 ZERO,
00043 SPECULAR,
00044 CIRCULAR
00045 };
00046
00051 enum ConvolutionResult{
00052 SAME,
00053 FULL
00054 };
00055
00056
00069 template<class Numeric>
00070 std::vector<Numeric> convolve1D(const std::vector<Numeric>& source, const std::vector<Numeric>& kernel, int offset = 0, ConvolutionPadding padding = SPECULAR, ConvolutionResult resultType = SAME);
00071
00079 template<class Numeric>
00080 std::vector<Numeric> besselKernel1D(Numeric sigma, unsigned int kernelSize);
00081
00089 template<class Numeric>
00090 std::vector<Numeric> gaussianKernel1D(Numeric sigma, unsigned int kernelSize);
00091
00093 template<class Numeric>
00094 std::ostream& operator<<(std::ostream& out, const std::vector<Numeric>& vector);
00095
00096
00097 #include <utils/Convolution.hpp>
00098
00099 #endif