123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100 |
- #ifndef KEYFRAMEDATABASE_H
- #define KEYFRAMEDATABASE_H
- #include <vector>
- #include <list>
- #include <set>
- #include "KeyFrame.h"
- #include "Frame.h"
- #include "ORBVocabulary.h"
- #include "Map.h"
- #include <boost/serialization/base_object.hpp>
- #include <boost/serialization/vector.hpp>
- #include <boost/serialization/list.hpp>
- #include<mutex>
- namespace ORB_SLAM3
- {
- class KeyFrame;
- class Frame;
- class Map;
- class KeyFrameDatabase
- {
- friend class boost::serialization::access;
- template<class Archive>
- void serialize(Archive& ar, const unsigned int version)
- {
- ar & mvBackupInvertedFileId;
- }
- public:
- KeyFrameDatabase(const ORBVocabulary &voc);
- void add(KeyFrame* pKF);
- void erase(KeyFrame* pKF);
- void clear();
- void clearMap(Map* pMap);
-
- std::vector<KeyFrame *> DetectLoopCandidates(KeyFrame* pKF, float minScore);
-
- void DetectCandidates(KeyFrame* pKF, float minScore,vector<KeyFrame*>& vpLoopCand, vector<KeyFrame*>& vpMergeCand);
- void DetectBestCandidates(KeyFrame *pKF, vector<KeyFrame*> &vpLoopCand, vector<KeyFrame*> &vpMergeCand, int nMinWords);
- void DetectNBestCandidates(KeyFrame *pKF, vector<KeyFrame*> &vpLoopCand, vector<KeyFrame*> &vpMergeCand, int nNumCandidates);
-
- std::vector<KeyFrame*> DetectRelocalizationCandidates(Frame* F, Map* pMap);
- void PreSave();
- void PostLoad(map<long unsigned int, KeyFrame*> mpKFid);
- void SetORBVocabulary(ORBVocabulary* pORBVoc);
- protected:
-
- const ORBVocabulary* mpVoc;
-
- std::vector<list<KeyFrame*> > mvInvertedFile;
-
- std::vector<list<long unsigned int> > mvBackupInvertedFileId;
-
- std::mutex mMutex;
- };
- }
- #endif
|