34 #include <QHBoxLayout> 35 #include <QPushButton> 36 #include <QProgressBar> 41 const QMap<int, Signature> * cache,
42 const std::map<int, int> * mapIds,
53 imageView_->setObjectName(
"multisession_imageview");
59 this->setLayout(
new QHBoxLayout());
60 QVBoxLayout * vLayout =
new QVBoxLayout();
62 QHBoxLayout * hLayout =
new QHBoxLayout();
65 vLayout->addLayout(hLayout, 0);
66 ((QHBoxLayout*)this->layout())->addLayout(vLayout, 1);
79 loopLinks.insert(localLinks.begin(), localLinks.end());
81 if(!loopLinks.empty())
108 std::map<int, std::pair<int, float> > top;
109 const std::map<int, float> & likelihood = stats.
posterior();
110 for(std::map<int, float>::const_iterator iter=likelihood.begin(); iter!=likelihood.end(); ++iter)
114 int mapId =
mapIds_->at(iter->first);
118 ((QHBoxLayout*)this->layout())->addWidget(subView, 1);
119 subViews_.insert(std::make_pair(mapId, std::make_pair(subView, 0)));
122 if(top.find(mapId) == top.end() || top.at(mapId).second < iter->second)
124 uInsert(top, std::make_pair(mapId, std::make_pair(iter->first, iter->second)));
130 for(std::map<
int, std::pair<MultiSessionLocSubView*, int> >::iterator iter=
subViews_.begin(); iter!=
subViews_.end(); ++iter)
133 for(std::multimap<int, Link>::iterator jter=loopLinks.begin(); jter!=loopLinks.end(); ++jter)
137 int mapId =
mapIds_->at(jter->first);
138 iter->second.second += mapId==iter->first?1:0;
144 int nodeId = top.at(iter->first).first;
145 if(
cache_->contains(nodeId))
150 Link link = loopLinks.find(nodeId) != loopLinks.end()?loopLinks.find(nodeId)->second:
Link();
151 std::multimap<int, cv::KeyPoint> keypoints;
152 for(std::multimap<int, int>::const_iterator jter=s.
getWords().begin(); jter!=s.
getWords().end(); ++jter)
154 if(jter->first>0 && lastSignature.
getWords().find(jter->first) != lastSignature.
getWords().end())
156 keypoints.insert(std::make_pair(jter->first, s.
getWordsKpts()[jter->second]));
160 if(!keypoints.empty())
165 iter->second.first->updateView(
175 iter->second.first->clear();
180 iter->second.first->clear();
185 iter->second.first->clear();
190 iter->second.first->clear();
196 for(std::map<
int, std::pair<MultiSessionLocSubView*, int> >::iterator iter=
subViews_.begin(); iter!=
subViews_.end(); ++iter)
198 delete iter->second.first;
const std::map< int, float > & posterior() const
QImage uCvMat2QImage(const cv::Mat &image, bool isBgr=true, uCvQtDepthColorMap colorMap=uCvQtDepthWhiteToBlack, float depthMin=0, float depthMax=0)
std::multimap< int, Link > RTABMAP_EXP filterLinks(const std::multimap< int, Link > &links, Link::Type filteredType, bool inverted=false)
void setImage(const QImage &image)
const std::vector< cv::KeyPoint > & getWordsKpts() const
#define UASSERT(condition)
Wrappers of STL for convenient functions.
void setBackgroundColor(const QColor &color)
const std::multimap< int, Link > & getLinks() const
const cv::Mat & imageRaw() const
bool uContains(const std::list< V > &list, const V &value)
const QColor & getDefaultMatchingFeatureColor() const
SensorData & sensorData()
void uncompressDataConst(cv::Mat *imageRaw, cv::Mat *depthOrRightRaw, LaserScan *laserScanRaw=0, cv::Mat *userDataRaw=0, cv::Mat *groundCellsRaw=0, cv::Mat *obstacleCellsRaw=0, cv::Mat *emptyCellsRaw=0) const
const cv::Mat & imageCompressed() const
void setFeatures(const std::multimap< int, cv::KeyPoint > &refWords, const cv::Mat &depth=cv::Mat(), const QColor &color=Qt::yellow)
void uInsert(std::map< K, V > &map, const std::pair< K, V > &pair)
const std::multimap< int, int > & getWords() const