Skip to content
Snippets Groups Projects

Ongoing #133 improvements

Merged Nicolas Pope requested to merge feature/133/ilw into master
4 files
+ 44
19
Compare changes
  • Side-by-side
  • Inline
Files
4
@@ -19,6 +19,9 @@ ILW::ILW(nlohmann::json &config) : ftl::Configurable(config) {
motion_rate_ = value("motion_rate", 0.4f);
motion_window_ = value("motion_window", 3);
use_lab_ = value("use_Lab", false);
params_.colour_smooth = value("colour_smooth", 50.0f);
params_.spatial_smooth = value("spatial_smooth", 0.04f);
params_.cost_ratio = value("cost_ratio", 75.0f);
on("ilw_align", [this](const ftl::config::Event &e) {
enabled_ = value("ilw_align", true);
@@ -40,18 +43,30 @@ ILW::ILW(nlohmann::json &config) : ftl::Configurable(config) {
use_lab_ = value("use_Lab", false);
});
flags_ = 0;
if (value("ignore_bad", false)) flags_ |= ftl::cuda::kILWFlag_IgnoreBad;
if (value("restrict_z", true)) flags_ |= ftl::cuda::kILWFlag_RestrictZ;
on("colour_smooth", [this](const ftl::config::Event &e) {
params_.colour_smooth = value("colour_smooth", 50.0f);
});
on("spatial_smooth", [this](const ftl::config::Event &e) {
params_.spatial_smooth = value("spatial_smooth", 0.04f);
});
on("cost_ratio", [this](const ftl::config::Event &e) {
params_.cost_ratio = value("cost_ratio", 75.0f);
});
params_.flags = 0;
if (value("ignore_bad", false)) params_.flags |= ftl::cuda::kILWFlag_IgnoreBad;
if (value("restrict_z", true)) params_.flags |= ftl::cuda::kILWFlag_RestrictZ;
on("ignore_bad", [this](const ftl::config::Event &e) {
if (value("ignore_bad", false)) flags_ |= ftl::cuda::kILWFlag_IgnoreBad;
else flags_ &= ~ftl::cuda::kILWFlag_IgnoreBad;
if (value("ignore_bad", false)) params_.flags |= ftl::cuda::kILWFlag_IgnoreBad;
else params_.flags &= ~ftl::cuda::kILWFlag_IgnoreBad;
});
on("restrict_z", [this](const ftl::config::Event &e) {
if (value("restrict_z", false)) flags_ |= ftl::cuda::kILWFlag_RestrictZ;
else flags_ &= ~ftl::cuda::kILWFlag_RestrictZ;
if (value("restrict_z", false)) params_.flags |= ftl::cuda::kILWFlag_RestrictZ;
else params_.flags &= ~ftl::cuda::kILWFlag_RestrictZ;
});
}
@@ -163,7 +178,7 @@ bool ILW::_phase1(ftl::rgbd::FrameSet &fs, int win, cudaStream_t stream) {
pose1,
pose2,
s2->parameters(),
flags_,
params_,
win,
stream
);
Loading