标签结合
来源:互联网 发布:nginx 配置本地目录 编辑:程序博客网 时间:2024/06/11 11:10
将形式:
samples/000001.jpg 95 71 321 384
samples/000002.jpg 72 94 293 400
samples/000003.jpg 216 59 307 185
samples/000004.jpg 622 257 1186 1038
samples/000005.jpg 236 109 356 275
和标签:
000001.jpg 165 184 244 176 196 249 194 271 266 260
000002.jpg 140 204 220 204 168 254 146 289 226 289
000003.jpg 244 104 264 105 263 121 235 134 251 140
000004.jpg 796 539 984 539 930 687 762 756 915 756
000005.jpg 273 169 328 161 298 172 283 208 323 207
结合成:
samples/000001.jpg 95 71 321 384 165 184 244 176 196 249 194 271 266 260
samples/000002.jpg 72 94 293 400 140 204 220 204 168 254 146 289 226 289
samples/000003.jpg 216 59 307 185 244 104 264 105 263 121 235 134 251 140
samples/000004.jpg 622 257 1186 1038 796 539 984 539 930 687 762 756 915 756
samples/000005.jpg 236 109 356 275 273 169 328 161 298 172 283 208 323 207
代码::
#include<opencv2/opencv.hpp>#include <iostream>#include <vector>#include <fstream>#include <string>using namespace cv;using namespace std;int main(){ifstream infile1("../label1.txt");fstream fout("../out.txt", ios::out);std::vector<string> imgnames;std::vector<vector<int>> rois;int box;while (infile1){string imgname;infile1 >> imgname;imgnames.push_back(imgname);vector<int>roi;for (int i = 0; i < 4; i++){infile1 >> box;roi.push_back(box);}rois.push_back(roi);}string imgname2;int key;std::vector<vector<int>> rois2;ifstream infile2("../label2.txt");while (infile2>>imgname2){vector<int>keys;for (int i = 0; i < 10; i++){infile2 >> key;keys.push_back(key);}rois2.push_back(keys);}for (int i = 0; i < rois.size(); i++){fout << imgnames[i] << " ";for (int m = 0; m < 4; m++){fout << rois[i][m] << " ";}for (int j = 0; j < 10; j++){fout << rois2[i][j] << " ";}fout << endl;}fout.close();return 0;}
- 标签结合
- Label标签结合input标签使用功能
- Struts2结合freemarker自定义标签
- 结合网站ASPCMS标签集锦
- Struts2结合freemarker自定义标签
- UL-LI 标签结合CSS的运用
- UL-LI 标签结合CSS的运用
- Asp结合正则替换掉HTML标签
- GridView结合a标签实现打开新窗口
- 结合jQuery扩展select标签操作
- UL-LI 标签结合CSS的运用
- 常用HTML标签元素结合及简介
- JAVA循环结合标签使用,控制跳转
- javaweb框架--自定义标签与freemaker结合
- jsf结合各种标签一起使用
- KindEditor和knockout结合使用自定义标签
- 常用HTML标签元素结合及简介
- dede中php标签结合sql使用方法
- tf.extract_image_patches
- Spyder调试快捷键
- 普通用户切换到root用户无法启动环境变量
- 每日收获——初体验
- 111111111111111111111111111111111111111111
- 标签结合
- 偷懒的一天
- Python 标准输出 sys.stdout 重定向
- 下本书,你该读什么?
- 机器学习基石 2.1 Perceptron Hypothesis Set
- 建造者模式
- Java复习笔记+经验总结-01 运算符 表达式 数组 流程控制语句
- 一起厌恶学习艳课网(二)
- 驱动开发中ioctl cmd定义分析