RTAB-Map 0.23.11
Real-Time Appearance-Based Mapping
Loading...
Searching...
No Matches
RegistrationVis.h
1/*
2Copyright (c) 2010-2016, Mathieu Labbe - IntRoLab - Universite de Sherbrooke
3All rights reserved.
4
5Redistribution and use in source and binary forms, with or without
6modification, are permitted provided that the following conditions are met:
7 * Redistributions of source code must retain the above copyright
8 notice, this list of conditions and the following disclaimer.
9 * Redistributions in binary form must reproduce the above copyright
10 notice, this list of conditions and the following disclaimer in the
11 documentation and/or other materials provided with the distribution.
12 * Neither the name of the Universite de Sherbrooke nor the
13 names of its contributors may be used to endorse or promote products
14 derived from this software without specific prior written permission.
15
16THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
20DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26*/
27
28#ifndef REGISTRATIONVIS_H_
29#define REGISTRATIONVIS_H_
30
31#include "rtabmap/core/rtabmap_core_export.h" // DLL export/import defines
32
33#include <rtabmap/core/Registration.h>
34#include <rtabmap/core/Signature.h>
35
36namespace rtabmap {
37
38class Feature2D;
39
40#ifdef RTABMAP_PYTHON
41class PyMatcher;
42#endif
43
60class RTABMAP_CORE_EXPORT RegistrationVis : public Registration
61{
62public:
64 RegistrationVis(const ParametersMap & parameters = ParametersMap(), Registration * child = 0);
65 virtual ~RegistrationVis();
66
68 virtual void parseParameters(const ParametersMap & parameters);
69
71 float getInlierDistance() const {return _inlierDistance;}
73 int getIterations() const {return _iterations;}
75 int getMinInliers() const {return _minInliers;}
77 int getNNType() const {return _nnType;}
79 std::string getNNTypeName() const {return getNNTypeName(_nnType);}
80
84 static std::string getNNTypeName(int nnType);
86 float getNNDR() const {return _nndr;}
88 int getEstimationType() const {return _estimationType;}
89
91 const Feature2D * getDetector() const {return _detectorFrom;}
92
93protected:
95 Signature & from,
96 Signature & to,
97 Transform guess,
98 RegistrationInfo & info) const;
99
100 virtual bool isImageRequiredImpl() const {return true;}
101 virtual bool canUseGuessImpl() const {return _correspondencesApproach != 0 || _guessWinSize>0;}
102 virtual int getMinVisualCorrespondencesImpl() const {return _minInliers;}
103
104private:
105 int _minInliers;
106 float _inlierDistance;
107 int _iterations;
108 int _refineIterations;
109 float _epipolarGeometryVar;
110 int _estimationType;
111 float _PnPReprojError;
112 int _PnPFlags;
113 int _PnPRefineIterations;
114 int _PnPVarMedianRatio;
115 float _PnPMaxVar;
116 bool _PnPSplitLinearCovarianceComponents;
117 unsigned int _multiSamplingPolicy;
118 int _correspondencesApproach;
119 int _flowWinSize;
120 int _flowIterations;
121 float _flowEps;
122 int _flowMaxLevel;
123 bool _flowGpu;
124 bool _flowUseMinEigenVals;
125 float _flowMinEigThreshold;
126 float _flowErrorThreshold;
127 float _nndr;
128 int _nnType;
129 bool _gmsWithRotation;
130 bool _gmsWithScale;
131 double _gmsThresholdFactor;
132 int _guessWinSize;
133 bool _guessMatchToProjection;
134 int _bundleAdjustment;
135 bool _depthAsMask;
136 float _maskFloorThreshold;
137 float _minInliersDistributionThr;
138 float _maxInliersMeanDistance;
139
140 ParametersMap _featureParameters;
141 ParametersMap _bundleParameters;
142
143 Feature2D * _detectorFrom;
144 Feature2D * _detectorTo;
145
146#ifdef RTABMAP_PYTHON
147 PyMatcher * _pyMatcher;
148#endif
149};
150
151}
152
153#endif /* REGISTRATION_H_ */
Abstract 2D feature detector and descriptor extractor for visual SLAM.
Definition Features2d.h:145
Statistics and diagnostics returned by Registration.
Visual registration between two signatures using features and geometry.
const Feature2D * getDetector() const
float getInlierDistance() const
virtual void parseParameters(const ParametersMap &parameters)
Parses Vis/ and feature parameters; recreates feature detectors.
static std::string getNNTypeName(int nnType)
Name of a Vis/CorNNType value.
std::string getNNTypeName() const
virtual Transform computeTransformationImpl(Signature &from, Signature &to, Transform guess, RegistrationInfo &info) const
Strategy-specific registration.
RegistrationVis(const ParametersMap &parameters=ParametersMap(), Registration *child=0)
child is owned and deleted in the destructor.
Abstract base for registering two observations (visual, ICP, or both).
Represents a node in RTAB-Map's pose graph.
Definition Signature.h:84
Represents a 3D rigid body transformation (rotation + translation).
Definition Transform.h:53
std::map< std::string, std::string > ParametersMap
Parameter keys mapped to their values, as used by every configurable class (see Parameters).
Definition Parameters.h:44