Parameters: renamed Rtabmap/VhStrategy to VhEp/Enabled

This commit is contained in:
matlabbe
2017-07-05 13:38:27 -04:00
parent 495681770e
commit f9ed36ed54
8 changed files with 104 additions and 152 deletions

View File

@@ -21,7 +21,7 @@ SET(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake_modules")
####################### #######################
SET(RTABMAP_MAJOR_VERSION 0) SET(RTABMAP_MAJOR_VERSION 0)
SET(RTABMAP_MINOR_VERSION 13) SET(RTABMAP_MINOR_VERSION 13)
SET(RTABMAP_PATCH_VERSION 0) SET(RTABMAP_PATCH_VERSION 1)
SET(RTABMAP_VERSION SET(RTABMAP_VERSION
${RTABMAP_MAJOR_VERSION}.${RTABMAP_MINOR_VERSION}.${RTABMAP_PATCH_VERSION}) ${RTABMAP_MAJOR_VERSION}.${RTABMAP_MINOR_VERSION}.${RTABMAP_PATCH_VERSION})

View File

@@ -168,7 +168,6 @@ typedef std::pair<std::string, std::string> ParametersPair;
class RTABMAP_EXP Parameters class RTABMAP_EXP Parameters
{ {
// Rtabmap parameters // Rtabmap parameters
RTABMAP_PARAM(Rtabmap, VhStrategy, int, 0, "None 0, Similarity 1, Epipolar 2.");
RTABMAP_PARAM(Rtabmap, PublishStats, bool, true, "Publishing statistics."); RTABMAP_PARAM(Rtabmap, PublishStats, bool, true, "Publishing statistics.");
RTABMAP_PARAM(Rtabmap, PublishLastSignature, bool, true, "Publishing last signature."); RTABMAP_PARAM(Rtabmap, PublishLastSignature, bool, true, "Publishing last signature.");
RTABMAP_PARAM(Rtabmap, PublishPdf, bool, true, "Publishing pdf."); RTABMAP_PARAM(Rtabmap, PublishPdf, bool, true, "Publishing pdf.");
@@ -301,9 +300,10 @@ class RTABMAP_EXP Parameters
RTABMAP_PARAM(Bayes, FullPredictionUpdate, bool, false, "Regenerate all the prediction matrix on each iteration (otherwise only removed/added ids are updated)."); RTABMAP_PARAM(Bayes, FullPredictionUpdate, bool, false, "Regenerate all the prediction matrix on each iteration (otherwise only removed/added ids are updated).");
// Verify hypotheses // Verify hypotheses
RTABMAP_PARAM(VhEp, Enabled, bool, false, uFormat("Verify visual loop closure hypothesis by computing a fundamental matrix. This is done prior to transformation computation when %s is enabled.", kRGBDEnabled().c_str()));
RTABMAP_PARAM(VhEp, MatchCountMin, int, 8, "Minimum of matching visual words pairs to accept the loop hypothesis."); RTABMAP_PARAM(VhEp, MatchCountMin, int, 8, "Minimum of matching visual words pairs to accept the loop hypothesis.");
RTABMAP_PARAM(VhEp, RansacParam1, float, 3, "Fundamental matrix (see cvFindFundamentalMat()): Max distance (in pixels) from the epipolar line for a point to be inlier."); RTABMAP_PARAM(VhEp, RansacParam1, float, 3, "Fundamental matrix (see cvFindFundamentalMat()): Max distance (in pixels) from the epipolar line for a point to be inlier.");
RTABMAP_PARAM(VhEp, RansacParam2, float, 0.99, "Fundamental matrix (see cvFindFundamentalMat()): Performance of the RANSAC."); RTABMAP_PARAM(VhEp, RansacParam2, float, 0.99, "Fundamental matrix (see cvFindFundamentalMat()): Performance of RANSAC.");
// RGB-D SLAM // RGB-D SLAM
RTABMAP_PARAM(RGBD, Enabled, bool, true, ""); RTABMAP_PARAM(RGBD, Enabled, bool, true, "");

View File

@@ -215,6 +215,7 @@ private:
unsigned int _maxMemoryAllowed; // signatures count in WM unsigned int _maxMemoryAllowed; // signatures count in WM
float _loopThr; float _loopThr;
float _loopRatio; float _loopRatio;
bool _verifyLoopClosureHypothesis;
unsigned int _maxRetrieved; unsigned int _maxRetrieved;
unsigned int _maxLocalRetrieved; unsigned int _maxLocalRetrieved;
bool _rawDataKept; bool _rawDataKept;

View File

@@ -224,6 +224,9 @@ const std::map<std::string, std::pair<bool, std::string> > & Parameters::getRemo
{ {
// removed parameters // removed parameters
// 0.13.1
removedParameters_.insert(std::make_pair("Rtabmap/VhStrategy", std::make_pair(true, Parameters::kVhEpEnabled())));
// 0.12.5 // 0.12.5
removedParameters_.insert(std::make_pair("Grid/FullUpdate", std::make_pair(true, Parameters::kGridGlobalFullUpdate()))); removedParameters_.insert(std::make_pair("Grid/FullUpdate", std::make_pair(true, Parameters::kGridGlobalFullUpdate())));

View File

@@ -83,6 +83,7 @@ Rtabmap::Rtabmap() :
_maxMemoryAllowed(Parameters::defaultRtabmapMemoryThr()), // 0=inf _maxMemoryAllowed(Parameters::defaultRtabmapMemoryThr()), // 0=inf
_loopThr(Parameters::defaultRtabmapLoopThr()), _loopThr(Parameters::defaultRtabmapLoopThr()),
_loopRatio(Parameters::defaultRtabmapLoopRatio()), _loopRatio(Parameters::defaultRtabmapLoopRatio()),
_verifyLoopClosureHypothesis(Parameters::defaultVhEpEnabled()),
_maxRetrieved(Parameters::defaultRtabmapMaxRetrieved()), _maxRetrieved(Parameters::defaultRtabmapMaxRetrieved()),
_maxLocalRetrieved(Parameters::defaultRGBDMaxLocalRetrieved()), _maxLocalRetrieved(Parameters::defaultRGBDMaxLocalRetrieved()),
_rawDataKept(Parameters::defaultMemImageKept()), _rawDataKept(Parameters::defaultMemImageKept()),
@@ -401,6 +402,7 @@ void Rtabmap::parseParameters(const ParametersMap & parameters)
Parameters::parse(parameters, Parameters::kRtabmapMemoryThr(), _maxMemoryAllowed); Parameters::parse(parameters, Parameters::kRtabmapMemoryThr(), _maxMemoryAllowed);
Parameters::parse(parameters, Parameters::kRtabmapLoopThr(), _loopThr); Parameters::parse(parameters, Parameters::kRtabmapLoopThr(), _loopThr);
Parameters::parse(parameters, Parameters::kRtabmapLoopRatio(), _loopRatio); Parameters::parse(parameters, Parameters::kRtabmapLoopRatio(), _loopRatio);
Parameters::parse(parameters, Parameters::kVhEpEnabled(), _verifyLoopClosureHypothesis);
Parameters::parse(parameters, Parameters::kRtabmapMaxRetrieved(), _maxRetrieved); Parameters::parse(parameters, Parameters::kRtabmapMaxRetrieved(), _maxRetrieved);
Parameters::parse(parameters, Parameters::kRGBDMaxLocalRetrieved(), _maxLocalRetrieved); Parameters::parse(parameters, Parameters::kRGBDMaxLocalRetrieved(), _maxLocalRetrieved);
Parameters::parse(parameters, Parameters::kMemImageKept(), _rawDataKept); Parameters::parse(parameters, Parameters::kMemImageKept(), _rawDataKept);
@@ -470,22 +472,11 @@ void Rtabmap::parseParameters(const ParametersMap & parameters)
_memory->parseParameters(parameters); _memory->parseParameters(parameters);
} }
VhStrategy vhStrategy = kVhUndef; if(!_epipolarGeometry)
// Verifying hypotheses strategy
if((iter=parameters.find(Parameters::kRtabmapVhStrategy())) != parameters.end())
{
vhStrategy = (VhStrategy)std::atoi((*iter).second.c_str());
}
if(!_epipolarGeometry && vhStrategy == kVhEpipolar)
{ {
_epipolarGeometry = new EpipolarGeometry(_parameters); _epipolarGeometry = new EpipolarGeometry(_parameters);
} }
else if(_epipolarGeometry && vhStrategy == kVhNone) else
{
delete _epipolarGeometry;
_epipolarGeometry = 0;
}
else if(_epipolarGeometry)
{ {
_epipolarGeometry->parseParameters(parameters); _epipolarGeometry->parseParameters(parameters);
} }
@@ -1407,7 +1398,7 @@ bool Rtabmap::process(
// Ignore loop closure if there is only one loop closure hypothesis // Ignore loop closure if there is only one loop closure hypothesis
UDEBUG("rejected hypothesis: single hypothesis"); UDEBUG("rejected hypothesis: single hypothesis");
} }
else if(_epipolarGeometry && !_epipolarGeometry->check(signature, _memory->getSignature(_highestHypothesis.first))) else if(_verifyLoopClosureHypothesis && !_epipolarGeometry->check(signature, _memory->getSignature(_highestHypothesis.first)))
{ {
UWARN("rejected hypothesis: by epipolar geometry"); UWARN("rejected hypothesis: by epipolar geometry");
} }

View File

@@ -747,7 +747,7 @@ PreferencesDialog::PreferencesDialog(QWidget * parent) :
_ui->doubleSpinBox_BRISK_patterScale->setObjectName(Parameters::kBRISKPatternScale().c_str()); _ui->doubleSpinBox_BRISK_patterScale->setObjectName(Parameters::kBRISKPatternScale().c_str());
// verifyHypotheses // verifyHypotheses
_ui->comboBox_vh_strategy->setObjectName(Parameters::kRtabmapVhStrategy().c_str()); _ui->groupBox_vh_epipolar2->setObjectName(Parameters::kVhEpEnabled().c_str());
_ui->surf_spinBox_matchCountMinAccepted->setObjectName(Parameters::kVhEpMatchCountMin().c_str()); _ui->surf_spinBox_matchCountMinAccepted->setObjectName(Parameters::kVhEpMatchCountMin().c_str());
_ui->surf_doubleSpinBox_ransacParam1->setObjectName(Parameters::kVhEpRansacParam1().c_str()); _ui->surf_doubleSpinBox_ransacParam1->setObjectName(Parameters::kVhEpRansacParam1().c_str());
_ui->surf_doubleSpinBox_ransacParam2->setObjectName(Parameters::kVhEpRansacParam2().c_str()); _ui->surf_doubleSpinBox_ransacParam2->setObjectName(Parameters::kVhEpRansacParam2().c_str());

View File

@@ -63,7 +63,7 @@
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
<y>-637</y> <y>0</y>
<width>678</width> <width>678</width>
<height>2739</height> <height>2739</height>
</rect> </rect>
@@ -95,7 +95,7 @@
<enum>QFrame::Raised</enum> <enum>QFrame::Raised</enum>
</property> </property>
<property name="currentIndex"> <property name="currentIndex">
<number>18</number> <number>11</number>
</property> </property>
<widget class="QWidget" name="page_22"> <widget class="QWidget" name="page_22">
<layout class="QVBoxLayout" name="verticalLayout_29" stretch="0,1"> <layout class="QVBoxLayout" name="verticalLayout_29" stretch="0,1">
@@ -7480,13 +7480,13 @@ see Sqlite3 doc 'PRAGMA temp_store'.</string>
</layout> </layout>
</widget> </widget>
<widget class="QWidget" name="page_23"> <widget class="QWidget" name="page_23">
<layout class="QVBoxLayout" name="verticalLayout_2"> <layout class="QVBoxLayout" name="verticalLayout_2" stretch="0,1">
<item> <item>
<widget class="QGroupBox" name="groupBox_bayes1"> <widget class="QGroupBox" name="groupBox_bayes1">
<property name="title"> <property name="title">
<string>Loop Closure Detection</string> <string>Loop Closure Detection</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_22"> <layout class="QVBoxLayout" name="verticalLayout_22" stretch="0,0,0,1,0,0">
<item> <item>
<widget class="QLabel" name="label"> <widget class="QLabel" name="label">
<property name="text"> <property name="text">
@@ -7630,139 +7630,96 @@ see Sqlite3 doc 'PRAGMA temp_store'.</string>
</layout> </layout>
</item> </item>
<item> <item>
<widget class="QGroupBox" name="groupBox_vh_strategy2"> <widget class="QGroupBox" name="groupBox_vh_epipolar2">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="title"> <property name="title">
<string>Hypothesis Verification</string> <string>Hypothesis Verification</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_3"> <property name="checkable">
<item> <bool>true</bool>
<layout class="QGridLayout" name="gridLayout_10" columnstretch="0,1"> </property>
<item row="0" column="0"> <layout class="QGridLayout" name="gridLayout" columnstretch="0,10">
<widget class="QComboBox" name="comboBox_vh_strategy"> <item row="0" column="0">
<property name="sizeAdjustPolicy"> <widget class="QSpinBox" name="surf_spinBox_matchCountMinAccepted">
<enum>QComboBox::AdjustToContents</enum> <property name="minimum">
</property> <number>8</number>
<item> </property>
<property name="text"> <property name="maximum">
<string>No verification</string> <number>100000</number>
</property> </property>
</item> <property name="value">
<item> <number>11</number>
<property name="text"> </property>
<string>Epipolar constraints</string> </widget>
</property> </item>
</item> <item row="0" column="1">
</widget> <widget class="QLabel" name="label_25">
</item> <property name="text">
<item row="0" column="1"> <string>Minimum match count to accept a loop closure.</string>
<widget class="QLabel" name="label_50"> </property>
<property name="text"> <property name="wordWrap">
<string>Hypothesis verification.</string> <bool>true</bool>
</property> </property>
<property name="textInteractionFlags"> <property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set> <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property> </property>
</widget> </widget>
</item> </item>
</layout> <item row="1" column="0">
</item> <widget class="QDoubleSpinBox" name="surf_doubleSpinBox_ransacParam1">
<item> <property name="decimals">
<widget class="QGroupBox" name="groupBox_vh_epipolar2"> <number>1</number>
<property name="title"> </property>
<string>Epipolar Constraints</string> <property name="maximum">
<double>10.000000000000000</double>
</property>
<property name="singleStep">
<double>0.100000000000000</double>
</property>
<property name="value">
<double>3.000000000000000</double>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="label_27">
<property name="text">
<string>Fundamental Matrix : Distance (pixels) for inliers.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QDoubleSpinBox" name="surf_doubleSpinBox_ransacParam2">
<property name="decimals">
<number>2</number>
</property>
<property name="maximum">
<double>0.990000000000000</double>
</property>
<property name="singleStep">
<double>0.010000000000000</double>
</property>
<property name="value">
<double>0.990000000000000</double>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLabel" name="label_28">
<property name="text">
<string>Fundamental Matrix : Ransac performance.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property> </property>
<layout class="QGridLayout" name="gridLayout" columnstretch="0,10">
<item row="0" column="0">
<widget class="QSpinBox" name="surf_spinBox_matchCountMinAccepted">
<property name="minimum">
<number>8</number>
</property>
<property name="maximum">
<number>100000</number>
</property>
<property name="value">
<number>11</number>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="label_25">
<property name="text">
<string>Minimum match count to accept a loop closure.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QDoubleSpinBox" name="surf_doubleSpinBox_ransacParam1">
<property name="decimals">
<number>1</number>
</property>
<property name="maximum">
<double>10.000000000000000</double>
</property>
<property name="singleStep">
<double>0.100000000000000</double>
</property>
<property name="value">
<double>3.000000000000000</double>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="label_27">
<property name="text">
<string>Fundamental Matrix : Distance (pixels) for inliers.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QDoubleSpinBox" name="surf_doubleSpinBox_ransacParam2">
<property name="decimals">
<number>2</number>
</property>
<property name="maximum">
<double>0.990000000000000</double>
</property>
<property name="singleStep">
<double>0.010000000000000</double>
</property>
<property name="value">
<double>0.990000000000000</double>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLabel" name="label_28">
<property name="text">
<string>Fundamental Matrix : Ransac performance.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
</layout>
</widget> </widget>
</item> </item>
</layout> </layout>

View File

@@ -1,7 +1,7 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<package> <package>
<name>rtabmap</name> <name>rtabmap</name>
<version>0.13.0</version> <version>0.13.1</version>
<description>RTAB-Map's standalone library. RTAB-Map is a RGB-D SLAM approach with real-time constraints.</description> <description>RTAB-Map's standalone library. RTAB-Map is a RGB-D SLAM approach with real-time constraints.</description>
<maintainer email="matlabbe@gmail.com">Mathieu Labbe</maintainer> <maintainer email="matlabbe@gmail.com">Mathieu Labbe</maintainer>
<author>Mathieu Labbe</author> <author>Mathieu Labbe</author>