From fdf1c78f3003514e4cca9c63ad9aa98bd19a3239 Mon Sep 17 00:00:00 2001
From: Nicolas Pope <nwpope@utu.fi>
Date: Fri, 4 Oct 2019 19:33:45 +0300
Subject: [PATCH] Alternate cost

---
 applications/reconstruct/src/ilw/ilw.cu | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/applications/reconstruct/src/ilw/ilw.cu b/applications/reconstruct/src/ilw/ilw.cu
index b33a3e7fe..e9d2049f8 100644
--- a/applications/reconstruct/src/ilw/ilw.cu
+++ b/applications/reconstruct/src/ilw/ilw.cu
@@ -92,9 +92,13 @@ __global__ void correspondence_energy_vector_kernel(
 
             // 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;
-            cost = params.cost_ratio * (ccost) + (1.0f - params.cost_ratio) * cost;
-            //cost /= 2.0f;
+			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 eq 2: Multiplied
+			cost = ccost * cost * cost * cost;
 
             ++count;
             avgcost += (params.flags & ftl::cuda::kILWFlag_ColourConfidenceOnly) ? ccost : cost;
-- 
GitLab