8 #define MULTI_THREAD_FRAME_PROCESSING 1
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__);
16 const cv::Mat& distortion,
18 KPextractor* iniExtractor,
19 KPextractor* relocExtractor,
20 KPextractor* extractor,
21 std::unique_ptr<WAIMap> globalMap,
46 if (globalMap ==
nullptr)
80 #if MULTI_THREAD_FRAME_PROCESSING
110 #if MULTI_THREAD_FRAME_PROCESSING
129 #if MULTI_THREAD_FRAME_PROCESSING
142 #if MULTI_THREAD_FRAME_PROCESSING
217 if (nbFrameInQueue == 0)
222 return nbFrameInQueue;
282 std::this_thread::sleep_for(25ms);
286 std::unique_lock<std::mutex> lock(ptr->
_stateMutex);
476 #if MULTI_THREAD_FRAME_PROCESSING
492 bool showKeyPointsMatched)
505 if (showKeyPointsMatched)
517 std::vector<WAIMapPoint*> result;
519 for (
int i = 0; i < frame->
N; i++)
532 std::pair<std::vector<cv::Point2f>,
533 std::vector<cv::Point3f>>& matching)
535 for (
int i = 0; i < frame->
N; i++)
543 matching.first.push_back(frame->
mvKeysUn[i].pt);
544 matching.second.push_back(cv::Point3f(v.
x, v.
y, v.
z));
548 return (
int)matching.first.size();
571 std::this_thread::sleep_for(std::chrono::microseconds(10));
573 std::cout <<
"localMapping is stopped" << std::endl;
603 std::this_thread::sleep_for(std::chrono::seconds(1));
std::vector< WAIMapPoint * > mvpMapPoints
static long unsigned int nNextId
std::vector< cv::KeyPoint > mvKeysUn
static bool mbInitialComputations
AR Keyframe database class.
static long unsigned int nNextId
void transform(cv::Mat transform)
static long unsigned int nNextId
KPextractor * _iniExtractor
std::queue< WAIFrame > _framesQueue
std::mutex _cameraExtrinsicGuessMutex
unsigned long _lastRelocFrameId
int getMatchedCorrespondances(WAIFrame *frame, std::pair< std::vector< cv::Point2f >, std::vector< cv::Point3f >> &matching)
std::vector< WAIMapPoint * > getMatchedMapPoints(WAIFrame *frame)
void transformCoords(cv::Mat transform)
virtual void setCamExrinsicGuess(cv::Mat extrinsicGuess)
unsigned long _lastKeyFrameFrameId
std::string getLoopCloseStatus()
virtual bool update(cv::Mat &imageGray)
virtual bool isTracking()
std::mutex _lastFrameMutex
virtual WAITrackingState getTrackingState()
virtual cv::Mat getPose()
virtual WAIFrame * getLastFramePtr()
void updateState(WAITrackingState state)
int getMapPointMatchesCount() const
void createFrame(WAIFrame &frame, cv::Mat &imageGray)
virtual void setMap(std::unique_ptr< WAIMap > globalMap)
virtual bool hasStateIdle()
void changeIntrinsic(cv::Mat intrinsic, cv::Mat distortion)
int getNextFrame(WAIFrame &frame)
virtual void updatePoseKFIntegration(WAIFrame &frame)
virtual bool retainImage()
int getKeyFramesInLoopCloseQueueCount()
virtual void requestStateIdle()
static void updatePoseThread(WAISlam *ptr)
KPextractor * _relocExtractor
virtual void drawInfo(cv::Mat &imageBGR, float scale, bool showInitLine, bool showKeyPoints, bool showKeyPointsMatched)
virtual WAIFrame getLastFrame()
std::thread * _poseUpdateThread
virtual void updatePose(WAIFrame &frame)
std::mutex _frameQueueMutex
std::mutex _cameraExtrinsicMutex
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)
unsigned int _relocFrameCounter
Initializer * initializer
float minCommonWordFactor