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