|
Point Cloud Library (PCL) 1.15.0
|
ConvexHull using libqhull library. More...
#include <pcl/surface/convex_hull.h>
Public Types | |
| using | Ptr = shared_ptr<ConvexHull<PointInT> > |
| using | ConstPtr = shared_ptr<const ConvexHull<PointInT> > |
| using | PointCloud = pcl::PointCloud<PointInT> |
| using | PointCloudPtr = typename PointCloud::Ptr |
| using | PointCloudConstPtr = typename PointCloud::ConstPtr |
| Public Types inherited from pcl::MeshConstruction< PointInT > | |
| using | Ptr = shared_ptr<MeshConstruction<PointInT> > |
| using | ConstPtr = shared_ptr<const MeshConstruction<PointInT> > |
| Public Types inherited from pcl::PCLSurfaceBase< PointInT > | |
| using | Ptr = shared_ptr<PCLSurfaceBase<PointInT> > |
| using | ConstPtr = shared_ptr<const PCLSurfaceBase<PointInT> > |
| using | KdTree = pcl::search::Search<PointInT> |
| using | KdTreePtr = typename KdTree::Ptr |
| Public Types inherited from pcl::PCLBase< PointInT > | |
| using | PointCloud |
| using | PointCloudPtr |
| using | PointCloudConstPtr |
| using | PointIndicesPtr |
| using | PointIndicesConstPtr |
Public Member Functions | |
| ConvexHull ()=default | |
| Empty constructor. | |
| ~ConvexHull () override=default | |
| Empty destructor. | |
| void | reconstruct (PointCloud &points, std::vector< pcl::Vertices > &polygons) |
| Compute a convex hull for all points given. | |
| void | reconstruct (PointCloud &points) |
| Compute a convex hull for all points given. | |
| void | setComputeAreaVolume (bool value) |
| If set to true, the qhull library is called to compute the total area and volume of the convex hull. | |
| double | getTotalArea () const |
| Returns the total area of the convex hull. | |
| double | getTotalVolume () const |
| Returns the total volume of the convex hull. | |
| void | setDimension (int dimension) |
| Sets the dimension on the input data, 2D or 3D. | |
| int | getDimension () const |
| Returns the dimensionality (2 or 3) of the calculated hull. | |
| void | getHullPointIndices (pcl::PointIndices &hull_point_indices) const |
| Retrieve the indices of the input point cloud that for the convex hull. | |
| Public Member Functions inherited from pcl::MeshConstruction< PointInT > | |
| MeshConstruction ()=default | |
| Constructor. | |
| ~MeshConstruction () override=default | |
| Destructor. | |
| void | reconstruct (pcl::PolygonMesh &output) override |
| Base method for surface reconstruction for all points given in <setInputCloud (), setIndices ()> | |
| virtual void | reconstruct (std::vector< pcl::Vertices > &polygons) |
| Base method for mesh construction for all points given in <setInputCloud (), setIndices ()> | |
| Public Member Functions inherited from pcl::PCLSurfaceBase< PointInT > | |
| PCLSurfaceBase () | |
| Empty constructor. | |
| ~PCLSurfaceBase () override=default | |
| Empty destructor. | |
| void | setSearchMethod (const KdTreePtr &tree) |
| Provide an optional pointer to a search object. | |
| KdTreePtr | getSearchMethod () |
| Get a pointer to the search method used. | |
| Public Member Functions inherited from pcl::PCLBase< PointInT > | |
| PCLBase () | |
| Empty constructor. | |
| PCLBase (const PCLBase &base) | |
| Copy constructor. | |
| virtual | ~PCLBase ()=default |
| Destructor. | |
| virtual void | setInputCloud (const PointCloudConstPtr &cloud) |
| Provide a pointer to the input dataset. | |
| PointCloudConstPtr const | getInputCloud () const |
| Get a pointer to the input point cloud dataset. | |
| virtual void | setIndices (const IndicesPtr &indices) |
| Provide a pointer to the vector of indices that represents the input data. | |
| virtual void | setIndices (const IndicesConstPtr &indices) |
| Provide a pointer to the vector of indices that represents the input data. | |
| virtual void | setIndices (const PointIndicesConstPtr &indices) |
| Provide a pointer to the vector of indices that represents the input data. | |
| virtual void | setIndices (std::size_t row_start, std::size_t col_start, std::size_t nb_rows, std::size_t nb_cols) |
| Set the indices for the points laying within an interest region of the point cloud. | |
| IndicesPtr | getIndices () |
| Get a pointer to the vector of indices used. | |
| IndicesConstPtr const | getIndices () const |
| Get a pointer to the vector of indices used. | |
| const PointInT & | operator[] (std::size_t pos) const |
| Override PointCloud operator[] to shorten code. | |
Protected Member Functions | |
| void | performReconstruction (PointCloud &points, std::vector< pcl::Vertices > &polygons, bool fill_polygon_data=false) |
| The actual reconstruction method. | |
| void | performReconstruction2D (PointCloud &points, std::vector< pcl::Vertices > &polygons, bool fill_polygon_data=false) |
| The reconstruction method for 2D data. | |
| void | performReconstruction3D (PointCloud &points, std::vector< pcl::Vertices > &polygons, bool fill_polygon_data=false) |
| The reconstruction method for 3D data. | |
| void | performReconstruction (PolygonMesh &output) override |
| A reconstruction method that returns a polygonmesh. | |
| void | performReconstruction (std::vector< pcl::Vertices > &polygons) override |
| A reconstruction method that returns the polygon of the convex hull. | |
| void | calculateInputDimension () |
| Automatically determines the dimension of input data - 2D or 3D. | |
| std::string | getClassName () const override |
| Class get name method. | |
| Protected Member Functions inherited from pcl::PCLBase< PointInT > | |
| bool | initCompute () |
| This method should get called before starting the actual computation. | |
| bool | deinitCompute () |
| This method should get called after finishing the actual computation. | |
Protected Attributes | |
| bool | compute_area_ {false} |
| double | total_area_ {0.0} |
| double | total_volume_ {0.0} |
| int | dimension_ {0} |
| The dimensionality of the concave hull (2D or 3D). | |
| double | projection_angle_thresh_ {std::cos (0.174532925)} |
| How close can a 2D plane's normal be to an axis to make projection problematic. | |
| std::string | qhull_flags {"qhull "} |
| Option flag string to be used calling qhull. | |
| const Eigen::Vector3d | x_axis_ {1.0, 0.0, 0.0} |
| const Eigen::Vector3d | y_axis_ {0.0, 1.0, 0.0} |
| const Eigen::Vector3d | z_axis_ {0.0, 0.0, 1.0} |
| pcl::PointIndices | hull_indices_ |
| Protected Attributes inherited from pcl::MeshConstruction< PointInT > | |
| bool | check_tree_ {true} |
| A flag specifying whether or not the derived reconstruction algorithm needs the search object tree. | |
| Protected Attributes inherited from pcl::PCLSurfaceBase< PointInT > | |
| KdTreePtr | tree_ |
| A pointer to the spatial search object. | |
| Protected Attributes inherited from pcl::PCLBase< PointInT > | |
| PointCloudConstPtr | input_ |
| The input point cloud dataset. | |
| IndicesPtr | indices_ |
| A pointer to the vector of point indices to use. | |
| bool | use_indices_ |
| Set to true if point indices are used. | |
| bool | fake_indices_ |
| If no set of indices are given, we construct a set of fake indices that mimic the input PointCloud. | |
ConvexHull using libqhull library.
Definition at line 72 of file convex_hull.h.
| using pcl::ConvexHull< PointInT >::ConstPtr = shared_ptr<const ConvexHull<PointInT> > |
Definition at line 82 of file convex_hull.h.
| using pcl::ConvexHull< PointInT >::PointCloud = pcl::PointCloud<PointInT> |
Definition at line 86 of file convex_hull.h.
| using pcl::ConvexHull< PointInT >::PointCloudConstPtr = typename PointCloud::ConstPtr |
Definition at line 88 of file convex_hull.h.
| using pcl::ConvexHull< PointInT >::PointCloudPtr = typename PointCloud::Ptr |
Definition at line 87 of file convex_hull.h.
| using pcl::ConvexHull< PointInT >::Ptr = shared_ptr<ConvexHull<PointInT> > |
Definition at line 81 of file convex_hull.h.
|
default |
Empty constructor.
|
overridedefault |
Empty destructor.
|
protected |
Automatically determines the dimension of input data - 2D or 3D.
Definition at line 57 of file convex_hull.hpp.
References pcl::compute3DCentroid(), pcl::computeCovarianceMatrixNormalized(), dimension_, pcl::eigen33(), getClassName(), pcl::PCLBase< PointInT >::indices_, and pcl::PCLBase< PointInT >::input_.
Referenced by performReconstruction().
|
inlineoverrideprotectedvirtual |
Class get name method.
Reimplemented from pcl::PCLSurfaceBase< PointInT >.
Definition at line 230 of file convex_hull.h.
Referenced by calculateInputDimension(), performReconstruction(), performReconstruction2D(), performReconstruction3D(), and setDimension().
|
inline |
Returns the dimensionality (2 or 3) of the calculated hull.
Definition at line 160 of file convex_hull.h.
References dimension_.
| void pcl::ConvexHull< PointInT >::getHullPointIndices | ( | pcl::PointIndices & | hull_point_indices | ) | const |
Retrieve the indices of the input point cloud that for the convex hull.
| [out] | hull_point_indices | The indices of the points forming the point cloud |
Definition at line 502 of file convex_hull.hpp.
References hull_indices_.
|
inline |
Returns the total area of the convex hull.
Definition at line 132 of file convex_hull.h.
References total_area_.
|
inline |
Returns the total volume of the convex hull.
Only valid for 3-dimensional sets. For 2D-sets volume is zero.
Definition at line 141 of file convex_hull.h.
References total_volume_.
|
protected |
The actual reconstruction method.
| [out] | points | the resultant points lying on the convex hull |
| [out] | polygons | the resultant convex hull polygons, as a set of vertices. The Vertices structure contains an array of point indices. |
| [in] | fill_polygon_data | true if polygons should be filled, false otherwise |
Definition at line 424 of file convex_hull.hpp.
References calculateInputDimension(), dimension_, getClassName(), performReconstruction2D(), and performReconstruction3D().
Referenced by performReconstruction(), performReconstruction(), reconstruct(), and reconstruct().
|
overrideprotectedvirtual |
A reconstruction method that returns a polygonmesh.
| [out] | output | a PolygonMesh representing the convex hull of the input data. |
Implements pcl::MeshConstruction< PointInT >.
Definition at line 462 of file convex_hull.hpp.
References pcl::PolygonMesh::cloud, performReconstruction(), pcl::PolygonMesh::polygons, and pcl::toPCLPointCloud2().
|
overrideprotectedvirtual |
A reconstruction method that returns the polygon of the convex hull.
| [out] | polygons | the polygon(s) representing the convex hull of the input data. |
Implements pcl::MeshConstruction< PointInT >.
Definition at line 474 of file convex_hull.hpp.
References performReconstruction().
|
protected |
The reconstruction method for 2D data.
Does not require dimension to be set.
| [out] | points | the resultant points lying on the convex hull |
| [out] | polygons | the resultant convex hull polygons, as a set of vertices. The Vertices structure contains an array of point indices. |
| [in] | fill_polygon_data | true if polygons should be filled, false otherwise |
Definition at line 76 of file convex_hull.hpp.
References pcl::PointCloud< PointT >::clear(), pcl::comparePoints2D(), pcl::compute3DCentroid(), compute_area_, pcl::computeCovarianceMatrixNormalized(), pcl::eigen33(), getClassName(), pcl::PointCloud< PointT >::height, hull_indices_, pcl::PCLBase< PointInT >::indices_, pcl::PCLBase< PointInT >::input_, pcl::PointCloud< PointT >::is_dense, pcl::console::isVerbosityLevelEnabled(), pcl::isXYZFinite(), pcl::console::L_DEBUG, projection_angle_thresh_, qhull_flags, pcl::PointCloud< PointT >::resize(), pcl::PointCloud< PointT >::size(), total_area_, total_volume_, pcl::PointCloud< PointT >::width, x_axis_, y_axis_, and z_axis_.
Referenced by performReconstruction().
|
protected |
The reconstruction method for 3D data.
Does not require dimension to be set.
| [out] | points | the resultant points lying on the convex hull |
| [out] | polygons | the resultant convex hull polygons, as a set of vertices. The Vertices structure contains an array of point indices. |
| [in] | fill_polygon_data | true if polygons should be filled, false otherwise |
Definition at line 291 of file convex_hull.hpp.
References compute_area_, getClassName(), pcl::PointCloud< PointT >::height, hull_indices_, pcl::PCLBase< PointInT >::indices_, pcl::PCLBase< PointInT >::input_, pcl::PointCloud< PointT >::is_dense, pcl::console::isVerbosityLevelEnabled(), pcl::console::L_DEBUG, qhull_flags, pcl::PointCloud< PointT >::resize(), pcl::PointCloud< PointT >::size(), total_area_, total_volume_, and pcl::PointCloud< PointT >::width.
Referenced by performReconstruction().
| void pcl::ConvexHull< PointInT >::reconstruct | ( | PointCloud & | points | ) |
Compute a convex hull for all points given.
| [out] | points | the resultant points lying on the convex hull. |
Definition at line 439 of file convex_hull.hpp.
References pcl::PointCloud< PointT >::clear(), pcl::PCLBase< PointInT >::deinitCompute(), pcl::PointCloud< PointT >::header, pcl::PointCloud< PointT >::height, pcl::PCLBase< PointInT >::indices_, pcl::PCLBase< PointInT >::initCompute(), pcl::PCLBase< PointInT >::input_, pcl::PointCloud< PointT >::is_dense, performReconstruction(), pcl::PointCloud< PointT >::size(), and pcl::PointCloud< PointT >::width.
| void pcl::ConvexHull< PointInT >::reconstruct | ( | PointCloud & | points, |
| std::vector< pcl::Vertices > & | polygons ) |
Compute a convex hull for all points given.
| [out] | points | the resultant points lying on the convex hull. |
| [out] | polygons | the resultant convex hull polygons, as a set of vertices. The Vertices structure contains an array of point indices. |
Definition at line 482 of file convex_hull.hpp.
References pcl::PointCloud< PointT >::clear(), pcl::PCLBase< PointInT >::deinitCompute(), pcl::PointCloud< PointT >::header, pcl::PointCloud< PointT >::height, pcl::PCLBase< PointInT >::indices_, pcl::PCLBase< PointInT >::initCompute(), pcl::PCLBase< PointInT >::input_, pcl::PointCloud< PointT >::is_dense, performReconstruction(), pcl::PointCloud< PointT >::size(), and pcl::PointCloud< PointT >::width.
|
inline |
If set to true, the qhull library is called to compute the total area and volume of the convex hull.
NOTE: When this option is activated, the qhull library produces output to the console.
| [in] | value | whether to compute the area and the volume, default is false |
Definition at line 121 of file convex_hull.h.
References compute_area_, and qhull_flags.
|
inline |
Sets the dimension on the input data, 2D or 3D.
| [in] | dimension | The dimension of the input data. If not set, this will be determined automatically. |
Definition at line 150 of file convex_hull.h.
References dimension_, and getClassName().
|
protected |
Definition at line 236 of file convex_hull.h.
Referenced by performReconstruction2D(), performReconstruction3D(), and setComputeAreaVolume().
|
protected |
The dimensionality of the concave hull (2D or 3D).
Definition at line 245 of file convex_hull.h.
Referenced by calculateInputDimension(), getDimension(), performReconstruction(), and setDimension().
|
protected |
Definition at line 263 of file convex_hull.h.
Referenced by getHullPointIndices(), performReconstruction2D(), and performReconstruction3D().
|
protected |
How close can a 2D plane's normal be to an axis to make projection problematic.
Definition at line 248 of file convex_hull.h.
Referenced by performReconstruction2D().
|
protected |
Option flag string to be used calling qhull.
Definition at line 251 of file convex_hull.h.
Referenced by performReconstruction2D(), performReconstruction3D(), and setComputeAreaVolume().
|
protected |
Definition at line 239 of file convex_hull.h.
Referenced by getTotalArea(), performReconstruction2D(), and performReconstruction3D().
|
protected |
Definition at line 242 of file convex_hull.h.
Referenced by getTotalVolume(), performReconstruction2D(), and performReconstruction3D().
|
protected |
Definition at line 254 of file convex_hull.h.
Referenced by performReconstruction2D().
|
protected |
Definition at line 257 of file convex_hull.h.
Referenced by performReconstruction2D().
|
protected |
Definition at line 260 of file convex_hull.h.
Referenced by performReconstruction2D().