1 #ifndef INCLUDE_GAZE_UTIL_CONFIG_H_
2 #define INCLUDE_GAZE_UTIL_CONFIG_H_
4 #include "opencv2/opencv.hpp"
5 #include "yaml-cpp/yaml.h"
33 YAML::Node
get_config(
int pipeline_step_number);
64 node.push_back(rhs.
x);
65 node.push_back(rhs.
y);
66 node.push_back(rhs.
z);
79 if (!node.IsSequence() || node.size() != 3) {
82 rhs.
x = node[0].as<
double>();
83 rhs.
y = node[1].as<
double>();
84 rhs.
z = node[2].as<
double>();
105 node.push_back(rhs[0]);
106 node.push_back(rhs[1]);
107 node.push_back(rhs[2]);
120 if (!node.IsSequence() || node.size() != 3) {
123 rhs[0] = node[0].as<
double>();
124 rhs[1] = node[1].as<
double>();
125 rhs[2] = node[2].as<
double>();
136 struct convert<cv::Mat> {
145 node[
"rows"] = rhs.
rows;
146 node[
"cols"] = rhs.
cols;
151 data.push_back(static_cast<double>(*d));
166 if (!node[
"rows"] || !node[
"cols"] || !node[
"dt"] || !node[
"data"] ||
167 !node[
"data"].IsSequence()) {
170 char dt = node[
"dt"].as<
char>();
174 int rows = node[
"rows"].as<
int>();
175 int cols = node[
"cols"].as<
int>();
176 if (
static_cast<decltype(node["data"].
size())
>(rows * cols) !=
177 node[
"data"].size()) {
181 double* data =
new double[rows *
cols];
182 for (
auto i = decltype(node[
"data"].
size()){0}; i < node[
"data"].size();
184 data[i] = node[
"data"][i].as<
double>();
195 #endif // INCLUDE_GAZE_UTIL_CONFIG_H_
static bool decode(const Node &node, cv::Point3d &rhs)
void copyTo(OutputArray m) const
static Node encode(const cv::Vec3d &rhs)
Point3_< double > Point3d
static Node encode(const cv::Mat &rhs)
static bool decode(const Node &node, cv::Vec3d &rhs)
static bool decode(const Node &node, cv::Mat &rhs)
static Node encode(const cv::Point3d &rhs)