2020-12-01 11:58:17 +08:00
|
|
|
/**
|
|
|
|
* This file is part of ORB-SLAM3
|
|
|
|
*
|
2022-03-28 21:20:28 +08:00
|
|
|
* Copyright (C) 2017-2021 Carlos Campos, Richard Elvira, Juan J. Gómez Rodríguez, José M.M. Montiel and Juan D. Tardós, University of Zaragoza.
|
2020-12-01 11:58:17 +08:00
|
|
|
* Copyright (C) 2014-2016 Raúl Mur-Artal, José M.M. Montiel and Juan D. Tardós, University of Zaragoza.
|
|
|
|
*
|
|
|
|
* ORB-SLAM3 is free software: you can redistribute it and/or modify it under the terms of the GNU General Public
|
|
|
|
* License as published by the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* ORB-SLAM3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
|
|
|
|
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along with ORB-SLAM3.
|
|
|
|
* If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef FRAMEDRAWER_H
|
|
|
|
#define FRAMEDRAWER_H
|
|
|
|
|
|
|
|
#include "Tracking.h"
|
|
|
|
#include "MapPoint.h"
|
|
|
|
#include "Atlas.h"
|
|
|
|
|
|
|
|
#include<opencv2/core/core.hpp>
|
|
|
|
#include<opencv2/features2d/features2d.hpp>
|
|
|
|
|
|
|
|
#include<mutex>
|
|
|
|
#include <unordered_set>
|
|
|
|
|
|
|
|
|
|
|
|
namespace ORB_SLAM3
|
|
|
|
{
|
|
|
|
|
|
|
|
class Tracking;
|
|
|
|
class Viewer;
|
|
|
|
|
|
|
|
class FrameDrawer
|
|
|
|
{
|
|
|
|
public:
|
2022-03-28 21:20:28 +08:00
|
|
|
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
|
2020-12-01 11:58:17 +08:00
|
|
|
FrameDrawer(Atlas* pAtlas);
|
|
|
|
|
|
|
|
// Update info from the last processed frame.
|
|
|
|
void Update(Tracking *pTracker);
|
|
|
|
|
|
|
|
// Draw last processed frame.
|
2022-03-28 21:20:28 +08:00
|
|
|
cv::Mat DrawFrame(float imageScale=1.f);
|
|
|
|
cv::Mat DrawRightFrame(float imageScale=1.f);
|
2020-12-01 11:58:17 +08:00
|
|
|
|
|
|
|
bool both;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
void DrawTextInfo(cv::Mat &im, int nState, cv::Mat &imText);
|
|
|
|
|
|
|
|
// Info of the frame to be drawn
|
|
|
|
cv::Mat mIm, mImRight;
|
|
|
|
int N;
|
|
|
|
vector<cv::KeyPoint> mvCurrentKeys,mvCurrentKeysRight;
|
|
|
|
vector<bool> mvbMap, mvbVO;
|
|
|
|
bool mbOnlyTracking;
|
|
|
|
int mnTracked, mnTrackedVO;
|
|
|
|
vector<cv::KeyPoint> mvIniKeys;
|
|
|
|
vector<int> mvIniMatches;
|
|
|
|
int mState;
|
2022-03-28 21:20:28 +08:00
|
|
|
std::vector<float> mvCurrentDepth;
|
|
|
|
float mThDepth;
|
2020-12-01 11:58:17 +08:00
|
|
|
|
|
|
|
Atlas* mpAtlas;
|
|
|
|
|
|
|
|
std::mutex mMutex;
|
|
|
|
vector<pair<cv::Point2f, cv::Point2f> > mvTracks;
|
|
|
|
|
|
|
|
Frame mCurrentFrame;
|
|
|
|
vector<MapPoint*> mvpLocalMap;
|
|
|
|
vector<cv::KeyPoint> mvMatchedKeys;
|
|
|
|
vector<MapPoint*> mvpMatchedMPs;
|
|
|
|
vector<cv::KeyPoint> mvOutlierKeys;
|
|
|
|
vector<MapPoint*> mvpOutlierMPs;
|
|
|
|
|
|
|
|
map<long unsigned int, cv::Point2f> mmProjectPoints;
|
|
|
|
map<long unsigned int, cv::Point2f> mmMatchedInImage;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
} //namespace ORB_SLAM
|
|
|
|
|
|
|
|
#endif // FRAMEDRAWER_H
|