Point Cloud Library (PCL)  1.8.1-dev
List of all members | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes
pcl::ConvexHull< PointInT > Class Template Reference

ConvexHull using libqhull library. More...

#include <pcl/surface/convex_hull.h>

+ Inheritance diagram for pcl::ConvexHull< PointInT >:

Public Types

typedef boost::shared_ptr
< ConvexHull< PointInT > > 
Ptr
 
typedef boost::shared_ptr
< const ConvexHull< PointInT > > 
ConstPtr
 
typedef pcl::PointCloud< PointInT > PointCloud
 
typedef PointCloud::Ptr PointCloudPtr
 
typedef PointCloud::ConstPtr PointCloudConstPtr
 
- Public Types inherited from pcl::MeshConstruction< PointInT >
typedef boost::shared_ptr
< MeshConstruction< PointInT > > 
Ptr
 
typedef boost::shared_ptr
< const MeshConstruction
< PointInT > > 
ConstPtr
 
- Public Types inherited from pcl::PCLSurfaceBase< PointInT >
typedef boost::shared_ptr
< PCLSurfaceBase< PointInT > > 
Ptr
 
typedef boost::shared_ptr
< const PCLSurfaceBase
< PointInT > > 
ConstPtr
 
typedef pcl::search::Search
< PointInT > 
KdTree
 
typedef pcl::search::Search
< PointInT >::Ptr 
KdTreePtr
 
- Public Types inherited from pcl::PCLBase< PointInT >
typedef pcl::PointCloud< PointInT > PointCloud
 
typedef PointCloud::Ptr PointCloudPtr
 
typedef PointCloud::ConstPtr PointCloudConstPtr
 
typedef boost::shared_ptr
< PointIndices
PointIndicesPtr
 
typedef boost::shared_ptr
< PointIndices const > 
PointIndicesConstPtr
 

Public Member Functions

 ConvexHull ()
 Empty constructor. More...
 
virtual ~ConvexHull ()
 Empty destructor. More...
 
void reconstruct (PointCloud &points, std::vector< pcl::Vertices > &polygons)
 Compute a convex hull for all points given. More...
 
void reconstruct (PointCloud &points)
 Compute a convex hull for all points given. More...
 
void setComputeAreaVolume (bool value)
 If set to true, the qhull library is called to compute the total area and volume of the convex hull. More...
 
double getTotalArea () const
 Returns the total area of the convex hull. More...
 
double getTotalVolume () const
 Returns the total volume of the convex hull. More...
 
void setDimension (int dimension)
 Sets the dimension on the input data, 2D or 3D. More...
 
int getDimension () const
 Returns the dimensionality (2 or 3) of the calculated hull. More...
 
void getHullPointIndices (pcl::PointIndices &hull_point_indices) const
 Retrieve the indices of the input point cloud that for the convex hull. More...
 
- Public Member Functions inherited from pcl::MeshConstruction< PointInT >
 MeshConstruction ()
 Constructor. More...
 
virtual ~MeshConstruction ()
 Destructor. More...
 
virtual void reconstruct (pcl::PolygonMesh &output)
 Base method for surface reconstruction for all points given in <setInputCloud (), setIndices ()> More...
 
virtual void reconstruct (std::vector< pcl::Vertices > &polygons)
 Base method for mesh construction for all points given in <setInputCloud (), setIndices ()> More...
 
- Public Member Functions inherited from pcl::PCLSurfaceBase< PointInT >
 PCLSurfaceBase ()
 Empty constructor. More...
 
virtual ~PCLSurfaceBase ()
 Empty destructor. More...
 
void setSearchMethod (const KdTreePtr &tree)
 Provide an optional pointer to a search object. More...
 
KdTreePtr getSearchMethod ()
 Get a pointer to the search method used. More...
 
- Public Member Functions inherited from pcl::PCLBase< PointInT >
 PCLBase ()
 Empty constructor. More...
 
 PCLBase (const PCLBase &base)
 Copy constructor. More...
 
virtual ~PCLBase ()
 Destructor. More...
 
virtual void setInputCloud (const PointCloudConstPtr &cloud)
 Provide a pointer to the input dataset. More...
 
PointCloudConstPtr const getInputCloud () const
 Get a pointer to the input point cloud dataset. More...
 
virtual void setIndices (const IndicesPtr &indices)
 Provide a pointer to the vector of indices that represents the input data. More...
 
virtual void setIndices (const IndicesConstPtr &indices)
 Provide a pointer to the vector of indices that represents the input data. More...
 
virtual void setIndices (const PointIndicesConstPtr &indices)
 Provide a pointer to the vector of indices that represents the input data. More...
 
virtual void setIndices (size_t row_start, size_t col_start, size_t nb_rows, size_t nb_cols)
 Set the indices for the points laying within an interest region of the point cloud. More...
 
IndicesPtr const getIndices ()
 Get a pointer to the vector of indices used. More...
 
IndicesConstPtr const getIndices () const
 Get a pointer to the vector of indices used. More...
 
const PointInT & operator[] (size_t pos) const
 Override PointCloud operator[] to shorten code. More...
 

Protected Member Functions

void performReconstruction (PointCloud &points, std::vector< pcl::Vertices > &polygons, bool fill_polygon_data=false)
 The actual reconstruction method. More...
 
void performReconstruction2D (PointCloud &points, std::vector< pcl::Vertices > &polygons, bool fill_polygon_data=false)
 The reconstruction method for 2D data. More...
 
void performReconstruction3D (PointCloud &points, std::vector< pcl::Vertices > &polygons, bool fill_polygon_data=false)
 The reconstruction method for 3D data. More...
 
virtual void performReconstruction (PolygonMesh &output)
 A reconstruction method that returns a polygonmesh. More...
 
virtual void performReconstruction (std::vector< pcl::Vertices > &polygons)
 A reconstruction method that returns the polygon of the convex hull. More...
 
void calculateInputDimension ()
 Automatically determines the dimension of input data - 2D or 3D. More...
 
std::string getClassName () const
 Class get name method. More...
 
- Protected Member Functions inherited from pcl::PCLBase< PointInT >
bool initCompute ()
 This method should get called before starting the actual computation. More...
 
bool deinitCompute ()
 This method should get called after finishing the actual computation. More...
 

Protected Attributes

bool compute_area_
 
double total_area_
 
double total_volume_
 
int dimension_
 The dimensionality of the concave hull (2D or 3D). More...
 
double projection_angle_thresh_
 How close can a 2D plane's normal be to an axis to make projection problematic. More...
 
std::string qhull_flags
 Option flag string to be used calling qhull. More...
 
const Eigen::Vector3d x_axis_
 
const Eigen::Vector3d y_axis_
 
const Eigen::Vector3d z_axis_
 
pcl::PointIndices hull_indices_
 
- Protected Attributes inherited from pcl::MeshConstruction< PointInT >
bool check_tree_
 A flag specifying whether or not the derived reconstruction algorithm needs the search object tree. More...
 
- Protected Attributes inherited from pcl::PCLSurfaceBase< PointInT >
KdTreePtr tree_
 A pointer to the spatial search object. More...
 
- Protected Attributes inherited from pcl::PCLBase< PointInT >
PointCloudConstPtr input_
 The input point cloud dataset. More...
 
IndicesPtr indices_
 A pointer to the vector of point indices to use. More...
 
bool use_indices_
 Set to true if point indices are used. More...
 
bool fake_indices_
 If no set of indices are given, we construct a set of fake indices that mimic the input PointCloud. More...
 

Detailed Description

template<typename PointInT>
class pcl::ConvexHull< PointInT >

ConvexHull using libqhull library.

Author
Aitor Aldoma, Alex Trevor

Definition at line 72 of file convex_hull.h.

Member Typedef Documentation

template<typename PointInT>
typedef boost::shared_ptr<const ConvexHull<PointInT> > pcl::ConvexHull< PointInT >::ConstPtr

Definition at line 82 of file convex_hull.h.

template<typename PointInT>
typedef pcl::PointCloud<PointInT> pcl::ConvexHull< PointInT >::PointCloud

Definition at line 86 of file convex_hull.h.

template<typename PointInT>
typedef PointCloud::ConstPtr pcl::ConvexHull< PointInT >::PointCloudConstPtr

Definition at line 88 of file convex_hull.h.

template<typename PointInT>
typedef PointCloud::Ptr pcl::ConvexHull< PointInT >::PointCloudPtr

Definition at line 87 of file convex_hull.h.

template<typename PointInT>
typedef boost::shared_ptr<ConvexHull<PointInT> > pcl::ConvexHull< PointInT >::Ptr

Definition at line 81 of file convex_hull.h.

Constructor & Destructor Documentation

template<typename PointInT>
pcl::ConvexHull< PointInT >::ConvexHull ( )
inline

Empty constructor.

Definition at line 91 of file convex_hull.h.

template<typename PointInT>
virtual pcl::ConvexHull< PointInT >::~ConvexHull ( )
inlinevirtual

Empty destructor.

Definition at line 98 of file convex_hull.h.

Member Function Documentation

template<typename PointInT >
void pcl::ConvexHull< PointInT >::calculateInputDimension ( )
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(), pcl::eigen33(), and pcl::EIGEN_ALIGN16.

template<typename PointInT>
std::string pcl::ConvexHull< PointInT >::getClassName ( ) const
inlineprotectedvirtual

Class get name method.

Reimplemented from pcl::PCLSurfaceBase< PointInT >.

Definition at line 234 of file convex_hull.h.

Referenced by pcl::ConvexHull< PointInT >::setDimension().

template<typename PointInT>
int pcl::ConvexHull< PointInT >::getDimension ( ) const
inline

Returns the dimensionality (2 or 3) of the calculated hull.

Definition at line 164 of file convex_hull.h.

References pcl::ConvexHull< PointInT >::dimension_.

template<typename PointInT >
void pcl::ConvexHull< PointInT >::getHullPointIndices ( pcl::PointIndices hull_point_indices) const

Retrieve the indices of the input point cloud that for the convex hull.

Note
Should only be called after reconstruction was performed.
Parameters
[out]hull_point_indicesThe indices of the points forming the point cloud

Definition at line 499 of file convex_hull.hpp.

template<typename PointInT>
double pcl::ConvexHull< PointInT >::getTotalArea ( ) const
inline

Returns the total area of the convex hull.

Definition at line 136 of file convex_hull.h.

References pcl::ConvexHull< PointInT >::total_area_.

template<typename PointInT>
double pcl::ConvexHull< PointInT >::getTotalVolume ( ) const
inline

Returns the total volume of the convex hull.

Only valid for 3-dimensional sets. For 2D-sets volume is zero.

Definition at line 145 of file convex_hull.h.

References pcl::ConvexHull< PointInT >::total_volume_.

template<typename PointInT >
void pcl::ConvexHull< PointInT >::performReconstruction ( PointCloud points,
std::vector< pcl::Vertices > &  polygons,
bool  fill_polygon_data = false 
)
protected

The actual reconstruction method.

Parameters
[out]pointsthe resultant points lying on the convex hull
[out]polygonsthe resultant convex hull polygons, as a set of vertices. The Vertices structure contains an array of point indices.
[in]fill_polygon_datatrue if polygons should be filled, false otherwise

Definition at line 421 of file convex_hull.hpp.

template<typename PointInT >
void pcl::ConvexHull< PointInT >::performReconstruction ( PolygonMesh output)
protectedvirtual

A reconstruction method that returns a polygonmesh.

Parameters
[out]outputa PolygonMesh representing the convex hull of the input data.

Implements pcl::MeshConstruction< PointInT >.

Definition at line 459 of file convex_hull.hpp.

References pcl::PolygonMesh::cloud, pcl::PolygonMesh::polygons, and pcl::toPCLPointCloud2().

template<typename PointInT >
void pcl::ConvexHull< PointInT >::performReconstruction ( std::vector< pcl::Vertices > &  polygons)
protectedvirtual

A reconstruction method that returns the polygon of the convex hull.

Parameters
[out]polygonsthe polygon(s) representing the convex hull of the input data.

Implements pcl::MeshConstruction< PointInT >.

Definition at line 471 of file convex_hull.hpp.

template<typename PointInT >
void pcl::ConvexHull< PointInT >::performReconstruction2D ( PointCloud points,
std::vector< pcl::Vertices > &  polygons,
bool  fill_polygon_data = false 
)
protected

The reconstruction method for 2D data.

Does not require dimension to be set.

Parameters
[out]pointsthe resultant points lying on the convex hull
[out]polygonsthe resultant convex hull polygons, as a set of vertices. The Vertices structure contains an array of point indices.
[in]fill_polygon_datatrue if polygons should be filled, false otherwise

Definition at line 76 of file convex_hull.hpp.

References pcl::comparePoints2D(), pcl::compute3DCentroid(), pcl::computeCovarianceMatrixNormalized(), pcl::eigen33(), pcl::PointCloud< T >::height, pcl::PointCloud< T >::is_dense, pcl::PointCloud< T >::points, and pcl::PointCloud< T >::width.

template<typename PointInT >
void pcl::ConvexHull< PointInT >::performReconstruction3D ( PointCloud points,
std::vector< pcl::Vertices > &  polygons,
bool  fill_polygon_data = false 
)
protected

The reconstruction method for 3D data.

Does not require dimension to be set.

Parameters
[out]pointsthe resultant points lying on the convex hull
[out]polygonsthe resultant convex hull polygons, as a set of vertices. The Vertices structure contains an array of point indices.
[in]fill_polygon_datatrue if polygons should be filled, false otherwise

Definition at line 292 of file convex_hull.hpp.

References pcl::PointCloud< T >::height, pcl::PointCloud< T >::is_dense, pcl::PointCloud< T >::points, and pcl::PointCloud< T >::width.

template<typename PointInT >
void pcl::ConvexHull< PointInT >::reconstruct ( PointCloud points,
std::vector< pcl::Vertices > &  polygons 
)

Compute a convex hull for all points given.

Note
In 2D case (i.e. if the input points belong to one plane) the polygons vector will have a single item, whereas in 3D case it will contain one item for each hull facet.
Parameters
[out]pointsthe resultant points lying on the convex hull.
[out]polygonsthe resultant convex hull polygons, as a set of vertices. The Vertices structure contains an array of point indices.

Definition at line 479 of file convex_hull.hpp.

References pcl::PointCloud< T >::header, pcl::PointCloud< T >::height, pcl::PointCloud< T >::is_dense, pcl::PointCloud< T >::points, and pcl::PointCloud< T >::width.

template<typename PointInT >
void pcl::ConvexHull< PointInT >::reconstruct ( PointCloud points)

Compute a convex hull for all points given.

Parameters
[out]pointsthe resultant points lying on the convex hull.

Definition at line 436 of file convex_hull.hpp.

References pcl::PointCloud< T >::header, pcl::PointCloud< T >::height, pcl::PointCloud< T >::is_dense, pcl::PointCloud< T >::points, and pcl::PointCloud< T >::width.

template<typename PointInT>
void pcl::ConvexHull< PointInT >::setComputeAreaVolume ( bool  value)
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.

Parameters
[in]valuewhether to compute the area and the volume, default is false

Definition at line 125 of file convex_hull.h.

References pcl::ConvexHull< PointInT >::compute_area_, and pcl::ConvexHull< PointInT >::qhull_flags.

template<typename PointInT>
void pcl::ConvexHull< PointInT >::setDimension ( int  dimension)
inline

Sets the dimension on the input data, 2D or 3D.

Parameters
[in]dimensionThe dimension of the input data. If not set, this will be determined automatically.

Definition at line 154 of file convex_hull.h.

References pcl::ConvexHull< PointInT >::dimension_, and pcl::ConvexHull< PointInT >::getClassName().

Member Data Documentation

template<typename PointInT>
bool pcl::ConvexHull< PointInT >::compute_area_
protected

Definition at line 240 of file convex_hull.h.

Referenced by pcl::ConvexHull< PointInT >::setComputeAreaVolume().

template<typename PointInT>
int pcl::ConvexHull< PointInT >::dimension_
protected

The dimensionality of the concave hull (2D or 3D).

Definition at line 249 of file convex_hull.h.

Referenced by pcl::ConvexHull< PointInT >::getDimension(), and pcl::ConvexHull< PointInT >::setDimension().

template<typename PointInT>
pcl::PointIndices pcl::ConvexHull< PointInT >::hull_indices_
protected

Definition at line 267 of file convex_hull.h.

template<typename PointInT>
double pcl::ConvexHull< PointInT >::projection_angle_thresh_
protected

How close can a 2D plane's normal be to an axis to make projection problematic.

Definition at line 252 of file convex_hull.h.

template<typename PointInT>
std::string pcl::ConvexHull< PointInT >::qhull_flags
protected

Option flag string to be used calling qhull.

Definition at line 255 of file convex_hull.h.

Referenced by pcl::ConvexHull< PointInT >::setComputeAreaVolume().

template<typename PointInT>
double pcl::ConvexHull< PointInT >::total_area_
protected

Definition at line 243 of file convex_hull.h.

Referenced by pcl::ConvexHull< PointInT >::getTotalArea().

template<typename PointInT>
double pcl::ConvexHull< PointInT >::total_volume_
protected

Definition at line 246 of file convex_hull.h.

Referenced by pcl::ConvexHull< PointInT >::getTotalVolume().

template<typename PointInT>
const Eigen::Vector3d pcl::ConvexHull< PointInT >::x_axis_
protected

Definition at line 258 of file convex_hull.h.

template<typename PointInT>
const Eigen::Vector3d pcl::ConvexHull< PointInT >::y_axis_
protected

Definition at line 261 of file convex_hull.h.

template<typename PointInT>
const Eigen::Vector3d pcl::ConvexHull< PointInT >::z_axis_
protected

Definition at line 264 of file convex_hull.h.


The documentation for this class was generated from the following files: