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

Config change to census shape

parent 9bcd8d9e
No related branches found
No related tags found
1 merge request!351Circle census transform or SGM
Pipeline #33087 passed
......@@ -12,6 +12,7 @@
#ifdef HAVE_LIBSGM
#include <libsgm.h>
#include <libsgm_parameters.hpp>
#include <opencv2/cudaimgproc.hpp>
#endif
......@@ -85,6 +86,7 @@ class FixstarsSGM : public ftl::operators::Operator {
int max_disp_;
float uniqueness_;
bool use_P2_map_;
sgm::CensusShape ct_shape_;
};
#endif
......
......@@ -64,6 +64,7 @@ FixstarsSGM::FixstarsSGM(ftl::operators::Graph *g, ftl::Configurable* cfg) :
P1_ = cfg->value("P1", 10);
P2_ = cfg->value("P2", 120);
max_disp_ = cfg->value("num_disp", 256);
ct_shape_ = static_cast<sgm::CensusShape>(cfg->value("ct_shape", 2));
if (uniqueness_ < 0.0 || uniqueness_ > 1.0) {
uniqueness_ = 1.0;
......@@ -118,6 +119,11 @@ FixstarsSGM::FixstarsSGM(ftl::operators::Graph *g, ftl::Configurable* cfg) :
}
});
cfg->on("ct_shape", [this, cfg]() {
ct_shape_ = static_cast<sgm::CensusShape>(cfg->value("ct_shape", 2));
updateParameters();
});
updateP2Parameters();
cfg->on("canny_low", [this, cfg]() {
......@@ -159,7 +165,7 @@ bool FixstarsSGM::init() {
bool FixstarsSGM::updateParameters() {
if (ssgm_ == nullptr) { return false; }
return this->ssgm_->updateParameters(
sgm::StereoSGM::Parameters(P1_, P2_, uniqueness_, true));
sgm::StereoSGM::Parameters(P1_, P2_, uniqueness_, true, ct_shape_));
}
bool FixstarsSGM::updateP2Parameters() {
......
......@@ -2,7 +2,7 @@
namespace sgm {
enum class CensusShape {
CT_5X5,
CT_5X5=0,
CS_CT_9X7,
CIRCLE_3
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment