From 5fe92f6da9faf0cbf4ecb137de402a7582870dac Mon Sep 17 00:00:00 2001
From: Nicolas Pope <nwpope@utu.fi>
Date: Fri, 9 Aug 2019 13:06:05 +0300
Subject: [PATCH] Correct upsample render

---
 applications/reconstruct/src/dibr.cu | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/applications/reconstruct/src/dibr.cu b/applications/reconstruct/src/dibr.cu
index 8c9607da2..7cc0f6de5 100644
--- a/applications/reconstruct/src/dibr.cu
+++ b/applications/reconstruct/src/dibr.cu
@@ -81,12 +81,12 @@ __device__ inline bool isStable(const float3 &previous, const float3 &estimate,
 
         // Make an initial estimate of the points location
 		// Use centroid depth as estimate...?
-		const float3 point = params.m_viewMatrix * ftl::cuda::upsampled_point(camera.points, make_float2(x+u*interval, y+v*interval));
+		const float3 point = params.m_viewMatrix * ftl::cuda::upsampled_point(camera.points, make_float2(float(x)+float(u)*interval, float(y)+float(v)*interval));
 		const float d = point.z;
 
 		const uint2 screenPos = params.camera.cameraToKinectScreen(point);
-		const unsigned int cx = screenPos.x+u;
-        const unsigned int cy = screenPos.y+v;
+		const unsigned int cx = screenPos.x;//+u;
+        const unsigned int cy = screenPos.y;//+v;
 		if (d > params.camera.m_sensorDepthWorldMin && d < params.camera.m_sensorDepthWorldMax && cx < depth.width() && cy < depth.height()) {
 			// Transform estimated point to virtual cam space and output z
 			atomicMin(&depth(cx,cy), d * 1000.0f);
-- 
GitLab