#include <iostream>
#include <fstream>
using namespace std;
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <Eigen/Geometry>
#include <boost/format.hpp> // 格式化字符串
#include <pcl/point_types.h>
#include <pcl/io/pcd_io.h>
#include <pcl/visualization/pcl_visualizer.h>
int main( int argc, char** argv)
{
/*彩色图和灰度图各5张,所以用容器来存储,colorImgs代表彩色图,depthImgs代表深度图*/
vector<cv::Mat> colorImgs, depthImgs;
/*vector有两个参数,后面的参数一般是默认的,这里用适合Eigen库的对齐方式来初始化容器,
总共有5张图片,对应5个位姿矩阵,poses存放的是变换矩阵,位姿记录的形式是平移向量加旋转四元数*/
vector<Eigen::Isometry3d,
Eigen::aligned_allocator<Eigen::Isometry3d>> poses; // 相机位姿
/*读取pose.txt文件,读取相机的位姿*/
ifstream fin("./pose.txt");
/*异常情况处理,只有在pose.txt所在目录才能读取该文件*/
if (!fin)
评论0