本文整理汇总了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);
}
}
示例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;
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
}
示例8: read
void read(const FileNode& node, ICFDetector& d,
const ICFDetector& default_value)
{
if( node.empty() )
d = default_value;
else
d.read(node);
}
示例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;
}
示例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);
}
示例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;
}
示例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);
}
示例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;
}
示例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();
}
示例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;
}