RSLightFields
Disparity map estimator from 3D light fields
rslf_kernels.hpp
1 #ifndef _RSLF_KERNELS
2 #define _RSLF_KERNELS
3 
4 
5 #include <rslf_types.hpp>
6 
7 
8 namespace rslf
9 {
10 
11 /*
12  * *****************************************************************
13  * KERNEL CLASSES
14  * *****************************************************************
15  */
16 
20 template<typename DataType>
22 {
23  public:
27  virtual float evaluate(DataType x) = 0;
31  virtual void evaluate_mat(const Mat& src, Mat& dst) = 0;
32 };
33 
39 template<typename DataType>
40 class BandwidthKernel: public KernelClass<DataType>
41 {
42  public:
43  BandwidthKernel(float h): m_h_(h) { inv_m_h_sq = 1.0 / (m_h_ * m_h_); }
44  float evaluate(DataType x);
45  void evaluate_mat(const Mat& src, Mat& dst);
46 
47  private:
48  float m_h_;
49  float inv_m_h_sq;
50 };
51 
52 }
53 
54 
55 #endif
virtual float evaluate(DataType x)=0
Get the value of the kernel.
Definition: rslf_depth_computation.hpp:14
Implement a toolbox of utilitary functions.
Pure virtual class implementing a generic kernel instance.
Definition: rslf_kernels.hpp:21
cv::Mat Mat
RSLF Matrix class (cv::Mat)
Definition: rslf_types.hpp:26
This kernel returns value: 1 - norm(x/h)^2 if norm(x/h) < 1, 0 else.
Definition: rslf_kernels.hpp:40
virtual void evaluate_mat(const Mat &src, Mat &dst)=0
Get a matrix with kernel evaluated at each element.