aihot  2017-04-28 23:30:03  OpenCV |   查看评论   
;                                           // 关闭序列
  •           
  •         fs << "Mapping";                              // 文本 - 映射
  •         fs << "{" << "One" << 1;  
  •         fs <<        "Two" << 2 << "}";                 
  •   
  •         fs << "R" << R;                                      // cv::Mat  
  •         fs << "T" << T;  
  •   
  •         fs << "MyData" << m;                                // 你自己的数据结构
  •   
  •         fs.release();                                       // 明确接近
  •         cout << "写入完成." << endl;  
  •     }  
  •   
  •     {//read  
  •         cout << endl << "Reading: " << endl;  
  •         FileStorage fs;   
  •         fs.open(filename, FileStorage::READ);  
  •   
  •         int itNr;   
  •         //fs["iterationNr"] >> itNr;  
  •         itNr = (int) fs["iterationNr"];  
  •         cout << itNr;  
  •         if (!fs.isOpened())  
  •         {  
  •             cerr << "无法打开 " << filename << endl;  
  •             help(av);  
  •             return 1;  
  •         }  
  •   
  •         FileNode n = fs["strings"];                         // 读取字符串序列 - 获取节点
  •         
  •  

    除特别注明外,本站所有文章均为 赢咖4注册 原创,转载请注明出处来自OpenCV学习笔记(六)——对XML和YAML文件实现I/O操作

    留言与评论(共有 0 条评论)
       
    验证码:
    [lianlun]1[/lianlun]