41#ifndef PCL_FEATURES_IMPL_GFPFH_H_
42#define PCL_FEATURES_IMPL_GFPFH_H_
44#include <pcl/features/gfpfh.h>
45#include <pcl/octree/octree_search.h>
52template<
typename Po
intInT,
typename Po
intNT,
typename Po
intOutT>
void
62 output.header = input_->header;
69 output.is_dense = input_->is_dense;
79template <
typename Po
intInT,
typename Po
intNT,
typename Po
intOutT>
void
103 std::vector<int> histogram;
108 int label = emptyLabel ();
109 if (!indices.empty ())
111 label = getDominantLabel (indices);
113 histogram.push_back (label);
123 std::vector<float> distances;
137template <
typename Po
intInT,
typename Po
intNT,
typename Po
intOutT>
void
147 std::vector< std::vector <int> >
transitions (getNumberOfClasses () + 1);
150 transition.resize (getNumberOfClasses () + 1, 0);
178template <
typename Po
intInT,
typename Po
intNT,
typename Po
intOutT>
void
180 std::vector<float>& distances)
195template <
typename Po
intInT,
typename Po
intNT,
typename Po
intOutT>
void
197 std::vector<float>& histogram)
200 std::tie (
min_it,
max_it) = std::minmax_element (distances.cbegin (), distances.cend ());
207 histogram.resize (descriptorSize (), 0);
211 using binSizeT =
decltype(descriptorSize());
213 for (
const float &distance : distances)
222template <
typename Po
intInT,
typename Po
intNT,
typename Po
intOutT>
void
230 for (std::size_t j = 0; j < histogram.size (); ++j)
238template <
typename Po
intInT,
typename Po
intNT,
typename Po
intOutT>
float
245 for (std::size_t i = 0; i < histogram.size (); ++i)
246 norm += std::min (
static_cast<float> (histogram[i]),
mean_histogram[i]);
248 norm /=
static_cast<float> (histogram.size ());
253template <
typename Po
intInT,
typename Po
intNT,
typename Po
intOutT> std::uint32_t
256 std::vector<std::uint32_t>
counts (getNumberOfClasses () + 1, 0);
257 for (
const auto &
nn_index : indices)
259 std::uint32_t label = (*labels_)[
nn_index].label;
265 return (emptyLabel ());
270#define PCL_INSTANTIATE_GFPFHEstimation(T,NT,OutT) template class PCL_EXPORTS pcl::GFPFHEstimation<T,NT,OutT>;
Iterator class for point clouds with or without given indices.
std::size_t size() const
Size of the range the iterator is going through.
Feature represents the base feature class.
virtual bool deinitCompute()
This method should get called after ending the actual computation.
void computeDistancesToMean(const std::vector< std::vector< int > > &transition_histograms, std::vector< float > &distances)
Compute the distance of each transition histogram to the mean.
typename Feature< PointInT, PointOutT >::PointCloudOut PointCloudOut
void computeTransitionHistograms(const std::vector< std::vector< int > > &label_histograms, std::vector< std::vector< int > > &transition_histograms)
Compute the fixed-length histograms of transitions.
std::uint32_t getDominantLabel(const pcl::Indices &indices)
Return the dominant label of a set of points.
void compute(PointCloudOut &output)
Overloaded computed method from pcl::Feature.
void computeMeanHistogram(const std::vector< std::vector< int > > &histograms, std::vector< float > &mean_histogram)
Compute the mean histogram of the given set of histograms.
float computeHIKDistance(const std::vector< int > &histogram, const std::vector< float > &mean_histogram)
Return the Intersection Kernel distance between two histograms.
void computeDistanceHistogram(const std::vector< float > &distances, std::vector< float > &histogram)
Compute the binned histogram of distance values.
void computeFeature(PointCloudOut &output) override
Estimate the Point Feature Histograms (PFH) descriptors at a set of points given by <setInputCloud ()...
std::vector< PointT, Eigen::aligned_allocator< PointT > > VectorType
uindex_t getOccupiedVoxelCenters(AlignedPointTVector &voxel_center_list_arg) const
Get a PointT vector of centers of all occupied voxels.
void setInputCloud(const PointCloudConstPtr &cloud_arg, const IndicesConstPtr &indices_arg=IndicesConstPtr())
Provide a pointer to the input data set.
void addPointsFromInputCloud()
Add points from input point cloud to octree.
uindex_t getApproxIntersectedVoxelCentersBySegment(const Eigen::Vector3f &origin, const Eigen::Vector3f &end, AlignedPointTVector &voxel_center_list, float precision=0.2)
Get a PointT vector of centers of voxels intersected by a line segment.
Octree pointcloud search class
bool voxelSearch(const PointT &point, Indices &point_idx_data)
Search for neighbors within a voxel at given point.
IndicesAllocator<> Indices
Type used for indices in PCL.