73 {
74 if(g_verbose)
75 std::cout << '\n';
76 std::string path = filename;
77 if (!dir.empty()) {
78 path = dir + '/' + filename;
79 }
80 std::ifstream stream(path);
81
82 if (!stream.good()) {
83 std::ostringstream what;
84 what << "Failed to open configuration file \"" << dir + '/' + filename << "\" for reading: \n" << strerror(errno);
85 throw std::runtime_error(what.str());
86 }
88
89 Config config;
90
91 config.directory = dir;
92
93 config.setVersionFrom(root);
94 config.setInputCameraNamesFrom(root);
95 config.setVirtualCameraNamesFrom(root);
96 config.setInputCameraParameters(root);
97 config.setVirtualCameraParameters(root);
98 config.setInputFilepaths(root, "ViewImageNames", config.texture_names);
99 config.setInputFilepaths(root, "DepthMapNames", config.depth_names);
100 config.setOutputFilepaths(root, "OutputFiles", config.outfilenames);
101 config.setOutputFilepaths(root, "MaskedOutputFiles", config.outmaskedfilenames);
102 config.setOutputFilepaths(root, "OutputMasks", config.outmaskfilenames);
103 config.setOutputFilepaths(root, "DepthOutputFiles", config.outdepthfilenames);
104 config.setOutputFilepaths(root, "MaskedDepthOutputFiles", config.outmaskdepthfilenames);
105 config.setValidityThreshold(root);
106 config.setSynthesisMethod(root);
107 config.setBlendingMethod(root);
108 config.setBlendingFactor(root);
109 config.setBlendingLowFreqFactor(root);
110 config.setBlendingHighFreqFactor(root);
111 config.setStartFrame(root);
112 config.setNumberOfFrames(root);
113
114 setPrecision(root);
115 setColorSpace(root);
116
117 auto node = root.optional("VirtualPoseTraceName");
118 if (node) {
119 auto filepath = node.asString();
120 if(g_verbose)
121 std::cout << "VirtualPoseTraceName: " << filepath << '\n';
122
123 }
124
125 config.setOverrideVirtualViewSetting(root);
126
127 return config;
128 }
static Node readFrom(std::istream &)