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 BOOST_FOREACH (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);
102 template <
typename Po
intNT,
typename Po
intOutT> Eigen::MatrixXf
104 const std::vector<int> &indices,
const std::vector<float> &sqr_dists,
double max_dist,
105 int nr_subdiv,
double plane_radius, PointOutT &radii,
bool compute_histogram =
false);
129 template <
typename Po
intInT,
typename Po
intNT,
typename Po
intOutT>
144 typedef typename boost::shared_ptr<RSDEstimation<PointInT, PointNT, PointOutT> >
Ptr;
145 typedef typename boost::shared_ptr<const RSDEstimation<PointInT, PointNT, PointOutT> >
ConstPtr;
149 RSDEstimation () : nr_subdiv_ (5), plane_radius_ (0.2), save_histograms_ (false)
180 PCL_ERROR (
"[pcl::%s::setKSearch] RSD does not work with k nearest neighbor search. Use setRadiusSearch() instead!\n",
getClassName ().c_str ());
195 inline boost::shared_ptr<std::vector<Eigen::MatrixXf, Eigen::aligned_allocator<Eigen::MatrixXf> > >
209 boost::shared_ptr<std::vector<Eigen::MatrixXf, Eigen::aligned_allocator<Eigen::MatrixXf> > >
histograms_;
216 double plane_radius_;
219 bool save_histograms_;
222 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
226 #ifdef PCL_NO_PRECOMPILE
227 #include <pcl/features/impl/rsd.hpp>
230 #endif //#ifndef PCL_RSD_H_
boost::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.
Feature< PointInT, PointOutT >::PointCloudOut PointCloudOut
Eigen::MatrixXf computeRSD(boost::shared_ptr< const pcl::PointCloud< PointInT > > &surface, boost::shared_ptr< 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.
std::string feature_name_
The feature name.
boost::shared_ptr< RSDEstimation< PointInT, PointNT, PointOutT > > Ptr
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)...
int getNrSubdivisions() const
Get the number of subdivisions for the considered distance interval.
void computeFeature(PointCloudOut &output)
Estimate the estimates the Radius-based Surface Descriptor (RSD) at a set of points given by
boost::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.
const std::string & getClassName() const
Get a string representation of the name of this class.
std::vector< PointT, Eigen::aligned_allocator< PointT > > points
The point data.
A point structure representing an N-D histogram.
RSDEstimation estimates the Radius-based Surface Descriptor (minimal and maximal radius of the local ...
bool getSaveHistograms() const
Returns whether the full distance-angle histograms are being saved.
void setKSearch(int)
Disables the setting of the number of k nearest neighbors to use for the feature estimation.
PointCloud represents the base class in PCL for storing collections of 3D points. ...
void setNrSubdivisions(int nr_subdiv)
Set the number of subdivisions for the considered distance interval.
Feature represents the base feature class.
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.
double getPlaneRadius() const
Get the maximum radius, above which everything can be considered planar.
Feature< PointInT, PointOutT >::PointCloudIn PointCloudIn
boost::shared_ptr< const RSDEstimation< PointInT, PointNT, PointOutT > > ConstPtr
void setSaveHistograms(bool save)
Set whether the full distance-angle histograms should be saved.