Go to the documentation of this file.00001
00064 #ifndef TF_EST_MULTI_CORS_H_
00065 #define TF_EST_MULTI_CORS_H_
00066
00067 #include <pcl/registration/registration.h>
00068 #ifdef PCL_VERSION_COMPARE
00069 #include <pcl/registration/correspondence_estimation.h>
00070 #include <pcl/registration/correspondence_types.h>
00071 #endif
00072
00076 template <typename Point>
00077 class TransformationEstimationMultipleCorrespondences : public pcl::Registration<Point, Point>
00078 {
00079
00081 struct COR_S {
00082 int ind_o, ind_n;
00083 float dis;
00084 };
00085
00087 struct SORT_S2 {
00088 float dis;
00089 int ind;
00090
00091 bool operator() (const SORT_S2 &i, const SORT_S2 &j) const { return (i.dis<j.dis);}
00092 };
00093
00094 typedef typename pcl::Registration<Point, Point>::PointCloudSource PointCloudSource;
00095 typedef typename PointCloudSource::Ptr PointCloudSourcePtr;
00096 typedef typename PointCloudSource::ConstPtr PointCloudSourceConstPtr;
00097
00098 public:
00099 TransformationEstimationMultipleCorrespondences () :
00100 tmax_(0.1f), rmax_(0.1f)
00101 {
00102 reg_name_ = "TransformationEstimationMultipleCorrespondences";
00103 };
00104
00106 void setMaxAngularDistance(const float f) {rmax_=f;}
00108 void setMaxTranslationDistance(const float f) {tmax_=f;}
00109
00111 Eigen::Matrix4f compute(const pcl::PointCloud<Point> &pc_old, const pcl::PointCloud<Point> &pc_new);
00112
00113 protected:
00114 virtual void
00115 computeTransformation (PointCloudSource &output);
00116
00117 virtual void
00118 computeTransformation (PointCloudSource &output,const Eigen::Matrix4f& guess){};
00119
00120
00121 Eigen::Matrix4f findTF_fast
00122 (const pcl::PointCloud<Point> &pc_old, const pcl::PointCloud<Point> &pc_new,
00123 const float rmax=0.1, const float tmax=0.1, Eigen::Matrix4f tf=Eigen::Matrix4f::Identity());
00124 int search_sorted_vector(const std::vector<SORT_S2> &tv, const float val);
00125
00126 float tmax_,rmax_;
00127
00128 using pcl::Registration<Point, Point>::converged_;
00129 using pcl::Registration<Point, Point>::reg_name_;
00130 using pcl::Registration<Point, Point>::final_transformation_;
00131 using pcl::Registration<Point, Point>::target_;
00132
00133 };
00134
00135 #include "impl/tf_est_multi_cors.hpp"
00136
00137 #endif