ICP.cpp
Go to the documentation of this file.
1 // kate: replace-tabs off; indent-width 4; indent-mode normal
2 // vim: ts=4:sw=4:noexpandtab
3 /*
4 
5 Copyright (c) 2010--2012,
6 François Pomerleau and Stephane Magnenat, ASL, ETHZ, Switzerland
7 You can contact the authors at <f dot pomerleau at gmail dot com> and
8 <stephane at magnenat dot net>
9 
10 All rights reserved.
11 
12 Redistribution and use in source and binary forms, with or without
13 modification, are permitted provided that the following conditions are met:
14  * Redistributions of source code must retain the above copyright
15  notice, this list of conditions and the following disclaimer.
16  * Redistributions in binary form must reproduce the above copyright
17  notice, this list of conditions and the following disclaimer in the
18  documentation and/or other materials provided with the distribution.
19  * Neither the name of the <organization> nor the
20  names of its contributors may be used to endorse or promote products
21  derived from this software without specific prior written permission.
22 
23 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
24 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 DISCLAIMED. IN NO EVENT SHALL ETH-ASL BE LIABLE FOR ANY
27 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 
34 */
35 
36 #include "PointMatcher.h"
37 #include "PointMatcherPrivate.h"
38 #include "Timer.h"
39 
40 #include "LoggerImpl.h"
41 #include "TransformationsImpl.h"
42 #include "DataPointsFiltersImpl.h"
43 #include "MatchersImpl.h"
44 #include "OutlierFiltersImpl.h"
45 #include "ErrorMinimizersImpl.h"
47 #include "InspectorsImpl.h"
48 
49 #include <yaml-cpp/yaml.h>
50 
51 using namespace std;
52 using namespace PointMatcherSupport;
53 
55 InvalidModuleType::InvalidModuleType(const std::string& reason):
56  runtime_error(reason)
57 {}
58 
60 template<typename T>
62  prefilteredReadingPtsCount(0),
63  prefilteredReferencePtsCount(0),
64  maxNumIterationsReached(false)
65 {}
66 
68 template<typename T>
70 {
71 }
72 
74 template<typename T>
76 {
77  transformations.clear();
78  readingDataPointsFilters.clear();
79  readingStepDataPointsFilters.clear();
80  referenceDataPointsFilters.clear();
81  matcher.reset();
82  outlierFilters.clear();
83  errorMinimizer.reset();
84  transformationCheckers.clear();
85  inspector.reset();
86 }
87 
89 template<typename T>
91 {
92 }
93 
95 template<typename T>
97 {
98  this->cleanup();
99 
100  this->transformations.push_back(std::make_shared<typename TransformationsImpl<T>::RigidTransformation>());
101  this->readingDataPointsFilters.push_back(std::make_shared<typename DataPointsFiltersImpl<T>::RandomSamplingDataPointsFilter>());
102  this->referenceDataPointsFilters.push_back(std::make_shared<typename DataPointsFiltersImpl<T>::SamplingSurfaceNormalDataPointsFilter>());
103  this->outlierFilters.push_back(std::make_shared<typename OutlierFiltersImpl<T>::TrimmedDistOutlierFilter>());
104  this->matcher = std::make_shared<typename MatchersImpl<T>::KDTreeMatcher>();
105  this->errorMinimizer = std::make_shared<PointToPlaneErrorMinimizer<T> >();
106  this->transformationCheckers.push_back(std::make_shared<typename TransformationCheckersImpl<T>::CounterTransformationChecker>());
107  this->transformationCheckers.push_back(std::make_shared<typename TransformationCheckersImpl<T>::DifferentialTransformationChecker>());
108  this->inspector = std::make_shared<typename InspectorsImpl<T>::NullInspector>();
109 }
110 
112 template<typename T>
114 {
115  this->cleanup();
116 
117  typedef set<string> StringSet;
118  StringSet usedModuleTypes;
119 
120  // Fix for issue #6: compilation on gcc 4.4.4
121  //PointMatcher<T> pm;
122  const PointMatcher & pm = PointMatcher::get();
123 
124  {
125  // NOTE: The logger needs to be initialize first to allow ouput from other contructors
126  boost::mutex::scoped_lock lock(loggerMutex);
127  usedModuleTypes.insert(createModuleFromRegistrar("logger", doc, pm.REG(Logger), logger));
128  }
129  usedModuleTypes.insert(createModulesFromRegistrar("readingDataPointsFilters", doc, pm.REG(DataPointsFilter), readingDataPointsFilters));
130  usedModuleTypes.insert(createModulesFromRegistrar("readingStepDataPointsFilters", doc, pm.REG(DataPointsFilter), readingStepDataPointsFilters));
131  usedModuleTypes.insert(createModulesFromRegistrar("referenceDataPointsFilters", doc, pm.REG(DataPointsFilter), referenceDataPointsFilters));
132  //usedModuleTypes.insert(createModulesFromRegistrar("transformations", doc, pm.REG(Transformation), transformations));
133  usedModuleTypes.insert(createModuleFromRegistrar("matcher", doc, pm.REG(Matcher), matcher));
134  usedModuleTypes.insert(createModulesFromRegistrar("outlierFilters", doc, pm.REG(OutlierFilter), outlierFilters));
135  usedModuleTypes.insert(createModuleFromRegistrar("errorMinimizer", doc, pm.REG(ErrorMinimizer), errorMinimizer));
136 
137  // See if to use a rigid transformation
138  if (nodeVal("errorMinimizer", doc) != "PointToPointSimilarityErrorMinimizer")
139  this->transformations.push_back(std::make_shared<typename TransformationsImpl<T>::RigidTransformation>());
140  else
141  this->transformations.push_back(std::make_shared<typename TransformationsImpl<T>::SimilarityTransformation>());
142 
143  usedModuleTypes.insert(createModulesFromRegistrar("transformationCheckers", doc, pm.REG(TransformationChecker), transformationCheckers));
144  usedModuleTypes.insert(createModuleFromRegistrar("inspector", doc, pm.REG(Inspector),inspector));
145 
146 
147  // FIXME: this line cause segfault when there is an error in the yaml file...
148  //loadAdditionalYAMLContent(doc);
149 
150  // check YAML entries that do not correspend to any module
151  for(YAML::const_iterator moduleTypeIt = doc.begin(); moduleTypeIt != doc.end(); ++moduleTypeIt)
152  {
153  std::string moduleType = moduleTypeIt->first.as<std::string>();
154 
155  if (usedModuleTypes.find(moduleType) == usedModuleTypes.end())
156  throw InvalidModuleType(
157  (boost::format("Module type %1% does not exist") % moduleType).str()
158  );
159  }
160 
161 }
162 
164 template<typename T>
166 {
167  YAML::Node doc = YAML::Load(in);
168  loadFromYamlNode(doc);
169 }
170 
172 template<typename T>
174 {
175  return prefilteredReadingPtsCount;
176 }
177 
179 template<typename T>
181 {
182  return prefilteredReferencePtsCount;
183 }
184 
186 template<typename T>
188 {
189  return maxNumIterationsReached;
190 }
191 
193 template<typename T>
194 template<typename R>
195 const std::string& PointMatcher<T>::ICPChainBase::createModulesFromRegistrar(const std::string& regName, const YAML::Node& doc, const R& registrar, std::vector<std::shared_ptr<typename R::TargetType> >& modules)
196 {
197  const YAML::Node reg = doc[regName];
198 
199  if (reg)
200  {
201  //cout << regName << endl;
202  for(YAML::const_iterator moduleIt = reg.begin(); moduleIt != reg.end(); ++moduleIt)
203  {
204  const YAML::Node& module(*moduleIt);
205  modules.push_back(registrar.createFromYAML(module));
206  }
207  }
208 
209  return regName;
210 }
211 
213 template<typename T>
214 template<typename R>
215 const std::string& PointMatcher<T>::ICPChainBase::createModuleFromRegistrar(const std::string& regName, const YAML::Node& doc, const R& registrar, std::shared_ptr<typename R::TargetType>& module)
216 {
217  const YAML::Node reg = doc[regName];
218 
219  if (reg)
220  {
221  //cout << regName << endl;
222  module = registrar.createFromYAML(reg);
223  }
224  else
225  module.reset();
226 
227  return regName;
228 }
229 
230 template<typename T>
231 std::string PointMatcher<T>::ICPChainBase::nodeVal(const std::string& regName, const YAML::Node& doc)
232 {
233  const YAML::Node reg = doc[regName];
234 
235  if (reg)
236  {
240 
241  return name;
242  }
243 
244  return "";
245 }
246 
247 template struct PointMatcher<float>::ICPChainBase;
248 template struct PointMatcher<double>::ICPChainBase;
249 
250 
252 template<typename T>
254  const DataPoints& readingIn,
255  const DataPoints& referenceIn)
256 {
257  const int dim = readingIn.features.rows();
258  const TransformationParameters identity = TransformationParameters::Identity(dim, dim);
259  return this->compute(readingIn, referenceIn, identity);
260 }
261 
263 template<typename T>
265  const DataPoints& readingIn,
266  const DataPoints& referenceIn,
267  const TransformationParameters& initialTransformationParameters)
268 {
269  return this->compute(readingIn, referenceIn, initialTransformationParameters);
270 }
271 
273 template<typename T>
275  const DataPoints& readingIn,
276  const DataPoints& referenceIn,
277  const TransformationParameters& T_refIn_dataIn)
278 {
279  // Ensuring minimum definition of components
280  if (!this->matcher)
281  throw runtime_error("You must setup a matcher before running ICP");
282  if (!this->errorMinimizer)
283  throw runtime_error("You must setup an error minimizer before running ICP");
284  if (!this->inspector)
285  throw runtime_error("You must setup an inspector before running ICP");
286 
287  this->inspector->init();
288 
289  timer t; // Print how long take the algo
290  const int dim(referenceIn.features.rows());
291 
292  // Apply reference filters
293  // reference is express in frame <refIn>
294  DataPoints reference(referenceIn);
295  this->referenceDataPointsFilters.init();
296  this->referenceDataPointsFilters.apply(reference);
297 
298  // Create intermediate frame at the center of mass of reference pts cloud
299  // this help to solve for rotations
300  const int nbPtsReference = reference.features.cols();
301  const Vector meanReference = reference.features.rowwise().sum() / nbPtsReference;
302  TransformationParameters T_refIn_refMean(Matrix::Identity(dim, dim));
303  T_refIn_refMean.block(0,dim-1, dim-1, 1) = meanReference.head(dim-1);
304 
305  // Reajust reference position:
306  // from here reference is express in frame <refMean>
307  // Shortcut to do T_refIn_refMean.inverse() * reference
308  reference.features.topRows(dim-1).colwise() -= meanReference.head(dim-1);
309 
310  // Init matcher with reference points center on its mean
311  this->matcher->init(reference);
312 
313  // statistics on last step
314  this->inspector->addStat("ReferencePreprocessingDuration", t.elapsed());
315  this->inspector->addStat("ReferenceInPointCount", referenceIn.features.cols());
316  this->inspector->addStat("ReferencePointCount", reference.features.cols());
317  LOG_INFO_STREAM("PointMatcher::icp - reference pre-processing took " << t.elapsed() << " [s]");
318  this->prefilteredReferencePtsCount = reference.features.cols();
319 
320  return computeWithTransformedReference(readingIn, reference, T_refIn_refMean, T_refIn_dataIn);
321 
322 }
323 
325 template<typename T>
327  const DataPoints& readingIn,
328  const DataPoints& reference,
329  const TransformationParameters& T_refIn_refMean,
330  const TransformationParameters& T_refIn_dataIn)
331 {
332  const int dim(reference.features.rows());
333 
334  if (T_refIn_dataIn.cols() != T_refIn_dataIn.rows()) {
335  throw runtime_error("The initial transformation matrix must be squared.");
336  }
337  if (dim != T_refIn_dataIn.cols()) {
338  throw runtime_error("The shape of initial transformation matrix must be NxN. "
339  "Where N is the number of rows in the read/reference scans.");
340  }
341 
342  timer t; // Print how long take the algo
343 
344  // Apply readings filters
345  // reading is express in frame <dataIn>
346  DataPoints reading(readingIn);
347  //const int nbPtsReading = reading.features.cols();
348  this->readingDataPointsFilters.init();
349  this->readingDataPointsFilters.apply(reading);
350  readingFiltered = reading;
351 
352  // Reajust reading position:
353  // from here reading is express in frame <refMean>
355  T_refMean_dataIn = T_refIn_refMean.inverse() * T_refIn_dataIn;
356  this->transformations.apply(reading, T_refMean_dataIn);
357 
358  // Prepare reading filters used in the loop
359  this->readingStepDataPointsFilters.init();
360 
361  // Since reading and reference are express in <refMean>
362  // the frame <refMean> is equivalent to the frame <iter(0)>
363  TransformationParameters T_iter = Matrix::Identity(dim, dim);
364 
365  bool iterate(true);
366  this->maxNumIterationsReached = false;
367  this->transformationCheckers.init(T_iter, iterate);
368 
369  size_t iterationCount(0);
370 
371  // statistics on last step
372  this->inspector->addStat("ReadingPreprocessingDuration", t.elapsed());
373  this->inspector->addStat("ReadingInPointCount", readingIn.features.cols());
374  this->inspector->addStat("ReadingPointCount", reading.features.cols());
375  LOG_INFO_STREAM("PointMatcher::icp - reading pre-processing took " << t.elapsed() << " [s]");
376  this->prefilteredReadingPtsCount = reading.features.cols();
377  t.restart();
378 
379  // iterations
380  while (iterate)
381  {
382  DataPoints stepReading(reading);
383 
384  //-----------------------------
385  // Apply step filter
386  this->readingStepDataPointsFilters.apply(stepReading);
387 
388  //-----------------------------
389  // Transform Readings
390  this->transformations.apply(stepReading, T_iter);
391 
392  //-----------------------------
393  // Match to closest point in Reference
394  const Matches matches(
395  this->matcher->findClosests(stepReading)
396  );
397 
398  //-----------------------------
399  // Detect outliers
400  const OutlierWeights outlierWeights(
401  this->outlierFilters.compute(stepReading, reference, matches)
402  );
403 
404  assert(outlierWeights.rows() == matches.ids.rows());
405  assert(outlierWeights.cols() == matches.ids.cols());
406 
407  //cout << "outlierWeights: " << outlierWeights << "\n";
408 
409 
410  //-----------------------------
411  // Dump
412  this->inspector->dumpIteration(
413  iterationCount, T_iter, reference, stepReading, matches, outlierWeights, this->transformationCheckers
414  );
415 
416  //-----------------------------
417  // Error minimization
418  // equivalent to:
419  // T_iter(i+1)_iter(0) = T_iter(i+1)_iter(i) * T_iter(i)_iter(0)
420  T_iter = this->errorMinimizer->compute(
421  stepReading, reference, outlierWeights, matches) * T_iter;
422 
423  // Old version
424  //T_iter = T_iter * this->errorMinimizer->compute(
425  // stepReading, reference, outlierWeights, matches);
426 
427  // in test
428  try
429  {
430  this->transformationCheckers.check(T_iter, iterate);
431  }
433  {
434  iterate = false;
435  this->maxNumIterationsReached = true;
436  }
437 
438  ++iterationCount;
439  }
440 
441  this->inspector->addStat("IterationsCount", iterationCount);
442  this->inspector->addStat("PointCountTouched", this->matcher->getVisitCount());
443  this->matcher->resetVisitCount();
444  this->inspector->addStat("OverlapRatio", this->errorMinimizer->getWeightedPointUsedRatio());
445  this->inspector->addStat("ConvergenceDuration", t.elapsed());
446  this->inspector->finish(iterationCount);
447 
448  LOG_INFO_STREAM("PointMatcher::icp - " << iterationCount << " iterations took " << t.elapsed() << " [s]");
449 
450  // Move transformation back to original coordinate (without center of mass)
451  // T_iter is equivalent to: T_iter(i+1)_iter(0)
452  // the frame <iter(0)> equals <refMean>
453  // so we have:
454  // T_iter(i+1)_dataIn = T_iter(i+1)_iter(0) * T_refMean_dataIn
455  // T_iter(i+1)_dataIn = T_iter(i+1)_iter(0) * T_iter(0)_dataIn
456  // T_refIn_refMean remove the temperary frame added during initialization
457  return (T_refIn_refMean * T_iter * T_refMean_dataIn);
458 }
459 
460 template struct PointMatcher<float>::ICP;
461 template struct PointMatcher<double>::ICP;
462 
463 
465 template<typename T>
467 {
468  return (mapPointCloud.features.cols() != 0);
469 }
470 
472 template<typename T>
474 {
475  // Ensuring minimum definition of components
476  if (!this->matcher)
477  throw runtime_error("You must setup a matcher before running ICP");
478  if (!this->inspector)
479  throw runtime_error("You must setup an inspector before running ICP");
480 
481  timer t; // Print how long take the algo
482  const int dim(inputCloud.features.rows());
483  const int ptCount(inputCloud.features.cols());
484 
485  // update keyframe
486  if (ptCount == 0)
487  {
488  LOG_WARNING_STREAM("Ignoring attempt to create a map from an empty cloud");
489  return false;
490  }
491 
492  this->inspector->addStat("MapPointCount", inputCloud.features.cols());
493 
494  // Set map
495  mapPointCloud = inputCloud;
496 
497  // Create intermediate frame at the center of mass of reference pts cloud
498  // this help to solve for rotations
499  const Vector meanMap = mapPointCloud.features.rowwise().sum() / ptCount;
500  T_refIn_refMean = Matrix::Identity(dim, dim);
501  T_refIn_refMean.block(0,dim-1, dim-1, 1) = meanMap.head(dim-1);
502 
503  // Reajust reference position (only translations):
504  // from here reference is express in frame <refMean>
505  // Shortcut to do T_refIn_refMean.inverse() * reference
506  mapPointCloud.features.topRows(dim-1).colwise() -= meanMap.head(dim-1);
507 
508  // Apply reference filters
509  this->referenceDataPointsFilters.init();
510  this->referenceDataPointsFilters.apply(mapPointCloud);
511 
512  this->matcher->init(mapPointCloud);
513 
514  this->inspector->addStat("SetMapDuration", t.elapsed());
515 
516  return true;
517 }
518 
520 template<typename T>
522 {
523  const int dim(mapPointCloud.features.rows());
524  T_refIn_refMean = Matrix::Identity(dim, dim);
525  mapPointCloud = DataPoints();
526 }
527 
528 template<typename T>
530 {
532 
533  if(mapPointCloud.getNbPoints() > 0)
534  {
535  this->matcher->init(mapPointCloud);
536  }
537 }
538 
539 template<typename T>
541 {
543 }
544 
545 template<typename T>
547 {
549 
550  if(mapPointCloud.getNbPoints() > 0)
551  {
552  this->matcher->init(mapPointCloud);
553  }
554 }
555 
557 template<typename T>
559 {
560  DataPoints globalMap(mapPointCloud);
561  if(this->hasMap())
562  {
563  const int dim(mapPointCloud.features.rows());
564  const Vector meanMapNonHomo(T_refIn_refMean.block(0,dim-1, dim-1, 1));
565  globalMap.features.topRows(dim-1).colwise() += meanMapNonHomo;
566  }
567 
568  return globalMap;
569 }
570 
572 template<typename T>
575 }
576 
578 template<typename T>
580 {
581  return mapPointCloud;
582 }
583 
585 template<typename T>
588 }
589 
591 template<typename T>
593  const DataPoints& cloudIn)
594 {
595  const int dim = cloudIn.features.rows();
596  const TransformationParameters identity = TransformationParameters::Identity(dim, dim);
597  return this->compute(cloudIn, identity);
598 }
599 
601 template<typename T>
603  const DataPoints& cloudIn, const TransformationParameters& T_dataInOld_dataInNew)
604 {
605  return this->compute(cloudIn, T_dataInOld_dataInNew);
606 }
607 
609 template<typename T>
611  const DataPoints& cloudIn, const TransformationParameters& T_refIn_dataIn)
612 {
613  // initial keyframe
614  if (!hasMap())
615  {
616  const int dim(cloudIn.features.rows());
617  LOG_WARNING_STREAM("Ignoring attempt to perform ICP with an empty map");
618  return Matrix::Identity(dim, dim);
619  }
620 
621  this->inspector->init();
622 
623  return this->computeWithTransformedReference(cloudIn, mapPointCloud, T_refIn_refMean, T_refIn_dataIn);
624 }
625 
626 template struct PointMatcher<float>::ICPSequence;
627 template struct PointMatcher<double>::ICPSequence;
PointMatcher::ICPSequence
Definition: PointMatcher.h:735
PointMatcher::ICPSequence::setDefault
virtual void setDefault()
Construct an ICP algorithm that works in most of the cases.
Definition: ICP.cpp:529
compute_overlap.reference
reference
Definition: compute_overlap.py:71
PointMatcher::ICPChainBase::cleanup
void cleanup()
Clean chain up, empty all filters and delete associated objects.
Definition: ICP.cpp:75
PointMatcher::ICPChainBase::loadFromYaml
virtual void loadFromYaml(std::istream &in)
Construct an ICP algorithm from a YAML file.
Definition: ICP.cpp:165
PointMatcher::ICPSequence::clearMap
void clearMap()
Clear the map (reset to same state as after the object is created)
Definition: ICP.cpp:521
PointMatcher::ICPSequence::hasMap
bool hasMap() const
Return whether the object currently holds a valid map.
Definition: ICP.cpp:466
PointMatcher::ICPChainBase::createModuleFromRegistrar
const std::string & createModuleFromRegistrar(const std::string &regName, const YAML::Node &doc, const R &registrar, std::shared_ptr< typename R::TargetType > &module)
Instantiate a module if its name is in the YAML file.
Definition: ICP.cpp:215
TransformationCheckersImpl::CounterTransformationChecker::MaxNumIterationsReached
Struct used to inform through an exeption that ICP reached max number of iterations.
Definition: TransformationCheckersImpl.h:61
PointMatcher::ICPSequence::compute
TransformationParameters compute(const DataPoints &cloudIn, const TransformationParameters &initialTransformationParameters)
Apply ICP to cloud cloudIn, with initial guess.
Definition: ICP.cpp:610
compute_overlap.transformations
transformations
Definition: compute_overlap.py:45
LoggerImpl.h
timer
PointMatcher::OutlierWeights
Matrix OutlierWeights
Weights of the associations between the points in Matches and the points in the reference.
Definition: PointMatcher.h:397
DataPoints
PM::DataPoints DataPoints
Definition: pypoint_matcher_helper.h:16
icp_customized.name
string name
Definition: icp_customized.py:45
PointMatcher::ICP::compute
TransformationParameters compute(const DataPoints &readingIn, const DataPoints &referenceIn, const TransformationParameters &initialTransformationParameters)
Perform ICP from initial guess and return optimised transformation matrix.
Definition: ICP.cpp:274
LOG_INFO_STREAM
#define LOG_INFO_STREAM(args)
Definition: PointMatcherPrivate.h:58
OutlierFiltersImpl.h
PointMatcher::ICPChainBase::createModulesFromRegistrar
const std::string & createModulesFromRegistrar(const std::string &regName, const YAML::Node &doc, const R &registrar, std::vector< std::shared_ptr< typename R::TargetType > > &modules)
Instantiate modules if their names are in the YAML file.
Definition: ICP.cpp:195
PointMatcher::ICPChainBase::loadAdditionalYAMLContent
virtual void loadAdditionalYAMLContent(YAML::Node &doc)
Hook to load addition subclass-specific content from the YAML file.
Definition: ICP.cpp:90
PointMatcherSupport::loggerMutex
boost::mutex loggerMutex
mutex to protect access to logging
Definition: Logger.cpp:41
PointMatcher::ICPChainBase::setDefault
virtual void setDefault()
Construct an ICP algorithm that works in most of the cases.
Definition: ICP.cpp:96
timer::restart
void restart()
PointMatcher::ICPSequence::setMap
bool setMap(const DataPoints &map)
Set the map using inputCloud.
Definition: ICP.cpp:473
PointMatcher::OutlierFilter
An outlier filter removes or weights links between points in reading and their matched points in refe...
Definition: PointMatcher.h:500
PointMatcher
Functions and classes that are dependant on scalar type are defined in this templatized class.
Definition: PointMatcher.h:130
PointMatcherPrivate.h
PointMatcherSupport::Logger
The logger interface, used to output warnings and informations.
Definition: PointMatcher.h:104
PointMatcher::ICPChainBase
Stuff common to all ICP algorithms.
Definition: PointMatcher.h:656
PointMatcher::DataPoints
A point cloud.
Definition: PointMatcher.h:207
PointMatcher::Matcher
A matcher links points in the reading to points in the reference.
Definition: PointMatcher.h:474
ErrorMinimizersImpl.h
testing::internal::string
::std::string string
Definition: gtest.h:1979
PointMatcher::ICPChainBase::loadFromYamlNode
virtual void loadFromYamlNode(const YAML::Node &doc)
Construct an ICP algorithm from a YAML file.
Definition: ICP.cpp:113
PointMatcher::ICPSequence::operator()
TransformationParameters operator()(const DataPoints &cloudIn)
Apply ICP to cloud cloudIn, with identity as initial guess.
Definition: ICP.cpp:592
PointMatcherSupport::InvalidModuleType
An exception thrown when one tries to use a module type that does not exist.
Definition: PointMatcher.h:83
PointMatcher::ICPChainBase::nodeVal
std::string nodeVal(const std::string &regName, const YAML::Node &doc)
Get the value of a field in a node.
Definition: ICP.cpp:231
PointMatcher::ICPSequence::getPrefilteredInternalMap
const DataPoints & getPrefilteredInternalMap() const
Return the map, in internal coordinates (fast)
Definition: ICP.cpp:579
TransformationCheckersImpl::DifferentialTransformationChecker
Definition: TransformationCheckersImpl.h:81
icp_customized.errorMinimizer
errorMinimizer
Definition: icp_customized.py:125
Timer.h
align_sequence.params
params
Definition: align_sequence.py:13
PointMatcher::ICPSequence::loadFromYaml
virtual void loadFromYaml(std::istream &in)
Construct an ICP algorithm from a YAML file.
Definition: ICP.cpp:546
TransformationsImpl::SimilarityTransformation
Definition: TransformationsImpl.h:68
OutlierFiltersImpl::TrimmedDistOutlierFilter
Definition: OutlierFiltersImpl.h:128
MatchersImpl.h
icp_advance_api.matches
matches
Definition: icp_advance_api.py:114
PointMatcher::TransformationChecker
A transformation checker can stop the iteration depending on some conditions.
Definition: PointMatcher.h:584
PointMatcher::DataPointsFilter
A data filter takes a point cloud as input, transforms it, and produces another point cloud as output...
Definition: PointMatcher.h:440
PointMatcherSupport::getNameParamsFromYAML
void getNameParamsFromYAML(const YAML::Node &module, std::string &name, Parametrizable::Parameters &params)
Retrieve name and parameters from a yaml node.
Definition: Registrar.cpp:7
LOG_WARNING_STREAM
#define LOG_WARNING_STREAM(args)
Definition: PointMatcherPrivate.h:68
TransformationsImpl::RigidTransformation
Definition: TransformationsImpl.h:54
icp_customized.matcher
matcher
Definition: icp_customized.py:121
PointMatcher::ICP::operator()
TransformationParameters operator()(const DataPoints &readingIn, const DataPoints &referenceIn)
Perform ICP and return optimised transformation matrix.
Definition: ICP.cpp:253
PointMatcher::DataPoints::features
Matrix features
features of points in the cloud
Definition: PointMatcher.h:331
PointMatcher::Vector
Eigen::Matrix< T, Eigen::Dynamic, 1 > Vector
A vector over ScalarType.
Definition: PointMatcher.h:161
timer::elapsed
double elapsed() const
TransformationsImpl.h
PointMatcher::ICPChainBase::ICPChainBase
ICPChainBase()
Protected contstructor, to prevent the creation of this object.
Definition: ICP.cpp:61
PointMatcher::ICP::computeWithTransformedReference
TransformationParameters computeWithTransformedReference(const DataPoints &readingIn, const DataPoints &reference, const TransformationParameters &T_refIn_refMean, const TransformationParameters &initialTransformationParameters)
Perferm ICP using an already-transformed reference and with an already-initialized matcher.
Definition: ICP.cpp:326
DataPointsFiltersImpl::SamplingSurfaceNormalDataPointsFilter
::SamplingSurfaceNormalDataPointsFilter< T > SamplingSurfaceNormalDataPointsFilter
Definition: DataPointsFiltersImpl.h:82
PointMatcher::Matches
Result of the data-association step (Matcher::findClosests), before outlier rejection.
Definition: PointMatcher.h:371
TransformationCheckersImpl::CounterTransformationChecker
Definition: TransformationCheckersImpl.h:58
std
icp_advance_api.dim
dim
Definition: icp_advance_api.py:152
DataPointsFiltersImpl::RandomSamplingDataPointsFilter
::RandomSamplingDataPointsFilter< T > RandomSamplingDataPointsFilter
Definition: DataPointsFiltersImpl.h:85
TransformationCheckersImpl.h
InspectorsImpl.h
icp_customized.inspector
inspector
Definition: icp_customized.py:131
PointMatcher::Inspector
An inspector allows to log data at the different steps, for analysis.
Definition: PointMatcher.h:625
PointMatcher::get
static const PointMatcher & get()
Return instances.
Definition: Registry.cpp:146
PointMatcher::ICPSequence::loadFromYamlNode
virtual void loadFromYamlNode(const YAML::Node &doc)
Construct an ICP algorithm from a YAML file.
Definition: ICP.cpp:540
PointMatcher::ErrorMinimizer
An error minimizer will compute a transformation matrix such as to minimize the error between the rea...
Definition: PointMatcher.h:531
PointMatcherSupport
Functions and classes that are not dependant on scalar type are defined in this namespace.
Definition: Bibliography.cpp:45
PointMatcher::ICPChainBase::getMaxNumIterationsReached
bool getMaxNumIterationsReached() const
Return the flag that informs if we reached the maximum number of iterations during the last iterative...
Definition: ICP.cpp:187
PointMatcher::ICPSequence::getPrefilteredMap
const DataPoints getPrefilteredMap() const
Return the map, in global coordinates (slow)
Definition: ICP.cpp:558
PointMatcher::ICPChainBase::getPrefilteredReferencePtsCount
unsigned getPrefilteredReferencePtsCount() const
Return the remaining number of points in the reference after prefiltering but before the iterative pr...
Definition: ICP.cpp:180
PointMatcher.h
public interface
DataPointsFiltersImpl.h
PointMatcher::ICPChainBase::~ICPChainBase
virtual ~ICPChainBase()
virtual desctructor
Definition: ICP.cpp:69
PointMatcher::ICP
ICP algorithm.
Definition: PointMatcher.h:704
PointMatcherSupport::Parametrizable::Parameters
std::map< std::string, Parameter > Parameters
Parameters stored as a map of string->string.
Definition: Parametrizable.h:199
compute_overlap.reading
reading
Definition: compute_overlap.py:70
PointMatcherSupport::logger
std::shared_ptr< Logger > logger
the current logger
Definition: Logger.cpp:42
PointMatcher::TransformationParameters
Matrix TransformationParameters
A matrix holding the parameters a transformation.
Definition: PointMatcher.h:182
PointMatcher::ICPChainBase::getPrefilteredReadingPtsCount
unsigned getPrefilteredReadingPtsCount() const
Return the remaining number of points in reading after prefiltering but before the iterative process.
Definition: ICP.cpp:173


libpointmatcher
Author(s):
autogenerated on Mon Sep 16 2024 02:24:09