Added Vis/CorCrossCheck parameter (to use BFMatcher with crosscheck option instead of knn with NNDR for features matching). DBViewer: after refine or add constraint, lines indicating feature correspondences are now shown with different color if they are inliers. Re-enabled saving/loading settings of the ImageViews (feature color, line color, transparency...).

This commit is contained in:
matlabbe
2020-05-01 22:12:56 -04:00
parent 45223b306a
commit d14efea4ac
5 changed files with 123 additions and 45 deletions

View File

@@ -398,8 +398,8 @@ DatabaseViewer::DatabaseViewer(const QString & ini, QWidget * parent) :
// connect configuration changed
connect(ui_->graphViewer, SIGNAL(configChanged()), this, SLOT(configModified()));
//connect(ui_->graphicsView_A, SIGNAL(configChanged()), this, SLOT(configModified()));
//connect(ui_->graphicsView_B, SIGNAL(configChanged()), this, SLOT(configModified()));
connect(ui_->graphicsView_A, SIGNAL(configChanged()), this, SLOT(configModified()));
connect(ui_->graphicsView_B, SIGNAL(configChanged()), this, SLOT(configModified()));
connect(ui_->comboBox_logger_level, SIGNAL(currentIndexChanged(int)), this, SLOT(configModified()));
connect(ui_->actionVertical_Layout, SIGNAL(toggled(bool)), this, SLOT(configModified()));
connect(ui_->checkBox_alignPosesWithGroundTruth, SIGNAL(stateChanged(int)), this, SLOT(updateGraphView()));
@@ -561,8 +561,8 @@ void DatabaseViewer::readSettings()
settings.endGroup();
// ImageViews
//ui_->graphicsView_A->loadSettings(settings, "ImageViewA");
//ui_->graphicsView_B->loadSettings(settings, "ImageViewB");
ui_->graphicsView_A->loadSettings(settings, "ImageViewA");
ui_->graphicsView_B->loadSettings(settings, "ImageViewB");
// ICP parameters
settings.beginGroup("icp");
@@ -646,8 +646,8 @@ void DatabaseViewer::writeSettings()
settings.endGroup();
// ImageViews
//ui_->graphicsView_A->saveSettings(settings, "ImageViewA");
//ui_->graphicsView_B->saveSettings(settings, "ImageViewB");
ui_->graphicsView_A->saveSettings(settings, "ImageViewA");
ui_->graphicsView_B->saveSettings(settings, "ImageViewB");
// save ICP parameters
settings.beginGroup("icp");
@@ -5096,7 +5096,7 @@ void DatabaseViewer::updateStereo(const SensorData * data)
}
ui_->graphicsView_stereo->update();
}
}
}
void DatabaseViewer::updateWordsMatching(const std::vector<int> & inliers)
{
@@ -5109,6 +5109,7 @@ void DatabaseViewer::updateWordsMatching()
ui_->graphicsView_B->clearLines();
ui_->graphicsView_B->setFeaturesColor(ui_->graphicsView_B->getDefaultFeatureColor());
const QMultiMap<int, KeypointItem*> & wordsA = ui_->graphicsView_A->getFeatures();
const QMultiMap<int, KeypointItem*> & wordsB = ui_->graphicsView_B->getFeatures();
std::set<int> inliersSet(inliers.begin(), inliers.end());
if(wordsA.size() && wordsB.size())
@@ -5152,19 +5153,27 @@ void DatabaseViewer::updateWordsMatching()
}
const KeypointItem * kptA = wordsA.value(ids[i]);
const KeypointItem * kptB = wordsB.value(ids[i]);
QColor cA = ui_->graphicsView_A->getDefaultMatchingLineColor();
QColor cB = ui_->graphicsView_B->getDefaultMatchingLineColor();
if(inliersSet.find(ids[i])!=inliersSet.end())
{
cA = ui_->graphicsView_A->getDefaultMatchingFeatureColor();
cB = ui_->graphicsView_B->getDefaultMatchingFeatureColor();
}
ui_->graphicsView_A->addLine(
kptA->rect().x()+kptA->rect().width()/2,
kptA->rect().y()+kptA->rect().height()/2,
kptB->rect().x()/scaleDiff+kptB->rect().width()/scaleDiff/2+deltaAX,
kptB->rect().x()/scaleDiff+kptB->rect().width()/scaleDiff/2+deltaAX,
kptB->rect().y()/scaleDiff+kptB->rect().height()/scaleDiff/2+deltaAY,
cA);
ui_->graphicsView_B->addLine(
kptA->rect().x()*scaleDiff+kptA->rect().width()*scaleDiff/2-deltaBX,
kptA->rect().y()*scaleDiff+kptA->rect().height()*scaleDiff/2-deltaBY,
kptB->rect().x()+kptB->rect().width()/2,
kptB->rect().x()+kptB->rect().width()/2,
kptB->rect().y()+kptB->rect().height()/2,
cB);
}
@@ -7162,7 +7171,7 @@ void DatabaseViewer::refineConstraint(int from, int to, bool silent)
this->updateConstraintView(newLink, true, *fromS, *toS);
ui_->graphicsView_A->setFeatures(fromS->getWords(), fromS->sensorData().depthRaw());
ui_->graphicsView_B->setFeatures(toS->getWords(), toS->sensorData().depthRaw());
}
}
updateWordsMatching(info.inliersIDs);
}
@@ -7208,6 +7217,7 @@ bool DatabaseViewer::addConstraint(int from, int to, bool silent)
std::list<Signature*> signatures;
Signature * fromS=0;
Signature * toS=0;
Link newLink;
RegistrationInfo info;
if(!containsLink(linksAdded_, from, to) &&
@@ -7226,7 +7236,6 @@ bool DatabaseViewer::addConstraint(int from, int to, bool silent)
{
odomMaxInf = graph::getMaxOdomInf(updateLinksWithModifications(links_));
}
Transform t;
@@ -7517,7 +7526,7 @@ bool DatabaseViewer::addConstraint(int from, int to, bool silent)
this->updateConstraintView(newLink, false, *fromS, *toS);
}
ui_->graphicsView_A->setFeatures(fromS->getWords(), fromS->sensorData().depthRaw());
ui_->graphicsView_A->setFeatures(fromS->getWords(), fromS->sensorData().depthRaw());
ui_->graphicsView_B->setFeatures(toS->getWords(), toS->sensorData().depthRaw());
updateWordsMatching(info.inliersIDs);
}