Point Cloud Library (PCL)  1.14.1-dev
grid_projection.h
1 /*
2  * Software License Agreement (BSD License)
3  *
4  * Copyright (c) 2010, Willow Garage, Inc.
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  *
11  * * Redistributions of source code must retain the above copyright
12  * notice, this list of conditions and the following disclaimer.
13  * * Redistributions in binary form must reproduce the above
14  * copyright notice, this list of conditions and the following
15  * disclaimer in the documentation and/or other materials provided
16  * with the distribution.
17  * * Neither the name of Willow Garage, Inc. nor the names of its
18  * contributors may be used to endorse or promote products derived
19  * from this software without specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32  * POSSIBILITY OF SUCH DAMAGE.
33  *
34  * $Id$
35  *
36  */
37 
38 #pragma once
39 
40 #include <pcl/memory.h>
41 #include <pcl/pcl_macros.h>
42 #include <pcl/surface/reconstruction.h>
43 
44 #include <boost/dynamic_bitset/dynamic_bitset.hpp> // for dynamic_bitset
45 #include <unordered_map>
46 
47 namespace pcl
48 {
49  /** \brief The 12 edges of a cell. */
50  const int I_SHIFT_EP[12][2] = {
51  {0, 4}, {1, 5}, {2, 6}, {3, 7},
52  {0, 1}, {1, 2}, {2, 3}, {3, 0},
53  {4, 5}, {5, 6}, {6, 7}, {7, 4}
54  };
55 
56  const int I_SHIFT_PT[4] = {
57  0, 4, 5, 7
58  };
59 
60  const int I_SHIFT_EDGE[3][2] = {
61  {0,1}, {1,3}, {1,2}
62  };
63 
64 
65  /** \brief Grid projection surface reconstruction method.
66  * \author Rosie Li
67  *
68  * \note If you use this code in any academic work, please cite:
69  * - Ruosi Li, Lu Liu, Ly Phan, Sasakthi Abeysinghe, Cindy Grimm, Tao Ju.
70  * Polygonizing extremal surfaces with manifold guarantees.
71  * In Proceedings of the 14th ACM Symposium on Solid and Physical Modeling, 2010.
72  * \ingroup surface
73  */
74  template <typename PointNT>
75  class GridProjection : public SurfaceReconstruction<PointNT>
76  {
77  public:
78  using Ptr = shared_ptr<GridProjection<PointNT> >;
79  using ConstPtr = shared_ptr<const GridProjection<PointNT> >;
80 
83 
85 
87  using KdTreePtr = typename KdTree::Ptr;
88 
89  /** \brief Data leaf. */
90  struct Leaf
91  {
92  Leaf () = default;
93 
95  Eigen::Vector4f pt_on_surface;
96  Eigen::Vector3f vect_at_grid_pt;
97  };
98 
99  using HashMap = std::unordered_map<int, Leaf, std::hash<int>, std::equal_to<>, Eigen::aligned_allocator<std::pair<const int, Leaf>>>;
100 
101  /** \brief Constructor. */
102  GridProjection ();
103 
104  /** \brief Constructor.
105  * \param in_resolution set the resolution of the grid
106  */
107  GridProjection (double in_resolution);
108 
109  /** \brief Destructor. */
110  ~GridProjection () override;
111 
112  /** \brief Set the size of the grid cell
113  * \param resolution the size of the grid cell
114  */
115  inline void
116  setResolution (double resolution)
117  {
118  leaf_size_ = resolution;
119  }
120 
121  inline double
122  getResolution () const
123  {
124  return (leaf_size_);
125  }
126 
127  /** \brief When averaging the vectors, we find the union of all the input data
128  * points within the padding area,and do a weighted average. Say if the padding
129  * size is 1, when we process cell (x,y,z), we will find union of input data points
130  * from (x-1) to (x+1), (y-1) to (y+1), (z-1) to (z+1)(in total, 27 cells). In this
131  * way, even the cells itself doesn't contain any data points, we will still process it
132  * because there are data points in the padding area. This can help us fix holes which
133  * is smaller than the padding size.
134  * \param padding_size The num of padding cells we want to create
135  */
136  inline void
137  setPaddingSize (int padding_size)
138  {
139  padding_size_ = padding_size;
140  }
141  inline int
142  getPaddingSize () const
143  {
144  return (padding_size_);
145  }
146 
147  /** \brief Set this only when using the k nearest neighbors search
148  * instead of finding the point union
149  * \param k The number of nearest neighbors we are looking for
150  */
151  inline void
153  {
154  k_ = k;
155  }
156  inline int
158  {
159  return (k_);
160  }
161 
162  /** \brief Binary search is used in projection. given a point x, we find another point
163  * which is 3*cell_size_ far away from x. Then we do a binary search between these
164  * two points to find where the projected point should be.
165  */
166  inline void
167  setMaxBinarySearchLevel (int max_binary_search_level)
168  {
169  max_binary_search_level_ = max_binary_search_level;
170  }
171  inline int
173  {
174  return (max_binary_search_level_);
175  }
176 
177  ///////////////////////////////////////////////////////////
178  inline const HashMap&
179  getCellHashMap () const
180  {
181  return (cell_hash_map_);
182  }
183 
184  inline const std::vector<Eigen::Vector3f, Eigen::aligned_allocator<Eigen::Vector3f> >&
186  {
187  return (vector_at_data_point_);
188  }
189 
190  inline const std::vector<Eigen::Vector4f, Eigen::aligned_allocator<Eigen::Vector4f> >&
191  getSurface () const
192  {
193  return (surface_);
194  }
195 
196  protected:
197  /** \brief Get the bounding box for the input data points, also calculating the
198  * cell size, and the gaussian scale factor
199  */
200  void
201  getBoundingBox ();
202 
203  /** \brief The actual surface reconstruction method.
204  * \param[out] polygons the resultant polygons, as a set of vertices. The Vertices structure contains an array of point indices.
205  */
206  bool
207  reconstructPolygons (std::vector<pcl::Vertices> &polygons);
208 
209  /** \brief Create the surface.
210  *
211  * The 1st step is filling the padding, so that all the cells in the padding
212  * area are in the hash map. The 2nd step is store the vector, and projected
213  * point. The 3rd step is finding all the edges intersects the surface, and
214  * creating surface.
215  *
216  * \param[out] output the resultant polygonal mesh
217  */
218  void
219  performReconstruction (pcl::PolygonMesh &output) override;
220 
221  /** \brief Create the surface.
222  *
223  * The 1st step is filling the padding, so that all the cells in the padding
224  * area are in the hash map. The 2nd step is store the vector, and projected
225  * point. The 3rd step is finding all the edges intersects the surface, and
226  * creating surface.
227  *
228  * \param[out] points the resultant points lying on the surface
229  * \param[out] polygons the resultant polygons, as a set of vertices. The Vertices structure contains an array of point indices.
230  */
231  void
233  std::vector<pcl::Vertices> &polygons) override;
234 
235  /** \brief When the input data points don't fill into the 1*1*1 box,
236  * scale them so that they can be filled in the unit box. Otherwise,
237  * it will be some drawing problem when doing visualization
238  * \param scale_factor scale all the input data point by scale_factor
239  */
240  void
241  scaleInputDataPoint (double scale_factor);
242 
243  /** \brief Get the 3d index (x,y,z) of the cell based on the location of
244  * the cell
245  * \param p the coordinate of the input point
246  * \param index the output 3d index
247  */
248  inline void
249  getCellIndex (const Eigen::Vector4f &p, Eigen::Vector3i& index) const
250  {
251  for (int i = 0; i < 3; ++i)
252  index[i] = static_cast<int> ((p[i] - min_p_(i)) / leaf_size_);
253  }
254 
255  /** \brief Given the 3d index (x, y, z) of the cell, get the
256  * coordinates of the cell center
257  * \param index the output 3d index
258  * \param center the resultant cell center
259  */
260  inline void
261  getCellCenterFromIndex (const Eigen::Vector3i &index, Eigen::Vector4f &center) const
262  {
263  for (int i = 0; i < 3; ++i)
264  center[i] =
265  min_p_[i] + static_cast<float> (index[i]) *
266  static_cast<float> (leaf_size_) +
267  static_cast<float> (leaf_size_) / 2.0f;
268  }
269 
270  /** \brief Given cell center, caluate the coordinates of the eight vertices of the cell
271  * \param cell_center the coordinates of the cell center
272  * \param pts the coordinates of the 8 vertices
273  */
274  void
275  getVertexFromCellCenter (const Eigen::Vector4f &cell_center,
276  std::vector<Eigen::Vector4f, Eigen::aligned_allocator<Eigen::Vector4f> > &pts) const;
277 
278  /** \brief Given an index (x, y, z) in 3d, translate it into the index
279  * in 1d
280  * \param index the index of the cell in (x,y,z) 3d format
281  */
282  inline int
283  getIndexIn1D (const Eigen::Vector3i &index) const
284  {
285  //assert(data_size_ > 0);
286  return (index[0] * data_size_ * data_size_ +
287  index[1] * data_size_ + index[2]);
288  }
289 
290  /** \brief Given an index in 1d, translate it into the index (x, y, z)
291  * in 3d
292  * \param index_1d the input 1d index
293  * \param index_3d the output 3d index
294  */
295  inline void
296  getIndexIn3D (int index_1d, Eigen::Vector3i& index_3d) const
297  {
298  //assert(data_size_ > 0);
299  index_3d[0] = index_1d / (data_size_ * data_size_);
300  index_1d -= index_3d[0] * data_size_ * data_size_;
301  index_3d[1] = index_1d / data_size_;
302  index_1d -= index_3d[1] * data_size_;
303  index_3d[2] = index_1d;
304  }
305 
306  /** \brief For a given 3d index of a cell, test whether the cells within its
307  * padding area exist in the hash table, if no, create an entry for that cell.
308  * \param index the index of the cell in (x,y,z) format
309  */
310  void
311  fillPad (const Eigen::Vector3i &index);
312 
313  /** \brief Obtain the index of a cell and the pad size.
314  * \param index the input index
315  * \param pt_union_indices the union of input data points within the cell and padding cells
316  */
317  void
318  getDataPtsUnion (const Eigen::Vector3i &index, pcl::Indices &pt_union_indices);
319 
320  /** \brief Given the index of a cell, exam it's up, left, front edges, and add
321  * the vertices to m_surface list.the up, left, front edges only share 4
322  * points, we first get the vectors at these 4 points and exam whether those
323  * three edges are intersected by the surface \param index the input index
324  * \param pt_union_indices the union of input data points within the cell and padding cells
325  */
326  void
327  createSurfaceForCell (const Eigen::Vector3i &index, pcl::Indices &pt_union_indices);
328 
329 
330  /** \brief Given the coordinates of one point, project it onto the surface,
331  * return the projected point. Do a binary search between p and p+projection_distance
332  * to find the projected point
333  * \param p the coordinates of the input point
334  * \param pt_union_indices the union of input data points within the cell and padding cells
335  * \param projection the resultant point projected
336  */
337  void
338  getProjection (const Eigen::Vector4f &p, pcl::Indices &pt_union_indices, Eigen::Vector4f &projection);
339 
340  /** \brief Given the coordinates of one point, project it onto the surface,
341  * return the projected point. Find the plane which fits all the points in
342  * pt_union_indices, projected p to the plane to get the projected point.
343  * \param p the coordinates of the input point
344  * \param pt_union_indices the union of input data points within the cell and padding cells
345  * \param projection the resultant point projected
346  */
347  void
348  getProjectionWithPlaneFit (const Eigen::Vector4f &p,
349  pcl::Indices &pt_union_indices,
350  Eigen::Vector4f &projection);
351 
352 
353  /** \brief Given the location of a point, get it's vector
354  * \param p the coordinates of the input point
355  * \param pt_union_indices the union of input data points within the cell and padding cells
356  * \param vo the resultant vector
357  */
358  void
359  getVectorAtPoint (const Eigen::Vector4f &p,
360  pcl::Indices &pt_union_indices, Eigen::Vector3f &vo);
361 
362  /** \brief Given the location of a point, get it's vector
363  * \param p the coordinates of the input point
364  * \param k_indices the k nearest neighbors of the query point
365  * \param k_squared_distances the squared distances of the k nearest
366  * neighbors to the query point
367  * \param vo the resultant vector
368  */
369  void
370  getVectorAtPointKNN (const Eigen::Vector4f &p,
371  pcl::Indices &k_indices,
372  std::vector<float> &k_squared_distances,
373  Eigen::Vector3f &vo);
374 
375  /** \brief Get the magnitude of the vector by summing up the distance.
376  * \param p the coordinate of the input point
377  * \param pt_union_indices the union of input data points within the cell and padding cells
378  */
379  double
380  getMagAtPoint (const Eigen::Vector4f &p, const pcl::Indices &pt_union_indices);
381 
382  /** \brief Get the 1st derivative
383  * \param p the coordinate of the input point
384  * \param vec the vector at point p
385  * \param pt_union_indices the union of input data points within the cell and padding cells
386  */
387  double
388  getD1AtPoint (const Eigen::Vector4f &p, const Eigen::Vector3f &vec,
389  const pcl::Indices &pt_union_indices);
390 
391  /** \brief Get the 2nd derivative
392  * \param p the coordinate of the input point
393  * \param vec the vector at point p
394  * \param pt_union_indices the union of input data points within the cell and padding cells
395  */
396  double
397  getD2AtPoint (const Eigen::Vector4f &p, const Eigen::Vector3f &vec,
398  const pcl::Indices &pt_union_indices);
399 
400  /** \brief Test whether the edge is intersected by the surface by
401  * doing the dot product of the vector at two end points. Also test
402  * whether the edge is intersected by the maximum surface by examining
403  * the 2nd derivative of the intersection point
404  * \param end_pts the two points of the edge
405  * \param vect_at_end_pts
406  * \param pt_union_indices the union of input data points within the cell and padding cells
407  */
408  bool
409  isIntersected (const std::vector<Eigen::Vector4f, Eigen::aligned_allocator<Eigen::Vector4f> > &end_pts,
410  std::vector<Eigen::Vector3f, Eigen::aligned_allocator<Eigen::Vector3f> > &vect_at_end_pts,
411  pcl::Indices &pt_union_indices);
412 
413  /** \brief Find point where the edge intersects the surface.
414  * \param level binary search level
415  * \param end_pts the two end points on the edge
416  * \param vect_at_end_pts the vectors at the two end points
417  * \param start_pt the starting point we use for binary search
418  * \param pt_union_indices the union of input data points within the cell and padding cells
419  * \param intersection the resultant intersection point
420  */
421  void
422  findIntersection (int level,
423  const std::vector<Eigen::Vector4f, Eigen::aligned_allocator<Eigen::Vector4f> > &end_pts,
424  const std::vector<Eigen::Vector3f, Eigen::aligned_allocator<Eigen::Vector3f> > &vect_at_end_pts,
425  const Eigen::Vector4f &start_pt,
426  pcl::Indices &pt_union_indices,
427  Eigen::Vector4f &intersection);
428 
429  /** \brief Go through all the entries in the hash table and update the
430  * cellData.
431  *
432  * When creating the hash table, the pt_on_surface field store the center
433  * point of the cell.After calling this function, the projection operator will
434  * project the center point onto the surface, and the pt_on_surface field will
435  * be updated using the projected point.Also the vect_at_grid_pt field will be
436  * updated using the vector at the upper left front vertex of the cell.
437  *
438  * \param index_1d the index of the cell after flatting it's 3d index into a 1d array
439  * \param index_3d the index of the cell in (x,y,z) 3d format
440  * \param pt_union_indices the union of input data points within the cell and pads
441  * \param cell_data information stored in the cell
442  */
443  void
444  storeVectAndSurfacePoint (int index_1d, const Eigen::Vector3i &index_3d,
445  pcl::Indices &pt_union_indices, const Leaf &cell_data);
446 
447  /** \brief Go through all the entries in the hash table and update the cellData.
448  * When creating the hash table, the pt_on_surface field store the center point
449  * of the cell.After calling this function, the projection operator will project the
450  * center point onto the surface, and the pt_on_surface field will be updated
451  * using the projected point.Also the vect_at_grid_pt field will be updated using
452  * the vector at the upper left front vertex of the cell. When projecting the point
453  * and calculating the vector, using K nearest neighbors instead of using the
454  * union of input data point within the cell and pads.
455  *
456  * \param index_1d the index of the cell after flatting it's 3d index into a 1d array
457  * \param index_3d the index of the cell in (x,y,z) 3d format
458  * \param cell_data information stored in the cell
459  */
460  void
461  storeVectAndSurfacePointKNN (int index_1d, const Eigen::Vector3i &index_3d, const Leaf &cell_data);
462 
463  private:
464  /** \brief Map containing the set of leaves. */
465  HashMap cell_hash_map_;
466 
467  /** \brief Min and max data points. */
468  Eigen::Vector4f min_p_, max_p_;
469 
470  /** \brief The size of a leaf. */
471  double leaf_size_;
472 
473  /** \brief Gaussian scale. */
474  double gaussian_scale_;
475 
476  /** \brief Data size. */
477  int data_size_;
478 
479  /** \brief Max binary search level. */
480  int max_binary_search_level_;
481 
482  /** \brief Number of neighbors (k) to use. */
483  int k_;
484 
485  /** \brief Padding size. */
486  int padding_size_;
487 
488  /** \brief The point cloud input (XYZ+Normals). */
489  PointCloudPtr data_;
490 
491  /** \brief Store the surface normal(vector) at the each input data point. */
492  std::vector<Eigen::Vector3f, Eigen::aligned_allocator<Eigen::Vector3f> > vector_at_data_point_;
493 
494  /** \brief An array of points which lay on the output surface. */
495  std::vector<Eigen::Vector4f, Eigen::aligned_allocator<Eigen::Vector4f> > surface_;
496 
497  /** \brief Bit map which tells if there is any input data point in the cell. */
498  boost::dynamic_bitset<> occupied_cell_list_;
499 
500  /** \brief Class get name method. */
501  std::string getClassName () const override { return ("GridProjection"); }
502 
503  /** \brief Output will be scaled up by this factor, if previously scaled down by scaleInputDataPoint. */
504  double cloud_scale_factor_ = 1.0;
505 
506  public:
508  };
509 }
Grid projection surface reconstruction method.
void getProjection(const Eigen::Vector4f &p, pcl::Indices &pt_union_indices, Eigen::Vector4f &projection)
Given the coordinates of one point, project it onto the surface, return the projected point.
void getIndexIn3D(int index_1d, Eigen::Vector3i &index_3d) const
Given an index in 1d, translate it into the index (x, y, z) in 3d.
bool reconstructPolygons(std::vector< pcl::Vertices > &polygons)
The actual surface reconstruction method.
void storeVectAndSurfacePointKNN(int index_1d, const Eigen::Vector3i &index_3d, const Leaf &cell_data)
Go through all the entries in the hash table and update the cellData.
const HashMap & getCellHashMap() const
std::unordered_map< int, Leaf, std::hash< int >, std::equal_to<>, Eigen::aligned_allocator< std::pair< const int, Leaf > >> HashMap
void getBoundingBox()
Get the bounding box for the input data points, also calculating the cell size, and the gaussian scal...
void getCellIndex(const Eigen::Vector4f &p, Eigen::Vector3i &index) const
Get the 3d index (x,y,z) of the cell based on the location of the cell.
const std::vector< Eigen::Vector3f, Eigen::aligned_allocator< Eigen::Vector3f > > & getVectorAtDataPoint() const
void getVectorAtPointKNN(const Eigen::Vector4f &p, pcl::Indices &k_indices, std::vector< float > &k_squared_distances, Eigen::Vector3f &vo)
Given the location of a point, get it's vector.
double getD2AtPoint(const Eigen::Vector4f &p, const Eigen::Vector3f &vec, const pcl::Indices &pt_union_indices)
Get the 2nd derivative.
void scaleInputDataPoint(double scale_factor)
When the input data points don't fill into the 1*1*1 box, scale them so that they can be filled in th...
shared_ptr< const GridProjection< PointNT > > ConstPtr
void setPaddingSize(int padding_size)
When averaging the vectors, we find the union of all the input data points within the padding area,...
GridProjection()
Constructor.
void getCellCenterFromIndex(const Eigen::Vector3i &index, Eigen::Vector4f &center) const
Given the 3d index (x, y, z) of the cell, get the coordinates of the cell center.
void setMaxBinarySearchLevel(int max_binary_search_level)
Binary search is used in projection.
int getMaxBinarySearchLevel() const
void getVertexFromCellCenter(const Eigen::Vector4f &cell_center, std::vector< Eigen::Vector4f, Eigen::aligned_allocator< Eigen::Vector4f > > &pts) const
Given cell center, caluate the coordinates of the eight vertices of the cell.
int getNearestNeighborNum() const
void createSurfaceForCell(const Eigen::Vector3i &index, pcl::Indices &pt_union_indices)
Given the index of a cell, exam it's up, left, front edges, and add the vertices to m_surface list....
shared_ptr< GridProjection< PointNT > > Ptr
const std::vector< Eigen::Vector4f, Eigen::aligned_allocator< Eigen::Vector4f > > & getSurface() const
double getD1AtPoint(const Eigen::Vector4f &p, const Eigen::Vector3f &vec, const pcl::Indices &pt_union_indices)
Get the 1st derivative.
void storeVectAndSurfacePoint(int index_1d, const Eigen::Vector3i &index_3d, pcl::Indices &pt_union_indices, const Leaf &cell_data)
Go through all the entries in the hash table and update the cellData.
void setNearestNeighborNum(int k)
Set this only when using the k nearest neighbors search instead of finding the point union.
typename pcl::PointCloud< PointNT >::Ptr PointCloudPtr
void getDataPtsUnion(const Eigen::Vector3i &index, pcl::Indices &pt_union_indices)
Obtain the index of a cell and the pad size.
void getProjectionWithPlaneFit(const Eigen::Vector4f &p, pcl::Indices &pt_union_indices, Eigen::Vector4f &projection)
Given the coordinates of one point, project it onto the surface, return the projected point.
int getIndexIn1D(const Eigen::Vector3i &index) const
Given an index (x, y, z) in 3d, translate it into the index in 1d.
void performReconstruction(pcl::PolygonMesh &output) override
Create the surface.
int getPaddingSize() const
double getMagAtPoint(const Eigen::Vector4f &p, const pcl::Indices &pt_union_indices)
Get the magnitude of the vector by summing up the distance.
void fillPad(const Eigen::Vector3i &index)
For a given 3d index of a cell, test whether the cells within its padding area exist in the hash tabl...
double getResolution() const
bool isIntersected(const std::vector< Eigen::Vector4f, Eigen::aligned_allocator< Eigen::Vector4f > > &end_pts, std::vector< Eigen::Vector3f, Eigen::aligned_allocator< Eigen::Vector3f > > &vect_at_end_pts, pcl::Indices &pt_union_indices)
Test whether the edge is intersected by the surface by doing the dot product of the vector at two end...
void findIntersection(int level, const std::vector< Eigen::Vector4f, Eigen::aligned_allocator< Eigen::Vector4f > > &end_pts, const std::vector< Eigen::Vector3f, Eigen::aligned_allocator< Eigen::Vector3f > > &vect_at_end_pts, const Eigen::Vector4f &start_pt, pcl::Indices &pt_union_indices, Eigen::Vector4f &intersection)
Find point where the edge intersects the surface.
typename KdTree::Ptr KdTreePtr
~GridProjection() override
Destructor.
void setResolution(double resolution)
Set the size of the grid cell.
void getVectorAtPoint(const Eigen::Vector4f &p, pcl::Indices &pt_union_indices, Eigen::Vector3f &vo)
Given the location of a point, get it's vector.
KdTree represents the base spatial locator class for kd-tree implementations.
Definition: kdtree.h:56
shared_ptr< KdTree< PointT > > Ptr
Definition: kdtree.h:69
shared_ptr< PointCloud< PointT > > Ptr
Definition: point_cloud.h:413
SurfaceReconstruction represents a base surface reconstruction class.
#define PCL_MAKE_ALIGNED_OPERATOR_NEW
Macro to signal a class requires a custom allocator.
Definition: memory.h:63
Defines functions, macros and traits for allocating and using memory.
const int I_SHIFT_PT[4]
IndicesAllocator<> Indices
Type used for indices in PCL.
Definition: types.h:133
const int I_SHIFT_EP[12][2]
The 12 edges of a cell.
const int I_SHIFT_EDGE[3][2]
Defines all the PCL and non-PCL macros used.
Eigen::Vector3f vect_at_grid_pt
Eigen::Vector4f pt_on_surface