HoviTron Video Pipeline
Config.h
1/* The copyright in this software is being made available under the BSD
2* License, included below. This software may be subject to other third party
3* and contributor rights, including patent rights, and no such rights are
4* granted under this license.
5*
6* Copyright (c) 2010-2018, ITU/ISO/IEC
7* All rights reserved.
8*
9* Redistribution and use in source and binary forms, with or without
10* modification, are permitted provided that the following conditions are met:
11*
12* * Redistributions of source code must retain the above copyright notice,
13* this list of conditions and the following disclaimer.
14* * Redistributions in binary form must reproduce the above copyright notice,
15* this list of conditions and the following disclaimer in the documentation
16* and/or other materials provided with the distribution.
17* * Neither the name of the ITU/ISO/IEC nor the names of its contributors may
18* be used to endorse or promote products derived from this software without
19* specific prior written permission.
20*
21* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
25* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
31* THE POSSIBILITY OF SUCH DAMAGE.
32*/
33
34/*
35Original authors:
36
37Universite Libre de Bruxelles, Brussels, Belgium:
38 Sarah Fachada, Sarah.Fernandes.Pinto.Fachada@ulb.ac.be
39 Daniele Bonatto, Daniele.Bonatto@ulb.ac.be
40 Arnaud Schenkel, arnaud.schenkel@ulb.ac.be
41
42Koninklijke Philips N.V., Eindhoven, The Netherlands:
43 Bart Kroon, bart.kroon@philips.com
44 Bart Sonneveldt, bart.sonneveldt@philips.com
45*/
46
47#ifndef RVSOCULUS_CONFIG_H
48#define RVSOCULUS_CONFIG_H
49
50#include "Parameters.h"
51//#include "PoseTraces.h"
52#include "JsonParser.h"
53
54#include <string>
55#include <vector>
56
57#include <opencv2/core.hpp>
58
64namespace rvs
65{
66 namespace detail
67 {
72 enum class ColorSpace {
73 YUV = 0,
74 RGB = 1
75 };
76 }
77
82 namespace ViewSynthesisMethod
83 {
84 auto const triangles = "Triangles";
85 }
86
91 namespace BlendingMethod
92 {
93 auto const simple = "Simple";
94 auto const multispectral = "Multispectral";
95 }
96
97 namespace detail
98 {
100 extern float g_rescale;
101
103 extern ColorSpace g_color_space;
104 }
105
107 extern bool g_with_opengl;
108
112 class Config {
113 public:
115 static Config loadFromFile(std::string const& filename, std::string const& dir);
116
118 std::string version;
119
121 std::vector<std::string> InputCameraNames;
122
124 std::vector<std::string> VirtualCameraNames;
125
127 std::vector<Parameters> params_real;
128
130 std::vector<Parameters> params_virtual;
131
133 std::vector<std::string> texture_names;
134
136 std::vector<std::string> depth_names;
137
139 std::vector<std::string> outfilenames;
140
142 std::vector<std::string> outmaskedfilenames;
143
145 std::vector<std::string> outmaskfilenames;
146
148 std::vector<std::string> outdepthfilenames;
149
151 std::vector<std::string> outmaskdepthfilenames;
152
154 float validity_threshold = 5000.f;
155
157 std::string vs_method = "Triangles";
158
160 std::string blending_method = "Simple";
161
164
167
169 float blending_factor = 5.f;
170
172 int start_frame = 0;
173
176
178 //PoseTrace pose_trace;
179
181 std::string directory;
182
185
186 private:
187 Config() = default;
188
189
190 std::vector<Parameters> loadCamerasParametersFromFile(std::string const& filepath, std::vector<std::string> names, json::Node overrides);
191 //void loadPoseTraceFromFile(std::string const& filepath);
192
193 void setVersionFrom(json::Node root);
194 void setInputCameraNamesFrom(json::Node root);
195 void setVirtualCameraNamesFrom(json::Node root);
196 void setInputCameraParameters(json::Node root);
197 void setVirtualCameraParameters(json::Node root);
198 void setInputFilepaths(json::Node root, char const *name, std::vector<std::string>&);
199 void setOutputFilepaths(json::Node root, char const *name, std::vector<std::string>&);
200 void setValidityThreshold(json::Node root);
201 void setSynthesisMethod(json::Node root);
202 void setBlendingMethod(json::Node root);
203 void setBlendingFactor(json::Node root);
204 void setBlendingLowFreqFactor(json::Node root);
205 void setBlendingHighFreqFactor(json::Node root);
206 void setStartFrame(json::Node root);
207 void setNumberOfFrames(json::Node root);
208 void setOverrideVirtualViewSetting(json::Node root);
209
210 static void setPrecision(json::Node root);
211 static void setColorSpace(json::Node root);
212 };
213}
214
215#endif //RVSOCULUS_CONFIG_H
Configuration parameters.
Definition: Config.h:112
float blending_low_freq_factor
Definition: Config.h:163
std::vector< std::string > outdepthfilenames
Definition: Config.h:148
int number_of_frames
Definition: Config.h:175
static Config loadFromFile(std::string const &filename, std::string const &dir)
Definition: Config.cpp:72
std::vector< Parameters > params_real
Definition: Config.h:127
std::vector< std::string > outfilenames
Definition: Config.h:139
std::string directory
Definition: Config.h:181
float blending_high_freq_factor
Definition: Config.h:166
std::string vs_method
Definition: Config.h:157
std::vector< std::string > outmaskedfilenames
Definition: Config.h:142
float validity_threshold
Definition: Config.h:154
int start_frame
Definition: Config.h:172
std::vector< std::string > outmaskdepthfilenames
Definition: Config.h:151
std::vector< std::string > outmaskfilenames
Definition: Config.h:145
bool overrideVirtualViewSetting
Definition: Config.h:184
std::vector< std::string > VirtualCameraNames
Definition: Config.h:124
std::vector< std::string > InputCameraNames
Definition: Config.h:121
std::vector< std::string > depth_names
Definition: Config.h:136
std::vector< std::string > texture_names
Definition: Config.h:133
float blending_factor
Definition: Config.h:169
std::string version
Definition: Config.h:118
std::vector< Parameters > params_virtual
Definition: Config.h:130
std::string blending_method
Definition: Config.h:160