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

Minor change to default values and cost function

parent c12fd6e1
No related branches found
No related tags found
1 merge request!122Implements #183 depth ray correspondences
...@@ -15,13 +15,13 @@ using cv::cuda::GpuMat; ...@@ -15,13 +15,13 @@ 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", 4);
motion_rate_ = value("motion_rate", 0.4f); motion_rate_ = value("motion_rate", 0.8f);
motion_window_ = value("motion_window", 3); motion_window_ = value("motion_window", 3);
use_lab_ = value("use_Lab", false); use_lab_ = value("use_Lab", false);
params_.colour_smooth = value("colour_smooth", 50.0f); params_.colour_smooth = value("colour_smooth", 50.0f);
params_.spatial_smooth = value("spatial_smooth", 0.04f); params_.spatial_smooth = value("spatial_smooth", 0.04f);
params_.cost_ratio = value("cost_ratio", 0.75f); params_.cost_ratio = value("cost_ratio", 0.2f);
discon_mask_ = value("discontinuity_mask",2); discon_mask_ = value("discontinuity_mask",2);
on("ilw_align", [this](const ftl::config::Event &e) { on("ilw_align", [this](const ftl::config::Event &e) {
...@@ -29,7 +29,7 @@ ILW::ILW(nlohmann::json &config) : ftl::Configurable(config) { ...@@ -29,7 +29,7 @@ ILW::ILW(nlohmann::json &config) : ftl::Configurable(config) {
}); });
on("iterations", [this](const ftl::config::Event &e) { on("iterations", [this](const ftl::config::Event &e) {
iterations_ = value("iterations", 1); iterations_ = value("iterations", 4);
}); });
on("motion_rate", [this](const ftl::config::Event &e) { on("motion_rate", [this](const ftl::config::Event &e) {
...@@ -57,7 +57,7 @@ ILW::ILW(nlohmann::json &config) : ftl::Configurable(config) { ...@@ -57,7 +57,7 @@ ILW::ILW(nlohmann::json &config) : ftl::Configurable(config) {
}); });
on("cost_ratio", [this](const ftl::config::Event &e) { on("cost_ratio", [this](const ftl::config::Event &e) {
params_.cost_ratio = value("cost_ratio", 75.0f); params_.cost_ratio = value("cost_ratio", 0.2f);
}); });
params_.flags = 0; params_.flags = 0;
......
...@@ -106,10 +106,10 @@ __global__ void correspondence_energy_vector_kernel( ...@@ -106,10 +106,10 @@ __global__ void correspondence_energy_vector_kernel(
if ((params.flags & ftl::cuda::kILWFlag_SkipBadColour) && ccost == 1.0f) continue; if ((params.flags & ftl::cuda::kILWFlag_SkipBadColour) && ccost == 1.0f) continue;
// Cost eq 1: summed contributions // Cost eq 1: summed contributions
//cost = params.cost_ratio * (ccost) + (1.0f - params.cost_ratio) * cost; cost = params.cost_ratio * (ccost) + (1.0f - params.cost_ratio) * cost;
// Cost eq 2: Multiplied // Cost eq 2: Multiplied
cost = ccost * cost * cost * cost; //cost = ccost * cost * cost * cost;
++count; ++count;
avgcost += (params.flags & ftl::cuda::kILWFlag_ColourConfidenceOnly) ? ccost : cost; avgcost += (params.flags & ftl::cuda::kILWFlag_ColourConfidenceOnly) ? ccost : cost;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment