41#ifndef PCL_FEATURES_IMPL_RIFT_H_
42#define PCL_FEATURES_IMPL_RIFT_H_
44#include <pcl/features/rift.h>
47template <
typename Po
intInT,
typename GradientT,
typename Po
intOutT>
void
55 PCL_ERROR (
"[pcl::RIFTEstimation] Null indices points passed!\n");
68 for (std::size_t idx = 0; idx < indices.size (); ++idx)
72 Eigen::Map<const Eigen::Vector3f>
gradient_vector (& (gradient[indices[idx]].gradient[0]));
80 const float eps = std::numeric_limits<float>::epsilon ();
85 int d_idx_min = (std::max)(
static_cast<int> (std::ceil (d - 1)), 0);
87 int g_idx_min =
static_cast<int> (std::ceil (g - 1));
88 int g_idx_max =
static_cast<int> (std::floor (g + 1));
99 float w = (1.0f - std::abs (d -
static_cast<float> (
d_idx))) * (1.0f - std::abs (g -
static_cast<float> (
g_idx)));
112template <
typename Po
intInT,
typename GradientT,
typename Po
intOutT>
void
116 if (search_radius_ == 0.0)
118 PCL_ERROR (
"[pcl::%s::computeFeature] The search radius must be set before computing the feature!\n",
119 getClassName ().
c_str ());
126 if (nr_gradient_bins_ <= 0)
128 PCL_ERROR (
"[pcl::%s::computeFeature] The number of gradient bins must be greater than zero!\n",
129 getClassName ().
c_str ());
134 if (nr_distance_bins_ <= 0)
136 PCL_ERROR (
"[pcl::%s::computeFeature] The number of distance bins must be greater than zero!\n",
137 getClassName ().
c_str ());
146 PCL_ERROR (
"[pcl::%s::computeFeature] No input gradient was given!\n", getClassName ().
c_str ());
151 if (gradient_->size () != surface_->size ())
153 PCL_ERROR (
"[pcl::%s::computeFeature] ", getClassName ().
c_str ());
154 PCL_ERROR (
"The number of points in the input dataset differs from the number of points in the gradient!\n");
160 Eigen::MatrixXf
rift_descriptor (nr_distance_bins_, nr_gradient_bins_);
165 for (std::size_t idx = 0; idx < indices_->size (); ++idx)
178#define PCL_INSTANTIATE_RIFTEstimation(T,NT,OutT) template class PCL_EXPORTS pcl::RIFTEstimation<T,NT,OutT>;
Iterator class for point clouds with or without given indices.
ConstCloudIterator(const PointCloud< PointT > &cloud)
std::size_t size() const
Size of the range the iterator is going through.
void computeFeature(PointCloudOut &output) override
Estimate the Rotation Invariant Feature Transform (RIFT) descriptors at a set of points given by <set...
void computeRIFT(const PointCloudIn &cloud, const PointCloudGradient &gradient, int p_idx, float radius, const pcl::Indices &indices, const std::vector< float > &squared_distances, Eigen::MatrixXf &rift_descriptor)
Estimate the Rotation Invariant Feature Transform (RIFT) descriptor for a given point based on its sp...
typename Feature< PointInT, PointOutT >::PointCloudOut PointCloudOut
const Eigen::Map< const Eigen::Vector3f > Vector3fMapConst
IndicesAllocator<> Indices
Type used for indices in PCL.