MCPcopy Create free account
hub / github.com/PRBonn/semantic_suma / updateParameters

Method updateParameters

src/core/Frame2Model.cpp:65–110  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63}
64
65void Frame2Model::updateParameters() {
66 float angle_thresh = std::cos(Math::deg2rad(params_["icp-max-angle"]));
67 float distance_thresh = params_["icp-max-distance"];
68
69 int32_t weight_function = 0;
70 float factor = 1.0f;
71 if (params_.hasParam("weighting")) {
72 std::string weighting_name = params_["weighting"];
73 if (weighting_name == "huber")
74 weight_function = 1;
75 else if (weighting_name == "turkey")
76 weight_function = 2;
77 else if (weighting_name == "stability")
78 weight_function = 3;
79 factor = params_["factor"];
80 }
81
82 float fov_up = std::abs(float(params_["data_fov_up"]));
83 float fov_down = std::abs(float(params_["data_fov_down"]));
84
85 bool distance_outliers = false;
86 if (params_.hasParam("distance_outliers")) distance_outliers = params_["distance_outliers"];
87
88 program_blend_.setUniform(GlUniform<bool>("distance_outliers", (weight_function == 0) || distance_outliers));
89 program_blend_.setUniform(GlUniform<int32_t>("weight_function", weight_function));
90 program_blend_.setUniform(GlUniform<float>("factor", factor));
91
92 program_blend_.setUniform(GlUniform<float>("factor", factor));
93 program_blend_.setUniform(GlUniform<float>("distance_thresh", distance_thresh));
94 program_blend_.setUniform(GlUniform<float>("angle_thresh", angle_thresh));
95 program_blend_.setUniform(GlUniform<float>("fov_up", fov_up));
96 program_blend_.setUniform(GlUniform<float>("fov_down", fov_down));
97 program_blend_.setUniform(GlUniform<float>("fov", fov_up + fov_down));
98 program_blend_.setUniform(GlUniform<float>("min_depth", float(params_["min_depth"])));
99 program_blend_.setUniform(GlUniform<float>("max_depth", float(params_["max_depth"])));
100 program_blend_.setUniform(GlUniform<float>("cutoff_threshold", float(params_["cutoff_threshold"])));
101
102 sampler_.setWrapOperation(TexWrapOp::CLAMP_TO_BORDER, TexWrapOp::CLAMP_TO_BORDER);
103 if (params_.hasParam("bilinear_sampling") && (bool)params_["bilinear_sampling"]) {
104 sampler_.setMinifyingOperation(TexMinOp::LINEAR);
105 sampler_.setMagnifyingOperation(TexMagOp::LINEAR);
106 } else {
107 sampler_.setMinifyingOperation(TexMinOp::NEAREST);
108 sampler_.setMagnifyingOperation(TexMagOp::NEAREST);
109 }
110}
111
112void Frame2Model::setParameter(const rv::Parameter& param) {
113 params_.insert(param);

Callers

nothing calls this directly

Calls 2

deg2radFunction · 0.85
hasParamMethod · 0.80

Tested by

no test coverage detected