121 Eigen::Vector4d xyz_centroid;
127 for (
int i = 0; i < 3; ++i)
128 for (
int j = 0; j < 3; ++j)
142 PCL_DEBUG (
"[pcl::%s] WARNING: Input dimension not specified. Automatically determining input dimension.\n", getClassName ().
c_str ());
143 if (std::abs (eigen_values[0]) < std::numeric_limits<double>::epsilon () || std::abs (eigen_values[0] / eigen_values[2]) < 1.0e-3)
177 char flags[] =
"qhull d QJ";
207 PCL_ERROR(
"[pcl::%s::performReconstrution] ERROR: qhull was unable to compute a "
208 "concave hull for the given point cloud (%zu)!\n",
209 getClassName().
c_str(),
228 PCL_ERROR (
"[pcl::%s::performReconstruction] ERROR: point cloud contains NaN values, consider running pcl::PassThrough filter first to remove NaNs!\n", getClassName ().
c_str ());
266 if (voronoi_centers_)
273 if (!
facet->upperdelaunay)
279 if (voronoi_centers_)
281 (*voronoi_centers_)[
non_upper].x =
static_cast<float> (
facet->center[0]);
282 (*voronoi_centers_)[
non_upper].y =
static_cast<float> (
facet->center[1]);
283 (*voronoi_centers_)[
non_upper].z =
static_cast<float> (
facet->center[2]);
298 if ((
neighb->visitid !=
qh->visit_id))
313 if ((
neighb->visitid !=
qh->visit_id))
318 a.x =
static_cast<float> ((
static_cast<vertexT*
>(
ridge->vertices->e[0].p))->point[0]);
319 a.y =
static_cast<float> ((
static_cast<vertexT*
>(
ridge->vertices->e[0].p))->point[1]);
320 a.z =
static_cast<float> ((
static_cast<vertexT*
>(
ridge->vertices->e[0].p))->point[2]);
321 b.x =
static_cast<float> ((
static_cast<vertexT*
>(
ridge->vertices->e[1].p))->point[0]);
322 b.y =
static_cast<float> ((
static_cast<vertexT*
>(
ridge->vertices->e[1].p))->point[1]);
323 b.z =
static_cast<float> ((
static_cast<vertexT*
>(
ridge->vertices->e[1].p))->point[2]);
324 c.x =
static_cast<float> ((
static_cast<vertexT*
>(
ridge->vertices->e[2].p))->point[0]);
325 c.y =
static_cast<float> ((
static_cast<vertexT*
>(
ridge->vertices->e[2].p))->point[1]);
326 c.z =
static_cast<float> ((
static_cast<vertexT*
>(
ridge->vertices->e[2].p))->point[2]);
337 if (voronoi_centers_)
338 voronoi_centers_->points.resize (
non_upper);
346 if (
ridge->bottom->upperdelaunay ||
ridge->top->upperdelaunay || !
ridge->top->good || !
ridge->bottom->good)
358 if (
ridge->bottom->upperdelaunay ||
ridge->top->upperdelaunay || !
ridge->top->good || !
ridge->bottom->good)
360 polygons[triangles].vertices.resize (3);
392 if (voronoi_centers_)
399 if (!
facet->upperdelaunay)
418 if (voronoi_centers_)
420 (*voronoi_centers_)[
dd].x =
static_cast<float> (
facet->center[0]);
421 (*voronoi_centers_)[
dd].y =
static_cast<float> (
facet->center[1]);
422 (*voronoi_centers_)[
dd].z = 0.0f;
434 std::map<int, std::vector<int> > edges;
439 if (
ridge->bottom->upperdelaunay ||
ridge->top->upperdelaunay || !
ridge->top->good || !
ridge->bottom->good)
483 std::map<int, std::vector<int> >::iterator
curr = edges.begin ();
485 std::vector<bool>
used (vertices,
false);
491 while (!edges.empty ())
495 for (
const auto &i : (*curr).second)
505 used[(*curr).first] =
true;
514 curr = edges.find (next);
515 if (
curr == edges.end ())
518 curr = edges.begin ();
540 polygons.push_back (vertices);
544 if (voronoi_centers_)
545 voronoi_centers_->points.resize (
dd);
554 xyz_centroid[0] = - xyz_centroid[0];
555 xyz_centroid[1] = - xyz_centroid[1];
556 xyz_centroid[2] = - xyz_centroid[2];
560 if (voronoi_centers_)
566 if (keep_information_)
570 tree.setInputCloud (input_, indices_);
573 std::vector<float> distances;
575 distances.resize (1);
578 hull_indices_.header = input_->header;
579 hull_indices_.indices.clear ();
584 tree.nearestKSearch (point, 1, neighbor, distances);
585 hull_indices_.indices.push_back (neighbor[0]);
void demeanPointCloud(ConstCloudIterator< PointT > &cloud_iterator, const Eigen::Matrix< Scalar, 4, 1 > ¢roid, pcl::PointCloud< PointT > &cloud_out, int npts=0)
Subtract a centroid from a point cloud and return the de-meaned representation.
unsigned int computeCovarianceMatrixNormalized(const pcl::PointCloud< PointT > &cloud, const Eigen::Matrix< Scalar, 4, 1 > ¢roid, Eigen::Matrix< Scalar, 3, 3 > &covariance_matrix)
Compute normalized the 3x3 covariance matrix of a given set of points.
double getCircumcircleRadius(const PointT &pa, const PointT &pb, const PointT &pc)
Compute the radius of a circumscribed circle for a triangle formed of three points pa,...
void transformPointCloud(const pcl::PointCloud< PointT > &cloud_in, pcl::PointCloud< PointT > &cloud_out, const Eigen::Matrix< Scalar, 4, 4 > &transform, bool copy_all_fields)
Apply a rigid transform defined by a 4x4 matrix.
void eigen33(const Matrix &mat, typename Matrix::Scalar &eigenvalue, Vector &eigenvector)
determines the eigenvector and eigenvalue of the smallest eigenvalue of the symmetric positive semi d...
unsigned int compute3DCentroid(ConstCloudIterator< PointT > &cloud_iterator, Eigen::Matrix< Scalar, 4, 1 > ¢roid)
Compute the 3D (X-Y-Z) centroid of a set of points and return it as a 3D vector.
void copyPointCloud(const pcl::PointCloud< PointInT > &cloud_in, pcl::PointCloud< PointOutT > &cloud_out)
Copy all the fields from a given point cloud into a new point cloud.