diff --git a/applications/reconstruct/src/ilw/ilw.cpp b/applications/reconstruct/src/ilw/ilw.cpp index 741e457aac1eaed70e40ea2de9fa4848c57e9736..5aa62b530835adb8a2e50c84f5310d114c58041b 100644 --- a/applications/reconstruct/src/ilw/ilw.cpp +++ b/applications/reconstruct/src/ilw/ilw.cpp @@ -23,7 +23,7 @@ ILW::ILW(nlohmann::json &config) : ftl::Configurable(config) { params_.spatial_smooth = value("spatial_smooth", 0.04f); params_.cost_ratio = value("cost_ratio", 0.2f); discon_mask_ = value("discontinuity_mask",2); - fill_depth_ = value("fill_depth", true); + fill_depth_ = value("fill_depth", false); on("fill_depth", [this](const ftl::config::Event &e) { fill_depth_ = value("fill_depth", true); diff --git a/applications/reconstruct/src/ilw/ilw.cu b/applications/reconstruct/src/ilw/ilw.cu index d36d609a1f5bbb0e744d2753bb77e1f32ca45fa6..af5916cf0e0234786839098e01d6508d5402e422 100644 --- a/applications/reconstruct/src/ilw/ilw.cu +++ b/applications/reconstruct/src/ilw/ilw.cu @@ -160,21 +160,21 @@ __global__ void correspondence_energy_vector_kernel( const float depth2 = d2.tex2D((int)screen.x, (int)screen.y); // Determine degree of correspondence - float cost = 1.0f - ftl::cuda::weighting(fabs(depth2 - camPos.z), params.spatial_smooth); + float cost = ftl::cuda::weighting(fabs(depth2 - camPos.z), params.spatial_smooth); // Point is too far away to even count - if (cost == 1.0f) continue; + //if (cost == 1.0f) continue; const uchar4 colour2 = c2.tex2D((int)screen.x, (int)screen.y); // Mix ratio of colour and distance costs - const float ccost = 1.0f - ftl::cuda::colourWeighting(colour1, colour2, params.colour_smooth); - if ((params.flags & ftl::cuda::kILWFlag_SkipBadColour) && ccost == 1.0f) continue; + const float ccost = ftl::cuda::colourWeighting(colour1, colour2, params.colour_smooth); + //if ((params.flags & ftl::cuda::kILWFlag_SkipBadColour) && ccost == 1.0f) continue; // Cost eq 1: summed contributions - cost = params.cost_ratio * (ccost) + (1.0f - params.cost_ratio) * cost; + cost = 1.0f - (params.cost_ratio * (ccost) + (1.0f - params.cost_ratio) * cost); // Cost eq 2: Multiplied - //cost = ccost * cost * cost * cost; + //cost = 1.0f - (ccost * ccost * cost); ++count; avgcost += (params.flags & ftl::cuda::kILWFlag_ColourConfidenceOnly) ? ccost : cost; diff --git a/components/renderers/cpp/src/splat_render.cpp b/components/renderers/cpp/src/splat_render.cpp index b22b377e158faff8143d49c279955a195ce52dcc..1ccaf156cc31d7ba2097364e627d6d93500d293a 100644 --- a/components/renderers/cpp/src/splat_render.cpp +++ b/components/renderers/cpp/src/splat_render.cpp @@ -363,10 +363,10 @@ bool Splatter::render(ftl::rgbd::VirtualSource *src, ftl::rgbd::Frame &out, cuda cv::cuda::swap(temp_.get<GpuMat>(Channel::Colour), out.create<GpuMat>(Channel::Normals)); out.resetTexture(Channel::Normals); } - else if (chan == Channel::Contribution) - { - cv::cuda::swap(temp_.get<GpuMat>(Channel::Contribution), out.create<GpuMat>(Channel::Contribution)); - } + //else if (chan == Channel::Contribution) + //{ + // cv::cuda::swap(temp_.get<GpuMat>(Channel::Contribution), out.create<GpuMat>(Channel::Contribution)); + //} else if (chan == Channel::Right) { Eigen::Affine3f transform(Eigen::Translation3f(camera.baseline,0.0f,0.0f)); diff --git a/components/rgbd-sources/include/ftl/rgbd/channels.hpp b/components/rgbd-sources/include/ftl/rgbd/channels.hpp index 551507730ffbee1c38784e8db8882d1c5ceaac8f..467df0b1eead1518acab99306a0729aa5fcc5849 100644 --- a/components/rgbd-sources/include/ftl/rgbd/channels.hpp +++ b/components/rgbd-sources/include/ftl/rgbd/channels.hpp @@ -105,6 +105,7 @@ inline bool isFloatChannel(ftl::rgbd::Channel chan) { switch (chan) { case Channel::Depth : //case Channel::Normals : + case Channel::Confidence: case Channel::Energy : return true; default : return false; }