40#ifndef PCL_SURFACE_IMPL_POISSON_H_
41#define PCL_SURFACE_IMPL_POISSON_H_
43#include <pcl/surface/poisson.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
63template <
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)
89template <
typename Po
intNT>
95template <
typename Po
intNT>
void
109template <
typename Po
intNT>
template <
int Degree>
void
123 if (solver_divide_ < min_depth_)
125 PCL_WARN (
"[pcl::Poisson] solver_divide_ must be at least as large as min_depth_: %d >= %d\n", solver_divide_, min_depth_);
126 solver_divide_ = min_depth_;
128 if (iso_divide_< min_depth_)
130 PCL_WARN (
"[pcl::Poisson] iso_divide_ must be at least as large as min_depth_: %d >= %d\n", iso_divide_, min_depth_);
131 iso_divide_ = min_depth_;
136 kernel_depth_ = depth_ - 2;
144 scale_,
center, scale, confidence_, point_weight_, !non_adaptive_weights_);
161 tree.GetMCIsoTriangles (
iso_value, iso_divide_, &
mesh, 0, 1, manifold_, output_polygons_);
166template <
typename Po
intNT>
void
202 PCL_ERROR (
stderr,
"Degree %d not supported\n", degree_);
208 cloud.resize (
int (
mesh.outOfCorePointCount () +
mesh.inCorePoints.
size ()));
210 for (
int i = 0; i <
int (
mesh.inCorePoints.
size ()); i++)
212 p =
mesh.inCorePoints[i];
217 for (
int i =
int (
mesh.inCorePoints.
size ()); i <
int (
mesh.outOfCorePointCount () +
mesh.inCorePoints.
size ()); i++)
219 mesh.nextOutOfCorePoint (p);
225 output.polygons.resize (
mesh.polygonCount ());
228 std::vector<poisson::CoredVertexIndex>
polygon;
246template <
typename Po
intNT>
void
248 std::vector<pcl::Vertices> &polygons)
283 PCL_ERROR (
stderr,
"Degree %d not supported\n", degree_);
289 points.resize (
int (
mesh.outOfCorePointCount () +
mesh.inCorePoints.
size ()));
291 for (
int i = 0; i <
int(
mesh.inCorePoints.
size ()); i++)
293 p =
mesh.inCorePoints[i];
298 for (
int i =
int(
mesh.inCorePoints.
size()); i <
int (
mesh.outOfCorePointCount() +
mesh.inCorePoints.
size ()); i++)
300 mesh.nextOutOfCorePoint (p);
306 polygons.resize (
mesh.polygonCount ());
309 std::vector<poisson::CoredVertexIndex>
polygon;
327#define PCL_INSTANTIATE_Poisson(T) template class PCL_EXPORTS pcl::Poisson<T>;
Iterator class for point clouds with or without given indices.
std::size_t size() const
Size of the range the iterator is going through.
The Poisson surface reconstruction algorithm.
void setThreads(int threads)
Set the number of threads to use.
Poisson()
Constructor that sets all the parameters to working default values.
void performReconstruction(pcl::PolygonMesh &output) override
Create the surface.
static void SetAllocator(int blockSize)
void RefineBoundary(int subdivisionDepth)
void setBSplineData(int maxDepth, Real normalSmooth=-1, bool reflectBoundary=false)
int LaplacianMatrixIteration(int subdivideDepth, bool showResidual, int minIters, double accuracy)
void SetLaplacianConstraints(void)
static double maxMemoryUsage
Define standard C methods and C++ classes that are common to all methods.
void toPCLPointCloud2(const pcl::PointCloud< PointT > &cloud, pcl::PCLPointCloud2 &msg)
Convert a pcl::PointCloud<T> object to a PCLPointCloud2 binary data blob.
Describes a set of vertices in a polygon mesh, by basically storing an array of indices.