本文整理汇总了C++中Labels::putLabels方法的典型用法代码示例。如果您正苦于以下问题:C++ Labels::putLabels方法的具体用法?C++ Labels::putLabels怎么用?C++ Labels::putLabels使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Labels
的用法示例。
在下文中一共展示了Labels::putLabels方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: readData
bool RTABMapDBAdapter::readData(const std::vector<std::string> &dbPaths,
Words &words, Labels &labels) {
// Read data from databases
std::map<int, std::map<int, std::unique_ptr<rtabmap::Signature>>>
allSignatures;
std::list<std::unique_ptr<Label>> allLabels;
int dbId = 0;
for (const auto &dbPath : dbPaths) {
auto dbSignatures = readSignatures(dbPath);
allSignatures.emplace(dbId, std::move(dbSignatures));
auto dbLabels = readLabels(dbPath, dbId, allSignatures);
std::move(dbLabels.begin(), dbLabels.end(), std::back_inserter(allLabels));
dbId++;
}
std::cout << "Building Index for Words" << std::endl;
std::list<std::unique_ptr<Word>> allWords = createWords(allSignatures);
std::cout << "Total Number of words: " << allWords.size() << std::endl;
long count = 0;
for (const auto &word : allWords) {
for (const auto &desc : word->getDescriptorsByDb()) {
count += desc.second.rows;
}
}
std::cout << "Total Number of descriptors: " << count << std::endl;
allWords = clusterPointsInWords(allWords);
count = 0;
for (const auto &word : allWords) {
for (const auto &desc : word->getDescriptorsByDb()) {
count += desc.second.rows;
}
}
std::cout << "Total Number of points: " << count << std::endl;
words.putWords(std::move(allWords));
std::cout << "Building Index for Labels" << std::endl;
labels.putLabels(std::move(allLabels));
return true;
}