37 cv::FileStorage fs(path, cv::FileStorage::READ);
39 fs[
"markerMapConfig"] >> markerMapConfig;
40 return markerMapConfig;
44 cv::FileStorage fs(path, cv::FileStorage::WRITE);
45 fs <<
"markerMapConfig" << markerMapConfig;
55 fs <<
"id" << this->
id;
56 fs <<
"type" << this->
type;
63 this->
id = (int) node[
"id"];
64 this->
type = (std::string) node[
"type"];
75 fs <<
"id" << this->
id;
76 fs <<
"type" << this->
type;
79 fs <<
"size" << (int) this->markers.size();
82 for(
auto &markerDetails:this->markers){
91 this->
id = (int) node[
"id"];
92 this->
type = (std::string) node[
"type"];
94 FileNode markersNode = node[
"markers"];
97 FileNode dataNodes = markersNode[
"data"];
98 if (dataNodes.type() != FileNode::SEQ) {
102 FileNodeIterator it = dataNodes.begin(), it_end = dataNodes.end();
103 for (; it != it_end; ++it) {
105 *it >> markerDetails;
106 this->markers.push_back(markerDetails);
117 fs <<
"size" << (int) this->markerMaps.size();
120 for(
auto &markerMapDetails:this->markerMaps){
121 fs << markerMapDetails;
129 FileNode dataNodes = node[
"data"];
130 if (dataNodes.type() != FileNode::SEQ) {
134 FileNodeIterator it = dataNodes.begin(), it_end = dataNodes.end();
135 for (; it != it_end; ++it) {
137 *it >> markerMapDetails;
138 this->markerMaps.push_back(markerMapDetails);
void read(const cv::FileNode &node)
void write(cv::FileStorage &fs) const
void write(cv::FileStorage &fs) const
static void writeFromFile(std::string path, MarkerMapConfig markerMapConfig)
static MarkerMapConfig readFromFile(std::string path)
void write(cv::FileStorage &fs) const
void read(const cv::FileNode &node)
void read(const cv::FileNode &node)