ICP  1.1.0
 Hosted by GitHub
ocl_icp_reg.hpp
Go to the documentation of this file.
1 
29 #ifndef OCL_ICP_SBS_HPP
30 #define OCL_ICP_SBS_HPP
31 
32 #include <GL/glew.h> // Add before CLUtils.hpp
33 #include <CLUtils.hpp>
34 #include <ICP/algorithms.hpp>
35 #include <eigen3/Eigen/Dense>
36 
37 
39 class CLEnvGL : public clutils::CLEnv
40 {
41 public:
43  CLEnvGL (GLuint *glPC4DBuffer, GLuint *glRGBABuffer, int width, int height);
44 
45 private:
47  void initGLMemObjects ();
48 
49  GLuint *glPC4DBuffer, *glRGBABuffer;
50  int width, height;
51 };
52 
53 
58 template <cl_algo::ICP::ICPStepConfigT RC, cl_algo::ICP::ICPStepConfigW WC>
59 class ICPReg
60 {
61 public:
62  ICPReg (GLuint *glPC4DBuffer, GLuint *glRGBABuffer);
63  void init (std::vector<cl_float8> pc8d1, std::vector<cl_float8> pc8d2);
64  void registerPC ();
65 
66 private:
67  unsigned int width, height, n, m, r;
68  CLEnvGL env;
69  clutils::CLEnvInfo<1> infoRBC, infoICP;
70  cl::Context &context;
71  cl::CommandQueue &queue;
72 
73  GLuint *glPC4DBuffer, *glRGBABuffer;
74  cl_float blue[4], green[4], dummy[4];
75  std::vector<cl_float4> vBlue, vGreen, vDummy;
76  std::vector<cl::BufferGL> dBufferGL;
77 
78  cl::size_t<3> src_origin_g, src_origin_c;
79  cl::size_t<3> dst_origin_1, dst_origin_2;
80  cl::size_t<3> region;
81  float a, c;
82  unsigned int max_iterations;
83  double angle_threshold;
84  double translation_threshold;
85 
86  cl_algo::ICP::ICPLMs fLM, mLM;
89 
90 };
91 
92 #endif // OCL_ICP_SBS_HPP
CLEnvGL(GLuint *glPC4DBuffer, GLuint *glRGBABuffer, int width, int height)
Initializes the OpenCL environment.
Definition: ocl_icp_reg.cpp:47
void init(std::vector< cl_float8 > pc8d1, std::vector< cl_float8 > pc8d2)
Initializes the OpenGL buffers.
Definition: ocl_icp_reg.cpp:131
Declares classes that organize the execution of OpenCL kernels.
Interface class for the getLMs kernel.
Definition: algorithms.hpp:312
Performs the ICP iterations.
Definition: ocl_icp_reg.hpp:59
ICPReg(GLuint *glPC4DBuffer, GLuint *glRGBABuffer)
Definition: ocl_icp_reg.cpp:80
std::vector< cl_float8 > pc8d2(n)
std::vector< cl_float8 > pc8d1(n)
Creates an OpenCL environment with CL-GL interoperability.
Definition: ocl_icp_reg.hpp:39
void registerPC()
Performs an ICP registration and transforms the moving point cloud.
Definition: ocl_icp_reg.cpp:165