SLProject  4.2.000
A platform independent 3D computer graphics framework for desktop OS, Android, iOS and online in web browsers
WAIKeyFrameDB.h
Go to the documentation of this file.
1 /**
2  * \file WAIKeyframeDB.h
3  * \date October 2017
4 // Codestyle: https://github.com/cpvrlab/SLProject/wiki/Coding-Style-Guidelines
5  * \authors Raul Mur-Artal, Michael Goettlicher, Marcus Hudritsch
6  * \copyright http://opensource.org/licenses/GPL-3.0
7 */
8 
9 /**
10  * This file is part of ORB-SLAM2.
11  *
12  * Copyright (C) 2014-2016 Ra�l Mur-Artal <raulmur at unizar dot es> (University of Zaragoza)
13  * For more information see <https://github.com/raulmur/ORB_SLAM2>
14  *
15  * ORB-SLAM2 is free software: you can redistribute it and/or modify
16  * it under the terms of the GNU General Public License as published by
17  * the Free Software Foundation, either version 3 of the License, or
18  * (at your option) any later version.
19  *
20  * ORB-SLAM2 is distributed in the hope that it will be useful,
21  * but WITHOUT ANY WARRANTY; without even the implied warranty of
22  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23  * GNU General Public License for more details.
24  *
25  * You should have received a copy of the GNU General Public License
26  * along with ORB-SLAM2. If not, see <http://www.gnu.org/licenses/>.
27  */
28 
29 #ifndef WAIKEYFRAMEDB_H
30 #define WAIKEYFRAMEDB_H
31 
32 #include <vector>
33 #include <list>
34 #include <WAIHelper.h>
35 #include <WAIKeyFrame.h>
36 #include <WAIOrbVocabulary.h>
37 #include <opencv2/core.hpp>
38 
39 #include <mutex>
40 
41 //-----------------------------------------------------------------------------
42 //! AR Keyframe database class
43 /*!
44  */
46 {
47 public:
49 
50  void add(WAIKeyFrame* pKF);
51  void erase(WAIKeyFrame* pKF);
52 
53  void clear();
54 
55  std::vector<std::list<WAIKeyFrame*>>& getInvertedFile() { return mvInvertedFile; }
56 
57  // Loop Detection
59  {
62  LOOP_DETECTION_ERROR_NO_SIMILAR_CANDIDATES
63  };
64  std::vector<WAIKeyFrame*> DetectLoopCandidates(WAIKeyFrame* pKF, float minCommonWordFactor, float minScore, int* errorCode);
65 
66  // Relocalization
67  std::vector<WAIKeyFrame*> DetectRelocalizationCandidates(WAIFrame* F, float minCommonWordFactor, bool applyMinAccScoreFilter = false);
68  std::vector<WAIKeyFrame*> DetectRelocalizationCandidates(WAIFrame* F, cv::Mat extrinsicGuess);
69 
70 protected:
71  // Associated vocabulary
73  // Inverted file
74  std::vector<std::list<WAIKeyFrame*>> mvInvertedFile;
75 
76  // Mutex
77  std::mutex mMutex;
78 };
79 
80 #endif // !WAIKEYFRAMEDB_H
#define WAI_API
Definition: WAIHelper.h:36
AR Keyframe database class.
Definition: WAIKeyFrameDB.h:46
std::mutex mMutex
Definition: WAIKeyFrameDB.h:77
WAIOrbVocabulary * mpVoc
Definition: WAIKeyFrameDB.h:72
std::vector< std::list< WAIKeyFrame * > > & getInvertedFile()
Definition: WAIKeyFrameDB.h:55
@ LOOP_DETECTION_ERROR_NONE
Definition: WAIKeyFrameDB.h:60
@ LOOP_DETECTION_ERROR_NO_CANDIDATES_WITH_COMMON_WORDS
Definition: WAIKeyFrameDB.h:61
std::vector< std::list< WAIKeyFrame * > > mvInvertedFile
Definition: WAIKeyFrameDB.h:74
AR Keyframe node class.
Definition: WAIKeyFrame.h:60
void clear(std::string path)
Definition: SLIOMemory.cpp:34