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

MovingLeastSquares represent an implementation of the MLS (Moving Least Squares) algorithm for data smoothing and improved normal estimation. More...

#include <pcl/surface/mls.h>

+ Inheritance diagram for pcl::MovingLeastSquares< PointInT, PointOutT >:

Classes

class  MLSVoxelGrid
 A minimalistic implementation of a voxel grid, necessary for the point cloud upsampling. More...
 

Public Types

enum  UpsamplingMethod {
  NONE, DISTINCT_CLOUD, SAMPLE_LOCAL_PLANE, RANDOM_UNIFORM_DENSITY,
  VOXEL_GRID_DILATION
}
 
typedef boost::shared_ptr
< MovingLeastSquares< PointInT,
PointOutT > > 
Ptr
 
typedef boost::shared_ptr
< const MovingLeastSquares
< PointInT, PointOutT > > 
ConstPtr
 
typedef pcl::search::Search
< PointInT > 
KdTree
 
typedef pcl::search::Search
< PointInT >::Ptr 
KdTreePtr
 
typedef pcl::PointCloud
< pcl::Normal
NormalCloud
 
typedef pcl::PointCloud
< pcl::Normal >::Ptr 
NormalCloudPtr
 
typedef pcl::PointCloud
< PointOutT > 
PointCloudOut
 
typedef PointCloudOut::Ptr PointCloudOutPtr
 
typedef PointCloudOut::ConstPtr PointCloudOutConstPtr
 
typedef pcl::PointCloud< PointInT > PointCloudIn
 
typedef PointCloudIn::Ptr PointCloudInPtr
 
typedef PointCloudIn::ConstPtr PointCloudInConstPtr
 
typedef boost::function< int(int,
double, std::vector< int >
&, std::vector< float > &)> 
SearchMethod
 
- Public Types inherited from pcl::CloudSurfaceProcessing< PointInT, PointOutT >
typedef boost::shared_ptr
< CloudSurfaceProcessing
< PointInT, PointOutT > > 
Ptr
 
typedef boost::shared_ptr
< const CloudSurfaceProcessing
< PointInT, PointOutT > > 
ConstPtr
 
- 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

 MovingLeastSquares ()
 Empty constructor. More...
 
virtual ~MovingLeastSquares ()
 Empty destructor. More...
 
void setComputeNormals (bool compute_normals)
 Set whether the algorithm should also store the normals computed. More...
 
void setSearchMethod (const KdTreePtr &tree)
 Provide a pointer to the search object. More...
 
KdTreePtr getSearchMethod () const
 Get a pointer to the search method used. More...
 
void setPolynomialOrder (int order)
 Set the order of the polynomial to be fit. More...
 
int getPolynomialOrder () const
 Get the order of the polynomial to be fit. More...
 
void setPolynomialFit (bool polynomial_fit)
 Sets whether the surface and normal are approximated using a polynomial, or only via tangent estimation. More...
 
bool getPolynomialFit () const
 Get the polynomial_fit value (true if the surface and normal are approximated using a polynomial). More...
 
void setSearchRadius (double radius)
 Set the sphere radius that is to be used for determining the k-nearest neighbors used for fitting. More...
 
double getSearchRadius () const
 Get the sphere radius used for determining the k-nearest neighbors. More...
 
void setSqrGaussParam (double sqr_gauss_param)
 Set the parameter used for distance based weighting of neighbors (the square of the search radius works best in general). More...
 
double getSqrGaussParam () const
 Get the parameter for distance based weighting of neighbors. More...
 
void setUpsamplingMethod (UpsamplingMethod method)
 Set the upsampling method to be used. More...
 
void setDistinctCloud (PointCloudInConstPtr distinct_cloud)
 Set the distinct cloud used for the DISTINCT_CLOUD upsampling method. More...
 
PointCloudInConstPtr getDistinctCloud () const
 Get the distinct cloud used for the DISTINCT_CLOUD upsampling method. More...
 
void setUpsamplingRadius (double radius)
 Set the radius of the circle in the local point plane that will be sampled. More...
 
double getUpsamplingRadius () const
 Get the radius of the circle in the local point plane that will be sampled. More...
 
void setUpsamplingStepSize (double step_size)
 Set the step size for the local plane sampling. More...
 
double getUpsamplingStepSize () const
 Get the step size for the local plane sampling. More...
 
void setPointDensity (int desired_num_points_in_radius)
 Set the parameter that specifies the desired number of points within the search radius. More...
 
int getPointDensity () const
 Get the parameter that specifies the desired number of points within the search radius. More...
 
void setDilationVoxelSize (float voxel_size)
 Set the voxel size for the voxel grid. More...
 
float getDilationVoxelSize () const
 Get the voxel size for the voxel grid. More...
 
void setDilationIterations (int iterations)
 Set the number of dilation steps of the voxel grid. More...
 
int getDilationIterations () const
 Get the number of dilation steps of the voxel grid. More...
 
void setCacheMLSResults (bool cache_mls_results)
 Set wether the mls results should be stored for each point in the input cloud. More...
 
bool getCacheMLSResults () const
 Get the cache_mls_results_ value (True if the mls results should be stored, otherwise false). More...
 
void setProjectionMethod (MLSResult::ProjectionMethod method)
 Set the method to be used when projection the point on to the MLS surface. More...
 
MLSResult::ProjectionMethod getProjectionMethod () const
 Get the current projection method being used. More...
 
const std::vector< MLSResult > & getMLSResults () const
 Get the MLSResults for input cloud. More...
 
void process (PointCloudOut &output)
 Base method for surface reconstruction for all points given in <setInputCloud (), setIndices ()> More...
 
PointIndicesPtr getCorrespondingIndices () const
 Get the set of indices with each point in output having the corresponding point in input. More...
 
- Public Member Functions inherited from pcl::CloudSurfaceProcessing< PointInT, PointOutT >
 CloudSurfaceProcessing ()
 Constructor. More...
 
virtual ~CloudSurfaceProcessing ()
 Empty destructor. 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

int searchForNeighbors (int index, std::vector< int > &indices, std::vector< float > &sqr_distances) const
 Search for the closest nearest neighbors of a given point using a radius search. More...
 
void computeMLSPointNormal (int index, const std::vector< int > &nn_indices, PointCloudOut &projected_points, NormalCloud &projected_points_normals, PointIndices &corresponding_input_indices, MLSResult &mls_result) const
 Smooth a given point and its neighborghood using Moving Least Squares. More...
 
void addProjectedPointNormal (int index, const Eigen::Vector3d &point, const Eigen::Vector3d &normal, double curvature, PointCloudOut &projected_points, NormalCloud &projected_points_normals, PointIndices &corresponding_input_indices) const
 This is a helper function for add projected points. More...
 
void copyMissingFields (const PointInT &point_in, PointOutT &point_out) const
 
virtual void performProcessing (PointCloudOut &output)
 Abstract surface reconstruction method. More...
 
void performUpsampling (PointCloudOut &output)
 Perform upsampling for the distinct-cloud and voxel-grid methods. 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

NormalCloudPtr normals_
 The point cloud that will hold the estimated normals, if set. More...
 
PointCloudInConstPtr distinct_cloud_
 The distinct point cloud that will be projected to the MLS surface. More...
 
SearchMethod search_method_
 The search method template for indices. More...
 
KdTreePtr tree_
 A pointer to the spatial search object. More...
 
int order_
 The order of the polynomial to be fit. More...
 
double search_radius_
 The nearest neighbors search radius for each point. More...
 
double sqr_gauss_param_
 Parameter for distance based weighting of neighbors (search_radius_ * search_radius_ works fine) More...
 
bool compute_normals_
 Parameter that specifies whether the normals should be computed for the input cloud or not. More...
 
UpsamplingMethod upsample_method_
 Parameter that specifies the upsampling method to be used. More...
 
double upsampling_radius_
 Radius of the circle in the local point plane that will be sampled. More...
 
double upsampling_step_
 Step size for the local plane sampling. More...
 
int desired_num_points_in_radius_
 Parameter that specifies the desired number of points within the search radius. More...
 
bool cache_mls_results_
 True if the mls results for the input cloud should be stored. More...
 
std::vector< MLSResultmls_results_
 Stores the MLS result for each point in the input cloud. More...
 
MLSResult::ProjectionMethod projection_method_
 Parameter that specifies the projection method to be used. More...
 
float voxel_size_
 Voxel size for the VOXEL_GRID_DILATION upsampling method. More...
 
int dilation_iteration_num_
 Number of dilation steps for the VOXEL_GRID_DILATION upsampling method. More...
 
int nr_coeff_
 Number of coefficients, to be computed from the requested order. More...
 
PointIndicesPtr corresponding_input_indices_
 Collects for each point in output the corrseponding point in the input. 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, typename PointOutT>
class pcl::MovingLeastSquares< PointInT, PointOutT >

MovingLeastSquares represent an implementation of the MLS (Moving Least Squares) algorithm for data smoothing and improved normal estimation.

It also contains methods for upsampling the resulting cloud based on the parametric fit. Reference paper: "Computing and Rendering Point Set Surfaces" by Marc Alexa, Johannes Behr, Daniel Cohen-Or, Shachar Fleishman, David Levin and Claudio T. Silva www.sci.utah.edu/~shachar/Publications/crpss.pdf

Author
Zoltan Csaba Marton, Radu B. Rusu, Alexandru E. Ichim, Suat Gedikli

Definition at line 245 of file mls.h.

Member Typedef Documentation

template<typename PointInT, typename PointOutT>
typedef boost::shared_ptr<const MovingLeastSquares<PointInT, PointOutT> > pcl::MovingLeastSquares< PointInT, PointOutT >::ConstPtr

Definition at line 249 of file mls.h.

template<typename PointInT, typename PointOutT>
typedef pcl::search::Search<PointInT> pcl::MovingLeastSquares< PointInT, PointOutT >::KdTree

Definition at line 257 of file mls.h.

template<typename PointInT, typename PointOutT>
typedef pcl::search::Search<PointInT>::Ptr pcl::MovingLeastSquares< PointInT, PointOutT >::KdTreePtr

Definition at line 258 of file mls.h.

template<typename PointInT, typename PointOutT>
typedef pcl::PointCloud<pcl::Normal> pcl::MovingLeastSquares< PointInT, PointOutT >::NormalCloud

Definition at line 259 of file mls.h.

template<typename PointInT, typename PointOutT>
typedef pcl::PointCloud<pcl::Normal>::Ptr pcl::MovingLeastSquares< PointInT, PointOutT >::NormalCloudPtr

Definition at line 260 of file mls.h.

template<typename PointInT, typename PointOutT>
typedef pcl::PointCloud<PointInT> pcl::MovingLeastSquares< PointInT, PointOutT >::PointCloudIn

Definition at line 266 of file mls.h.

template<typename PointInT, typename PointOutT>
typedef PointCloudIn::ConstPtr pcl::MovingLeastSquares< PointInT, PointOutT >::PointCloudInConstPtr

Definition at line 268 of file mls.h.

template<typename PointInT, typename PointOutT>
typedef PointCloudIn::Ptr pcl::MovingLeastSquares< PointInT, PointOutT >::PointCloudInPtr

Definition at line 267 of file mls.h.

template<typename PointInT, typename PointOutT>
typedef pcl::PointCloud<PointOutT> pcl::MovingLeastSquares< PointInT, PointOutT >::PointCloudOut

Definition at line 262 of file mls.h.

template<typename PointInT, typename PointOutT>
typedef PointCloudOut::ConstPtr pcl::MovingLeastSquares< PointInT, PointOutT >::PointCloudOutConstPtr

Definition at line 264 of file mls.h.

template<typename PointInT, typename PointOutT>
typedef PointCloudOut::Ptr pcl::MovingLeastSquares< PointInT, PointOutT >::PointCloudOutPtr

Definition at line 263 of file mls.h.

template<typename PointInT, typename PointOutT>
typedef boost::shared_ptr<MovingLeastSquares<PointInT, PointOutT> > pcl::MovingLeastSquares< PointInT, PointOutT >::Ptr

Definition at line 248 of file mls.h.

template<typename PointInT, typename PointOutT>
typedef boost::function<int (int, double, std::vector<int> &, std::vector<float> &)> pcl::MovingLeastSquares< PointInT, PointOutT >::SearchMethod

Definition at line 270 of file mls.h.

Member Enumeration Documentation

template<typename PointInT, typename PointOutT>
enum pcl::MovingLeastSquares::UpsamplingMethod
Enumerator
NONE 

No upsampling will be done, only the input points will be projected to their own MLS surfaces.

DISTINCT_CLOUD 

Project the points of the distinct cloud to the MLS surface.

SAMPLE_LOCAL_PLANE 

The local plane of each input point will be sampled in a circular fashion using the upsampling_radius_ and the upsampling_step_ parameters.

RANDOM_UNIFORM_DENSITY 

The local plane of each input point will be sampled using an uniform random distribution such that the density of points is constant throughout the cloud - given by the desired_num_points_in_radius_ parameter.

VOXEL_GRID_DILATION 

The input cloud will be inserted into a voxel grid with voxels of size voxel_size_; this voxel grid will be dilated dilation_iteration_num_ times and the resulting points will be projected to the MLS surface of the closest point in the input cloud; the result is a point cloud with filled holes and a constant point density.

Definition at line 272 of file mls.h.

Constructor & Destructor Documentation

template<typename PointInT, typename PointOutT>
pcl::MovingLeastSquares< PointInT, PointOutT >::MovingLeastSquares ( )
inline

Empty constructor.

Definition at line 290 of file mls.h.

template<typename PointInT, typename PointOutT>
virtual pcl::MovingLeastSquares< PointInT, PointOutT >::~MovingLeastSquares ( )
inlinevirtual

Empty destructor.

Definition at line 315 of file mls.h.

Member Function Documentation

template<typename PointInT , typename PointOutT >
void pcl::MovingLeastSquares< PointInT, PointOutT >::addProjectedPointNormal ( int  index,
const Eigen::Vector3d &  point,
const Eigen::Vector3d &  normal,
double  curvature,
PointCloudOut projected_points,
NormalCloud projected_points_normals,
PointIndices corresponding_input_indices 
) const
protected

This is a helper function for add projected points.

Parameters
[in]indexthe index of the query point in the input cloud
[in]pointthe projected point to be added
[in]normalthe projected point's normal to be added
[in]curvaturethe projected point's curvature
[out]projected_pointsthe set of projected points around the query point
[out]projected_points_normalsthe normals corresponding to the projected points
[out]corresponding_input_indicesthe set of indices with each point in output having the corresponding point in input

Definition at line 250 of file mls.hpp.

References pcl::_Normal::curvature, pcl::PointIndices::indices, and pcl::PointCloud< T >::push_back().

template<typename PointInT , typename PointOutT >
void pcl::MovingLeastSquares< PointInT, PointOutT >::computeMLSPointNormal ( int  index,
const std::vector< int > &  nn_indices,
PointCloudOut projected_points,
NormalCloud projected_points_normals,
PointIndices corresponding_input_indices,
MLSResult mls_result 
) const
protected

Smooth a given point and its neighborghood using Moving Least Squares.

Parameters
[in]indexthe index of the query point in the input cloud
[in]nn_indicesthe set of nearest neighbors indices for pt
[out]projected_pointsthe set of points projected points around the query point (in the case of upsampling method NONE, only the query point projected to its own fitted surface will be returned, in the case of the other upsampling methods, multiple points will be returned)
[out]projected_points_normalsthe normals corresponding to the projected points
[out]corresponding_input_indicesthe set of indices with each point in output having the corresponding point in input
[out]mls_resultstores the MLS result for each point in the input cloud (used only in the case of VOXEL_GRID_DILATION or DISTINCT_CLOUD upsampling)

Definition at line 172 of file mls.hpp.

References pcl::MLSResult::computeMLSSurface(), pcl::MLSResult::curvature, pcl::MLSResult::MLSProjectionResults::normal, pcl::MLSResult::num_neighbors, pcl::MLSResult::MLSProjectionResults::point, pcl::MLSResult::projectPointSimpleToPolynomialSurface(), pcl::MLSResult::projectPointToMLSPlane(), and pcl::MLSResult::projectQueryPoint().

template<typename PointInT , typename PointOutT >
void pcl::MovingLeastSquares< PointInT, PointOutT >::copyMissingFields ( const PointInT &  point_in,
PointOutT &  point_out 
) const
protected

Definition at line 922 of file mls.hpp.

References pcl::copyPoint().

template<typename PointInT, typename PointOutT>
bool pcl::MovingLeastSquares< PointInT, PointOutT >::getCacheMLSResults ( ) const
inline

Get the cache_mls_results_ value (True if the mls results should be stored, otherwise false).

Definition at line 492 of file mls.h.

References pcl::MovingLeastSquares< PointInT, PointOutT >::cache_mls_results_.

template<typename PointInT, typename PointOutT>
PointIndicesPtr pcl::MovingLeastSquares< PointInT, PointOutT >::getCorrespondingIndices ( ) const
inline

Get the set of indices with each point in output having the corresponding point in input.

Definition at line 523 of file mls.h.

References pcl::MovingLeastSquares< PointInT, PointOutT >::corresponding_input_indices_.

template<typename PointInT, typename PointOutT>
int pcl::MovingLeastSquares< PointInT, PointOutT >::getDilationIterations ( ) const
inline

Get the number of dilation steps of the voxel grid.

Note
Used only in the VOXEL_GRID_DILATION upsampling method

Definition at line 480 of file mls.h.

References pcl::MovingLeastSquares< PointInT, PointOutT >::dilation_iteration_num_.

template<typename PointInT, typename PointOutT>
float pcl::MovingLeastSquares< PointInT, PointOutT >::getDilationVoxelSize ( ) const
inline

Get the voxel size for the voxel grid.

Note
Used only in the VOXEL_GRID_DILATION upsampling method

Definition at line 467 of file mls.h.

References pcl::MovingLeastSquares< PointInT, PointOutT >::voxel_size_.

template<typename PointInT, typename PointOutT>
PointCloudInConstPtr pcl::MovingLeastSquares< PointInT, PointOutT >::getDistinctCloud ( ) const
inline

Get the distinct cloud used for the DISTINCT_CLOUD upsampling method.

Definition at line 410 of file mls.h.

References pcl::MovingLeastSquares< PointInT, PointOutT >::distinct_cloud_.

template<typename PointInT, typename PointOutT>
const std::vector<MLSResult>& pcl::MovingLeastSquares< PointInT, PointOutT >::getMLSResults ( ) const
inline

Get the MLSResults for input cloud.

Note
The results are only stored if setCacheMLSResults(true) was called or when using the upsampling method DISTINCT_CLOUD or VOXEL_GRID_DILATION.
This vector is align with the input cloud indicies, so use getCorrespondingIndices to get the correct results when using output cloud indicies.

Definition at line 511 of file mls.h.

References pcl::MovingLeastSquares< PointInT, PointOutT >::mls_results_.

template<typename PointInT, typename PointOutT>
int pcl::MovingLeastSquares< PointInT, PointOutT >::getPointDensity ( ) const
inline

Get the parameter that specifies the desired number of points within the search radius.

Note
Used only in the case of RANDOM_UNIFORM_DENSITY upsampling

Definition at line 453 of file mls.h.

References pcl::MovingLeastSquares< PointInT, PointOutT >::desired_num_points_in_radius_.

template<typename PointInT, typename PointOutT>
bool pcl::MovingLeastSquares< PointInT, PointOutT >::getPolynomialFit ( ) const
inline

Get the polynomial_fit value (true if the surface and normal are approximated using a polynomial).

Definition at line 374 of file mls.h.

References pcl::MovingLeastSquares< PointInT, PointOutT >::order_.

template<typename PointInT, typename PointOutT>
int pcl::MovingLeastSquares< PointInT, PointOutT >::getPolynomialOrder ( ) const
inline

Get the order of the polynomial to be fit.

Definition at line 349 of file mls.h.

References pcl::MovingLeastSquares< PointInT, PointOutT >::order_.

template<typename PointInT, typename PointOutT>
MLSResult::ProjectionMethod pcl::MovingLeastSquares< PointInT, PointOutT >::getProjectionMethod ( ) const
inline

Get the current projection method being used.

Definition at line 504 of file mls.h.

References pcl::MovingLeastSquares< PointInT, PointOutT >::projection_method_.

template<typename PointInT, typename PointOutT>
KdTreePtr pcl::MovingLeastSquares< PointInT, PointOutT >::getSearchMethod ( ) const
inline

Get a pointer to the search method used.

Definition at line 338 of file mls.h.

References pcl::MovingLeastSquares< PointInT, PointOutT >::tree_.

template<typename PointInT, typename PointOutT>
double pcl::MovingLeastSquares< PointInT, PointOutT >::getSearchRadius ( ) const
inline

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

Definition at line 385 of file mls.h.

References pcl::MovingLeastSquares< PointInT, PointOutT >::search_radius_.

template<typename PointInT, typename PointOutT>
double pcl::MovingLeastSquares< PointInT, PointOutT >::getSqrGaussParam ( ) const
inline

Get the parameter for distance based weighting of neighbors.

Definition at line 396 of file mls.h.

References pcl::MovingLeastSquares< PointInT, PointOutT >::sqr_gauss_param_.

template<typename PointInT, typename PointOutT>
double pcl::MovingLeastSquares< PointInT, PointOutT >::getUpsamplingRadius ( ) const
inline

Get the radius of the circle in the local point plane that will be sampled.

Note
Used only in the case of SAMPLE_LOCAL_PLANE upsampling

Definition at line 424 of file mls.h.

References pcl::MovingLeastSquares< PointInT, PointOutT >::upsampling_radius_.

template<typename PointInT, typename PointOutT>
double pcl::MovingLeastSquares< PointInT, PointOutT >::getUpsamplingStepSize ( ) const
inline

Get the step size for the local plane sampling.

Note
Used only in the case of SAMPLE_LOCAL_PLANE upsampling

Definition at line 438 of file mls.h.

References pcl::MovingLeastSquares< PointInT, PointOutT >::upsampling_step_.

template<typename PointInT , typename PointOutT >
void pcl::MovingLeastSquares< PointInT, PointOutT >::performProcessing ( PointCloudOut output)
protectedvirtual

Abstract surface reconstruction method.

Parameters
[out]outputthe result of the reconstruction

Implements pcl::CloudSurfaceProcessing< PointInT, PointOutT >.

Definition at line 282 of file mls.hpp.

References pcl::PointCloud< T >::begin(), pcl::PointCloud< T >::end(), and pcl::PointCloud< T >::insert().

template<typename PointInT , typename PointOutT >
void pcl::MovingLeastSquares< PointInT, PointOutT >::performUpsampling ( PointCloudOut output)
protected

Perform upsampling for the distinct-cloud and voxel-grid methods.

Parameters
[out]outputthe result of the reconstruction

Definition at line 400 of file mls.hpp.

References pcl::MovingLeastSquares< PointInT, PointOutT >::MLSVoxelGrid::dilate(), pcl::MovingLeastSquares< PointInT, PointOutT >::MLSVoxelGrid::getPosition(), and pcl::MovingLeastSquares< PointInT, PointOutT >::MLSVoxelGrid::voxel_grid_.

template<typename PointInT , typename PointOutT >
void pcl::MovingLeastSquares< PointInT, PointOutT >::process ( PointCloudOut output)
virtual

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

Parameters
[out]outputthe resultant reconstructed surface model

Reimplemented from pcl::CloudSurfaceProcessing< PointInT, PointOutT >.

Definition at line 58 of file mls.hpp.

References pcl::PointCloud< T >::header, pcl::PointCloud< T >::height, pcl::PointCloud< T >::points, pcl::PointCloud< T >::size(), and pcl::PointCloud< T >::width.

template<typename PointInT, typename PointOutT>
int pcl::MovingLeastSquares< PointInT, PointOutT >::searchForNeighbors ( int  index,
std::vector< int > &  indices,
std::vector< float > &  sqr_distances 
) const
inlineprotected

Search for the closest nearest neighbors of a given point using a radius search.

Parameters
[in]indexthe index of the query point
[out]indicesthe resultant vector of indices representing the k-nearest neighbors
[out]sqr_distancesthe resultant squared distances from the query point to the k-nearest neighbors

Definition at line 656 of file mls.h.

References pcl::MovingLeastSquares< PointInT, PointOutT >::search_method_, and pcl::MovingLeastSquares< PointInT, PointOutT >::search_radius_.

template<typename PointInT, typename PointOutT>
void pcl::MovingLeastSquares< PointInT, PointOutT >::setCacheMLSResults ( bool  cache_mls_results)
inline

Set wether the mls results should be stored for each point in the input cloud.

Parameters
[in]Trueif the mls results should be stored, otherwise false.
Note
The cache_mls_results_ is forced to true when using upsampling method VOXEL_GRID_DILATION or DISTINCT_CLOUD.
If memory consumption is a concern set to false when not using upsampling method VOXEL_GRID_DILATION or DISTINCT_CLOUD.

Definition at line 488 of file mls.h.

References pcl::MovingLeastSquares< PointInT, PointOutT >::cache_mls_results_.

template<typename PointInT, typename PointOutT>
void pcl::MovingLeastSquares< PointInT, PointOutT >::setComputeNormals ( bool  compute_normals)
inline

Set whether the algorithm should also store the normals computed.

Note
This is optional, but need a proper output cloud type

Definition at line 322 of file mls.h.

References pcl::MovingLeastSquares< PointInT, PointOutT >::compute_normals_.

template<typename PointInT, typename PointOutT>
void pcl::MovingLeastSquares< PointInT, PointOutT >::setDilationIterations ( int  iterations)
inline

Set the number of dilation steps of the voxel grid.

Note
Used only in the VOXEL_GRID_DILATION upsampling method
Parameters
[in]iterationsthe number of dilation iterations

Definition at line 474 of file mls.h.

References pcl::MovingLeastSquares< PointInT, PointOutT >::dilation_iteration_num_.

template<typename PointInT, typename PointOutT>
void pcl::MovingLeastSquares< PointInT, PointOutT >::setDilationVoxelSize ( float  voxel_size)
inline

Set the voxel size for the voxel grid.

Note
Used only in the VOXEL_GRID_DILATION upsampling method
Parameters
[in]voxel_sizethe edge length of a cubic voxel in the voxel grid

Definition at line 460 of file mls.h.

References pcl::MovingLeastSquares< PointInT, PointOutT >::voxel_size_.

template<typename PointInT, typename PointOutT>
void pcl::MovingLeastSquares< PointInT, PointOutT >::setDistinctCloud ( PointCloudInConstPtr  distinct_cloud)
inline

Set the distinct cloud used for the DISTINCT_CLOUD upsampling method.

Definition at line 406 of file mls.h.

References pcl::MovingLeastSquares< PointInT, PointOutT >::distinct_cloud_.

template<typename PointInT, typename PointOutT>
void pcl::MovingLeastSquares< PointInT, PointOutT >::setPointDensity ( int  desired_num_points_in_radius)
inline

Set the parameter that specifies the desired number of points within the search radius.

Note
Used only in the case of RANDOM_UNIFORM_DENSITY upsampling
Parameters
[in]desired_num_points_in_radiusthe desired number of points in the output cloud in a sphere of radius search_radius_ around each point

Definition at line 446 of file mls.h.

References pcl::MovingLeastSquares< PointInT, PointOutT >::desired_num_points_in_radius_.

template<typename PointInT, typename PointOutT>
void pcl::MovingLeastSquares< PointInT, PointOutT >::setPolynomialFit ( bool  polynomial_fit)
inline

Sets whether the surface and normal are approximated using a polynomial, or only via tangent estimation.

Parameters
[in]polynomial_fitset to true for polynomial fit

Definition at line 356 of file mls.h.

References pcl::MovingLeastSquares< PointInT, PointOutT >::order_.

template<typename PointInT, typename PointOutT>
void pcl::MovingLeastSquares< PointInT, PointOutT >::setPolynomialOrder ( int  order)
inline

Set the order of the polynomial to be fit.

Parameters
[in]orderthe order of the polynomial
Note
Setting order > 1 indicates using a plynomial fit.

Definition at line 345 of file mls.h.

References pcl::MovingLeastSquares< PointInT, PointOutT >::order_.

template<typename PointInT, typename PointOutT>
void pcl::MovingLeastSquares< PointInT, PointOutT >::setProjectionMethod ( MLSResult::ProjectionMethod  method)
inline

Set the method to be used when projection the point on to the MLS surface.

Parameters
method
Note
This is only used when polynomial fit is enabled.

Definition at line 499 of file mls.h.

References pcl::MovingLeastSquares< PointInT, PointOutT >::projection_method_.

template<typename PointInT, typename PointOutT>
void pcl::MovingLeastSquares< PointInT, PointOutT >::setSearchMethod ( const KdTreePtr tree)
inline

Provide a pointer to the search object.

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

Definition at line 328 of file mls.h.

References pcl::search::Search< PointInT >::radiusSearch(), pcl::MovingLeastSquares< PointInT, PointOutT >::search_method_, and pcl::MovingLeastSquares< PointInT, PointOutT >::tree_.

template<typename PointInT, typename PointOutT>
void pcl::MovingLeastSquares< PointInT, PointOutT >::setSearchRadius ( double  radius)
inline

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

Parameters
[in]radiusthe sphere radius that is to contain all k-nearest neighbors
Note
Calling this method resets the squared Gaussian parameter to radius * radius !

Definition at line 381 of file mls.h.

References pcl::MovingLeastSquares< PointInT, PointOutT >::search_radius_, and pcl::MovingLeastSquares< PointInT, PointOutT >::sqr_gauss_param_.

template<typename PointInT, typename PointOutT>
void pcl::MovingLeastSquares< PointInT, PointOutT >::setSqrGaussParam ( double  sqr_gauss_param)
inline

Set the parameter used for distance based weighting of neighbors (the square of the search radius works best in general).

Parameters
[in]sqr_gauss_paramthe squared Gaussian parameter

Definition at line 392 of file mls.h.

References pcl::MovingLeastSquares< PointInT, PointOutT >::sqr_gauss_param_.

template<typename PointInT, typename PointOutT>
void pcl::MovingLeastSquares< PointInT, PointOutT >::setUpsamplingMethod ( UpsamplingMethod  method)
inline

Set the upsampling method to be used.

Parameters
method

Definition at line 402 of file mls.h.

References pcl::MovingLeastSquares< PointInT, PointOutT >::upsample_method_.

template<typename PointInT, typename PointOutT>
void pcl::MovingLeastSquares< PointInT, PointOutT >::setUpsamplingRadius ( double  radius)
inline

Set the radius of the circle in the local point plane that will be sampled.

Note
Used only in the case of SAMPLE_LOCAL_PLANE upsampling
Parameters
[in]radiusthe radius of the circle

Definition at line 418 of file mls.h.

References pcl::MovingLeastSquares< PointInT, PointOutT >::upsampling_radius_.

template<typename PointInT, typename PointOutT>
void pcl::MovingLeastSquares< PointInT, PointOutT >::setUpsamplingStepSize ( double  step_size)
inline

Set the step size for the local plane sampling.

Note
Used only in the case of SAMPLE_LOCAL_PLANE upsampling
Parameters
[in]step_sizethe step size

Definition at line 431 of file mls.h.

References pcl::MovingLeastSquares< PointInT, PointOutT >::upsampling_step_.

Member Data Documentation

template<typename PointInT, typename PointOutT>
bool pcl::MovingLeastSquares< PointInT, PointOutT >::cache_mls_results_
protected

True if the mls results for the input cloud should be stored.

Note
This is forced to true when using upsampling methods VOXEL_GRID_DILATION or DISTINCT_CLOUD.

Definition at line 571 of file mls.h.

Referenced by pcl::MovingLeastSquares< PointInT, PointOutT >::getCacheMLSResults(), and pcl::MovingLeastSquares< PointInT, PointOutT >::setCacheMLSResults().

template<typename PointInT, typename PointOutT>
bool pcl::MovingLeastSquares< PointInT, PointOutT >::compute_normals_
protected

Parameter that specifies whether the normals should be computed for the input cloud or not.

Definition at line 548 of file mls.h.

Referenced by pcl::MovingLeastSquares< PointInT, PointOutT >::setComputeNormals().

template<typename PointInT, typename PointOutT>
PointIndicesPtr pcl::MovingLeastSquares< PointInT, PointOutT >::corresponding_input_indices_
protected

Collects for each point in output the corrseponding point in the input.

Definition at line 648 of file mls.h.

Referenced by pcl::MovingLeastSquares< PointInT, PointOutT >::getCorrespondingIndices().

template<typename PointInT, typename PointOutT>
int pcl::MovingLeastSquares< PointInT, PointOutT >::desired_num_points_in_radius_
protected

Parameter that specifies the desired number of points within the search radius.

Note
Used only in the case of RANDOM_UNIFORM_DENSITY upsampling

Definition at line 566 of file mls.h.

Referenced by pcl::MovingLeastSquares< PointInT, PointOutT >::getPointDensity(), and pcl::MovingLeastSquares< PointInT, PointOutT >::setPointDensity().

template<typename PointInT, typename PointOutT>
int pcl::MovingLeastSquares< PointInT, PointOutT >::dilation_iteration_num_
protected

Number of dilation steps for the VOXEL_GRID_DILATION upsampling method.

Definition at line 642 of file mls.h.

Referenced by pcl::MovingLeastSquares< PointInT, PointOutT >::getDilationIterations(), and pcl::MovingLeastSquares< PointInT, PointOutT >::setDilationIterations().

template<typename PointInT, typename PointOutT>
PointCloudInConstPtr pcl::MovingLeastSquares< PointInT, PointOutT >::distinct_cloud_
protected

The distinct point cloud that will be projected to the MLS surface.

Definition at line 530 of file mls.h.

Referenced by pcl::MovingLeastSquares< PointInT, PointOutT >::getDistinctCloud(), and pcl::MovingLeastSquares< PointInT, PointOutT >::setDistinctCloud().

template<typename PointInT, typename PointOutT>
std::vector<MLSResult> pcl::MovingLeastSquares< PointInT, PointOutT >::mls_results_
protected

Stores the MLS result for each point in the input cloud.

Note
Used only in the case of VOXEL_GRID_DILATION or DISTINCT_CLOUD upsampling

Definition at line 576 of file mls.h.

Referenced by pcl::MovingLeastSquares< PointInT, PointOutT >::getMLSResults().

template<typename PointInT, typename PointOutT>
NormalCloudPtr pcl::MovingLeastSquares< PointInT, PointOutT >::normals_
protected

The point cloud that will hold the estimated normals, if set.

Definition at line 527 of file mls.h.

template<typename PointInT, typename PointOutT>
int pcl::MovingLeastSquares< PointInT, PointOutT >::nr_coeff_
protected

Number of coefficients, to be computed from the requested order.

Definition at line 645 of file mls.h.

template<typename PointInT, typename PointOutT>
int pcl::MovingLeastSquares< PointInT, PointOutT >::order_
protected
template<typename PointInT, typename PointOutT>
MLSResult::ProjectionMethod pcl::MovingLeastSquares< PointInT, PointOutT >::projection_method_
protected

Parameter that specifies the projection method to be used.

Definition at line 579 of file mls.h.

Referenced by pcl::MovingLeastSquares< PointInT, PointOutT >::getProjectionMethod(), and pcl::MovingLeastSquares< PointInT, PointOutT >::setProjectionMethod().

template<typename PointInT, typename PointOutT>
SearchMethod pcl::MovingLeastSquares< PointInT, PointOutT >::search_method_
protected
template<typename PointInT, typename PointOutT>
double pcl::MovingLeastSquares< PointInT, PointOutT >::search_radius_
protected
template<typename PointInT, typename PointOutT>
double pcl::MovingLeastSquares< PointInT, PointOutT >::sqr_gauss_param_
protected

Parameter for distance based weighting of neighbors (search_radius_ * search_radius_ works fine)

Definition at line 545 of file mls.h.

Referenced by pcl::MovingLeastSquares< PointInT, PointOutT >::getSqrGaussParam(), pcl::MovingLeastSquares< PointInT, PointOutT >::setSearchRadius(), and pcl::MovingLeastSquares< PointInT, PointOutT >::setSqrGaussParam().

template<typename PointInT, typename PointOutT>
KdTreePtr pcl::MovingLeastSquares< PointInT, PointOutT >::tree_
protected

A pointer to the spatial search object.

Definition at line 536 of file mls.h.

Referenced by pcl::MovingLeastSquares< PointInT, PointOutT >::getSearchMethod(), and pcl::MovingLeastSquares< PointInT, PointOutT >::setSearchMethod().

template<typename PointInT, typename PointOutT>
UpsamplingMethod pcl::MovingLeastSquares< PointInT, PointOutT >::upsample_method_
protected

Parameter that specifies the upsampling method to be used.

Definition at line 551 of file mls.h.

Referenced by pcl::MovingLeastSquares< PointInT, PointOutT >::setUpsamplingMethod().

template<typename PointInT, typename PointOutT>
double pcl::MovingLeastSquares< PointInT, PointOutT >::upsampling_radius_
protected

Radius of the circle in the local point plane that will be sampled.

Note
Used only in the case of SAMPLE_LOCAL_PLANE upsampling

Definition at line 556 of file mls.h.

Referenced by pcl::MovingLeastSquares< PointInT, PointOutT >::getUpsamplingRadius(), and pcl::MovingLeastSquares< PointInT, PointOutT >::setUpsamplingRadius().

template<typename PointInT, typename PointOutT>
double pcl::MovingLeastSquares< PointInT, PointOutT >::upsampling_step_
protected

Step size for the local plane sampling.

Note
Used only in the case of SAMPLE_LOCAL_PLANE upsampling

Definition at line 561 of file mls.h.

Referenced by pcl::MovingLeastSquares< PointInT, PointOutT >::getUpsamplingStepSize(), and pcl::MovingLeastSquares< PointInT, PointOutT >::setUpsamplingStepSize().

template<typename PointInT, typename PointOutT>
float pcl::MovingLeastSquares< PointInT, PointOutT >::voxel_size_
protected

Voxel size for the VOXEL_GRID_DILATION upsampling method.

Definition at line 639 of file mls.h.

Referenced by pcl::MovingLeastSquares< PointInT, PointOutT >::getDilationVoxelSize(), and pcl::MovingLeastSquares< PointInT, PointOutT >::setDilationVoxelSize().


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