基于图像三维重建学习笔记

1. 编译报错

 在对应的文件task5_test_fundamental_ransac.cc中添加

#include <cassert>

解决!

2. 使用Eigen实现针孔相机模型投影变换

View Code

3. 使用读文件getline,这边的line、stream是这一行的数据,>>表示以空格为分隔,读取一个字符串

 /* 加载数据 */
    std::ifstream in(file_name);
    assert(in.is_open());
    std::string line, word;

    // 加载相机参数
    {
        int n_cams = 0;
        getline(in, line);
        std::stringstream stream(line);
        stream >> word >> n_cams;
        cams.resize(n_cams);
        for (int i = 0; i < cams.size(); i++) {
            getline(in, line);
            std::stringstream stream(line);
            stream >> cams[i].focal_length;
            stream >> cams[i].distortion[0] >> cams[i].distortion[1];
            for (int j = 0; j < 3; j++)stream >> cams[i].translation[j];
            for (int j = 0; j < 9; j++)stream >> cams[i].rotation[j];
        }
    }

4. 使用小工具exiftool,获取焦距

安装: sudo apt-get install exiftool 

使用: exiftool ./ImageBasedModellingEdu/examples/data/sequence/IMG_0191.JPG 

结果:Focal Length即为焦距

 

posted @ 2021-01-19 23:58  我的二河  阅读(156)  评论(0)    收藏  举报