当前位置: 首页>>代码示例>>C++>>正文


C++ FileNode类代码示例

本文整理汇总了C++中FileNode的典型用法代码示例。如果您正苦于以下问题:C++ FileNode类的具体用法?C++ FileNode怎么用?C++ FileNode使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了FileNode类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: readDefaultRunParams

void DetectorQualityEvaluator::readDefaultRunParams (FileNode &fn)
{
    if (! fn.empty() )
    {
        isSaveKeypointsDefault = (int)fn[IS_SAVE_KEYPOINTS] != 0;
        defaultDetector->read (fn);
    }
}
开发者ID:93sam,项目名称:opencv,代码行数:8,代码来源:detector_descriptor_evaluation.cpp

示例2: FileNode

/**
 * Create intermediate directory to build full tree
 */
FileNode *FileNode::createIntermediateDir(struct zip *zip,
        const char *fname) {
    FileNode *n = new FileNode(zip, fname, NEW_NODE_INDEX);
    if (n == NULL) {
        return NULL;
    }
    n->state = NEW_DIR;
    n->is_dir = true;
    n->has_cretime = true;
    n->m_mtime = n->m_atime = n->m_ctime = n->cretime = time(NULL);
    n->m_size = 0;
    n->m_mode = S_IFDIR | 0775;

    n->parse_name();

    return n;
}
开发者ID:jigneshvasoya,项目名称:fuse-zip,代码行数:20,代码来源:fileNode.cpp

示例3: readVectorOrMat

 static inline void readVectorOrMat(const FileNode & node, std::vector<T> & v)
 {
     if (node.type() == FileNode::MAP)
     {
         Mat m;
         node >> m;
         m.copyTo(v);
     }
开发者ID:ernest-galbrun,项目名称:opencv,代码行数:8,代码来源:precomp.hpp

示例4: readKeyMap

int imageDB::readKeyMap(const FileStorage& cvfs, const FileNode& node)
{
	keypoint_map.clear();

	int keypoint_id;

	FileNodeIterator	it = node.begin();
	while(it != node.end()){
		vector<KeyPoint> keypt_vec;
		keypoint_id = (int)(*it)["keypoint_id"];
		cv::read((*it)["KeyPoint"], keypt_vec);
		keypoint_map.insert(pair<int,KeyPoint>(keypoint_id,keypt_vec[0]));
		it++;
	}

	return 0;
}
开发者ID:Barbakas,项目名称:OpenCV-Marker-less-AR,代码行数:17,代码来源:imageDB.cpp

示例5:

void CaffeClassifier::Impl::SetParams(const FileNode& params_file_node)
{
    CV_Assert(!params_file_node.isNone());
    params_file_node["device_id"] >> device_id;
    params_file_node["net_description_file"] >> net_description_file;
    params_file_node["net_binary_file"] >> net_binary_file;
    params_file_node["output_blob_name"] >> output_blob_name;
}
开发者ID:ekaterinaMaljutina,项目名称:DNN_based_detection,代码行数:8,代码来源:caffe_classifier.cpp

示例6: readRunParams

 virtual int readRunParams( FileStorage& fs )
 {
     int code = CV_StereoMatchingTest::readRunParams(fs);
     FileNode fn = fs.getFirstTopLevelNode();
     assert(fn.isSeq());
     for( int i = 0; i < (int)fn.size(); i+=4 )
     {
         string caseName = fn[i], datasetName = fn[i+1];
         RunParams params;
         string ndisp = fn[i+2]; params.ndisp = atoi(ndisp.c_str());
         string iterCount = fn[i+3]; params.iterCount = atoi(iterCount.c_str());
         caseNames.push_back( caseName );
         caseDatasets.push_back( datasetName );
         caseRunParams.push_back( params );
     }
     return code;
 }
开发者ID:JaehyunAhn,项目名称:Basic_OpenCV_utilization,代码行数:17,代码来源:test_stereomatching.cpp

示例7: readVectorOfVector

void readVectorOfVector(FileStorage &fns, string name, vector<vector<KeyPoint> > &vov)
{
    vov.clear();
    FileNode fn = fns[name];
    if (fn.empty()){
        return;
    }

    FileNodeIterator current = fn.begin(), it_end = fn.end(); // Go through the node
    for (; current != it_end; ++current)
    {
        vector<KeyPoint> tmp;
        FileNode item = *current;
        read(item, tmp);
        vov.push_back(tmp);
    }
}
开发者ID:straiki,项目名称:DP,代码行数:17,代码来源:Common.cpp

示例8: read

void read(const FileNode& node, ICFDetector& d,
    const ICFDetector& default_value)
{
    if( node.empty() )
        d = default_value;
    else
        d.read(node);
}
开发者ID:AWin9,项目名称:opencv_contrib,代码行数:8,代码来源:icfdetector.cpp

示例9: format

bool DataSetVOC::loadBBoxes(CStr &nameNE, vector<Vec4i> &boxes, vecI &clsIdx)
{
	string fName = format(_S(annoPathW), _S(nameNE));
	FileStorage fs(fName, FileStorage::READ);
	FileNode fn = fs["annotation"]["object"];

	boxes.clear();
	clsIdx.clear();
	if (fn.isSeq()){
		for (FileNodeIterator it = fn.begin(), it_end = fn.end(); it != it_end; it++)
			loadBox(*it, boxes, clsIdx);
	}
	else
		loadBox(fn, boxes, clsIdx);
	fs.release();
	return true;
}
开发者ID:MasazI,项目名称:BING-Objectness,代码行数:17,代码来源:DataSetVOC.cpp

示例10: CV_Assert

void ImageMolecule::deserialize(const cv::FileNode& fn)
{
  FileNode atoms = fn["atoms"];
  CV_Assert(atoms.type() == FileNode::SEQ);

  std::map<int, Ptr<ImageAtom> > a_map;
  for (size_t i = 0; i < atoms.size(); i++)
  {
    Ptr<ImageAtom> atom(new ImageAtom);
    atom->deserialize(atoms[i]);
    a_map[atom->uid()] = atom;
    //we will insert from pairs...
    insertAtom(atom);
  }

  FileNode pairs = fn["pairs"];
  CV_Assert(pairs.type() == FileNode::SEQ);
  vector<AtomPair> pairs_temp;
  pairs_temp.resize(pairs.size());
  for (size_t i = 0; i < pairs.size(); i++)
  {
    pairs_temp[i].deserialize(pairs[i]);

    pairs_temp[i].setAtom1(a_map[pairs_temp[i].atom1()->uid()]);
    pairs_temp[i].setAtom2(a_map[pairs_temp[i].atom2()->uid()]);

  }

  insertPairs(pairs_temp);

}
开发者ID:LuisServin,项目名称:catkin_ws,代码行数:31,代码来源:ImageMolecule.cpp

示例11: load

 bool load(const String &fn)
 {
     FileStorage fs(fn, FileStorage::READ);
     if (! fs.isOpened())
         return false;
     bool ok = classifier->load(fs);
     FileNode pers = fs["persons"];
     FileNodeIterator it = pers.begin();
     for( ; it != pers.end(); ++it )
     {
         int id;
         (*it) >> id;
         string s =(*it).name();
         persons[id] = s;
     }
     fs.release();
     return ok;
 }
开发者ID:Liorme1,项目名称:uniform-lbp,代码行数:18,代码来源:online.cpp

示例12: read

//==============================================================================
void
shape_model::
read(const FileNode& node)
{
    assert(node.type() == FileNode::MAP);
    node["V"] >> V; node["e"] >> e; node["C"] >> C;
    node["Y"] >> Y;
    p = Mat::zeros(e.rows,1,CV_32F);
}
开发者ID:chrischensy,项目名称:ios_facedetect_1_0,代码行数:10,代码来源:shape_model.cpp

示例13: snprintf

bool f_lcc::load_rad_data()
{
	char buf[1024];
	snprintf(buf, 1024, "%s.yml", m_fmap);
	int size;
	FileStorage fs(buf, FileStorage::READ);
	if(!fs.isOpened()){
		cerr << "Failed to open " << buf << endl;
		return false;
	}else{
		FileNode fn = fs["LCCR"];
		if(!fn.empty()){
			fn >> size; 
		}
		fn = fs["LCCAMap"];
		if(!fn.empty()){
			fn >> m_amap;
		}
开发者ID:yokosako,项目名称:aws,代码行数:18,代码来源:f_misc.cpp

示例14: exit

void UndistortImages::loadImages( char* images_list ){
    FileStorage fs;
    fs.open(images_list,FileStorage::READ);
    if( !fs.isOpened() ){
        cerr << " Fail to open " << images_list << endl;
        exit(EXIT_FAILURE);
    }
    
    cout << " Images size = " << fs["images"].size() << endl;

    FileNode imagesPathNode = fs["images"];
    for(FileNodeIterator it = imagesPathNode.begin();
            it != imagesPathNode.end(); ++it){
        inputImagesPaths.push_back( *it );
    }

    fs.release();
}
开发者ID:Thomio-Watanabe,项目名称:undistort_images,代码行数:18,代码来源:undistort.cpp

示例15: readRunParams

 virtual int readRunParams( FileStorage& fs )
 {
     int code = CV_StereoMatchingTest::readRunParams(fs);
     FileNode fn = fs.getFirstTopLevelNode();
     assert(fn.isSeq());
     for( int i = 0; i < (int)fn.size(); i+=5 )
     {
         string caseName = fn[i], datasetName = fn[i+1];
         RunParams params;
         string ndisp = fn[i+2]; params.ndisp = atoi(ndisp.c_str());
         string winSize = fn[i+3]; params.winSize = atoi(winSize.c_str());
         string fullDP = fn[i+4]; params.fullDP = atoi(fullDP.c_str()) == 0 ? false : true;
         caseNames.push_back( caseName );
         caseDatasets.push_back( datasetName );
         caseRunParams.push_back( params );
     }
     return code;
 }
开发者ID:,项目名称:,代码行数:18,代码来源:


注:本文中的FileNode类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。