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