45#include <pcl/features/feature.h>
59 histogramsPC.resize (histograms2D.size ());
60 histogramsPC.width = histograms2D.size ();
61 histogramsPC.height = 1;
62 histogramsPC.is_dense =
true;
64 const int rows = histograms2D.at(0).rows();
65 const int cols = histograms2D.at(0).cols();
68 for (
const Eigen::MatrixXf& h : histograms2D)
70 Eigen::Map<Eigen::MatrixXf> histogram (&(it->histogram[0]), rows, cols);
87 template <
typename Po
intInT,
typename Po
intNT,
typename Po
intOutT> Eigen::MatrixXf
90 int nr_subdiv,
double plane_radius, PointOutT &radii,
bool compute_histogram =
false);
103 template <
typename Po
intNT,
typename Po
intOutT> Eigen::MatrixXf
105 const pcl::Indices &indices,
const std::vector<float> &sqr_dists,
double max_dist,
106 int nr_subdiv,
double plane_radius, PointOutT &radii,
bool compute_histogram =
false);
130 template <
typename Po
intInT,
typename Po
intNT,
typename Po
intOutT>
145 using Ptr = shared_ptr<RSDEstimation<PointInT, PointNT, PointOutT> >;
146 using ConstPtr = shared_ptr<const RSDEstimation<PointInT, PointNT, PointOutT> >;
150 RSDEstimation () : nr_subdiv_ (5), plane_radius_ (0.2), save_histograms_ (false)
185 PCL_ERROR (
"[pcl::%s::setKSearch] RSD does not work with k nearest neighbor search. Use setRadiusSearch() instead!\n",
getClassName ().c_str ());
204 inline shared_ptr<std::vector<Eigen::MatrixXf, Eigen::aligned_allocator<Eigen::MatrixXf> > >
218 shared_ptr<std::vector<Eigen::MatrixXf, Eigen::aligned_allocator<Eigen::MatrixXf> > >
histograms_;
225 double plane_radius_;
228 bool save_histograms_;
235#ifdef PCL_NO_PRECOMPILE
236#include <pcl/features/impl/rsd.hpp>
PointCloudNConstPtr normals_
A pointer to the input dataset that contains the point normals of the XYZ dataset.
Feature represents the base feature class.
double search_parameter_
The actual search parameter (from either search_radius_ or k_).
const std::string & getClassName() const
Get a string representation of the name of this class.
double search_radius_
The nearest neighbors search radius for each point.
std::string feature_name_
The feature name.
PointCloudInConstPtr surface_
An input point cloud describing the surface that is to be used for nearest neighbors estimation.
PointCloud represents the base class in PCL for storing collections of 3D points.
iterator begin() noexcept
RSDEstimation estimates the Radius-based Surface Descriptor (minimal and maximal radius of the local ...
void setNrSubdivisions(int nr_subdiv)
Set the number of subdivisions for the considered distance interval.
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 RSDEstimation< PointInT, PointNT, PointOutT > > ConstPtr
void setKSearch(int)
Disables the setting of the number of k nearest neighbors to use for the feature estimation.
typename Feature< PointInT, PointOutT >::PointCloudOut PointCloudOut
int getNrSubdivisions() const
Get the number of subdivisions for the considered distance interval.
typename Feature< PointInT, PointOutT >::PointCloudIn PointCloudIn
void computeFeature(PointCloudOut &output) override
Estimate the estimates the Radius-based Surface Descriptor (RSD) at a set of points given by <setInpu...
RSDEstimation()
Empty constructor.
bool getSaveHistograms() const
Returns whether the full distance-angle histograms are being saved.
double getPlaneRadius() const
Get the maximum radius, above which everything can be considered planar.
shared_ptr< RSDEstimation< PointInT, PointNT, PointOutT > > Ptr
void setSaveHistograms(bool save)
Set whether the full distance-angle histograms should be saved.
shared_ptr< std::vector< Eigen::MatrixXf, Eigen::aligned_allocator< Eigen::MatrixXf > > > histograms_
The list of full distance-angle histograms for all points.
void setPlaneRadius(double plane_radius)
Set the maximum radius, above which everything can be considered planar.
#define PCL_MAKE_ALIGNED_OPERATOR_NEW
Macro to signal a class requires a custom allocator.
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>).
Eigen::MatrixXf computeRSD(const pcl::PointCloud< PointInT > &surface, const pcl::PointCloud< PointNT > &normals, const pcl::Indices &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...
Defines functions, macros and traits for allocating and using memory.
IndicesAllocator<> Indices
Type used for indices in PCL.
Defines all the PCL and non-PCL macros used.
A point structure representing an N-D histogram.