| 72 | } |
| 73 | |
| 74 | void KeyFrameDatabase::clearMap(Map* pMap) |
| 75 | { |
| 76 | unique_lock<mutex> lock(mMutex); |
| 77 | |
| 78 | // Erase elements in the Inverse File for the entry |
| 79 | for(std::vector<list<KeyFrame*> >::iterator vit=mvInvertedFile.begin(), vend=mvInvertedFile.end(); vit!=vend; vit++) |
| 80 | { |
| 81 | // List of keyframes that share the word |
| 82 | list<KeyFrame*> &lKFs = *vit; |
| 83 | |
| 84 | for(list<KeyFrame*>::iterator lit=lKFs.begin(), lend= lKFs.end(); lit!=lend;) |
| 85 | { |
| 86 | KeyFrame* pKFi = *lit; |
| 87 | if(pMap == pKFi->GetMap()) |
| 88 | { |
| 89 | lit = lKFs.erase(lit); |
| 90 | // Dont delete the KF because the class Map clean all the KF when it is destroyed |
| 91 | } |
| 92 | else |
| 93 | { |
| 94 | ++lit; |
| 95 | } |
| 96 | } |
| 97 | } |
| 98 | } |
| 99 | |
| 100 | vector<KeyFrame*> KeyFrameDatabase::DetectLoopCandidates(KeyFrame* pKF, float minScore) |
| 101 | { |