41 #ifndef PCL_FEATURE_H_
42 #define PCL_FEATURE_H_
45 # pragma GCC system_header
48 #include <boost/function.hpp>
49 #include <boost/bind.hpp>
51 #include <pcl/pcl_base.h>
52 #include <pcl/search/search.h>
69 const Eigen::Vector4f &point,
70 Eigen::Vector4f &plane_parameters,
float &curvature);
86 float &nx,
float &ny,
float &nz,
float &curvature);
104 template <
typename Po
intInT,
typename Po
intOutT>
113 typedef boost::shared_ptr< Feature<PointInT, PointOutT> >
Ptr;
114 typedef boost::shared_ptr< const Feature<PointInT, PointOutT> >
ConstPtr;
125 typedef boost::function<int (size_t, double, std::vector<int> &, std::vector<float> &)>
SearchMethod;
126 typedef boost::function<int (const PointCloudIn &cloud, size_t index, double, std::vector<int> &, std::vector<float> &)>
SearchMethodSurface;
156 inline PointCloudInConstPtr
218 compute (PointCloudOut &output);
245 inline const std::string&
271 std::vector<int> &indices, std::vector<float> &distances)
const
273 return (search_method_surface_ (*
input_, index, parameter, indices, distances));
289 std::vector<int> &indices, std::vector<float> &distances)
const
291 return (search_method_surface_ (cloud, index, parameter, indices, distances));
299 computeFeature (PointCloudOut &output) = 0;
302 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
309 template <
typename Po
intInT,
typename Po
intNT,
typename Po
intOutT>
322 typedef boost::shared_ptr< FeatureFromNormals<PointInT, PointNT, PointOutT> >
Ptr;
323 typedef boost::shared_ptr< const FeatureFromNormals<PointInT, PointNT, PointOutT> >
ConstPtr;
347 inline PointCloudNConstPtr
361 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
367 template <
typename Po
intInT,
typename Po
intLT,
typename Po
intOutT>
381 typedef boost::shared_ptr< FeatureFromLabels<PointInT, PointLT, PointOutT> >
Ptr;
382 typedef boost::shared_ptr< const FeatureFromLabels<PointInT, PointLT, PointOutT> >
ConstPtr;
412 inline PointCloudLConstPtr
429 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
446 template <
typename Po
intInT,
typename Po
intRFT>
474 inline PointCloudLRFConstPtr
498 #include <pcl/features/impl/feature.hpp>
500 #endif //#ifndef PCL_FEATURE_H_
int k_
The number of K nearest neighbors to use for each point.
boost::function< int(const PointCloudIn &cloud, size_t index, double, std::vector< int > &, std::vector< float > &)> SearchMethodSurface
Feature< PointInT, PointRFT >::Ptr LRFEstimationPtr
Check if frames_ has been correctly initialized and compute it if needed.
pcl::search::Search< PointInT >::Ptr KdTreePtr
PointCloudLRFConstPtr frames_
A boost shared pointer to the local reference frames.
boost::shared_ptr< const FeatureFromNormals< PointInT, PointNT, PointOutT > > ConstPtr
PointCloudIn::Ptr PointCloudInPtr
void setKSearch(int k)
Set the number of k nearest neighbors to use for the feature estimation.
boost::shared_ptr< pcl::search::Search< PointT > > Ptr
PointCloudN::Ptr PointCloudNPtr
const std::string & getClassName() const
Get a string representation of the name of this class.
PointCloudLRF::ConstPtr PointCloudLRFConstPtr
bool fake_surface_
If no surface is given, we use the input PointCloud as the surface.
PointCloudLConstPtr getInputLabels() const
Get a pointer to the labels of the input XYZ point cloud dataset.
pcl::PointCloud< PointNT > PointCloudN
boost::shared_ptr< Feature< PointInT, PointOutT > > Ptr
std::string feature_name_
The feature name.
virtual ~FeatureFromLabels()
Empty destructor.
virtual ~FeatureFromNormals()
Empty destructor.
virtual ~FeatureWithLocalReferenceFrames()
Empty destructor.
void setInputLabels(const PointCloudLConstPtr &labels)
Provide a pointer to the input dataset that contains the point labels of the XYZ dataset.
PointCloudConstPtr input_
The input point cloud dataset.
void setRadiusSearch(double radius)
Set the sphere radius that is to be used for determining the nearest neighbors used for the feature e...
PointCloudN::ConstPtr PointCloudNConstPtr
void setInputNormals(const PointCloudNConstPtr &normals)
Provide a pointer to the input dataset that contains the point normals of the XYZ dataset...
double getRadiusSearch() const
Get the sphere radius used for determining the neighbors.
FeatureWithLocalReferenceFrames provides a public interface for descriptor extractor classes which ne...
KdTreePtr tree_
A pointer to the spatial search object.
KdTreePtr getSearchMethod() const
Get a pointer to the search method used.
boost::shared_ptr< FeatureFromLabels< PointInT, PointLT, PointOutT > > Ptr
int searchForNeighbors(size_t index, double parameter, std::vector< int > &indices, std::vector< float > &distances) const
Search for k-nearest neighbors using the spatial locator from setSearchmethod, and the given surface ...
PointCloudLRFConstPtr getInputReferenceFrames() const
Get a pointer to the local reference frames.
FeatureFromNormals()
Empty constructor.
PointCloudInConstPtr surface_
An input point cloud describing the surface that is to be used for nearest neighbors estimation...
virtual bool initCompute()
This method should get called before starting the actual computation.
boost::shared_ptr< const PointCloud< PointWithRange > > ConstPtr
int searchForNeighbors(const PointCloudIn &cloud, size_t index, double parameter, std::vector< int > &indices, std::vector< float > &distances) const
Search for k-nearest neighbors using the spatial locator from setSearchmethod, and the given surface ...
PointCloudInConstPtr getSearchSurface() const
Get a pointer to the surface point cloud dataset.
boost::shared_ptr< FeatureFromNormals< PointInT, PointNT, PointOutT > > Ptr
void compute(PointCloudOut &output)
Base method for feature estimation for all points given in using th...
PointCloudIn::ConstPtr PointCloudInConstPtr
pcl::search::Search< PointInT > KdTree
void setSearchSurface(const PointCloudInConstPtr &cloud)
Provide a pointer to a dataset to add additional information to estimate the features for every point...
virtual bool deinitCompute()
This method should get called after ending the actual computation.
double search_parameter_
The actual search parameter (from either search_radius_ or k_).
double getSearchParameter() const
Get the internal search parameter.
int getKSearch() const
get the number of k nearest neighbors used for the feature estimation.
boost::shared_ptr< const Feature< PointInT, PointOutT > > ConstPtr
FeatureWithLocalReferenceFrames()
Empty constructor.
double search_radius_
The nearest neighbors search radius for each point.
pcl::PointCloud< PointOutT > PointCloudOut
PointCloudNConstPtr getInputNormals() const
Get a pointer to the normals of the input XYZ point cloud dataset.
void setInputReferenceFrames(const PointCloudLRFConstPtr &frames)
Provide a pointer to the input dataset that contains the local reference frames of the XYZ dataset...
void solvePlaneParameters(const Eigen::Matrix3f &covariance_matrix, const Eigen::Vector4f &point, Eigen::Vector4f &plane_parameters, float &curvature)
Solve the eigenvalues and eigenvectors of a given 3x3 covariance matrix, and estimate the least-squar...
virtual bool initCompute()
This method should get called before starting the actual computation.
Feature represents the base feature class.
virtual bool initLocalReferenceFrames(const size_t &indices_size, const LRFEstimationPtr &lrf_estimation=LRFEstimationPtr())
PointCloudLRF::Ptr PointCloudLRFPtr
virtual bool initCompute()
This method should get called before starting the actual computation.
Feature()
Empty constructor.
pcl::PointCloud< PointInT > PointCloudIn
PointCloudLConstPtr labels_
A pointer to the input dataset that contains the point labels of the XYZ dataset. ...
pcl::PointCloud< PointRFT > PointCloudLRF
boost::shared_ptr< PointCloud< PointWithRange > > Ptr
boost::function< int(size_t, double, std::vector< int > &, std::vector< float > &)> SearchMethod
void setSearchMethod(const KdTreePtr &tree)
Provide a pointer to the search object.
PCLBase< PointInT > BaseClass
SearchMethodSurface search_method_surface_
The search method template for points.
boost::shared_ptr< const FeatureFromLabels< PointInT, PointLT, PointOutT > > ConstPtr
PointCloudNConstPtr normals_
A pointer to the input dataset that contains the point normals of the XYZ dataset.
bool frames_never_defined_
The user has never set the frames.
virtual ~Feature()
Empty destructor.
FeatureFromLabels()
Empty constructor.