Point Cloud Library (PCL)  1.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Classes | Public Types | Public Member Functions
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 >:
Inheritance graph
[legend]
Collaboration diagram for pcl::GreedyProjectionTriangulation< PointInT >:
Collaboration graph
[legend]

List of all members.

Classes

struct  doubleEdge
 Struct for storing the edges starting from a fringe point.
struct  nnAngle
 Struct for storing the angles to nearest neighbors.

Public Types

enum  {
  NONE = -1, FREE = 0, FRINGE = 1, BOUNDARY = 2,
  COMPLETED = 3
}
typedef pcl::KdTree< PointInT > KdTree
typedef pcl::KdTree< PointInT >
::Ptr 
KdTreePtr
typedef pcl::PointCloud< PointInT > PointCloudIn
typedef PointCloudIn::Ptr PointCloudInPtr
typedef PointCloudIn::ConstPtr PointCloudInConstPtr
typedef pcl::PointCloud< PointInT > PointCloud
typedef PointCloud::Ptr PointCloudPtr
typedef PointCloud::ConstPtr PointCloudConstPtr
typedef PointIndices::Ptr PointIndicesPtr
typedef PointIndices::ConstPtr PointIndicesConstPtr

Public Member Functions

 GreedyProjectionTriangulation ()
 Empty constructor.
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).
double getMu ()
 Get the nearest neighbor distance multiplier.
void setMaximumNearestNeighbors (int nnn)
 Set the maximum number of nearest neighbors to be searched for.
int getMaximumNearestNeighbors ()
 Get the maximum number of nearest neighbors to be searched for.
void setSearchRadius (double radius)
 Set the sphere radius that is to be used for determining the k-nearest neighbors used for triangulating.
double getSearchRadius ()
 Get the sphere radius used for determining the k-nearest neighbors.
void setMinimumAngle (double minimum_angle)
 Set the minimum angle each triangle should have.
double getMinimumAngle ()
 Get the parameter for distance based weighting of neighbors.
void setMaximumAngle (double maximum_angle)
 Set the maximum angle each triangle can have.
double getMaximumAngle ()
 Get the parameter for distance based weighting of neighbors.
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.
double getMaximumSurfaceAngle ()
 Get the maximum surface angle.
void setNormalConsistency (bool consistent)
 Set the flag for consistently oriented normals.
bool getNormalConsistency ()
 Get the flag for consistently oriented normals.
std::vector< int > getPointStates ()
 Get the state of each point after reconstruction.
std::vector< int > getPartIDs ()
 Get the ID of each point after reconstruction.
std::vector< int > getSFN ()
 Get the sfn list.
std::vector< int > getFFN ()
 Get the ffn list.
void removeOverlapTriangles (pcl::PolygonMesh &mesh1, pcl::PolygonMesh &mesh2)
 Remove the triangles from the 1st mesh that have neighbors in the 2nd mesh.
void reconstruct (pcl::PolygonMesh &output)
 Base method for surface reconstruction for all points given in <setInputCloud (), setIndices ()>
void reconstruct (std::vector< pcl::Vertices > &polygons)
 Base method for mesh construction for all points given in <setInputCloud (), setIndices ()>
void setSearchMethod (const KdTreePtr &tree)
 Provide an optional pointer to the search object.
KdTreePtr getSearchMethod ()
 Get a pointer to the search method used.
virtual void setInputCloud (const PointCloudConstPtr &cloud)
 Provide a pointer to the input dataset.
PointCloudConstPtr const getInputCloud ()
 Get a pointer to the input point cloud dataset.
void setIndices (const IndicesPtr &indices)
 Provide a pointer to the vector of indices that represents the input data.
void setIndices (const IndicesConstPtr &indices)
 Provide a pointer to the vector of indices that represents the input data.
void setIndices (const PointIndicesConstPtr &indices)
 Provide a pointer to the vector of indices that represents the input data.
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.
IndicesPtr const getIndices ()
 Get a pointer to the vector of indices used.
const PointInT & operator[] (size_t pos)
 Override PointCloud operator[] to shorten code.

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.

Author:
Zoltan Csaba Marton

Definition at line 148 of file gp3.h.


Member Typedef Documentation

template<typename PointInT >
typedef pcl::KdTree<PointInT> pcl::GreedyProjectionTriangulation< PointInT >::KdTree

Reimplemented from pcl::MeshConstruction< PointInT >.

Definition at line 155 of file gp3.h.

template<typename PointInT >
typedef pcl::KdTree<PointInT>::Ptr pcl::GreedyProjectionTriangulation< PointInT >::KdTreePtr

Reimplemented from pcl::MeshConstruction< PointInT >.

Definition at line 156 of file gp3.h.

typedef pcl::PointCloud<PointInT > pcl::PCLBase< PointInT >::PointCloud [inherited]

Definition at line 76 of file pcl_base.h.

typedef PointCloud::ConstPtr pcl::PCLBase< PointInT >::PointCloudConstPtr [inherited]

Definition at line 78 of file pcl_base.h.

template<typename PointInT >
typedef pcl::PointCloud<PointInT> pcl::GreedyProjectionTriangulation< PointInT >::PointCloudIn

Definition at line 158 of file gp3.h.

template<typename PointInT >
typedef PointCloudIn::ConstPtr pcl::GreedyProjectionTriangulation< PointInT >::PointCloudInConstPtr

Definition at line 160 of file gp3.h.

template<typename PointInT >
typedef PointCloudIn::Ptr pcl::GreedyProjectionTriangulation< PointInT >::PointCloudInPtr

Definition at line 159 of file gp3.h.

typedef PointCloud::Ptr pcl::PCLBase< PointInT >::PointCloudPtr [inherited]

Reimplemented in pcl::OrganizedFastMesh< PointInT >.

Definition at line 77 of file pcl_base.h.

typedef PointIndices::ConstPtr pcl::PCLBase< PointInT >::PointIndicesConstPtr [inherited]

Definition at line 81 of file pcl_base.h.

typedef PointIndices::Ptr pcl::PCLBase< PointInT >::PointIndicesPtr [inherited]

Definition at line 80 of file pcl_base.h.


Member Enumeration Documentation

template<typename PointInT >
anonymous enum
Enumerator:
NONE 
FREE 
FRINGE 
BOUNDARY 
COMPLETED 

Definition at line 164 of file gp3.h.


Constructor & Destructor Documentation

template<typename PointInT >
pcl::GreedyProjectionTriangulation< PointInT >::GreedyProjectionTriangulation ( ) [inline]

Empty constructor.

Definition at line 174 of file gp3.h.


Member Function Documentation

template<typename PointInT >
std::vector<int> pcl::GreedyProjectionTriangulation< PointInT >::getFFN ( ) [inline]

Get the ffn list.

Definition at line 274 of file gp3.h.

IndicesPtr const pcl::PCLBase< PointInT >::getIndices ( ) [inline, inherited]

Get a pointer to the vector of indices used.

Definition at line 192 of file pcl_base.h.

PointCloudConstPtr const pcl::PCLBase< PointInT >::getInputCloud ( ) [inline, inherited]

Get a pointer to the input point cloud dataset.

Definition at line 109 of file pcl_base.h.

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

Get the parameter for distance based weighting of neighbors.

Definition at line 231 of file gp3.h.

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

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

Definition at line 198 of file gp3.h.

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

Get the maximum surface angle.

Definition at line 243 of file gp3.h.

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

Get the parameter for distance based weighting of neighbors.

Definition at line 220 of file gp3.h.

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

Get the nearest neighbor distance multiplier.

Definition at line 188 of file gp3.h.

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

Get the flag for consistently oriented normals.

Definition at line 253 of file gp3.h.

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

Get the ID of each point after reconstruction.

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

Definition at line 265 of file gp3.h.

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

Get the state of each point after reconstruction.

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

Definition at line 259 of file gp3.h.

template<typename PointInT >
KdTreePtr pcl::MeshConstruction< PointInT >::getSearchMethod ( ) [inline, inherited]

Get a pointer to the search method used.

Definition at line 202 of file reconstruction.h.

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

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

Definition at line 209 of file gp3.h.

template<typename PointInT >
std::vector<int> pcl::GreedyProjectionTriangulation< PointInT >::getSFN ( ) [inline]

Get the sfn list.

Definition at line 270 of file gp3.h.

const PointInT & pcl::PCLBase< PointInT >::operator[] ( size_t  pos) [inline, inherited]

Override PointCloud operator[] to shorten code.

Note:
this method can be called instead of (*input_)[(*indices_)[pos]] or input_->points[(*indices_)[pos]]
Parameters:
posposition in indices_ vector

Definition at line 199 of file pcl_base.h.

template<typename PointInT >
void pcl::MeshConstruction< PointInT >::reconstruct ( pcl::PolygonMesh output) [inherited]

Base method for surface reconstruction for all points given in <setInputCloud (), setIndices ()>

Parameters:
[out]outputthe resultant reconstructed surface model
Note:
This method copies the input point cloud data from PointCloud<T> to PointCloud2, and is implemented here for backwards compatibility only!

NOTE: passing in boost shared pointer with * as const& should be OK here

Definition at line 126 of file reconstruction.hpp.

template<typename PointInT >
void pcl::MeshConstruction< PointInT >::reconstruct ( std::vector< pcl::Vertices > &  polygons) [inherited]

Base method for mesh construction for all points given in <setInputCloud (), setIndices ()>

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

Definition at line 166 of file reconstruction.hpp.

template<typename PointInT >
void pcl::GreedyProjectionTriangulation< PointInT >::removeOverlapTriangles ( pcl::PolygonMesh mesh1,
pcl::PolygonMesh mesh2 
)

Remove the triangles from the 1st mesh that have neighbors in the 2nd mesh.

Parameters:
[in,out]mesh1the first polygon mesh
[in,out]mesh2the second polygon mesh

Definition at line 1645 of file gp3.hpp.

void pcl::PCLBase< PointInT >::setIndices ( const IndicesPtr indices) [inline, inherited]

Provide a pointer to the vector of indices that represents the input data.

Parameters:
indicesa pointer to the vector of indices that represents the input data.

Definition at line 115 of file pcl_base.h.

void pcl::PCLBase< PointInT >::setIndices ( const IndicesConstPtr indices) [inline, inherited]

Provide a pointer to the vector of indices that represents the input data.

Parameters:
indicesa pointer to the vector of indices that represents the input data.

Definition at line 126 of file pcl_base.h.

void pcl::PCLBase< PointInT >::setIndices ( const PointIndicesConstPtr indices) [inline, inherited]

Provide a pointer to the vector of indices that represents the input data.

Parameters:
indicesa pointer to the vector of indices that represents the input data.

Definition at line 137 of file pcl_base.h.

void pcl::PCLBase< PointInT >::setIndices ( size_t  row_start,
size_t  col_start,
size_t  nb_rows,
size_t  nb_cols 
) [inline, inherited]

Set the indices for the points laying within an interest region of the point cloud.

Note:
you shouldn't call this method on unorganized point clouds!
Parameters:
row_startthe offset on rows
col_startthe offset on columns
nb_rowsthe number of rows to be considered row_start included
nb_colsthe number of columns to be considered col_start included

Definition at line 153 of file pcl_base.h.

virtual void pcl::PCLBase< PointInT >::setInputCloud ( const PointCloudConstPtr cloud) [inline, virtual, inherited]

Provide a pointer to the input dataset.

Parameters:
cloudthe const boost shared pointer to a PointCloud message

Definition at line 105 of file pcl_base.h.

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 227 of file gp3.h.

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 194 of file gp3.h.

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 239 of file gp3.h.

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 216 of file gp3.h.

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 184 of file gp3.h.

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

Set the flag for consistently oriented normals.

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

Definition at line 249 of file gp3.h.

template<typename PointInT >
void pcl::MeshConstruction< PointInT >::setSearchMethod ( const KdTreePtr tree) [inline, inherited]

Provide an optional pointer to the search object.

Parameters:
[in]treea pointer to the spatial search object.

Definition at line 195 of file reconstruction.h.

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 205 of file gp3.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines