Super4PCS Library  V1.1.2(719f5c0)
super4pcs.h
1 // Copyright 2014 Nicolas Mellado
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 //
15 // -------------------------------------------------------------------------- //
16 //
17 // Authors: Nicolas Mellado, Dror Aiger
18 //
19 // An implementation of the Super 4-points Congruent Sets (Super 4PCS)
20 // algorithm presented in:
21 //
22 // Super 4PCS: Fast Global Pointcloud Registration via Smart Indexing
23 // Nicolas Mellado, Dror Aiger, Niloy J. Mitra
24 // Symposium on Geometry Processing 2014.
25 //
26 // Data acquisition in large-scale scenes regularly involves accumulating
27 // information across multiple scans. A common approach is to locally align scan
28 // pairs using Iterative Closest Point (ICP) algorithm (or its variants), but
29 // requires static scenes and small motion between scan pairs. This prevents
30 // accumulating data across multiple scan sessions and/or different acquisition
31 // modalities (e.g., stereo, depth scans). Alternatively, one can use a global
32 // registration algorithm allowing scans to be in arbitrary initial poses. The
33 // state-of-the-art global registration algorithm, 4PCS, however has a quadratic
34 // time complexity in the number of data points. This vastly limits its
35 // applicability to acquisition of large environments. We present Super 4PCS for
36 // global pointcloud registration that is optimal, i.e., runs in linear time (in
37 // the number of data points) and is also output sensitive in the complexity of
38 // the alignment problem based on the (unknown) overlap across scan pairs.
39 // Technically, we map the algorithm as an 'instance problem' and solve it
40 // efficiently using a smart indexing data organization. The algorithm is
41 // simple, memory-efficient, and fast. We demonstrate that Super 4PCS results in
42 // significant speedup over alternative approaches and allows unstructured
43 // efficient acquisition of scenes at scales previously not possible. Complete
44 // source code and datasets are available for research use at
45 // http://geometry.cs.ucl.ac.uk/projects/2014/super4PCS/.
46 
47 #ifndef _SUPER4PCS_ALGO_SUPER4PCS_H_
48 #define _SUPER4PCS_ALGO_SUPER4PCS_H_
49 
50 #include "super4pcs/algorithms/match4pcsBase.h"
51 #include "super4pcs/algorithms/pairCreationFunctor.h"
52 
53 namespace GlobalRegistration {
54 
56 class MatchSuper4PCS : public Match4PCSBase {
57  public:
59  using Scalar = typename Base::Scalar;
60  using PairsVector = typename Base::PairsVector;
61 
62  explicit MatchSuper4PCS(const Match4PCSOptions& options,
63  const Utils::Logger &logger);
64 
65  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
66 
68 
69 private:
73 
75 
76  mutable PairCreationFunctor<Scalar> pcfunctor_;
77 
78 protected:
92  void
93  ExtractPairs(
94  Scalar pair_distance,
95  Scalar pair_normals_angle,
96  Scalar pair_distance_epsilon,
97  int base_point1,
98  int base_point2,
99  PairsVector* pairs) const override;
100 
114  bool FindCongruentQuadrilaterals(
115  Scalar invariant1,
116  Scalar invariant2,
117  Scalar distance_threshold1,
118  Scalar distance_threshold2,
119  const PairsVector& P_pairs,
120  const PairsVector& Q_pairs,
121  std::vector<Quadrilateral>* quadrilaterals) const override;
122 
128  void Initialize(const std::vector<Point3D>& P,
129  const std::vector<Point3D>& Q) override;
130 };
131 }
132 
133 #endif
std::vector< std::pair< int, int > > PairsVector
Definition: match4pcsBase.h:68
EIGEN_MAKE_ALIGNED_OPERATOR_NEW ~MatchSuper4PCS()
Definition: super4pcs.cc:76
MatchSuper4PCS(const Match4PCSOptions &options, const Utils::Logger &logger)
Definition: super4pcs.cc:66
typename Base::Scalar Scalar
Definition: super4pcs.h:59
Class for the computation of the 4PCS algorithm.
Definition: super4pcs.h:56
Definition: bbox.h:54
Definition: match4pcsBase.h:65
typename Base::PairsVector PairsVector
Definition: super4pcs.h:60
delta and overlap_estimation are the application parameters. All other parameters are more likely to ...
Definition: shared4pcs.h:148
typename Point3D::Scalar Scalar
Definition: match4pcsBase.h:69
Definition: logger.h:62