44 #ifndef _SUPER4PCS_ALGO_MATCH_4PCS_BASE_ 45 #define _SUPER4PCS_ALGO_MATCH_4PCS_BASE_ 49 #ifdef SUPER4PCS_USE_OPENMP 53 #include "super4pcs/shared4pcs.h" 54 #include "super4pcs/sampling.h" 55 #include "super4pcs/accelerators/kdtree.h" 56 #include "super4pcs/utils/logger.h" 58 #ifdef TEST_GLOBAL_TIMINGS 59 # include "super4pcs/utils/timer.h" 74 inline void operator() (
float,
float, Eigen::Ref<Match4PCSBase::MatrixType>)
const {}
83 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
112 std::vector<Point3D>* Q,
113 Eigen::Ref<MatrixType> transformation,
114 const Sampler& sampler = Sampler(),
115 const Visitor& v = Visitor());
120 int number_of_trials_;
125 Scalar max_base_diameter_;
132 Eigen::Matrix<Scalar, 4, 4> transform_;
137 Eigen::Matrix<Scalar, 3, 1> qcentroid1_, qcentroid2_;
144 int current_congruent_[4];
146 std::vector<Point3D> sampled_P_3D_;
148 std::vector<Point3D> sampled_Q_3D_;
150 std::vector<Point3D> base_3D_;
153 std::vector<Point3D> Q_copy_;
167 std::mt19937 randomGenerator_;
171 #ifdef SUPER4PCS_USE_OPENMP 172 const int omp_nthread_congruent_;
176 #ifdef TEST_GLOBAL_TIMINGS 190 #ifdef SUPER4PCS_USE_OPENMP
191 ,
const int omp_nthread_congruent = omp_get_max_threads()
196 inline void Log(Args...args)
const { logger_.
Log<level>(args...); }
212 bool SelectRandomTriangle(
int& base1,
int& base2,
int& base3);
218 bool TryQuadrilateral(
Scalar &invariant1,
Scalar &invariant2,
219 int &base1,
int &base2,
int &base3,
int &base4);
232 bool ComputeRigidTransformation(
const std::array<Point3D, 4>& ref,
233 const std::array<Point3D, 4>& candidate,
234 const Eigen::Matrix<Scalar, 3, 1>& centroid1,
235 Eigen::Matrix<Scalar, 3, 1> centroid2,
237 Eigen::Ref<MatrixType> transform,
239 bool computeScale )
const;
245 Scalar Verify(
const Eigen::Ref<const MatrixType> & mat)
const;
251 template <
typename Visitor>
252 bool Perform_N_steps(
int n,
253 Eigen::Ref<MatrixType> transformation,
254 std::vector<Point3D>* Q,
260 template <
typename Visitor>
261 bool TryOneBase(
const Visitor &v);
271 Initialize(
const std::vector<Point3D>& P,
272 const std::vector<Point3D>& Q) = 0;
274 template <
typename Sampler>
275 void init(
const std::vector<Point3D>& P,
276 const std::vector<Point3D>& Q,
277 const Sampler& sampler);
282 bool SelectQuadrilateral(
Scalar &invariant1,
Scalar &invariant2,
283 int& base1,
int& base2,
int& base3,
int& base4);
285 const std::vector<Point3D>& base3D()
const {
return base_3D_; }
301 ExtractPairs(
Scalar pair_distance,
302 Scalar pair_normals_angle,
303 Scalar pair_distance_epsilon,
int base_point1,
321 FindCongruentQuadrilaterals(
Scalar invariant1,
Scalar invariant2,
322 Scalar distance_threshold1,
323 Scalar distance_threshold2,
326 std::vector<Quadrilateral>* quadrilaterals)
const = 0;
331 template <
typename Visitor>
332 bool TryCongruentSet(
int base_id1,
336 const std::vector<Quadrilateral> &congruent_quads,
338 size_t &nbCongruent);
345 #include "super4pcs/algorithms/match4pcsBase.hpp" std::vector< std::pair< int, int > > PairsVector
Definition: match4pcsBase.h:68
const std::vector< Point3D > & getSecondSampled() const
Read access to the sampled clouds used for the registration.
Definition: match4pcsBase.h:93
Eigen::Matrix< Scalar, 4, 4 > MatrixType
Definition: match4pcsBase.h:71
static constexpr int kNumberOfDiameterTrials
Definition: match4pcsBase.h:79
Scalar ComputeTransformation(const std::vector< Point3D > &P, std::vector< Point3D > *Q, Eigen::Ref< MatrixType > transformation, const Sampler &sampler=Sampler(), const Visitor &v=Visitor())
Computes an approximation of the best LCP (directional) from Q to P and the rigid transformation that...
Definition: match4pcsBase.hpp:63
Sampling::UniformDistSampler DefaultSampler
Definition: match4pcsBase.h:77
void Log(const Args &...args) const
Definition: logger.h:74
typename Point3D::VectorType VectorType
Definition: match4pcsBase.h:70
LogLevel
Definition: logger.h:55
Definition: match4pcsBase.h:65
Eigen::Matrix< Scalar, 3, 1 > VectorType
Definition: shared4pcs.h:64
const std::vector< Point3D > & getFirstSampled() const
Read access to the sampled clouds used for the registration.
Definition: match4pcsBase.h:88
static constexpr Scalar distance_factor
Definition: match4pcsBase.h:81
void operator()(float, float, Eigen::Ref< Match4PCSBase::MatrixType >) const
Definition: match4pcsBase.h:74
delta and overlap_estimation are the application parameters. All other parameters are more likely to ...
Definition: shared4pcs.h:148
float Scalar
Definition: shared4pcs.h:63
Definition: match4pcsBase.h:73
constexpr bool needsGlobalTransformation() const
Definition: match4pcsBase.h:75
virtual EIGEN_MAKE_ALIGNED_OPERATOR_NEW ~Match4PCSBase()
Definition: match4pcsBase.cc:156
Definition: sampling.h:59
typename Point3D::Scalar Scalar
Definition: match4pcsBase.h:69
static constexpr Scalar kLargeNumber
Definition: match4pcsBase.h:80