ORB SLAM2 代码分析(2)

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/huangkangying/article/details/88542857

Tracking详解

GrabImageRGBD:

  • Covert color RGB to Gray
  • 构造Frame
  • 调用Track()

构造Frame

Frame类一共有5个构造函数:

  1. 默认构造
Frame::Frame();
  1. 拷贝构造
Frame::Frame(const Frame& frame);
  1. 用于双目的构造函数
Frame::Frame(const cv::Mat &imLeft, const cv::Mat &imRight, 
const double &timeStamp, ORBextractor* extractorLeft, ORBextractor* extractorRight, 
ORBVocabulary* voc, cv::Mat &K, cv::Mat &distCoef, 
const float &bf, const float &thDepth);
  1. 用于RGBD的构造函数
Frame::Frame(const cv::Mat &imGray, const cv::Mat &imDepth, 
const double &timeStamp, ORBextractor* extractor,ORBVocabulary* voc, 
cv::Mat &K, cv::Mat &distCoef, const float &bf, const float &thDepth);
  1. 用于单目的构造函数
Frame::Frame(const cv::Mat &imGray, const double &timeStamp, 
ORBextractor* extractor,ORBVocabulary* voc, 
cv::Mat &K, cv::Mat &distCoef, const float &bf, const float &thDepth);

下面主要分析对于RGBD的构造函数:

  • 设定frame ID
  • 设定Scale Level信息,主要用于图像金字塔
  • 提取出ORB关键点和描述子
    // ORB extraction
    ExtractORB(0,imGray);
  • 对关键点进行undistortion
    UndistortKeyPoints();
  • 通过depth图像构建stereo图像:
    ComputeStereoFromRGBD(imDepth);

猜你喜欢

转载自blog.csdn.net/huangkangying/article/details/88542857