40 #ifndef PCL_SURFACE_IMPL_POISSON_H_
41 #define PCL_SURFACE_IMPL_POISSON_H_
43 #include <pcl/surface/poisson.h>
44 #include <pcl/common/common.h>
45 #include <pcl/common/vector_average.h>
46 #include <pcl/Vertices.h>
48 #include <pcl/surface/3rdparty/poisson4/octree_poisson.h>
49 #include <pcl/surface/3rdparty/poisson4/sparse_matrix.h>
50 #include <pcl/surface/3rdparty/poisson4/function_data.h>
51 #include <pcl/surface/3rdparty/poisson4/ppolynomial.h>
52 #include <pcl/surface/3rdparty/poisson4/multi_grid_octree_data.h>
53 #include <pcl/surface/3rdparty/poisson4/geometry.h>
55 #define MEMORY_ALLOCATOR_BLOCK_SIZE 1<<12
63 template <
typename Po
intNT>
71 , samples_per_node_ (1.0)
73 , output_polygons_ (false)
74 , no_reset_samples_ (false)
75 , no_clip_tree_ (false)
80 , non_adaptive_weights_ (false)
81 , show_residual_ (false)
83 , solver_accuracy_ (1e-3f)
88 template <
typename Po
intNT>
94 template <
typename Po
intNT>
template <
int Degree>
void
108 if (solver_divide_ < min_depth_)
110 PCL_WARN (
"[pcl::Poisson] solver_divide_ must be at least as large as min_depth_: %d >= %d\n", solver_divide_, min_depth_);
111 solver_divide_ = min_depth_;
113 if (iso_divide_< min_depth_)
115 PCL_WARN (
"[pcl::Poisson] iso_divide_ must be at least as large as min_depth_: %d >= %d\n", iso_divide_, min_depth_);
116 iso_divide_ = min_depth_;
121 kernel_depth_ = depth_ - 2;
128 int point_count = tree.
setTree (input_, depth_, min_depth_, kernel_depth_, samples_per_node_,
129 scale_, center, scale, confidence_, point_weight_, !non_adaptive_weights_);
135 PCL_DEBUG (
"Input Points: %d\n" , point_count );
136 PCL_DEBUG (
"Leaves/Nodes: %d/%d\n" , tree.
tree.leaves() , tree.
tree.nodes() );
146 tree.GetMCIsoTriangles (iso_value, iso_divide_, &mesh, 0, 1, manifold_, output_polygons_);
151 template <
typename Po
intNT>
void
162 execute<1> (mesh, center, scale);
167 execute<2> (mesh, center, scale);
172 execute<3> (mesh, center, scale);
177 execute<4> (mesh, center, scale);
182 execute<5> (mesh, center, scale);
187 PCL_ERROR (stderr,
"Degree %d not supported\n", degree_);
195 for (
int i = 0; i < int (mesh.
inCorePoints.size ()); i++)
213 std::vector<poisson::CoredVertexIndex> polygon;
218 v.
vertices.resize (polygon.size ());
220 for (
int i = 0; i < static_cast<int> (polygon.size ()); ++i)
221 if (polygon[i].inCore )
231 template <
typename Po
intNT>
void
233 std::vector<pcl::Vertices> &polygons)
243 execute<1> (mesh, center, scale);
248 execute<2> (mesh, center, scale);
253 execute<3> (mesh, center, scale);
258 execute<4> (mesh, center, scale);
263 execute<5> (mesh, center, scale);
268 PCL_ERROR (stderr,
"Degree %d not supported\n", degree_);
276 for (
int i = 0; i < int(mesh.
inCorePoints.size ()); i++)
294 std::vector<poisson::CoredVertexIndex> polygon;
299 v.
vertices.resize (polygon.size ());
301 for (
int i = 0; i < static_cast<int> (polygon.size ()); ++i)
302 if (polygon[i].inCore )
312 #define PCL_INSTANTIATE_Poisson(T) template class PCL_EXPORTS pcl::Poisson<T>;
314 #endif // PCL_SURFACE_IMPL_POISSON_H_
void performReconstruction(pcl::PolygonMesh &output)
Create the surface.
int nextOutOfCorePoint(Point3D< float > &p)
void RefineBoundary(int subdivisionDepth)
std::vector< uint32_t > vertices
int setTree(boost::shared_ptr< const pcl::PointCloud< PointNT > > input_, int maxDepth, int minDepth, int kernelDepth, Real samplesPerNode, Real scaleFactor, Point3D< Real > ¢er, Real &scale, int useConfidence, Real constraintWeight, bool adaptiveWeights)
int LaplacianMatrixIteration(int subdivideDepth, bool showResidual, int minIters, double accuracy)
Describes a set of vertices in a polygon mesh, by basically storing an array of indices.
std::vector< PointT, Eigen::aligned_allocator< PointT > > points
The point data.
The Poisson surface reconstruction algorithm.
int nextPolygon(std::vector< CoredVertexIndex > &vertices)
static double maxMemoryUsage
Poisson()
Constructor that sets all the parameters to working default values.
std::vector< ::pcl::Vertices > polygons
::pcl::PCLPointCloud2 cloud
void toPCLPointCloud2(const pcl::PointCloud< PointT > &cloud, pcl::PCLPointCloud2 &msg)
Convert a pcl::PointCloud<T> object to a PCLPointCloud2 binary data blob.
static void SetAllocator(int blockSize)
void SetLaplacianConstraints(void)
int outOfCorePointCount(void)
std::vector< Point3D< float > > inCorePoints
void setBSplineData(int maxDepth, Real normalSmooth=-1, bool reflectBoundary=false)