SLProject  4.2.000
A platform independent 3D computer graphics framework for desktop OS, Android, iOS and online in web browsers
WAISlam.cpp
Go to the documentation of this file.
1 #include <WAISlam.h>
2 #include <AverageTiming.h>
3 #include <Utils.h>
4 
5 #define MIN_FRAMES 0
6 #define MAX_FRAMES 30
7 //#define MULTI_MAPPING_THREADS 1
8 #define MULTI_THREAD_FRAME_PROCESSING 1
9 
10 #define LOG_WAISLAM_WARN(...) Utils::log("WAISlam", __VA_ARGS__);
11 #define LOG_WAISLAM_INFO(...) Utils::log("WAISlam", __VA_ARGS__);
12 #define LOG_WAISLAM_DEBUG(...) Utils::log("WAISlam", __VA_ARGS__);
13 
14 //-----------------------------------------------------------------------------
15 WAISlam::WAISlam(const cv::Mat& intrinsic,
16  const cv::Mat& distortion,
17  WAIOrbVocabulary* voc,
18  KPextractor* iniExtractor,
19  KPextractor* relocExtractor,
20  KPextractor* extractor,
21  std::unique_ptr<WAIMap> globalMap,
22  WAISlam::Params params)
23 {
24  _iniData.initializer = nullptr;
25  _params = params;
26 
29 
32 
33  _distortion = distortion.clone();
34  _cameraIntrinsic = intrinsic.clone();
35  _voc = voc;
36 
37  _extractor = extractor;
38  _relocExtractor = relocExtractor;
39  _iniExtractor = iniExtractor;
40 
41  if (_iniExtractor == nullptr)
43  if (_relocExtractor == nullptr)
45 
46  if (globalMap == nullptr)
47  {
48  WAIKeyFrameDB* kfDB = new WAIKeyFrameDB(voc);
49  _globalMap = std::make_unique<WAIMap>(kfDB);
51 
54  }
55  else
56  {
57  _globalMap = std::move(globalMap);
59  _initialized = true;
60  }
61 
62  _localMapping = new ORB_SLAM2::LocalMapping(_globalMap.get(),
63  _voc,
64  params.cullRedundantPerc);
65  _loopClosing = new ORB_SLAM2::LoopClosing(_globalMap.get(),
66  _voc,
68  false,
69  false);
70 
71  _localMapping->SetLoopCloser(_loopClosing);
72  _loopClosing->SetLocalMapper(_localMapping);
73 
75  {
76  _mappingThreads.push_back(new std::thread(&LocalMapping::Run, _localMapping));
77  _loopClosingThread = new std::thread(&LoopClosing::Run, _loopClosing);
78  }
79 
80 #if MULTI_THREAD_FRAME_PROCESSING
81  _poseUpdateThread = new std::thread(updatePoseThread, this);
82  _isFinish = false;
83  _isStop = false;
84  _requestFinish = false;
85 #endif
86 
87  _iniData.initializer = nullptr;
88  _cameraExtrinsic = cv::Mat::eye(4, 4, CV_32F);
89 
90  _lastFrame = WAIFrame();
91 }
92 //-----------------------------------------------------------------------------
94 {
95  if (!_params.serial)
96  {
97  _localMapping->RequestFinish();
98  _loopClosing->RequestFinish();
99  }
100 
101  // Wait until all thread have effectively stopped
104 
105  for (std::thread* t : _mappingThreads) { t->join(); }
106 
107  if (_loopClosingThread)
108  _loopClosingThread->join();
109 
110 #if MULTI_THREAD_FRAME_PROCESSING
111  requestFinish();
112  _poseUpdateThread->join();
113  delete _poseUpdateThread;
114  _poseUpdateThread = nullptr;
115 #endif
116 
117  delete _localMapping;
118  delete _loopClosing;
119 }
120 //-----------------------------------------------------------------------------
122 {
123  if (!_params.serial)
124  {
125  _localMapping->RequestReset();
126  _loopClosing->RequestReset();
127  }
128 
129 #if MULTI_THREAD_FRAME_PROCESSING
130  requestFinish();
131  _poseUpdateThread->join();
132 #endif
133 
134  _globalMap->clear();
135  _localMap.keyFrames.clear();
136  _localMap.mapPoints.clear();
137  _localMap.refKF = nullptr;
138 
140  _lastRelocFrameId = 0;
141 
142 #if MULTI_THREAD_FRAME_PROCESSING
143  _poseUpdateThread = new std::thread(updatePoseThread, this);
144  _isFinish = false;
145  _isStop = false;
146  _requestFinish = false;
147 #endif
148 
150  WAIFrame::nNextId = 0;
154 }
155 //-----------------------------------------------------------------------------
156 void WAISlam::changeIntrinsic(cv::Mat intrinsic, cv::Mat distortion)
157 {
158  _cameraIntrinsic = intrinsic;
159  _distortion = distortion;
160 }
161 //-----------------------------------------------------------------------------
162 void WAISlam::createFrame(WAIFrame& frame, cv::Mat& imageGray)
163 {
164  switch (getTrackingState())
165  {
167  frame = WAIFrame(imageGray,
168  0.0,
171  _distortion,
172  _voc,
174  break;
177  frame = WAIFrame(imageGray,
178  0.0,
181  _distortion,
182  _voc,
184  break;
185  default:
186  frame = WAIFrame(imageGray,
187  0.0,
188  _extractor,
190  _distortion,
191  _voc,
193  }
194 }
195 //-----------------------------------------------------------------------------
196 /* Separate Pose update thread */
198 {
199  std::unique_lock<std::mutex> lock(_lastFrameMutex);
200  while (!_framesQueue.empty())
201  {
202  _framesQueue.pop();
203  }
204 }
205 //-----------------------------------------------------------------------------
207 {
208  std::unique_lock<std::mutex> lock(_mutexStates);
209  _state = state;
210 }
211 //-----------------------------------------------------------------------------
213 {
214  int nbFrameInQueue;
215  std::unique_lock<std::mutex> lock(_frameQueueMutex);
216  nbFrameInQueue = (int)_framesQueue.size();
217  if (nbFrameInQueue == 0)
218  return 0;
219 
220  frame = _framesQueue.front();
221  _framesQueue.pop();
222  return nbFrameInQueue;
223 }
224 //-----------------------------------------------------------------------------
226 {
227  std::unique_lock<std::mutex> lock(_stateMutex);
228  _requestFinish = true;
229 }
230 //-----------------------------------------------------------------------------
232 {
233  std::unique_lock<std::mutex> lock(_stateMutex);
234  return _requestFinish;
235 }
236 
238 {
239  std::unique_lock<std::mutex> lock(_stateMutex);
240  return _isFinish;
241 }
242 //-----------------------------------------------------------------------------
244 {
245  std::unique_lock<std::mutex> lock(_stateMutex);
246  return _isStop;
247 }
248 //-----------------------------------------------------------------------------
250 {
251  std::unique_lock<std::mutex> lock(_stateMutex);
252  _isStop = false;
253  _localMapping->RequestContinue();
255 }
256 //-----------------------------------------------------------------------------
258 {
259  while (1)
260  {
261  WAIFrame f;
262  while (ptr->getNextFrame(f) && !ptr->finishRequested())
263  {
264  if (ptr->_params.ensureKFIntegration)
265  ptr->updatePoseKFIntegration(f);
266  else
267  ptr->updatePose(f);
268  }
269 
270  if (ptr->finishRequested())
271  {
272  std::unique_lock<std::mutex> lock(ptr->_frameQueueMutex);
273 
274  while (!ptr->_framesQueue.empty())
275  ptr->_framesQueue.pop();
276 
277  break;
278  }
279 
280  while (ptr->isStop() && !ptr->isFinished() && !ptr->finishRequested())
281  {
282  std::this_thread::sleep_for(25ms);
283  }
284  }
285 
286  std::unique_lock<std::mutex> lock(ptr->_stateMutex);
287  ptr->_requestFinish = false;
288  ptr->_isFinish = true;
289 }
290 //-----------------------------------------------------------------------------
292 {
293  std::unique_lock<std::mutex> guard(_mutexStates);
294 
295  switch (_state)
296  {
298  {
299 #if 0
301  if (ok)
302  {
303  _lastKeyFrameFrameId = frame.mnId;
304  _lastRelocFrameId = 0;
306  _initialized = true;
307  }
308 #else
309  if (initialize(_iniData, frame, _voc, _localMap))
310  {
312  {
313  _localMapping->InsertKeyFrame(_localMap.keyFrames[0]);
314  _localMapping->InsertKeyFrame(_localMap.keyFrames[1]);
315  _lastKeyFrameFrameId = frame.mnId;
316  _lastRelocFrameId = 0;
318  _initialized = true;
319  if (_params.serial)
320  {
321  _localMapping->RunOnce();
322  _localMapping->RunOnce();
323  }
324  }
325  }
326 #endif
327  }
328  break;
330  {
332  if (_relocFrameCounter > 30)
334  }
336  {
337  int inliers;
338  if (tracking(_globalMap.get(),
339  _localMap,
340  frame,
341  _lastFrame,
342  (int)_lastRelocFrameId,
343  _velocity,
344  inliers))
345  {
346  std::unique_lock<std::mutex> lock(_cameraExtrinsicMutex);
347  motionModel(frame,
348  _lastFrame,
349  _velocity,
351  lock.unlock();
352  mapping(_globalMap.get(),
353  _localMap,
355  frame,
356  inliers,
359  if (_params.serial)
360  {
361  _localMapping->RunOnce();
362  _loopClosing->RunOnce();
363  }
364  _infoMatchedInliners = inliers;
365  }
366  else
367  {
369  }
370  }
371  break;
373  {
374  int inliers;
375  if (relocalization(frame,
376  _globalMap.get(),
377  _localMap,
379  inliers,
381  {
382  _relocFrameCounter = 0;
383  _lastRelocFrameId = frame.mnId;
384  _velocity = cv::Mat();
386  }
387  }
388  break;
389  }
390 
391  std::unique_lock<std::mutex> lock(_lastFrameMutex);
392  _lastFrame = WAIFrame(frame);
393 }
394 //-----------------------------------------------------------------------------
396 {
397  switch (_state)
398  {
400  {
401  int inliers;
402  if (tracking(_globalMap.get(),
403  _localMap,
404  frame,
405  _lastFrame,
406  (int)_lastRelocFrameId,
407  _velocity,
408  inliers))
409  {
410  std::unique_lock<std::mutex> lock(_cameraExtrinsicMutex);
411  motionModel(frame,
412  _lastFrame,
413  _velocity,
415  lock.unlock();
417  _localMap,
419  frame,
420  inliers,
423  if (_params.serial)
424  {
425  _localMapping->RunOnce();
426  _loopClosing->RunOnce();
427  }
428  _infoMatchedInliners = inliers;
429  }
430  else
431  {
433  }
434  }
435  break;
437  {
438  int inliers;
439  if (relocalization(frame,
440  _globalMap.get(),
441  _localMap,
443  inliers,
445  {
446  _lastRelocFrameId = frame.mnId;
447  _velocity = cv::Mat();
449  _infoMatchedInliners = inliers;
450  }
451  }
452  break;
453  }
454 
455  std::unique_lock<std::mutex> lock(_lastFrameMutex);
456  _lastFrame = WAIFrame(frame);
457 }
458 //-----------------------------------------------------------------------------
460 {
461  std::unique_lock<std::mutex> lock(_lastFrameMutex);
462  return _lastFrame;
463 }
464 //-----------------------------------------------------------------------------
466 {
467  std::unique_lock<std::mutex> lock(_lastFrameMutex);
468  return &_lastFrame;
469 }
470 //-----------------------------------------------------------------------------
471 bool WAISlam::update(cv::Mat& imageGray)
472 {
473  WAIFrame frame;
474  createFrame(frame, imageGray);
475 
476 #if MULTI_THREAD_FRAME_PROCESSING
477  std::unique_lock<std::mutex> lock(_frameQueueMutex);
478  _framesQueue.push(frame);
479 #else
482  else
483  updatePose(frame);
484 #endif
485  return isTracking();
486 }
487 //-----------------------------------------------------------------------------
488 void WAISlam::drawInfo(cv::Mat& imageBGR,
489  float scale,
490  bool showInitLine,
491  bool showKeyPoints,
492  bool showKeyPointsMatched)
493 {
494  std::unique_lock<std::mutex> lock(_lastFrameMutex);
495  std::unique_lock<std::mutex> lock2(_stateMutex);
497  {
498  if (showInitLine)
499  drawInitInfo(_iniData, _lastFrame, imageBGR, scale);
500  }
502  {
503  if (showKeyPoints)
504  drawKeyPointInfo(_lastFrame, imageBGR, scale);
505  if (showKeyPointsMatched)
506  drawKeyPointMatches(_lastFrame, imageBGR, scale);
507  }
509  {
510  if (showKeyPoints)
511  drawKeyPointInfo(_lastFrame, imageBGR, scale);
512  }
513 }
514 //-----------------------------------------------------------------------------
515 std::vector<WAIMapPoint*> WAISlam::getMatchedMapPoints(WAIFrame* frame)
516 {
517  std::vector<WAIMapPoint*> result;
518 
519  for (int i = 0; i < frame->N; i++)
520  {
521  if (frame->mvpMapPoints[i])
522  {
523  if (frame->mvpMapPoints[i]->Observations() > 0)
524  result.push_back(frame->mvpMapPoints[i]);
525  }
526  }
527 
528  return result;
529 }
530 //-----------------------------------------------------------------------------
532  std::pair<std::vector<cv::Point2f>,
533  std::vector<cv::Point3f>>& matching)
534 {
535  for (int i = 0; i < frame->N; i++)
536  {
537  WAIMapPoint* mp = frame->mvpMapPoints[i];
538  if (mp)
539  {
540  if (mp->isFixed())
541  {
542  WAI::V3 v = mp->worldPosVec();
543  matching.first.push_back(frame->mvKeysUn[i].pt);
544  matching.second.push_back(cv::Point3f(v.x, v.y, v.z));
545  }
546  }
547  }
548  return (int)matching.first.size();
549 }
550 //-----------------------------------------------------------------------------
552 {
553  std::unique_lock<std::mutex> lock(_cameraExtrinsicMutex);
554  return _cameraExtrinsic;
555 }
556 //-----------------------------------------------------------------------------
557 void WAISlam::setCamExrinsicGuess(cv::Mat extrinsicGuess)
558 {
559  std::unique_lock<std::mutex> lock(_cameraExtrinsicGuessMutex);
560  _cameraExtrinsicGuess = extrinsicGuess;
561 }
562 //-----------------------------------------------------------------------------
564 {
566  {
567  std::unique_lock<std::mutex> guard(_mutexStates);
568  _localMapping->RequestPause();
569  while (!_localMapping->isPaused())
570  {
571  std::this_thread::sleep_for(std::chrono::microseconds(10));
572  }
573  std::cout << "localMapping is stopped" << std::endl;
574  }
575 
577 }
578 //-----------------------------------------------------------------------------
580 {
581  std::unique_lock<std::mutex> guard(_mutexStates);
582  return (_state == WAITrackingState::Idle);
583 }
584 //-----------------------------------------------------------------------------
586 {
587  std::unique_lock<std::mutex> guard(_mutexStates);
589 }
590 //-----------------------------------------------------------------------------
592 {
593  return false;
594 }
595 //-----------------------------------------------------------------------------
596 void WAISlam::transformCoords(cv::Mat transform)
597 {
598  if (_loopClosingThread != nullptr)
599  {
600  _localMapping->RequestPause();
601  while (!_localMapping->isPaused() && !_localMapping->isFinished())
602  {
603  std::this_thread::sleep_for(std::chrono::seconds(1));
604  }
605  }
606 
607  WAIMap* map = _globalMap.get();
608 
609  map->transform(transform);
610 
611  _initialized = true;
612  _localMapping->RequestContinue();
613 }
614 //-----------------------------------------------------------------------------
615 void WAISlam::setMap(std::unique_ptr<WAIMap> globalMap)
616 {
618  reset();
619  _globalMap = std::move(globalMap);
620  _initialized = true;
621  resume();
622 }
623 //-----------------------------------------------------------------------------
625 {
626  return _infoMatchedInliners;
627 }
628 //-----------------------------------------------------------------------------
630 {
631  return _loopClosing->getStatusString();
632 }
633 //-----------------------------------------------------------------------------
635 {
636  return _globalMap->getNumLoopClosings();
637 }
638 //-----------------------------------------------------------------------------
640 {
641  return _loopClosing->numOfKfsInQueue();
642 }
643 //-----------------------------------------------------------------------------
WAITrackingState
Definition: WAISlamTools.h:27
@ TrackingOK
Definition: WAISlamTools.h:31
@ TrackingStart
Definition: WAISlamTools.h:33
@ TrackingLost
Definition: WAISlamTools.h:32
@ Initializing
Definition: WAISlamTools.h:30
@ Idle
Definition: WAISlamTools.h:29
std::vector< WAIMapPoint * > mvpMapPoints
Definition: WAIFrame.h:147
long unsigned int mnId
Definition: WAIFrame.h:159
static long unsigned int nNextId
Definition: WAIFrame.h:158
int N
Definition: WAIFrame.h:123
std::vector< cv::KeyPoint > mvKeysUn
Definition: WAIFrame.h:129
static bool mbInitialComputations
Definition: WAIFrame.h:182
AR Keyframe database class.
Definition: WAIKeyFrameDB.h:46
static long unsigned int nNextId
Definition: WAIKeyFrame.h:174
Definition: WAIMap.h:52
void transform(cv::Mat transform)
Definition: WAIMap.cpp:192
bool isFixed() const
Definition: WAIMapPoint.h:105
static long unsigned int nNextId
Definition: WAIMapPoint.h:110
WAI::V3 worldPosVec()
Definition: WAIMapPoint.cpp:95
KPextractor * _iniExtractor
Definition: WAISlam.h:198
std::queue< WAIFrame > _framesQueue
Definition: WAISlam.h:201
std::mutex _cameraExtrinsicGuessMutex
Definition: WAISlam.h:187
unsigned long _lastRelocFrameId
Definition: WAISlam.h:194
int getMatchedCorrespondances(WAIFrame *frame, std::pair< std::vector< cv::Point2f >, std::vector< cv::Point3f >> &matching)
Definition: WAISlam.cpp:531
std::mutex _mutexStates
Definition: WAISlam.h:188
std::vector< WAIMapPoint * > getMatchedMapPoints(WAIFrame *frame)
Definition: WAISlam.cpp:515
bool isStop()
Definition: WAISlam.cpp:243
virtual void reset()
Definition: WAISlam.cpp:121
WAISlam::Params _params
Definition: WAISlam.h:191
bool _isFinish
Definition: WAISlam.h:174
bool _requestFinish
Definition: WAISlam.h:173
void flushQueue()
Definition: WAISlam.cpp:197
virtual void resume()
Definition: WAISlam.cpp:249
KPextractor * _extractor
Definition: WAISlam.h:196
int _infoMatchedInliners
Definition: WAISlam.h:199
void transformCoords(cv::Mat transform)
Definition: WAISlam.cpp:596
virtual void setCamExrinsicGuess(cv::Mat extrinsicGuess)
Definition: WAISlam.cpp:557
unsigned long _lastKeyFrameFrameId
Definition: WAISlam.h:195
std::mutex _stateMutex
Definition: WAISlam.h:176
std::string getLoopCloseStatus()
Definition: WAISlam.cpp:629
virtual bool update(cv::Mat &imageGray)
Definition: WAISlam.cpp:471
virtual bool isTracking()
Definition: WAISlam.cpp:585
std::mutex _lastFrameMutex
Definition: WAISlam.h:189
virtual ~WAISlam()
Definition: WAISlam.cpp:93
virtual WAITrackingState getTrackingState()
Definition: WAISlam.h:149
WAITrackingState _state
Definition: WAISlam.h:185
virtual cv::Mat getPose()
Definition: WAISlam.cpp:551
virtual WAIFrame * getLastFramePtr()
Definition: WAISlam.cpp:465
void updateState(WAITrackingState state)
Definition: WAISlam.cpp:206
int getMapPointMatchesCount() const
Definition: WAISlam.cpp:624
void createFrame(WAIFrame &frame, cv::Mat &imageGray)
Definition: WAISlam.cpp:162
bool finishRequested()
Definition: WAISlam.cpp:231
virtual void setMap(std::unique_ptr< WAIMap > globalMap)
Definition: WAISlam.cpp:615
void requestFinish()
Definition: WAISlam.cpp:225
virtual bool hasStateIdle()
Definition: WAISlam.cpp:579
void changeIntrinsic(cv::Mat intrinsic, cv::Mat distortion)
Definition: WAISlam.cpp:156
int getNextFrame(WAIFrame &frame)
Definition: WAISlam.cpp:212
bool isFinished()
Definition: WAISlam.cpp:237
virtual void updatePoseKFIntegration(WAIFrame &frame)
Definition: WAISlam.cpp:395
virtual bool retainImage()
Definition: WAISlam.cpp:591
int getKeyFramesInLoopCloseQueueCount()
Definition: WAISlam.cpp:639
bool _isStop
Definition: WAISlam.h:175
virtual void requestStateIdle()
Definition: WAISlam.cpp:563
static void updatePoseThread(WAISlam *ptr)
Definition: WAISlam.cpp:257
KPextractor * _relocExtractor
Definition: WAISlam.h:197
virtual void drawInfo(cv::Mat &imageBGR, float scale, bool showInitLine, bool showKeyPoints, bool showKeyPointsMatched)
Definition: WAISlam.cpp:488
virtual WAIFrame getLastFrame()
Definition: WAISlam.cpp:459
std::thread * _poseUpdateThread
Definition: WAISlam.h:200
virtual void updatePose(WAIFrame &frame)
Definition: WAISlam.cpp:291
int getLoopCloseCount()
Definition: WAISlam.cpp:634
std::mutex _frameQueueMutex
Definition: WAISlam.h:202
std::mutex _cameraExtrinsicMutex
Definition: WAISlam.h:186
WAISlam(const cv::Mat &intrinsic, const cv::Mat &distortion, WAIOrbVocabulary *voc, KPextractor *iniExtractor, KPextractor *relocExtractor, KPextractor *extractor, std::unique_ptr< WAIMap > globalMap, WAISlam::Params params)
Definition: WAISlam.cpp:15
unsigned int _relocFrameCounter
Definition: WAISlam.h:193
static void motionModel(WAIFrame &frame, WAIFrame &lastFrame, cv::Mat &velocity, cv::Mat &pose)
cv::Mat _cameraIntrinsic
Definition: WAISlamTools.h:201
cv::Mat _cameraExtrinsic
Definition: WAISlamTools.h:202
std::vector< std::thread * > _mappingThreads
Definition: WAISlamTools.h:217
LoopClosing * _loopClosing
Definition: WAISlamTools.h:215
static bool initialize(WAIInitializerData &iniData, WAIFrame &frame, WAIOrbVocabulary *voc, LocalMap &localMap, int mapPointsNeeded=100)
std::unique_ptr< WAIMap > _globalMap
Definition: WAISlamTools.h:208
cv::Mat _distortion
Definition: WAISlamTools.h:200
static bool oldInitialize(WAIFrame &frame, WAIInitializerData &iniData, WAIMap *map, LocalMap &localMap, LocalMapping *localMapper, LoopClosing *loopCloser, WAIOrbVocabulary *voc, int mapPointsNeeded=100)
std::thread * _loopClosingThread
Definition: WAISlamTools.h:218
static bool tracking(WAIMap *map, LocalMap &localMap, WAIFrame &frame, WAIFrame &lastFrame, int lastRelocFrameId, cv::Mat &velocity, int &inliers)
static void drawInitInfo(WAIInitializerData &iniData, WAIFrame &frame, cv::Mat &imageBGR, float scale)
LocalMapping * _localMapping
Definition: WAISlamTools.h:214
static bool relocalization(WAIFrame &currentFrame, WAIMap *waiMap, LocalMap &localMap, float minCommonWordFactor, int &inliers, bool minAccScoreFilter=false)
static void drawKeyPointMatches(WAIFrame &frame, cv::Mat &image, float scale)
WAIFrame _lastFrame
Definition: WAISlamTools.h:206
cv::Mat _cameraExtrinsicGuess
Definition: WAISlamTools.h:204
static void strictMapping(WAIMap *map, LocalMap &localMap, LocalMapping *localMapper, WAIFrame &frame, int inliers, const unsigned long lastRelocFrameId, unsigned long &lastKeyFrameFrameId)
LocalMap _localMap
Definition: WAISlamTools.h:209
WAIOrbVocabulary * _voc
Definition: WAISlamTools.h:210
static bool genInitialMap(WAIMap *globalMap, LocalMapping *localMapper, LoopClosing *loopCloser, LocalMap &localMap)
WAIInitializerData _iniData
Definition: WAISlamTools.h:205
std::thread * _processNewKeyFrameThread
Definition: WAISlamTools.h:216
static void mapping(WAIMap *map, LocalMap &localMap, LocalMapping *localMapper, WAIFrame &frame, int inliers, const unsigned long lastRelocFrameId, unsigned long &lastKeyFrameFrameId)
static void drawKeyPointInfo(WAIFrame &frame, cv::Mat &image, float scale)
cv::Mat _velocity
Definition: WAISlamTools.h:211
float x
Definition: WAIMath.h:33
float z
Definition: WAIMath.h:33
float y
Definition: WAIMath.h:33
Initializer * initializer
Definition: WAISlamTools.h:19
bool ensureKFIntegration
Definition: WAISlam.h:32
bool minAccScoreFilter
Definition: WAISlam.h:55
bool retainImg
Definition: WAISlam.h:36
float cullRedundantPerc
Definition: WAISlam.h:48
float minCommonWordFactor
Definition: WAISlam.h:52
bool onlyTracking
Definition: WAISlam.h:38