RTAB-Map 0.24.5
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#ifdef RTABMAP_ONNXRUNTIME
44class OnnxMatcher;
45#endif
46
63class RTABMAP_CORE_EXPORT RegistrationVis : public Registration
64{
65public:
67 RegistrationVis(const ParametersMap & parameters = ParametersMap(), Registration * child = 0);
68 virtual ~RegistrationVis();
69
71 virtual void parseParameters(const ParametersMap & parameters);
72
74 float getInlierDistance() const {return _inlierDistance;}
76 int getIterations() const {return _iterations;}
78 int getMinInliers() const {return _minInliers;}
80 int getNNType() const {return _nnType;}
82 std::string getNNTypeName() const {return getNNTypeName(_nnType);}
83
87 static std::string getNNTypeName(int nnType);
89 float getNNDR() const {return _nndr;}
91 int getEstimationType() const {return _estimationType;}
92
94 const Feature2D * getDetector() const {return _detectorFrom;}
95
96protected:
98 Signature & from,
99 Signature & to,
100 Transform guess,
101 RegistrationInfo & info) const;
102
103 virtual bool isImageRequiredImpl() const {return true;}
104 virtual bool canUseGuessImpl() const {return _correspondencesApproach != 0 || _guessWinSize>0;}
105 virtual int getMinVisualCorrespondencesImpl() const {return _minInliers;}
106
107private:
108 int _minInliers;
109 float _inlierDistance;
110 int _iterations;
111 int _refineIterations;
112 float _epipolarGeometryVar;
113 int _estimationType;
114 float _PnPReprojError;
115 int _PnPFlags;
116 int _PnPRefineIterations;
117 int _PnPVarMedianRatio;
118 float _PnPMaxVar;
119 bool _PnPSplitLinearCovarianceComponents;
120 unsigned int _multiSamplingPolicy;
121 int _correspondencesApproach;
122 int _flowWinSize;
123 int _flowIterations;
124 float _flowEps;
125 int _flowMaxLevel;
126 bool _flowGpu;
127 bool _flowUseMinEigenVals;
128 float _flowMinEigThreshold;
129 float _flowErrorThreshold;
130 float _nndr;
131 int _nnType;
132 bool _gmsWithRotation;
133 bool _gmsWithScale;
134 double _gmsThresholdFactor;
135 int _guessWinSize;
136 bool _guessMatchToProjection;
137 int _bundleAdjustment;
138 bool _depthAsMask;
139 float _maskFloorThreshold;
140 float _minInliersDistributionThr;
141 float _maxInliersMeanDistance;
142
143 ParametersMap _featureParameters;
144 ParametersMap _bundleParameters;
145
146 Feature2D * _detectorFrom;
147 Feature2D * _detectorTo;
148
149#ifdef RTABMAP_PYTHON
150 PyMatcher * _pyMatcher;
151#endif
152#ifdef RTABMAP_ONNXRUNTIME
153 OnnxMatcher * _onnxMatcher;
154#endif
155};
156
157}
158
159#endif /* REGISTRATION_H_ */
Abstract 2D feature detector and descriptor extractor for visual SLAM.
Definition Features2d.h:146
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