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)
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);
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);
284 posesWithinErrorBounds (Eigen::Affine3f &pose1,
285 Eigen::Affine3f &pose2);
289 #include <pcl/registration/impl/ppf_registration.hpp>
291 #endif // PCL_PPF_REGISTRATION_H_
std::vector< PoseWithVotes, Eigen::aligned_allocator< PoseWithVotes > > PoseWithVotesList
Class that registers two point clouds based on their sets of PPFSignatures.
PointCloudSource::Ptr PointCloudSourcePtr
float getModelDiameter()
Returns the maximum distance found between any feature pair in the given input feature cloud...
void setSceneReferencePointSamplingRate(unsigned int scene_reference_point_sampling_rate)
Method for setting the scene reference point sampling rate.
HashKeyStruct(int a, int b, int c, int d)
PoseWithVotes(Eigen::Affine3f &a_pose, unsigned int &a_votes)
unsigned int getSceneReferencePointSamplingRate()
Returns the parameter for the scene reference point sampling rate of the algorithm.
float getDistanceDiscretizationStep()
Returns the distance discretization step parameter (the step value between each bin of the hash map f...
boost::shared_ptr< FeatureHashMapType > FeatureHashMapTypePtr
float getAngleDiscretizationStep()
Returns the angle discretization step parameter (the step value between each bin of the hash map for ...
pcl::PointCloud< PointTarget > PointCloudTarget
boost::shared_ptr< PPFHashMapSearch > Ptr
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...
void setPositionClusteringThreshold(float clustering_position_diff_threshold)
Method for setting the position difference clustering parameter.
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.
void setRotationClusteringThreshold(float clustering_rotation_diff_threshold)
Method for setting the rotation clustering parameter.
Data structure to hold the information for the key in the feature hash map of the PPFHashMapSearch cl...
float getPositionClusteringThreshold()
Returns the parameter defining the position difference clustering parameter - distance threshold belo...
boost::shared_ptr< PointCloud< PointT > > Ptr
PointCloudTarget::ConstPtr PointCloudTargetConstPtr
boost::unordered_multimap< HashKeyStruct, std::pair< size_t, size_t > > FeatureHashMapType
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...
pcl::PointCloud< PointSource > PointCloudSource
boost::shared_ptr< const PointCloud< PointT > > ConstPtr
PointCloudTarget::Ptr PointCloudTargetPtr
std::vector< std::vector< float > > alpha_m_
Structure for storing a pose (represented as an Eigen::Affine3f) and an integer for counting votes...
void setSearchMethod(PPFHashMapSearch::Ptr search_method)
Function that sets the search method for the algorithm.
PointCloudSource::ConstPtr PointCloudSourceConstPtr
Registration represents the base registration class for general purpose, ICP-like methods...
PPFHashMapSearch::Ptr getSearchMethod()
Getter function for the search method of the class.
PPFRegistration()
Empty constructor that initializes all the parameters of the algorithm with default values...
boost::shared_ptr< KdTreeFLANN< PointT > > Ptr