mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-02 17:40:23 +08:00
Fixed accumulated words bug in highest hypothesis view
This commit is contained in:
@@ -89,6 +89,7 @@ public:
|
|||||||
const QMultiMap<int, rtabmap::KeypointItem *> & getFeatures() const {return _features;}
|
const QMultiMap<int, rtabmap::KeypointItem *> & getFeatures() const {return _features;}
|
||||||
|
|
||||||
void clearLines();
|
void clearLines();
|
||||||
|
void clearFeatures();
|
||||||
void clear();
|
void clear();
|
||||||
|
|
||||||
virtual QSize sizeHint() const;
|
virtual QSize sizeHint() const;
|
||||||
|
|||||||
@@ -651,8 +651,7 @@ void ImageView::updateOpacity()
|
|||||||
|
|
||||||
void ImageView::setFeatures(const std::multimap<int, cv::KeyPoint> & refWords, const cv::Mat & depth, const QColor & color)
|
void ImageView::setFeatures(const std::multimap<int, cv::KeyPoint> & refWords, const cv::Mat & depth, const QColor & color)
|
||||||
{
|
{
|
||||||
qDeleteAll(_features);
|
clearFeatures();
|
||||||
_features.clear();
|
|
||||||
|
|
||||||
float xRatio = 0;
|
float xRatio = 0;
|
||||||
float yRatio = 0;
|
float yRatio = 0;
|
||||||
@@ -684,8 +683,7 @@ void ImageView::setFeatures(const std::multimap<int, cv::KeyPoint> & refWords, c
|
|||||||
|
|
||||||
void ImageView::setFeatures(const std::vector<cv::KeyPoint> & features, const cv::Mat & depth, const QColor & color)
|
void ImageView::setFeatures(const std::vector<cv::KeyPoint> & features, const cv::Mat & depth, const QColor & color)
|
||||||
{
|
{
|
||||||
qDeleteAll(_features);
|
clearFeatures();
|
||||||
_features.clear();
|
|
||||||
|
|
||||||
float xRatio = 0;
|
float xRatio = 0;
|
||||||
float yRatio = 0;
|
float yRatio = 0;
|
||||||
@@ -901,11 +899,21 @@ void ImageView::clearLines()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ImageView::clear()
|
void ImageView::clearFeatures()
|
||||||
{
|
{
|
||||||
qDeleteAll(_features);
|
qDeleteAll(_features);
|
||||||
_features.clear();
|
_features.clear();
|
||||||
|
|
||||||
|
if(!_graphicsView->isVisible())
|
||||||
|
{
|
||||||
|
this->update();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void ImageView::clear()
|
||||||
|
{
|
||||||
|
clearFeatures();
|
||||||
|
|
||||||
qDeleteAll(_lines);
|
qDeleteAll(_lines);
|
||||||
_lines.clear();
|
_lines.clear();
|
||||||
|
|
||||||
|
|||||||
@@ -3540,6 +3540,10 @@ void MainWindow::drawKeypoints(const std::multimap<int, cv::KeyPoint> & refWords
|
|||||||
|
|
||||||
timer.start();
|
timer.start();
|
||||||
ULOGGER_DEBUG("refWords.size() = %d", refWords.size());
|
ULOGGER_DEBUG("refWords.size() = %d", refWords.size());
|
||||||
|
if(refWords.size())
|
||||||
|
{
|
||||||
|
_ui->imageView_source->clearFeatures();
|
||||||
|
}
|
||||||
for(std::multimap<int, cv::KeyPoint>::const_iterator iter = refWords.begin(); iter != refWords.end(); ++iter )
|
for(std::multimap<int, cv::KeyPoint>::const_iterator iter = refWords.begin(); iter != refWords.end(); ++iter )
|
||||||
{
|
{
|
||||||
int id = iter->first;
|
int id = iter->first;
|
||||||
@@ -3576,6 +3580,10 @@ void MainWindow::drawKeypoints(const std::multimap<int, cv::KeyPoint> & refWords
|
|||||||
timer.start();
|
timer.start();
|
||||||
ULOGGER_DEBUG("loopWords.size() = %d", loopWords.size());
|
ULOGGER_DEBUG("loopWords.size() = %d", loopWords.size());
|
||||||
QList<QPair<cv::Point2f, cv::Point2f> > uniqueCorrespondences;
|
QList<QPair<cv::Point2f, cv::Point2f> > uniqueCorrespondences;
|
||||||
|
if(loopWords.size())
|
||||||
|
{
|
||||||
|
_ui->imageView_loopClosure->clearFeatures();
|
||||||
|
}
|
||||||
for(std::multimap<int, cv::KeyPoint>::const_iterator iter = loopWords.begin(); iter != loopWords.end(); ++iter )
|
for(std::multimap<int, cv::KeyPoint>::const_iterator iter = loopWords.begin(); iter != loopWords.end(); ++iter )
|
||||||
{
|
{
|
||||||
int id = iter->first;
|
int id = iter->first;
|
||||||
@@ -3643,6 +3651,12 @@ void MainWindow::drawKeypoints(const std::multimap<int, cv::KeyPoint> & refWords
|
|||||||
deltaX = _ui->imageView_source->width();
|
deltaX = _ui->imageView_source->width();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(refWords.size() && loopWords.size())
|
||||||
|
{
|
||||||
|
_ui->imageView_source->clearLines();
|
||||||
|
_ui->imageView_loopClosure->clearLines();
|
||||||
|
}
|
||||||
|
|
||||||
for(QList<QPair<cv::Point2f, cv::Point2f> >::iterator iter = uniqueCorrespondences.begin();
|
for(QList<QPair<cv::Point2f, cv::Point2f> >::iterator iter = uniqueCorrespondences.begin();
|
||||||
iter!=uniqueCorrespondences.end();
|
iter!=uniqueCorrespondences.end();
|
||||||
++iter)
|
++iter)
|
||||||
|
|||||||
Reference in New Issue
Block a user