43 #include <pcl/features/feature.h>
88 template <
typename Po
intInT,
typename Po
intNT,
typename Po
intOutT>
92 using Ptr = shared_ptr<SpinImageEstimation<PointInT, PointNT, PointOutT> >;
93 using ConstPtr = shared_ptr<const SpinImageEstimation<PointInT, PointNT, PointOutT> >;
123 double support_angle_cos = 0.0,
124 unsigned int min_pts_neighb = 0);
136 const unsigned int necessary_desc_size = (bin_count+1)*(2*bin_count+1);
137 if (necessary_desc_size >
static_cast<unsigned int>(PointOutT::descriptorSize())) {
138 for(
int i=0; ; ++i) {
139 if(((i+1)*(2*i+1)) <= PointOutT::descriptorSize()) {
145 PCL_ERROR(
"[pcl::SpinImageEstimation] The chosen image width is too large, setting it to %u instead. "
146 "Consider using pcl::Histogram<%u> as output type of SpinImageEstimation "
147 "(possibly with `#define PCL_NO_PRECOMPILE 1`).\n", image_width_, ((bin_count+1)*(2*bin_count+1)));
148 }
else if (necessary_desc_size <
static_cast<unsigned int>(PointOutT::descriptorSize())) {
149 image_width_ = bin_count;
150 PCL_WARN(
"[pcl::SpinImageEstimation] The chosen image width is smaller than the output histogram allows. "
151 "This is not an error, but the last few histogram bins will not be set. "
152 "Consider using pcl::Histogram<%u> as output type of SpinImageEstimation "
153 "(possibly with `#define PCL_NO_PRECOMPILE 1`).\n", ((bin_count+1)*(2*bin_count+1)));
155 image_width_ = bin_count;
168 if (0.0 > support_angle_cos || support_angle_cos > 1.0)
170 throw PCLException (
"Cosine of support angle should be between 0 and 1",
171 "spin_image.h",
"setSupportAngle");
174 support_angle_cos_ = support_angle_cos;
185 min_pts_neighb_ = min_pts_neighb;
201 input_normals_ = normals;
212 rotation_axis_ = axis;
213 use_custom_axis_ =
true;
214 use_custom_axes_cloud_ =
false;
226 rotation_axes_cloud_ = axes;
228 use_custom_axes_cloud_ =
true;
229 use_custom_axis_ =
false;
236 use_custom_axis_ =
false;
237 use_custom_axes_cloud_ =
false;
290 bool is_angular_{
false};
292 PointNT rotation_axis_;
293 bool use_custom_axis_{
false};
294 bool use_custom_axes_cloud_{
false};
296 bool is_radial_{
false};
298 unsigned int image_width_;
299 double support_angle_cos_;
300 unsigned int min_pts_neighb_;
304 #ifdef PCL_NO_PRECOMPILE
305 #include <pcl/features/impl/spin_image.hpp>
Feature represents the base feature class.
typename PointCloudIn::Ptr PointCloudInPtr
shared_ptr< Feature< PointInT, PointOutT > > Ptr
shared_ptr< const Feature< PointInT, PointOutT > > ConstPtr
typename PointCloudIn::ConstPtr PointCloudInConstPtr
A base class for all pcl exceptions which inherits from std::runtime_error.
shared_ptr< PointCloud< PointNT > > Ptr
shared_ptr< const PointCloud< PointNT > > ConstPtr
Estimates spin-image descriptors in the given input points.
void setRotationAxis(const PointNT &axis)
Sets single vector a rotation axis for all input points.
typename Feature< PointInT, PointOutT >::PointCloudOut PointCloudOut
Eigen::ArrayXXd computeSiForPoint(int index) const
Computes a spin-image for the point of the scan.
void useNormalsAsRotationAxis()
Sets input normals as rotation axes (default setting).
void setRadialStructure(bool is_radial=true)
Sets/unsets flag for radial spin-image structure.
void setAngularDomain(bool is_angular=true)
Sets/unsets flag for angular spin-image domain.
~SpinImageEstimation() override=default
Empty destructor.
typename PointCloudN::Ptr PointCloudNPtr
void setImageWidth(unsigned int bin_count)
Sets spin-image resolution.
void setMinPointCountInNeighbourhood(unsigned int min_pts_neighb)
Sets minimal points count for spin image computation.
void setInputNormals(const PointCloudNConstPtr &normals)
Provide a pointer to the input dataset that contains the point normals of the input XYZ dataset given...
typename PointCloudN::ConstPtr PointCloudNConstPtr
SpinImageEstimation(unsigned int image_width=8, double support_angle_cos=0.0, unsigned int min_pts_neighb=0)
Constructs empty spin image estimator.
bool initCompute() override
initializes computations specific to spin-image.
void setSupportAngle(double support_angle_cos)
Sets the maximum angle for the point normal to get to support region.
void computeFeature(PointCloudOut &output) override
Estimate the Spin Image descriptors at a set of points given by setInputWithNormals() using the surfa...
void setInputRotationAxes(const PointCloudNConstPtr &axes)
Sets array of vectors as rotation axes for input points.
Defines all the PCL implemented PointT point type structures.