43 #include <pcl/pcl_base.h>
44 #include <pcl/point_representation.h>
67 template <
typename Po
intFeature>
72 using Ptr = shared_ptr<PyramidFeatureHistogram<PointFeature>>;
73 using ConstPtr = shared_ptr<const PyramidFeatureHistogram<PointFeature>>;
76 shared_ptr<const pcl::PointRepresentation<PointFeature>>;
88 dimension_range_input_ = dimension_range_input;
92 inline std::vector<std::pair<float, float>>
95 return dimension_range_input_;
105 dimension_range_target_ = dimension_range_target;
109 inline std::vector<std::pair<float, float>>
112 return dimension_range_target_;
122 feature_representation_ = feature_representation;
130 return feature_representation_;
156 std::size_t nr_dimensions{0}, nr_levels{0}, nr_features{0};
157 std::vector<std::pair<float, float>> dimension_range_input_, dimension_range_target_;
159 bool is_computed_{
false};
164 initializeHistogram();
171 convertFeatureToVector(
const PointFeature& feature,
172 std::vector<float>& feature_vector);
177 addFeature(std::vector<float>& feature);
184 at(std::vector<std::size_t>& access, std::size_t& level);
191 at(std::vector<float>& feature, std::size_t& level);
194 struct PyramidFeatureHistogramLevel {
195 PyramidFeatureHistogramLevel() =
default;
197 PyramidFeatureHistogramLevel(std::vector<std::size_t>& a_bins_per_dimension,
198 std::vector<float>& a_bin_step)
199 : bins_per_dimension(a_bins_per_dimension), bin_step(a_bin_step)
201 initializeHistogramLevel();
205 initializeHistogramLevel();
207 std::vector<unsigned int> hist;
208 std::vector<std::size_t> bins_per_dimension;
209 std::vector<float> bin_step;
211 std::vector<PyramidFeatureHistogramLevel> hist_levels;
215 #ifdef PCL_NO_PRECOMPILE
216 #include <pcl/registration/impl/pyramid_feature_matching.hpp>
void setPointRepresentation(const FeatureRepresentationConstPtr &feature_representation)
Provide a pointer to the feature representation to use to convert features to k-D vectors...
void setTargetDimensionRange(std::vector< std::pair< float, float >> &dimension_range_target)
Method to set the target dimension range parameter.
shared_ptr< const PyramidFeatureHistogram< PointFeature >> ConstPtr
shared_ptr< const pcl::PointRepresentation< PointFeature >> FeatureRepresentationConstPtr
static float comparePyramidFeatureHistograms(const PyramidFeatureHistogramPtr &pyramid_a, const PyramidFeatureHistogramPtr &pyramid_b)
Static method for comparing two pyramid histograms that returns a floating point value between 0 and ...
std::vector< std::pair< float, float > > getInputDimensionRange()
Method for retrieving the input dimension range vector.
FeatureRepresentationConstPtr const getPointRepresentation()
Get a pointer to the feature representation used when converting features into k-D vectors...
Class that compares two sets of features by using a multiscale representation of the features inside ...
PyramidFeatureHistogram()
Empty constructor that instantiates the feature representation variable.
bool isComputed()
Checks whether the pyramid histogram has been computed.
void compute()
The central method for inserting the feature set inside the pyramid and obtaining the complete pyrami...
Ptr PyramidFeatureHistogramPtr
void setInputDimensionRange(std::vector< std::pair< float, float >> &dimension_range_input)
Method for setting the input dimension range parameter.
std::vector< std::pair< float, float > > getTargetDimensionRange()
Method for retrieving the target dimension range vector.
shared_ptr< PyramidFeatureHistogram< PointFeature >> Ptr