template <class vector>
struct HeadLocation{
vector x;
vector y;
}; vector<HeadLocation<int> > gt_loc_; //二维vector容器 void ReadLocationFromTextFile(const string filename) {
cout << "Opening file " << filename << endl;
ifstream infile(filename.c_str());
if (!infile){ printf("不存在此文本文件!"); };
int num_crowd;
infile >> num_crowd;
if (num_crowd <= 0){ cout << "Number of crowd must be positive!\n"; };
gt_loc_.clear(); //size = 0, capicity =?
gt_loc_.resize(num_crowd); //size = num_crowd(行) for (int i = 0; i < num_crowd; i++) {
/*HeadLocation<float> location_t;
HeadLocation<int> location(location_t.begin(), location_t.end());*/
HeadLocation<int> location;
infile >> location.x >> location.y; for (int j = 0; j < 3; ++j) {
location.x = (location.x - 1) / 2;
location.y = (location.y - 1) / 2;
}
gt_loc_[i] = location;
}
infile.close(); // 关闭文件
}

  

最新文章

  1. 我们都是IT民工---------流浪人IDE开发札记
  2. 18个演讲PPT技巧,让你成为真正的演讲高手
  3. Matrix(单点移动,多点缩放)
  4. 条件随机场理论分析CRF(Conditional Random Field)
  5. Coding上传项目步骤
  6. nyoj814_又见拦截导弹_DP
  7. Bzoj 1598: [Usaco2008 Mar]牛跑步 dijkstra,堆,K短路,A*
  8. PHP 根据值查找键名
  9. Nginx学习——Nginx基本配置
  10. 使用 video.js 开发 HTML5 视频页面
  11. 【Linux 操作系统】Ubuntu 基础操作 基础命令 热键 man手册使用 关机 重启等命令使用
  12. Go之十大经典排序算法
  13. 放球游戏B
  14. macos 下usb键盘问题.
  15. suse日常操作(含suse/rhel内核与发行版对应关系)
  16. JAVA中关于对像的读写
  17. 17_react脚手架应用分析
  18. Axis1.4开发webservice个人笔记
  19. 安装64位php开发环境
  20. 阿里云windows时间同步服务地址

热门文章

  1. Entity Framework 6.0 Tutorials(3):Code-based Configuration
  2. easyUI form sumit 中文乱码
  3. Git代码冲突常见解决方法
  4. Linq to SQL Like Operator
  5. TSQL--删除正在运行的数据库
  6. C# 文本输入限制类型,datagridview单元格输入验证
  7. WinForm中ListBox的使用
  8. java集合类学习笔记之LinkList
  9. Selenium3+python异常后截图(screenshot)
  10. Sample-Code:Translator