Loading...
Searching...
No Matches
pcl::ConcaveHull< PointInT > Class Template Reference
Module surface

ConcaveHull (alpha shapes) using libqhull library. More...

`#include <pcl/surface/concave_hull.h>`

Inheritance diagram for pcl::ConcaveHull< PointInT >:

## Public Types

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

| ConcaveHull ()=default
| Empty constructor.
| ~ConcaveHull () override=default
| Empty destructor.
void | reconstruct (PointCloud &points, std::vector< pcl::Vertices > &polygons)
| Compute a concave hull for all points given.
void | reconstruct (PointCloud &output)
| Compute a concave hull for all points given.
void | setAlpha (double alpha)
| Set the alpha value, which limits the size of the resultant hull segments (the smaller the more detailed the hull).
double | getAlpha ()
| Returns the alpha parameter, see setAlpha().
void | setVoronoiCenters (PointCloudPtr voronoi_centers)
| If set, the voronoi cells center will be saved in voronoi_centers.
void | setKeepInformation (bool value)
| If keep_information_is set to true the convex hull points keep other information like rgb, normals, ...
int | getDimension () const
| Returns the dimensionality (2 or 3) of the calculated hull.
void | setDimension (int dimension)
| Sets the dimension on the input data, 2D or 3D.
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 Types

using | Ptr = shared_ptr<ConcaveHull<PointInT> >
using | ConstPtr = shared_ptr<const ConcaveHull<PointInT> >

## Protected Member Functions

std::string | getClassName () const override
| Class get name method.
void | performReconstruction (PointCloud &points, std::vector< pcl::Vertices > &polygons)
| The actual reconstruction method.
void | performReconstruction (PolygonMesh &output) override
| Abstract surface reconstruction method.
void | performReconstruction (std::vector< pcl::Vertices > &polygons) override
| Abstract surface reconstruction 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

double | alpha_ {0.0}
| The method accepts facets only if the distance from any vertex to the facet->center (center of the voronoi cell) is smaller than alpha.
bool | keep_information_ {false}
| If set to true, the reconstructed point cloud describing the hull is obtained from the original input cloud by performing a nearest neighbor search from Qhull output.
PointCloudPtr | voronoi_centers_ {nullptr}
| the centers of the voronoi cells
int | dim_ {0}
| the dimensionality of the concave hull
pcl::PointIndices | hull_indices_
| vector containing the point cloud indices of the convex hull points.
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.

## Detailed Description

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

ConcaveHull (alpha shapes) using libqhull library.

Author
  Aitor Aldoma

Definition at line 55 of file concave_hull.h.

## Member Typedef Documentation

## ConstPtr

template<typename PointInT>

using pcl::ConcaveHull< PointInT >::ConstPtr = shared_ptr<const ConcaveHull<PointInT> >

protected

Definition at line 59 of file concave_hull.h.

## PointCloud

template<typename PointInT>

using pcl::ConcaveHull< PointInT >::PointCloud = pcl::PointCloud<PointInT>

Definition at line 69 of file concave_hull.h.

## PointCloudConstPtr

template<typename PointInT>

using pcl::ConcaveHull< PointInT >::PointCloudConstPtr = typename PointCloud::ConstPtr

Definition at line 71 of file concave_hull.h.

## PointCloudPtr

template<typename PointInT>

using pcl::ConcaveHull< PointInT >::PointCloudPtr = typename PointCloud::Ptr

Definition at line 70 of file concave_hull.h.

## Ptr

template<typename PointInT>

using pcl::ConcaveHull< PointInT >::Ptr = shared_ptr<ConcaveHull<PointInT> >

protected

Definition at line 58 of file concave_hull.h.

## Constructor & Destructor Documentation

## ConcaveHull()

template<typename PointInT>

pcl::ConcaveHull< PointInT >::ConcaveHull | ( |  | ) |

default

Empty constructor.

## ~ConcaveHull()

template<typename PointInT>

pcl::ConcaveHull< PointInT >::~ConcaveHull | ( |  | ) |

override default

Empty destructor.

## Member Function Documentation

## getAlpha()

template<typename PointInT>

double pcl::ConcaveHull< PointInT >::getAlpha | ( |  | ) |

inline

Returns the alpha parameter, see setAlpha().

Definition at line 109 of file concave_hull.h.

References alpha_.

## getClassName()

template<typename PointInT>

std::string pcl::ConcaveHull< PointInT >::getClassName | ( |  | ) | const

inline override protected virtual

Class get name method.

Reimplemented from pcl::PCLSurfaceBase< PointInT >.

Definition at line 165 of file concave_hull.h.

Referenced by performReconstruction(), reconstruct(), reconstruct(), and setDimension().

## getDimension()

template<typename PointInT>

int pcl::ConcaveHull< PointInT >::getDimension | ( |  | ) | const

inline

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

Definition at line 135 of file concave_hull.h.

References dim_.

## getHullPointIndices()

template<typename PointInT>

void pcl::ConcaveHull< 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 and if the ConcaveHull is set to preserve information via setKeepInformation ().

Parameters

  [out] | hull_point_indices | The indices of the points forming the point cloud

Definition at line 618 of file concave_hull.hpp.

References hull_indices_, and keep_information_.

## performReconstruction() [1/3]

template<typename PointInT>

void pcl::ConcaveHull< PointInT >::performReconstruction | ( | PointCloud & | points,
|  | std::vector< pcl::Vertices > & | polygons )

protected

The actual reconstruction method.

Parameters

  points | the resultant points lying on the concave hull
  polygons | the resultant concave hull polygons, as a set of vertices. The Vertices structure contains an array of point indices.

Definition at line 119 of file concave_hull.hpp.

References alpha_, pcl::compute3DCentroid(), pcl::computeCovarianceMatrixNormalized(), pcl::copyPointCloud(), pcl::demeanPointCloud(), dim_, pcl::eigen33(), pcl::getCircumcircleRadius(), getClassName(), pcl::PointCloud< PointT >::height, hull_indices_, pcl::PCLBase< PointInT >::indices_, pcl::PCLBase< PointInT >::input_, pcl::PointCloud< PointT >::is_dense, keep_information_, pcl::KdTreeFLANN< PointT, Dist >::nearestKSearch(), pcl::PointCloud< PointT >::points, pcl::PointCloud< PointT >::resize(), pcl::KdTreeFLANN< PointT, Dist >::setInputCloud(), pcl::PointCloud< PointT >::size(), pcl::transformPointCloud(), pcl::Vertices::vertices, voronoi_centers_, and pcl::PointCloud< PointT >::width.

Referenced by performReconstruction(), performReconstruction(), reconstruct(), and reconstruct().

## performReconstruction() [2/3]

template<typename PointInT>

void pcl::ConcaveHull< PointInT >::performReconstruction | ( | PolygonMesh & | output | ) |

override protected virtual

Abstract surface reconstruction method.

Parameters

  [out] | output | the output polygonal mesh

Implements pcl::MeshConstruction< PointInT >.

Definition at line 598 of file concave_hull.hpp.

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

## performReconstruction() [3/3]

template<typename PointInT>

void pcl::ConcaveHull< PointInT >::performReconstruction | ( | std::vector< pcl::Vertices > & | polygons | ) |

override protected virtual

Abstract surface reconstruction method.

Parameters

  [out] | polygons | the resultant polygons, as a set of vertices. The Vertices structure contains an array of point indices.

Implements pcl::MeshConstruction< PointInT >.

Definition at line 610 of file concave_hull.hpp.

References performReconstruction().

## reconstruct() [1/2]

template<typename PointInT>

void pcl::ConcaveHull< PointInT >::reconstruct | ( | PointCloud & | output | ) |

Compute a concave hull for all points given.

Software License Agreement (BSD License).

Parameters

  output | the resultant concave hull vertices

Point Cloud Library (PCL) - www.pointclouds.org Copyright (c) 2010-2011, Willow Garage, Inc.

All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
- Neither the name of Willow Garage, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

$Id$

Definition at line 59 of file concave_hull.hpp.

References alpha_, pcl::PointCloud< PointT >::clear(), pcl::PCLBase< PointInT >::deinitCompute(), getClassName(), pcl::PointCloud< PointT >::header, pcl::PointCloud< PointT >::height, pcl::PCLBase< PointInT >::initCompute(), pcl::PCLBase< PointInT >::input_, pcl::PointCloud< PointT >::is_dense, performReconstruction(), pcl::PointCloud< PointT >::size(), and pcl::PointCloud< PointT >::width.

## reconstruct() [2/2]

template<typename PointInT>

void pcl::ConcaveHull< PointInT >::reconstruct | ( | PointCloud & | points,
|  | std::vector< pcl::Vertices > & | polygons )

Compute a concave hull for all points given.

Parameters

  points | the resultant points lying on the concave hull
  polygons | the resultant concave hull polygons, as a set of vertices. The Vertices structure contains an array of point indices.

Definition at line 88 of file concave_hull.hpp.

References alpha_, pcl::PointCloud< PointT >::clear(), pcl::PCLBase< PointInT >::deinitCompute(), getClassName(), pcl::PointCloud< PointT >::header, pcl::PointCloud< PointT >::height, pcl::PCLBase< PointInT >::initCompute(), pcl::PCLBase< PointInT >::input_, pcl::PointCloud< PointT >::is_dense, performReconstruction(), pcl::PointCloud< PointT >::size(), and pcl::PointCloud< PointT >::width.

## setAlpha()

template<typename PointInT>

void pcl::ConcaveHull< PointInT >::setAlpha | ( | double | alpha | ) |

inline

Set the alpha value, which limits the size of the resultant hull segments (the smaller the more detailed the hull).

Parameters

  alpha | positive, non-zero value, defining the maximum length from a vertex to the facet center (center of the voronoi cell).

Definition at line 102 of file concave_hull.h.

References alpha_.

## setDimension()

template<typename PointInT>

void pcl::ConcaveHull< PointInT >::setDimension | ( | int | dimension | ) |

inline

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

Parameters

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

Definition at line 144 of file concave_hull.h.

References dim_, and getClassName().

## setKeepInformation()

template<typename PointInT>

void pcl::ConcaveHull< PointInT >::setKeepInformation | ( | bool | value | ) |

inline

If keep_information_is set to true the convex hull points keep other information like rgb, normals, ...

Parameters

  value | where to keep the information or not, default is false

Definition at line 128 of file concave_hull.h.

References keep_information_.

## setVoronoiCenters()

template<typename PointInT>

void pcl::ConcaveHull< PointInT >::setVoronoiCenters | ( | PointCloudPtr | voronoi_centers | ) |

inline

If set, the voronoi cells center will be saved in voronoi_centers.

Parameters

  voronoi_centers |

Definition at line 118 of file concave_hull.h.

References voronoi_centers_.

## Member Data Documentation

## alpha_

template<typename PointInT>

double pcl::ConcaveHull< PointInT >::alpha_ {0.0}

protected

The method accepts facets only if the distance from any vertex to the facet->center (center of the voronoi cell) is smaller than alpha.

Definition at line 190 of file concave_hull.h.

Referenced by getAlpha(), performReconstruction(), reconstruct(), reconstruct(), and setAlpha().

## dim_

template<typename PointInT>

int pcl::ConcaveHull< PointInT >::dim_ {0}

protected

the dimensionality of the concave hull

Definition at line 201 of file concave_hull.h.

Referenced by getDimension(), performReconstruction(), and setDimension().

## hull_indices_

template<typename PointInT>

pcl::PointIndices pcl::ConcaveHull< PointInT >::hull_indices_

protected

vector containing the point cloud indices of the convex hull points.

Definition at line 204 of file concave_hull.h.

Referenced by getHullPointIndices(), and performReconstruction().

## keep_information_

template<typename PointInT>

bool pcl::ConcaveHull< PointInT >::keep_information_ {false}

protected

If set to true, the reconstructed point cloud describing the hull is obtained from the original input cloud by performing a nearest neighbor search from Qhull output.

Definition at line 195 of file concave_hull.h.

Referenced by getHullPointIndices(), performReconstruction(), and setKeepInformation().

## voronoi_centers_

template<typename PointInT>

PointCloudPtr pcl::ConcaveHull< PointInT >::voronoi_centers_ {nullptr}

protected

the centers of the voronoi cells

Definition at line 198 of file concave_hull.h.

Referenced by performReconstruction(), and setVoronoiCenters().

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

- pcl/surface/concave_hull.h
- pcl/surface/impl/concave_hull.hpp