Basic Image AlgorithmS Library  2.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
clfRecursiveGauss.hh
1 /*
2  * clfRecursiveGauss.hh
3  *
4  * Created on: Oct 28, 2011
5  * Author: fkellner
6  */
7 
8 #ifndef CLFRECURSIVEGAUSS_HH_
9 #define CLFRECURSIVEGAUSS_HH_
10 
11 #include <Base/Common/BIASpragmaStart.hh>
12 #include <bias_config.h>
13 #include <OpenCLFramework/Algorithm/clfAlgorithm.hh>
14 
15 namespace BIAS {
16 /**
17  * @brief recursive approximation of gaussian blur (IIR)
18  * opencl implementation of deriche, recursively implementing the gaussian and its derivatives (icip, 1992)
19  */
20 class BIASOpenCLFramework_EXPORT clfRecursiveGauss : public clfAlgorithm {
21 public:
22  /**
23  * @brief constructor, give context or let
24  */
25  clfRecursiveGauss(float sigma = 2.0f, clfContext *ctx = NULL, bool sharedGL = false, unsigned int device = 0);
26  virtual ~clfRecursiveGauss();
27 
28  /**
29  * @brief gauss filter rgba image
30  */
31  int Filter(clfImage2D *src, clfImage2D *&dst);
32 
33  /**
34  * @brief optimized gauss filter for grey images
35  */
36  int FilterGrey(clfImage2D *src, clfImage2D *&dst);
37 
38  /**
39  * @brief optimized gauss filter for already packed grey images
40  */
41  int FilterGreyColPacked(clfImage2D *src, clfImage2D *&dst);
42 
43  /**
44  * @brief Set Sigma and calculate coefficients for iir filter
45  * @param sigma gaussian sigma
46  * @param order derivative
47  */
48  void SetSigma(float sigma, int order = 0);
49 
50  /**
51  * @brief clear intermediate images
52  * resets storage of internal images, needs to be called if image sizes differ from frame to frame
53  */
54  void Reset();
55 
56  /**
57  * @brief filter in X-direction
58  */
59  int FilterX(clfImage2D *src, clfImage2D *&dst);
60  /**
61  * @brief filter in Y-direction
62  */
63  int FilterY(clfImage2D *src, clfImage2D *&dst);
64 
65 protected:
66 
69 
71 
72  std::vector<float> params_;
73 
74  std::vector<std::string> kernelNames_;
75 
76 };
77 
78 } /* namespace BIAS */
79 #include <Base/Common/BIASpragmaEnd.hh>
80 #endif /* CLFRECURSIVEGAUSS_HH_ */
OpenCL Image2D wrapper.
Definition: clfImage2D.hh:46
std::vector< float > params_
OpenCL Context wrapper.
Definition: clfContext.hh:49
recursive approximation of gaussian blur (IIR) opencl implementation of deriche, recursively implemen...
std::vector< std::string > kernelNames_