face alignment读取.pts文件
来源:互联网 发布:金字塔程序化交易软件 编辑:程序博客网 时间:2024/06/05 07:37
在c++下,.pts文件中存储了landmark点的坐标,其内容如下所示:
version: 1n_points: 68{446.000 91.000449.459 119.344450.957 150.614460.552 176.986471.486 202.157488.087 226.842506.016 246.438524.662 263.865553.315 271.435578.732 266.260599.361 248.966...}
想要通过c++读取其中的点的坐标,需要用到fscanf函数,以及正则表达式。
整体代码如下:
char filename[100];sprintf(filename, "300W/01_Indoor/indoor_%03d.pts", i);FILE *f = fopen(filename,"r+");for (int k = 0; k<3; k++) fscanf(f, "%*[^\n]%*c");//跳过前三行,用到了正则表达式Mat1f temp(2 * 68, 1);//点云存储在一个float类型的向量中。for (int j = 0; j<68; j++){ fscanf(f, "%f", &temp(2 * j, 0));//依次读取每一行中的float数值,并存储下来 fscanf(f, "%f", &temp(2 * j + 1, 0));}fclose(f);
参考:
跳过某一行(百度知道)
补充:
关于文件读取:如果一个存储数据的文件里有乱码,那么在读取该文件时,读到乱码之后,所有的数据都有可能改变。这点十分值得注意。
0 0
- face alignment读取.pts文件
- face alignment中opencv读取pts文件并修改系列程序
- Face Alignment
- Face Alignment
- Face Alignment
- Face Alignment(Face Landmark)
- Face Detection & Alignment
- Face Alignment Survey
- 利用flandmark进行face alignment
- 利用flandmark进行face alignment
- Join cascade face detctor alignment
- Mnemonic Descent Method -- Face Alignment
- Face Alignment at 3000FPS工程配置
- cvpr2015的face Alignment 文章笔记
- 阅读Face Alignment by Explicit Shape Regression
- Affine-Transformation Parameters Regression for Face Alignment
- Face Alignment at 3000 FPS 阅读笔记
- Unconstrained Face Alignment via Cascaded Compositional Learning
- Java中的volatile关键字
- the apk for your currently selected variant(app-release-unsigned.apk)is not signed.Please specity a
- iframe参数详解
- List
- springmvc后台获取图片,到jsp页面显示
- face alignment读取.pts文件
- php伪静态
- 解析 XML
- Linux 下编译安装 PHP 5.6
- JEECG 新手常见问题大全,入门必读
- 【加密技术】Java实现四大加密算法
- Group Anagrams 同字母异序String的分组
- 为什么抽象类实现接口的时候不需要重写接口里的方法?
- 开发模式和生产模式下上传图片到服务器和七牛