42 #ifndef PCL_PPF_REGISTRATION_H_
43 #define PCL_PPF_REGISTRATION_H_
45 #include <pcl/registration/boost.h>
46 #include <pcl/registration/registration.h>
47 #include <pcl/features/ppf.h>
59 struct HashKeyStruct :
public std::pair <int, std::pair <int, std::pair <int, int> > >
64 this->second.first = b;
65 this->second.second.first = c;
66 this->second.second.second = d;
71 typedef boost::shared_ptr<PPFHashMapSearch>
Ptr;
78 PPFHashMapSearch (
float angle_discretization_step = 12.0f / 180.0f * static_cast<float> (M_PI),
79 float distance_discretization_step = 0.01f)
81 , feature_hash_map_ (new FeatureHashMapType)
82 , internals_initialized_ (false)
83 , angle_discretization_step_ (angle_discretization_step)
84 , distance_discretization_step_ (distance_discretization_step)
104 nearestNeighborSearch (
float &f1,
float &f2,
float &f3,
float &f4,
105 std::vector<std::pair<size_t, size_t> > &indices);
125 FeatureHashMapTypePtr feature_hash_map_;
126 bool internals_initialized_;
128 float angle_discretization_step_, distance_discretization_step_;
143 template <
typename Po
intSource,
typename Po
intTarget>
184 scene_reference_point_sampling_rate_ (5),
185 clustering_position_diff_threshold_ (0.01f),
186 clustering_rotation_diff_threshold_ (20.0f / 180.0f * static_cast<float> (M_PI))
247 computeTransformation (PointCloudSource &output,
const Eigen::Matrix4f& guess);
254 unsigned int scene_reference_point_sampling_rate_;
258 float clustering_position_diff_threshold_, clustering_rotation_diff_threshold_;
266 poseWithVotesCompareFunction (
const PoseWithVotes &a,
267 const PoseWithVotes &b);
272 clusterVotesCompareFunction (
const std::pair<size_t, unsigned int> &a,
273 const std::pair<size_t, unsigned int> &b);
278 clusterPoses (PoseWithVotesList &poses,
279 PoseWithVotesList &result);
284 posesWithinErrorBounds (Eigen::Affine3f &pose1,
285 Eigen::Affine3f &pose2);
289 #include <pcl/registration/impl/ppf_registration.hpp>
291 #endif // PCL_PPF_REGISTRATION_H_
PointCloudTarget::Ptr PointCloudTargetPtr
Registration represents the base registration class for general purpose, ICP-like methods...
void setSearchMethod(PPFHashMapSearch::Ptr search_method)
Function that sets the search method for the algorithm.
PPFHashMapSearch::Ptr getSearchMethod()
Getter function for the search method of the class.
float getAngleDiscretizationStep()
Returns the angle discretization step parameter (the step value between each bin of the hash map for ...
std::vector< std::vector< float > > alpha_m_
void setSceneReferencePointSamplingRate(unsigned int scene_reference_point_sampling_rate)
Method for setting the scene reference point sampling rate.
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...
std::vector< PoseWithVotes, Eigen::aligned_allocator< PoseWithVotes > > PoseWithVotesList
boost::shared_ptr< KdTreeFLANN< PointT > > Ptr
float getDistanceDiscretizationStep()
Returns the distance discretization step parameter (the step value between each bin of the hash map f...
pcl::PointCloud< PointSource > PointCloudSource
float getModelDiameter()
Returns the maximum distance found between any feature pair in the given input feature cloud...
void setInputTarget(const PointCloudTargetConstPtr &cloud)
Provide a pointer to the input target (e.g., the point cloud that we want to align the input source t...
PPFRegistration()
Empty constructor that initializes all the parameters of the algorithm with default values...
PoseWithVotes(Eigen::Affine3f &a_pose, unsigned int &a_votes)
Ptr makeShared()
Convenience method for returning a copy of the class instance as a boost::shared_ptr.
float getRotationClusteringThreshold()
Returns the parameter defining the rotation clustering threshold.
unsigned int getSceneReferencePointSamplingRate()
Returns the parameter for the scene reference point sampling rate of the algorithm.
boost::shared_ptr< const PointCloud< PointT > > ConstPtr
boost::unordered_multimap< HashKeyStruct, std::pair< size_t, size_t > > FeatureHashMapType
PointCloudSource::ConstPtr PointCloudSourceConstPtr
pcl::PointCloud< PointTarget > PointCloudTarget
PointCloudTarget::ConstPtr PointCloudTargetConstPtr
Structure for storing a pose (represented as an Eigen::Affine3f) and an integer for counting votes...
Class that registers two point clouds based on their sets of PPFSignatures.
float getPositionClusteringThreshold()
Returns the parameter defining the position difference clustering parameter - distance threshold belo...
boost::shared_ptr< PPFHashMapSearch > Ptr
Data structure to hold the information for the key in the feature hash map of the PPFHashMapSearch cl...
boost::shared_ptr< PointCloud< PointSource > > Ptr
void setRotationClusteringThreshold(float clustering_rotation_diff_threshold)
Method for setting the rotation clustering parameter.
PointCloudSource::Ptr PointCloudSourcePtr
void setPositionClusteringThreshold(float clustering_position_diff_threshold)
Method for setting the position difference clustering parameter.
HashKeyStruct(int a, int b, int c, int d)
boost::shared_ptr< FeatureHashMapType > FeatureHashMapTypePtr