Skip to content
Snippets Groups Projects
Commit a0c13794 authored by Nicolas Pope's avatar Nicolas Pope
Browse files

Allow motion rate control

parent f6d49adb
No related branches found
No related tags found
2 merge requests!116Implements #133 point alignment,!114Ongoing #133 improvements
...@@ -16,6 +16,7 @@ using cv::cuda::GpuMat; ...@@ -16,6 +16,7 @@ using cv::cuda::GpuMat;
ILW::ILW(nlohmann::json &config) : ftl::Configurable(config) { ILW::ILW(nlohmann::json &config) : ftl::Configurable(config) {
enabled_ = value("ilw_align", true); enabled_ = value("ilw_align", true);
iterations_ = value("iterations", 1); iterations_ = value("iterations", 1);
motion_rate_ = value("motion_rate", 0.4f);
on("ilw_align", [this](const ftl::config::Event &e) { on("ilw_align", [this](const ftl::config::Event &e) {
enabled_ = value("ilw_align", true); enabled_ = value("ilw_align", true);
...@@ -25,6 +26,10 @@ ILW::ILW(nlohmann::json &config) : ftl::Configurable(config) { ...@@ -25,6 +26,10 @@ ILW::ILW(nlohmann::json &config) : ftl::Configurable(config) {
iterations_ = value("iterations", 1); iterations_ = value("iterations", 1);
}); });
on("motion_rate", [this](const ftl::config::Event &e) {
motion_rate_ = value("motion_rate", 0.4f);
});
flags_ = 0; flags_ = 0;
if (value("ignore_bad", false)) flags_ |= ftl::cuda::kILWFlag_IgnoreBad; if (value("ignore_bad", false)) flags_ |= ftl::cuda::kILWFlag_IgnoreBad;
if (value("restrict_z", true)) flags_ |= ftl::cuda::kILWFlag_RestrictZ; if (value("restrict_z", true)) flags_ |= ftl::cuda::kILWFlag_RestrictZ;
...@@ -58,7 +63,7 @@ bool ILW::process(ftl::rgbd::FrameSet &fs, cudaStream_t stream) { ...@@ -58,7 +63,7 @@ bool ILW::process(ftl::rgbd::FrameSet &fs, cudaStream_t stream) {
} }
_phase1(fs, win, stream); _phase1(fs, win, stream);
//for (int j=0; j<3; ++j) { //for (int j=0; j<3; ++j) {
_phase2(fs, 0.4f, stream); _phase2(fs, motion_rate_, stream);
//} //}
// TODO: Break if no time left // TODO: Break if no time left
......
...@@ -62,6 +62,7 @@ class ILW : public ftl::Configurable { ...@@ -62,6 +62,7 @@ class ILW : public ftl::Configurable {
bool enabled_; bool enabled_;
unsigned int flags_; unsigned int flags_;
int iterations_; int iterations_;
float motion_rate_;
}; };
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment