不怕大家笑话,主函数我找了好久才找到,甚至是看完了主要的头文件和源文件后,就非常纳闷,主函数呢,跑哪里去来,最后还是一个个翻,原来是在Examples/Monocular里。在这呢主要了解下monotmu下的主函数:
#include<iostream>
#include<algorithm>
#include<fstream>
#include<chrono>
#include<opencv2/core/core.hpp>
#include<System.h>
using namespace std;
// 函数声明,编译都是从上往下,运行才是从主函数开始,然后一级一级运行,所以要先声明
void LoadImages(const string &strFile, vector<string> &vstrImageFilenames,
vector<double> &vTimestamps);
int main(int argc, char **argv)
{
if(argc != 4)// 确定输入为4个参数,如下显示的四个变量
{
cerr << endl << "Usage: ./mono_tum path_to_vocabulary path_to_settings path_to_sequence" << endl;
return 1;
}
// Retrieve paths to images
vector<string> vstrImageFilenames;// 图片文件列表
vector<double> vTimestamps;
string strFile = string(argv[3])&