Point Cloud Library (PCL)
1.10.1
|
44 #include <pcl/features/feature.h>
58 histogramsPC.points.resize (histograms2D.size ());
59 histogramsPC.width = histograms2D.size ();
60 histogramsPC.height = 1;
61 histogramsPC.is_dense =
true;
63 const int rows = histograms2D.at(0).rows();
64 const int cols = histograms2D.at(0).cols();
67 for (
const Eigen::MatrixXf& h : histograms2D)
69 Eigen::Map<Eigen::MatrixXf> histogram (&(it->histogram[0]), rows, cols);
86 template <
typename Po
intInT,
typename Po
intNT,
typename Po
intOutT> Eigen::MatrixXf
88 const std::vector<int> &indices,
double max_dist,
89 int nr_subdiv,
double plane_radius, PointOutT &radii,
bool compute_histogram =
false);
91 template <
typename Po
intInT,
typename Po
intNT,
typename Po
intOutT>
92 PCL_DEPRECATED(
"use computeRSD() overload that takes input point clouds by const reference")
95 const std::vector<
int> &indices,
double max_dist,
96 int nr_subdiv,
double plane_radius, PointOutT &radii,
bool compute_histogram = false)
98 return computeRSD (*surface, *normals, indices, max_dist, nr_subdiv, plane_radius, radii, compute_histogram);
112 template <
typename Po
intNT,
typename Po
intOutT> Eigen::MatrixXf
114 const std::vector<int> &indices,
const std::vector<float> &sqr_dists,
double max_dist,
115 int nr_subdiv,
double plane_radius, PointOutT &radii,
bool compute_histogram =
false);
117 template <
typename Po
intNT,
typename Po
intOutT>
118 PCL_DEPRECATED(
"use computeRSD() overload that takes input point cloud by const reference")
121 const std::vector<
int> &indices, const std::vector<
float> &sqr_dists,
double max_dist,
122 int nr_subdiv,
double plane_radius, PointOutT &radii,
bool compute_histogram = false)
124 return computeRSD (*normals, indices, sqr_dists, max_dist, nr_subdiv, plane_radius, radii, compute_histogram);
149 template <
typename Po
intInT,
typename Po
intNT,
typename Po
intOutT>
169 RSDEstimation () : nr_subdiv_ (5), plane_radius_ (0.2), save_histograms_ (false)
204 PCL_ERROR (
"[pcl::%s::setKSearch] RSD does not work with k nearest neighbor search. Use setRadiusSearch() instead!\n",
getClassName ().c_str ());
244 double plane_radius_;
247 bool save_histograms_;
254 #ifdef PCL_NO_PRECOMPILE
255 #include <pcl/features/impl/rsd.hpp>
Defines all the PCL and non-PCL macros used.
This file defines compatibility wrappers for low level I/O functions.
shared_ptr< Feature< PointInT, PointOutT > > Ptr
std::vector< PointT, Eigen::aligned_allocator< PointT > > points
The point data.
int getNrSubdivisions() const
Get the number of subdivisions for the considered distance interval.
void getFeaturePointCloud(const std::vector< Eigen::MatrixXf, Eigen::aligned_allocator< Eigen::MatrixXf > > &histograms2D, PointCloud< Histogram< N > > &histogramsPC)
Transform a list of 2D matrices into a point cloud containing the values in a vector (Histogram<N>).
void computeFeature(PointCloudOut &output) override
Estimate the estimates the Radius-based Surface Descriptor (RSD) at a set of points given by <setInpu...
bool getSaveHistograms() const
Returns whether the full distance-angle histograms are being saved.
PointCloud represents the base class in PCL for storing collections of 3D points.
shared_ptr< std::vector< Eigen::MatrixXf, Eigen::aligned_allocator< Eigen::MatrixXf > > > getHistograms() const
Returns a pointer to the list of full distance-angle histograms for all points.
shared_ptr< const Feature< PointInT, PointOutT > > ConstPtr
RSDEstimation estimates the Radius-based Surface Descriptor (minimal and maximal radius of the local ...
typename Feature< PointInT, PointOutT >::PointCloudOut PointCloudOut
#define PCL_MAKE_ALIGNED_OPERATOR_NEW
Macro to signal a class requires a custom allocator.
void setPlaneRadius(double plane_radius)
Set the maximum radius, above which everything can be considered planar.
double getPlaneRadius() const
Get the maximum radius, above which everything can be considered planar.
Eigen::MatrixXf computeRSD(const pcl::PointCloud< PointInT > &surface, const pcl::PointCloud< PointNT > &normals, const std::vector< int > &indices, double max_dist, int nr_subdiv, double plane_radius, PointOutT &radii, bool compute_histogram=false)
Estimate the Radius-based Surface Descriptor (RSD) for a given point based on its spatial neighborhoo...
RSDEstimation()
Empty constructor.
A point structure representing an N-D histogram.
PCL_EXPORTS int save(const std::string &file_name, const pcl::PCLPointCloud2 &blob, unsigned precision=5)
Save point cloud data to a binary file when available else to ASCII.
void setSaveHistograms(bool save)
Set whether the full distance-angle histograms should be saved.
#define PCL_DEPRECATED(message)
const std::string & getClassName() const
Get a string representation of the name of this class.
std::string feature_name_
The feature name.
shared_ptr< std::vector< Eigen::MatrixXf, Eigen::aligned_allocator< Eigen::MatrixXf > > > histograms_
The list of full distance-angle histograms for all points.
void setNrSubdivisions(int nr_subdiv)
Set the number of subdivisions for the considered distance interval.
boost::shared_ptr< T > shared_ptr
Alias for boost::shared_ptr.
void setKSearch(int)
Disables the setting of the number of k nearest neighbors to use for the feature estimation.
Feature represents the base feature class.