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

GreedyProjectionTriangulation is an implementation of a greedy triangulation algorithm for 3D points based on local 2D projections. More...

#include <pcl/surface/gp3.h>

+ Inheritance diagram for pcl::GreedyProjectionTriangulation< PointInT >:
+ Collaboration diagram for pcl::GreedyProjectionTriangulation< PointInT >:

Public Types

enum  GP3Type {
  NONE = -1 , FREE = 0 , FRINGE = 1 , BOUNDARY = 2 ,
  COMPLETED = 3
}
 
using Ptr = shared_ptr< GreedyProjectionTriangulation< PointInT > >
 
using ConstPtr = shared_ptr< const GreedyProjectionTriangulation< PointInT > >
 
using KdTree = pcl::KdTree< PointInT >
 
using KdTreePtr = typename KdTree::Ptr
 
using PointCloudIn = pcl::PointCloud< PointInT >
 
using PointCloudInPtr = typename PointCloudIn::Ptr
 
using PointCloudInConstPtr = typename PointCloudIn::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 = pcl::PointCloud< PointInT >
 
using PointCloudPtr = typename PointCloud::Ptr
 
using PointCloudConstPtr = typename PointCloud::ConstPtr
 
using PointIndicesPtr = PointIndices::Ptr
 
using PointIndicesConstPtr = PointIndices::ConstPtr
 

Public Member Functions

 GreedyProjectionTriangulation ()=default
 Empty constructor. More...
 
void setMu (double mu)
 Set the multiplier of the nearest neighbor distance to obtain the final search radius for each point (this will make the algorithm adapt to different point densities in the cloud). More...
 
double getMu () const
 Get the nearest neighbor distance multiplier. More...
 
void setMaximumNearestNeighbors (int nnn)
 Set the maximum number of nearest neighbors to be searched for. More...
 
int getMaximumNearestNeighbors () const
 Get the maximum number of nearest neighbors to be searched for. More...
 
void setSearchRadius (double radius)
 Set the sphere radius that is to be used for determining the k-nearest neighbors used for triangulating. More...
 
double getSearchRadius () const
 Get the sphere radius used for determining the k-nearest neighbors. More...
 
void setMinimumAngle (double minimum_angle)
 Set the minimum angle each triangle should have. More...
 
double getMinimumAngle () const
 Get the parameter for distance based weighting of neighbors. More...
 
void setMaximumAngle (double maximum_angle)
 Set the maximum angle each triangle can have. More...
 
double getMaximumAngle () const
 Get the parameter for distance based weighting of neighbors. More...
 
void setMaximumSurfaceAngle (double eps_angle)
 Don't consider points for triangulation if their normal deviates more than this value from the query point's normal. More...
 
double getMaximumSurfaceAngle () const
 Get the maximum surface angle. More...
 
void setNormalConsistency (bool consistent)
 Set the flag if the input normals are oriented consistently. More...
 
bool getNormalConsistency () const
 Get the flag for consistently oriented normals. More...
 
void setConsistentVertexOrdering (bool consistent_ordering)
 Set the flag to order the resulting triangle vertices consistently (positive direction around normal). More...
 
bool getConsistentVertexOrdering () const
 Get the flag signaling consistently ordered triangle vertices. More...
 
std::vector< int > getPointStates () const
 Get the state of each point after reconstruction. More...
 
std::vector< int > getPartIDs () const
 Get the ID of each point after reconstruction. More...
 
pcl::Indices getSFN () const
 Get the sfn list. More...
 
pcl::Indices getFFN () const
 Get the ffn list. More...
 
- Public Member Functions inherited from pcl::MeshConstruction< PointInT >
 MeshConstruction ()=default
 Constructor. More...
 
 ~MeshConstruction () override=default
 Destructor. More...
 
void reconstruct (pcl::PolygonMesh &output) override
 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...
 
 ~PCLSurfaceBase () override=default
 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 ()=default
 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 (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. More...
 
IndicesPtr 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[] (std::size_t pos) const
 Override PointCloud operator[] to shorten code. More...
 

Protected Attributes

double mu_ {0.0}
 The nearest neighbor distance multiplier to obtain the final search radius. More...
 
double search_radius_ {0.0}
 The nearest neighbors search radius for each point and the maximum edge length. More...
 
int nnn_ {100}
 The maximum number of nearest neighbors accepted by searching. More...
 
double minimum_angle_ {M_PI/18}
 The preferred minimum angle for the triangles. More...
 
double maximum_angle_ {2*M_PI/3}
 The maximum angle for the triangles. More...
 
double eps_angle_ {M_PI/4}
 Maximum surface angle. More...
 
bool consistent_ {false}
 Set this to true if the normals of the input are consistently oriented. More...
 
bool consistent_ordering_ {false}
 Set this to true if the output triangle vertices should be consistently oriented. More...
 
- 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. 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...
 

Additional Inherited Members

- 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...
 

Detailed Description

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

GreedyProjectionTriangulation is an implementation of a greedy triangulation algorithm for 3D points based on local 2D projections.

It assumes locally smooth surfaces and relatively smooth transitions between areas with different point densities.

Template Parameters
PointInTPoint type must have XYZ and normal information, for example pcl::PointNormal or pcl::PointXYZRGBNormal or pcl::PointXYZINormal
Author
Zoltan Csaba Marton

Definition at line 131 of file gp3.h.

Member Typedef Documentation

◆ ConstPtr

template<typename PointInT >
using pcl::GreedyProjectionTriangulation< PointInT >::ConstPtr = shared_ptr<const GreedyProjectionTriangulation<PointInT> >

Definition at line 135 of file gp3.h.

◆ KdTree

template<typename PointInT >
using pcl::GreedyProjectionTriangulation< PointInT >::KdTree = pcl::KdTree<PointInT>

Definition at line 141 of file gp3.h.

◆ KdTreePtr

template<typename PointInT >
using pcl::GreedyProjectionTriangulation< PointInT >::KdTreePtr = typename KdTree::Ptr

Definition at line 142 of file gp3.h.

◆ PointCloudIn

template<typename PointInT >
using pcl::GreedyProjectionTriangulation< PointInT >::PointCloudIn = pcl::PointCloud<PointInT>

Definition at line 144 of file gp3.h.

◆ PointCloudInConstPtr

template<typename PointInT >
using pcl::GreedyProjectionTriangulation< PointInT >::PointCloudInConstPtr = typename PointCloudIn::ConstPtr

Definition at line 146 of file gp3.h.

◆ PointCloudInPtr

template<typename PointInT >
using pcl::GreedyProjectionTriangulation< PointInT >::PointCloudInPtr = typename PointCloudIn::Ptr

Definition at line 145 of file gp3.h.

◆ Ptr

template<typename PointInT >
using pcl::GreedyProjectionTriangulation< PointInT >::Ptr = shared_ptr<GreedyProjectionTriangulation<PointInT> >

Definition at line 134 of file gp3.h.

Member Enumeration Documentation

◆ GP3Type

template<typename PointInT >
enum pcl::GreedyProjectionTriangulation::GP3Type
Enumerator
NONE 
FREE 
FRINGE 
BOUNDARY 
COMPLETED 

Definition at line 148 of file gp3.h.

Constructor & Destructor Documentation

◆ GreedyProjectionTriangulation()

template<typename PointInT >
pcl::GreedyProjectionTriangulation< PointInT >::GreedyProjectionTriangulation ( )
default

Empty constructor.

Member Function Documentation

◆ getConsistentVertexOrdering()

template<typename PointInT >
bool pcl::GreedyProjectionTriangulation< PointInT >::getConsistentVertexOrdering ( ) const
inline

Get the flag signaling consistently ordered triangle vertices.

Definition at line 245 of file gp3.h.

References pcl::GreedyProjectionTriangulation< PointInT >::consistent_ordering_.

◆ getFFN()

template<typename PointInT >
pcl::Indices pcl::GreedyProjectionTriangulation< PointInT >::getFFN ( ) const
inline

Get the ffn list.

Definition at line 266 of file gp3.h.

◆ getMaximumAngle()

template<typename PointInT >
double pcl::GreedyProjectionTriangulation< PointInT >::getMaximumAngle ( ) const
inline

Get the parameter for distance based weighting of neighbors.

Definition at line 212 of file gp3.h.

References pcl::GreedyProjectionTriangulation< PointInT >::maximum_angle_.

◆ getMaximumNearestNeighbors()

template<typename PointInT >
int pcl::GreedyProjectionTriangulation< PointInT >::getMaximumNearestNeighbors ( ) const
inline

Get the maximum number of nearest neighbors to be searched for.

Definition at line 179 of file gp3.h.

References pcl::GreedyProjectionTriangulation< PointInT >::nnn_.

◆ getMaximumSurfaceAngle()

template<typename PointInT >
double pcl::GreedyProjectionTriangulation< PointInT >::getMaximumSurfaceAngle ( ) const
inline

Get the maximum surface angle.

Definition at line 224 of file gp3.h.

References pcl::GreedyProjectionTriangulation< PointInT >::eps_angle_.

◆ getMinimumAngle()

template<typename PointInT >
double pcl::GreedyProjectionTriangulation< PointInT >::getMinimumAngle ( ) const
inline

Get the parameter for distance based weighting of neighbors.

Definition at line 201 of file gp3.h.

References pcl::GreedyProjectionTriangulation< PointInT >::minimum_angle_.

◆ getMu()

template<typename PointInT >
double pcl::GreedyProjectionTriangulation< PointInT >::getMu ( ) const
inline

Get the nearest neighbor distance multiplier.

Definition at line 169 of file gp3.h.

References pcl::GreedyProjectionTriangulation< PointInT >::mu_.

◆ getNormalConsistency()

template<typename PointInT >
bool pcl::GreedyProjectionTriangulation< PointInT >::getNormalConsistency ( ) const
inline

Get the flag for consistently oriented normals.

Definition at line 234 of file gp3.h.

References pcl::GreedyProjectionTriangulation< PointInT >::consistent_.

◆ getPartIDs()

template<typename PointInT >
std::vector<int> pcl::GreedyProjectionTriangulation< PointInT >::getPartIDs ( ) const
inline

Get the ID of each point after reconstruction.

Note
parts are numbered from 0, a -1 denotes unconnected points

Definition at line 257 of file gp3.h.

◆ getPointStates()

template<typename PointInT >
std::vector<int> pcl::GreedyProjectionTriangulation< PointInT >::getPointStates ( ) const
inline

Get the state of each point after reconstruction.

Note
Options are defined as constants: FREE, FRINGE, COMPLETED, BOUNDARY and NONE

Definition at line 251 of file gp3.h.

◆ getSearchRadius()

template<typename PointInT >
double pcl::GreedyProjectionTriangulation< PointInT >::getSearchRadius ( ) const
inline

Get the sphere radius used for determining the k-nearest neighbors.

Definition at line 190 of file gp3.h.

References pcl::GreedyProjectionTriangulation< PointInT >::search_radius_.

◆ getSFN()

template<typename PointInT >
pcl::Indices pcl::GreedyProjectionTriangulation< PointInT >::getSFN ( ) const
inline

Get the sfn list.

Definition at line 262 of file gp3.h.

◆ setConsistentVertexOrdering()

template<typename PointInT >
void pcl::GreedyProjectionTriangulation< PointInT >::setConsistentVertexOrdering ( bool  consistent_ordering)
inline

Set the flag to order the resulting triangle vertices consistently (positive direction around normal).

Note
Assumes consistently oriented normals (towards the viewpoint) – see setNormalConsistency ()
Parameters
[in]consistent_orderingset it to true if triangle vertices should be ordered consistently

Definition at line 241 of file gp3.h.

References pcl::GreedyProjectionTriangulation< PointInT >::consistent_ordering_.

◆ setMaximumAngle()

template<typename PointInT >
void pcl::GreedyProjectionTriangulation< PointInT >::setMaximumAngle ( double  maximum_angle)
inline

Set the maximum angle each triangle can have.

Parameters
[in]maximum_anglethe maximum angle each triangle can have
Note
For best results, its value should be around 120 degrees

Definition at line 208 of file gp3.h.

References pcl::GreedyProjectionTriangulation< PointInT >::maximum_angle_.

◆ setMaximumNearestNeighbors()

template<typename PointInT >
void pcl::GreedyProjectionTriangulation< PointInT >::setMaximumNearestNeighbors ( int  nnn)
inline

Set the maximum number of nearest neighbors to be searched for.

Parameters
[in]nnnthe maximum number of nearest neighbors

Definition at line 175 of file gp3.h.

References pcl::GreedyProjectionTriangulation< PointInT >::nnn_.

◆ setMaximumSurfaceAngle()

template<typename PointInT >
void pcl::GreedyProjectionTriangulation< PointInT >::setMaximumSurfaceAngle ( double  eps_angle)
inline

Don't consider points for triangulation if their normal deviates more than this value from the query point's normal.

Parameters
[in]eps_anglemaximum surface angle
Note
As normal estimation methods usually give smooth transitions at sharp edges, this ensures correct triangulation by avoiding connecting points from one side to points from the other through forcing the use of the edge points.

Definition at line 220 of file gp3.h.

References pcl::GreedyProjectionTriangulation< PointInT >::eps_angle_.

◆ setMinimumAngle()

template<typename PointInT >
void pcl::GreedyProjectionTriangulation< PointInT >::setMinimumAngle ( double  minimum_angle)
inline

Set the minimum angle each triangle should have.

Parameters
[in]minimum_anglethe minimum angle each triangle should have
Note
As this is a greedy approach, this will have to be violated from time to time

Definition at line 197 of file gp3.h.

References pcl::GreedyProjectionTriangulation< PointInT >::minimum_angle_.

◆ setMu()

template<typename PointInT >
void pcl::GreedyProjectionTriangulation< PointInT >::setMu ( double  mu)
inline

Set the multiplier of the nearest neighbor distance to obtain the final search radius for each point (this will make the algorithm adapt to different point densities in the cloud).

Parameters
[in]muthe multiplier

Definition at line 165 of file gp3.h.

References pcl::GreedyProjectionTriangulation< PointInT >::mu_.

◆ setNormalConsistency()

template<typename PointInT >
void pcl::GreedyProjectionTriangulation< PointInT >::setNormalConsistency ( bool  consistent)
inline

Set the flag if the input normals are oriented consistently.

Parameters
[in]consistentset it to true if the normals are consistently oriented

Definition at line 230 of file gp3.h.

References pcl::GreedyProjectionTriangulation< PointInT >::consistent_.

◆ setSearchRadius()

template<typename PointInT >
void pcl::GreedyProjectionTriangulation< PointInT >::setSearchRadius ( double  radius)
inline

Set the sphere radius that is to be used for determining the k-nearest neighbors used for triangulating.

Parameters
[in]radiusthe sphere radius that is to contain all k-nearest neighbors
Note
This distance limits the maximum edge length!

Definition at line 186 of file gp3.h.

References pcl::GreedyProjectionTriangulation< PointInT >::search_radius_.

Member Data Documentation

◆ consistent_

template<typename PointInT >
bool pcl::GreedyProjectionTriangulation< PointInT >::consistent_ {false}
protected

Set this to true if the normals of the input are consistently oriented.

Definition at line 288 of file gp3.h.

Referenced by pcl::GreedyProjectionTriangulation< PointInT >::getNormalConsistency(), and pcl::GreedyProjectionTriangulation< PointInT >::setNormalConsistency().

◆ consistent_ordering_

template<typename PointInT >
bool pcl::GreedyProjectionTriangulation< PointInT >::consistent_ordering_ {false}
protected

Set this to true if the output triangle vertices should be consistently oriented.

Definition at line 291 of file gp3.h.

Referenced by pcl::GreedyProjectionTriangulation< PointInT >::getConsistentVertexOrdering(), and pcl::GreedyProjectionTriangulation< PointInT >::setConsistentVertexOrdering().

◆ eps_angle_

template<typename PointInT >
double pcl::GreedyProjectionTriangulation< PointInT >::eps_angle_ {M_PI/4}
protected

◆ maximum_angle_

template<typename PointInT >
double pcl::GreedyProjectionTriangulation< PointInT >::maximum_angle_ {2*M_PI/3}
protected

◆ minimum_angle_

template<typename PointInT >
double pcl::GreedyProjectionTriangulation< PointInT >::minimum_angle_ {M_PI/18}
protected

The preferred minimum angle for the triangles.

Definition at line 279 of file gp3.h.

Referenced by pcl::GreedyProjectionTriangulation< PointInT >::getMinimumAngle(), and pcl::GreedyProjectionTriangulation< PointInT >::setMinimumAngle().

◆ mu_

template<typename PointInT >
double pcl::GreedyProjectionTriangulation< PointInT >::mu_ {0.0}
protected

The nearest neighbor distance multiplier to obtain the final search radius.

Definition at line 270 of file gp3.h.

Referenced by pcl::GreedyProjectionTriangulation< PointInT >::getMu(), and pcl::GreedyProjectionTriangulation< PointInT >::setMu().

◆ nnn_

template<typename PointInT >
int pcl::GreedyProjectionTriangulation< PointInT >::nnn_ {100}
protected

The maximum number of nearest neighbors accepted by searching.

Definition at line 276 of file gp3.h.

Referenced by pcl::GreedyProjectionTriangulation< PointInT >::getMaximumNearestNeighbors(), and pcl::GreedyProjectionTriangulation< PointInT >::setMaximumNearestNeighbors().

◆ search_radius_

template<typename PointInT >
double pcl::GreedyProjectionTriangulation< PointInT >::search_radius_ {0.0}
protected

The nearest neighbors search radius for each point and the maximum edge length.

Definition at line 273 of file gp3.h.

Referenced by pcl::GreedyProjectionTriangulation< PointInT >::getSearchRadius(), and pcl::GreedyProjectionTriangulation< PointInT >::setSearchRadius().


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