41#ifndef PCL_FEATURES_IMPL_INTENSITY_SPIN_H_
42#define PCL_FEATURES_IMPL_INTENSITY_SPIN_H_
44#include <pcl/features/intensity_spin.h>
47template <
typename Po
intInT,
typename Po
intOutT>
void
62 for (
int idx = 0; idx < k; ++idx)
68 float constant = 1.0f / (2.0f * sigma_ * sigma_);
71 for (
int idx = 0; idx < k; ++idx)
74 const float eps = std::numeric_limits<float>::epsilon ();
82 int d_idx =
static_cast<int> (d);
83 int i_idx =
static_cast<int> (i);
89 int d_idx_min = (std::max)(
static_cast<int> (std::floor (d - 3*sigma)), 0);
91 int i_idx_min = (std::max)(
static_cast<int> (std::floor (i - 3*sigma)), 0);
109template <
typename Po
intInT,
typename Po
intOutT>
void
113 if (search_radius_ == 0.0)
115 PCL_ERROR (
"[pcl::%s::computeFeature] The search radius must be set before computing the feature!\n",
116 getClassName ().
c_str ());
123 if (nr_intensity_bins_ <= 0)
125 PCL_ERROR (
"[pcl::%s::computeFeature] The number of intensity bins must be greater than zero!\n",
126 getClassName ().
c_str ());
131 if (nr_distance_bins_ <= 0)
133 PCL_ERROR (
"[pcl::%s::computeFeature] The number of distance bins must be greater than zero!\n",
134 getClassName ().
c_str ());
143 std::vector<float>
nn_dist_sqr (surface_->size ());
147 for (std::size_t idx = 0; idx < indices_->size (); ++idx)
154 for (
int bin = 0;
bin < nr_intensity_bins_ * nr_distance_bins_; ++
bin)
155 output[idx].histogram[
bin] = std::numeric_limits<float>::quiet_NaN ();
171#define PCL_INSTANTIATE_IntensitySpinEstimation(T,NT) template class PCL_EXPORTS pcl::IntensitySpinEstimation<T,NT>;
Iterator class for point clouds with or without given indices.
ConstCloudIterator(const PointCloud< PointT > &cloud)
typename Feature< PointInT, PointOutT >::PointCloudOut PointCloudOut
void computeFeature(PointCloudOut &output) override
Estimate the intensity-domain descriptors at a set of points given by <setInputCloud (),...
void computeIntensitySpinImage(const PointCloudIn &cloud, float radius, float sigma, int k, const pcl::Indices &indices, const std::vector< float > &squared_distances, Eigen::MatrixXf &intensity_spin_image)
Estimate the intensity-domain spin image descriptor for a given point based on its spatial neighborho...
IndicesAllocator<> Indices
Type used for indices in PCL.