SLProject 4.0.000
WAISlam Class Reference

#include <WAISlam.h>

Inheritance diagram for WAISlam:
[legend]

Classes

struct  Params
 

Public Member Functions

 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)
 
virtual ~WAISlam ()
 
virtual void reset ()
 
void changeIntrinsic (cv::Mat intrinsic, cv::Mat distortion)
 
void createFrame (WAIFrame &frame, cv::Mat &imageGray)
 
virtual void updatePose (WAIFrame &frame)
 
virtual bool update (cv::Mat &imageGray)
 
virtual void updatePoseKFIntegration (WAIFrame &frame)
 
virtual void resume ()
 
virtual bool isTracking ()
 
virtual bool hasStateIdle ()
 
virtual void requestStateIdle ()
 
virtual bool retainImage ()
 
void transformCoords (cv::Mat transform)
 
std::vector< WAIMapPoint * > getMatchedMapPoints (WAIFrame *frame)
 
int getMatchedCorrespondances (WAIFrame *frame, std::pair< std::vector< cv::Point2f >, std::vector< cv::Point3f > > &matching)
 
virtual bool isInitialized ()
 
virtual WAIMapgetMap ()
 
virtual WAIFrame getLastFrame ()
 
virtual WAIFramegetLastFramePtr ()
 
virtual std::vector< WAIMapPoint * > getLocalMapPoints ()
 
virtual int getNumKeyFrames ()
 
virtual std::vector< WAIMapPoint * > getMapPoints ()
 
virtual std::vector< WAIKeyFrame * > getKeyFrames ()
 
virtual std::string getPrintableState ()
 
virtual int getKeyPointCount ()
 
virtual int getKeyFrameCount ()
 
virtual int getMapPointCount ()
 
virtual cv::Mat getPose ()
 
virtual void setCamExrinsicGuess (cv::Mat extrinsicGuess)
 
virtual void setMap (std::unique_ptr< WAIMap > globalMap)
 
virtual WAITrackingState getTrackingState ()
 
virtual void drawInfo (cv::Mat &imageBGR, float scale, bool showInitLine, bool showKeyPoints, bool showKeyPointsMatched)
 
KPextractor * getKPextractor ()
 
int getMapPointMatchesCount () const
 
std::string getLoopCloseStatus ()
 
int getLoopCloseCount ()
 
int getKeyFramesInLoopCloseQueueCount ()
 

Protected Member Functions

void updateState (WAITrackingState state)
 
bool finishRequested ()
 
void requestFinish ()
 
bool isStop ()
 
bool isFinished ()
 
void flushQueue ()
 
int getNextFrame (WAIFrame &frame)
 
- Protected Member Functions inherited from WAISlamTools
virtual ~WAISlamTools ()
 
 WAISlamTools ()
 

Static Protected Member Functions

static void updatePoseThread (WAISlam *ptr)
 
- Static Protected Member Functions inherited from WAISlamTools
static void countReprojectionOutliers (WAIFrame &frame, unsigned int &m, unsigned int &n, unsigned int &outliers)
 

Protected Attributes

bool _requestFinish
 
bool _isFinish
 
bool _isStop
 
std::mutex _stateMutex
 
WAITrackingState _state = WAITrackingState::Idle
 
std::mutex _cameraExtrinsicMutex
 
std::mutex _cameraExtrinsicGuessMutex
 
std::mutex _mutexStates
 
std::mutex _lastFrameMutex
 
WAISlam::Params _params
 
unsigned int _relocFrameCounter = 0
 
unsigned long _lastRelocFrameId = 0
 
unsigned long _lastKeyFrameFrameId = 0
 
KPextractor * _extractor = nullptr
 
KPextractor * _relocExtractor = nullptr
 
KPextractor * _iniExtractor = nullptr
 
int _infoMatchedInliners = 0
 
std::thread * _poseUpdateThread
 
std::queue< WAIFrame_framesQueue
 
std::mutex _frameQueueMutex
 
- Protected Attributes inherited from WAISlamTools
cv::Mat _distortion
 
cv::Mat _cameraIntrinsic
 
cv::Mat _cameraExtrinsic
 
cv::Mat _cameraExtrinsicGuess
 
WAIInitializerData _iniData
 
WAIFrame _lastFrame
 
std::unique_ptr< WAIMap_globalMap
 
LocalMap _localMap
 
WAIOrbVocabulary_voc = nullptr
 
cv::Mat _velocity
 
bool _initialized = false
 
LocalMapping * _localMapping = nullptr
 
LoopClosing * _loopClosing = nullptr
 
std::thread * _processNewKeyFrameThread = nullptr
 
std::vector< std::thread * > _mappingThreads
 
std::thread * _loopClosingThread = nullptr
 

Additional Inherited Members

- Static Public Member Functions inherited from WAISlamTools
static void drawKeyPointInfo (WAIFrame &frame, cv::Mat &image, float scale)
 
static void drawKeyPointMatches (WAIFrame &frame, cv::Mat &image, float scale)
 
static void drawInitInfo (WAIInitializerData &iniData, WAIFrame &frame, cv::Mat &imageBGR, float scale)
 
static bool initialize (WAIInitializerData &iniData, WAIFrame &frame, WAIOrbVocabulary *voc, LocalMap &localMap, int mapPointsNeeded=100)
 
static bool genInitialMap (WAIMap *globalMap, LocalMapping *localMapper, LoopClosing *loopCloser, LocalMap &localMap)
 
static bool oldInitialize (WAIFrame &frame, WAIInitializerData &iniData, WAIMap *map, LocalMap &localMap, LocalMapping *localMapper, LoopClosing *loopCloser, WAIOrbVocabulary *voc, int mapPointsNeeded=100)
 
static int findFrameFixedMapMatches (WAIFrame &frame, WAIMap *waiMap, std::vector< cv::Point2f > &points2d, std::vector< cv::Point3f > &points3d)
 
static bool relocalization (WAIFrame &currentFrame, WAIMap *waiMap, LocalMap &localMap, float minCommonWordFactor, int &inliers, bool minAccScoreFilter=false)
 
static bool relocalizationGPS (WAIFrame &currentFrame, WAIMap *waiMap, LocalMap &localMap, cv::Mat locENU, cv::Mat dirENU, float minCommonWordFactor, int &inliers, bool minAccScoreFilter)
 
static bool tracking (WAIMap *map, LocalMap &localMap, WAIFrame &frame, WAIFrame &lastFrame, int lastRelocFrameId, cv::Mat &velocity, int &inliers)
 
static bool strictTracking (WAIMap *map, LocalMap &localMap, WAIFrame &frame, WAIFrame &lastFrame, int lastRelocFrameId, int &inliers)
 
static bool trackLocalMap (LocalMap &localMap, WAIFrame &frame, int lastRelocFrameId, int &inliers)
 
static void mapping (WAIMap *map, LocalMap &localMap, LocalMapping *localMapper, WAIFrame &frame, int inliers, const unsigned long lastRelocFrameId, unsigned long &lastKeyFrameFrameId)
 
static void strictMapping (WAIMap *map, LocalMap &localMap, LocalMapping *localMapper, WAIFrame &frame, int inliers, const unsigned long lastRelocFrameId, unsigned long &lastKeyFrameFrameId)
 
static void motionModel (WAIFrame &frame, WAIFrame &lastFrame, cv::Mat &velocity, cv::Mat &pose)
 
static bool trackReferenceKeyFrame (LocalMap &map, WAIFrame &lastFrame, WAIFrame &frame)
 
static bool strictTrackReferenceKeyFrame (LocalMap &map, WAIFrame &lastFrame, WAIFrame &frame)
 
static bool trackWithMotionModel (cv::Mat velocity, WAIFrame &previousFrame, WAIFrame &frame)
 
static void updateLocalMap (WAIFrame &frame, LocalMap &localMap)
 
static int trackLocalMapPoints (LocalMap &localMap, int lastRelocFrameId, WAIFrame &frame)
 
static bool needNewKeyFrame (WAIMap *globalMap, LocalMap &localMap, LocalMapping *localMapper, WAIFrame &frame, int nInliners, const unsigned long lastRelocFrameId, const unsigned long lastKeyFrameFrameId)
 
static bool strictNeedNewKeyFrame (WAIMap *map, LocalMap &localMap, LocalMapping *localMapper, WAIFrame &frame, int nInliers, const unsigned long lastRelocFrameId, const unsigned long lastKeyFrameFrameId)
 
static void createNewKeyFrame (LocalMapping *localMapper, LocalMap &localMap, WAIMap *globalMap, WAIFrame &frame, unsigned long &lastKeyFrameFrameId)
 
static WAIFrame createMarkerFrame (std::string markerFile, KPextractor *markerExtractor, const cv::Mat &markerCameraIntrinsic, WAIOrbVocabulary *voc)
 
static bool findMarkerHomography (WAIFrame &markerFrame, WAIKeyFrame *kfCand, cv::Mat &homography, int minMatches)
 
static bool doMarkerMapPreprocessing (std::string markerFile, cv::Mat &nodeTransform, float markerWidthInM, KPextractor *markerExtractor, WAIMap *map, const cv::Mat &markerCameraIntrinsic, WAIOrbVocabulary *voc)
 
static bool detectCycle (WAIKeyFrame *kf, std::set< WAIKeyFrame * > &visitedNode)
 
static bool checkKFConnectionsTree (WAIMap *map)
 

Constructor & Destructor Documentation

◆ WAISlam()

WAISlam::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 
)

◆ ~WAISlam()

WAISlam::~WAISlam ( )
virtual

Member Function Documentation

◆ changeIntrinsic()

void WAISlam::changeIntrinsic ( cv::Mat  intrinsic,
cv::Mat  distortion 
)

◆ createFrame()

void WAISlam::createFrame ( WAIFrame frame,
cv::Mat &  imageGray 
)

◆ drawInfo()

void WAISlam::drawInfo ( cv::Mat &  imageBGR,
float  scale,
bool  showInitLine,
bool  showKeyPoints,
bool  showKeyPointsMatched 
)
virtual

◆ finishRequested()

bool WAISlam::finishRequested ( )
protected

◆ flushQueue()

void WAISlam::flushQueue ( )
protected

◆ getKeyFrameCount()

virtual int WAISlam::getKeyFrameCount ( )
inlinevirtual

◆ getKeyFrames()

virtual std::vector< WAIKeyFrame * > WAISlam::getKeyFrames ( )
inlinevirtual

◆ getKeyFramesInLoopCloseQueueCount()

int WAISlam::getKeyFramesInLoopCloseQueueCount ( )

◆ getKeyPointCount()

virtual int WAISlam::getKeyPointCount ( )
inlinevirtual

◆ getKPextractor()

KPextractor * WAISlam::getKPextractor ( )
inline

◆ getLastFrame()

WAIFrame WAISlam::getLastFrame ( )
virtual

◆ getLastFramePtr()

WAIFrame * WAISlam::getLastFramePtr ( )
virtual

◆ getLocalMapPoints()

virtual std::vector< WAIMapPoint * > WAISlam::getLocalMapPoints ( )
inlinevirtual

◆ getLoopCloseCount()

int WAISlam::getLoopCloseCount ( )

◆ getLoopCloseStatus()

std::string WAISlam::getLoopCloseStatus ( )

◆ getMap()

virtual WAIMap * WAISlam::getMap ( )
inlinevirtual

◆ getMapPointCount()

virtual int WAISlam::getMapPointCount ( )
inlinevirtual

◆ getMapPointMatchesCount()

int WAISlam::getMapPointMatchesCount ( ) const

◆ getMapPoints()

virtual std::vector< WAIMapPoint * > WAISlam::getMapPoints ( )
inlinevirtual

◆ getMatchedCorrespondances()

int WAISlam::getMatchedCorrespondances ( WAIFrame frame,
std::pair< std::vector< cv::Point2f >, std::vector< cv::Point3f > > &  matching 
)

◆ getMatchedMapPoints()

std::vector< WAIMapPoint * > WAISlam::getMatchedMapPoints ( WAIFrame frame)

◆ getNextFrame()

int WAISlam::getNextFrame ( WAIFrame frame)
protected

◆ getNumKeyFrames()

virtual int WAISlam::getNumKeyFrames ( )
inlinevirtual

◆ getPose()

cv::Mat WAISlam::getPose ( )
virtual

◆ getPrintableState()

virtual std::string WAISlam::getPrintableState ( )
inlinevirtual

◆ getTrackingState()

virtual WAITrackingState WAISlam::getTrackingState ( )
inlinevirtual

◆ hasStateIdle()

bool WAISlam::hasStateIdle ( )
virtual

◆ isFinished()

bool WAISlam::isFinished ( )
protected

◆ isInitialized()

virtual bool WAISlam::isInitialized ( )
inlinevirtual

◆ isStop()

bool WAISlam::isStop ( )
protected

◆ isTracking()

bool WAISlam::isTracking ( )
virtual

◆ requestFinish()

void WAISlam::requestFinish ( )
protected

◆ requestStateIdle()

void WAISlam::requestStateIdle ( )
virtual

◆ reset()

void WAISlam::reset ( )
virtual

◆ resume()

void WAISlam::resume ( )
virtual

◆ retainImage()

bool WAISlam::retainImage ( )
virtual

◆ setCamExrinsicGuess()

void WAISlam::setCamExrinsicGuess ( cv::Mat  extrinsicGuess)
virtual

◆ setMap()

void WAISlam::setMap ( std::unique_ptr< WAIMap globalMap)
virtual

◆ transformCoords()

void WAISlam::transformCoords ( cv::Mat  transform)

◆ update()

bool WAISlam::update ( cv::Mat &  imageGray)
virtual

◆ updatePose()

void WAISlam::updatePose ( WAIFrame frame)
virtual

◆ updatePoseKFIntegration()

void WAISlam::updatePoseKFIntegration ( WAIFrame frame)
virtual

◆ updatePoseThread()

void WAISlam::updatePoseThread ( WAISlam ptr)
staticprotected

◆ updateState()

void WAISlam::updateState ( WAITrackingState  state)
protected

Member Data Documentation

◆ _cameraExtrinsicGuessMutex

std::mutex WAISlam::_cameraExtrinsicGuessMutex
protected

◆ _cameraExtrinsicMutex

std::mutex WAISlam::_cameraExtrinsicMutex
protected

◆ _extractor

KPextractor* WAISlam::_extractor = nullptr
protected

◆ _frameQueueMutex

std::mutex WAISlam::_frameQueueMutex
protected

◆ _framesQueue

std::queue<WAIFrame> WAISlam::_framesQueue
protected

◆ _infoMatchedInliners

int WAISlam::_infoMatchedInliners = 0
protected

◆ _iniExtractor

KPextractor* WAISlam::_iniExtractor = nullptr
protected

◆ _isFinish

bool WAISlam::_isFinish
protected

◆ _isStop

bool WAISlam::_isStop
protected

◆ _lastFrameMutex

std::mutex WAISlam::_lastFrameMutex
protected

◆ _lastKeyFrameFrameId

unsigned long WAISlam::_lastKeyFrameFrameId = 0
protected

◆ _lastRelocFrameId

unsigned long WAISlam::_lastRelocFrameId = 0
protected

◆ _mutexStates

std::mutex WAISlam::_mutexStates
protected

◆ _params

WAISlam::Params WAISlam::_params
protected

◆ _poseUpdateThread

std::thread* WAISlam::_poseUpdateThread
protected

◆ _relocExtractor

KPextractor* WAISlam::_relocExtractor = nullptr
protected

◆ _relocFrameCounter

unsigned int WAISlam::_relocFrameCounter = 0
protected

◆ _requestFinish

bool WAISlam::_requestFinish
protected

◆ _state

WAITrackingState WAISlam::_state = WAITrackingState::Idle
protected

◆ _stateMutex

std::mutex WAISlam::_stateMutex
protected

The documentation for this class was generated from the following files: