本文整理汇总了C++中cv::FileNode::begin方法的典型用法代码示例。如果您正苦于以下问题:C++ FileNode::begin方法的具体用法?C++ FileNode::begin怎么用?C++ FileNode::begin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cv::FileNode
的用法示例。
在下文中一共展示了FileNode::begin方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: read
void RFS::read(const cv::FileNode &fn)
{
rtrees.clear();
for (auto it = fn.begin(); it != fn.end(); ++it)
{
RTree rfs;
*it >> rfs;
rtrees.push_back(rfs);
}
}
示例2: loadConfigurationFromFileNode
bool ConfigurationDataReader::loadConfigurationFromFileNode(const cv::FileNode &dataFileNode)
{
bool success = true;
cv::FileNodeIterator itEnd = dataFileNode.end();
for (cv::FileNodeIterator it = dataFileNode.begin(); it != itEnd && success; it++)
{
const char *newDataValueName = (*it).name().c_str();
success = success && loadNodeFromFileNode(dataFileNode, newDataValueName);
}
return success;
}
示例3: read
void read ( const cv::FileNode& node, map< string, V >&result)
{
bool node_type_ok = (node.type() & FileNode::MAP) > 0;
if(!node_type_ok)
{
cout << node.type() << endl;
cout << (node.type() & FileNode::MAP) << endl;
cout << ((node.type() & FileNode::MAP) > 0) << endl;
assert(node_type_ok);
}
for(FileNodeIterator iter = node.begin(); iter != node.end(); ++iter)
{
string node_name = (*iter).name();
V value;
//iter >> value;
deformable_depth::read_in_map(*iter,value);
result[node_name] = value;
}
}
示例4: read
void read(const cv::FileNode& node, vector<vector< pair<int, int> > >& termPair)
{
cv::FileNodeIterator it = node.begin(), it_end = node.end();
for( ; it != it_end; ++it)
{
vector<int> first_part;
vector<int> second_part;
(*it)["first"] >> first_part;
(*it)["second"] >> second_part;
vector<pair<int, int> > first_second;
first_second.resize(first_part.size());
for(int j = 0; j < first_part.size(); ++j)
{
first_second[j].first = first_part[j];
first_second[j].second = second_part[j];
}
termPair.push_back(first_second);
}
}
示例5: storeInit
persistStore();
}
void ViolenceModel::storeInit(cv::FileStorage &file, std::string exampleStoreName, cv::Mat &exampleStore,
std::string classStoreName, cv::Mat &classStore,
std::string indexCacheName, std::map<std::string, time_t> &indexCache)
{
// Read the data structures in from the training store.
file[exampleStoreName] >> exampleStore;
std::cout << exampleStoreName << " loaded. size: " << exampleStore.size() << "\n";
file[classStoreName] >> classStore;
std::cout << classStoreName << " loaded. size: " << classStore.size() << "\n";
cv::FileNode indexedFilePaths = file[indexCacheName];
cv::FileNodeIterator iter = indexedFilePaths.begin(), end = indexedFilePaths.end();
while ( iter != end )
{
std::string path = (*iter)[VIOLENCE_MODEL_TRAINING_EXAMPLE_PATH];
//std::cout << "found path: " << path << "\n";
int modTime = (int)(*iter)[VIOLENCE_MODEL_TRAINING_EXAMPLE_MOD_DATE];
indexCache[path] = (time_t)modTime;
iter++;
}
// Ensure we go no further the height (rows) are not equivalent.
std::cout << "classes: " << classStore.size().height << " examples: " << exampleStore.size().height << " indices: " << indexCache.size() << "\n";
assert(classStore.size().height == exampleStore.size().height && classStore.size().height == indexCache.size());
}
void ViolenceModel::index(std::string resourcePath, bool isViolent)