Point Cloud Library (PCL)
1.10.1
|
43 #include <pcl/registration/boost.h>
44 #include <pcl/registration/registration.h>
45 #include <pcl/features/ppf.h>
47 #include <unordered_map>
59 struct HashKeyStruct :
public std::pair <int, std::pair <int, std::pair <int, int> > >
66 this->second.first = b;
67 this->second.second.first = c;
68 this->second.second.second = d;
73 const std::size_t h1 = std::hash<int>{} (s.first);
74 const std::size_t h2 = std::hash<int>{} (s.second.first);
75 const std::size_t h3 = std::hash<int>{} (s.second.second.first);
76 const std::size_t h4 = std::hash<int>{} (s.second.second.second);
77 return h1 ^ (h2 << 1) ^ (h3 << 2) ^ (h4 << 3);
90 PPFHashMapSearch (
float angle_discretization_step = 12.0f / 180.0f * static_cast<float> (M_PI),
91 float distance_discretization_step = 0.01f)
93 , internals_initialized_ (false)
94 , angle_discretization_step_ (angle_discretization_step)
95 , distance_discretization_step_ (distance_discretization_step)
115 nearestNeighborSearch (
float &f1,
float &f2,
float &f3,
float &f4,
116 std::vector<std::pair<std::size_t, std::size_t> > &indices);
137 bool internals_initialized_;
139 float angle_discretization_step_, distance_discretization_step_;
154 template <
typename Po
intSource,
typename Po
intTarget>
194 scene_reference_point_sampling_rate_ (5),
195 clustering_position_diff_threshold_ (0.01f),
196 clustering_rotation_diff_threshold_ (20.0f / 180.0f * static_cast<float> (M_PI))
257 computeTransformation (
PointCloudSource &output,
const Eigen::Matrix4f& guess)
override;
264 unsigned int scene_reference_point_sampling_rate_;
268 float clustering_position_diff_threshold_, clustering_rotation_diff_threshold_;
276 poseWithVotesCompareFunction (
const PoseWithVotes &a,
277 const PoseWithVotes &b);
282 clusterVotesCompareFunction (
const std::pair<std::size_t, unsigned int> &a,
283 const std::pair<std::size_t, unsigned int> &b);
294 posesWithinErrorBounds (Eigen::Affine3f &pose1,
295 Eigen::Affine3f &pose2);
299 #include <pcl/registration/impl/ppf_registration.hpp>
This file defines compatibility wrappers for low level I/O functions.
Registration represents the base registration class for general purpose, ICP-like methods.
void setInputTarget(const PointCloudTargetConstPtr &cloud) override
Provide a pointer to the input target (e.g., the point cloud that we want to align the input source t...
Ptr makeShared()
Convenience method for returning a copy of the class instance as a shared_ptr.
typename PointCloudTarget::ConstPtr PointCloudTargetConstPtr
PPFHashMapSearch::Ptr getSearchMethod()
Getter function for the search method of the class.
HashKeyStruct(int a, int b, int c, int d)
void setRotationClusteringThreshold(float clustering_rotation_diff_threshold)
Method for setting the rotation clustering parameter.
shared_ptr< PPFHashMapSearch > Ptr
std::vector< std::vector< float > > alpha_m_
float getRotationClusteringThreshold()
Returns the parameter defining the rotation clustering threshold.
typename PointCloudSource::ConstPtr PointCloudSourceConstPtr
void setSearchMethod(PPFHashMapSearch::Ptr search_method)
Function that sets the search method for the algorithm.
std::size_t operator()(const HashKeyStruct &s) const noexcept
unsigned int getSceneReferencePointSamplingRate()
Returns the parameter for the scene reference point sampling rate of the algorithm.
std::unordered_multimap< HashKeyStruct, std::pair< std::size_t, std::size_t >, HashKeyStruct > FeatureHashMapType
float getModelDiameter()
Returns the maximum distance found between any feature pair in the given input feature cloud.
std::vector< PoseWithVotes, Eigen::aligned_allocator< PoseWithVotes > > PoseWithVotesList
shared_ptr< FeatureHashMapType > FeatureHashMapTypePtr
Data structure to hold the information for the key in the feature hash map of the PPFHashMapSearch cl...
float getAngleDiscretizationStep()
Returns the angle discretization step parameter (the step value between each bin of the hash map for ...
PPFHashMapSearch(float angle_discretization_step=12.0f/180.0f *static_cast< float >(M_PI), float distance_discretization_step=0.01f)
Constructor for the PPFHashMapSearch class which sets the two step parameters for the enclosed data s...
typename PointCloudSource::Ptr PointCloudSourcePtr
Structure for storing a pose (represented as an Eigen::Affine3f) and an integer for counting votes.
pcl::PointCloud< PointSource > PointCloudSource
PPFRegistration()
Empty constructor that initializes all the parameters of the algorithm with default values.
void setSceneReferencePointSamplingRate(unsigned int scene_reference_point_sampling_rate)
Method for setting the scene reference point sampling rate.
shared_ptr< PointCloud< PointSource > > Ptr
shared_ptr< const PPFHashMapSearch > ConstPtr
Class that registers two point clouds based on their sets of PPFSignatures.
shared_ptr< const PointCloud< PointT > > ConstPtr
PoseWithVotes(Eigen::Affine3f &a_pose, unsigned int &a_votes)
float getDistanceDiscretizationStep()
Returns the distance discretization step parameter (the step value between each bin of the hash map f...
float getPositionClusteringThreshold()
Returns the parameter defining the position difference clustering parameter - distance threshold belo...
void setPositionClusteringThreshold(float clustering_position_diff_threshold)
Method for setting the position difference clustering parameter.
typename PointCloudTarget::Ptr PointCloudTargetPtr
shared_ptr< KdTreeFLANN< PointT, Dist > > Ptr
boost::shared_ptr< T > shared_ptr
Alias for boost::shared_ptr.