From b35a7e8b10dc23a841756a5ac1cc5844fa9a69e0 Mon Sep 17 00:00:00 2001
From: Nicolas Pope <nwpope@utu.fi>
Date: Mon, 11 Nov 2019 18:37:22 +0200
Subject: [PATCH] Use radius discon

---
 components/operators/src/mask.cu | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/components/operators/src/mask.cu b/components/operators/src/mask.cu
index ac6467a70..aac736b1c 100644
--- a/components/operators/src/mask.cu
+++ b/components/operators/src/mask.cu
@@ -29,19 +29,19 @@ __global__ void discontinuity_kernel(ftl::cuda::TextureObject<int> mask_out, ftl
 
 			const uchar4 sup = support.tex2D((int)x, (int)y);
 			if (sup.x <= RADIUS) {
-				float dS = depth.tex2D((int)x - sup.x - 1, (int)y);
+				float dS = depth.tex2D((int)x - sup.x - RADIUS, (int)y);
 				if (fabs(dS - d) > threshold) mask.isDiscontinuity(true);
 			}
 			if (sup.y <= RADIUS) {
-				float dS = depth.tex2D((int)x + sup.y + 1, (int)y);
+				float dS = depth.tex2D((int)x + sup.y + RADIUS, (int)y);
 				if (fabs(dS - d) > threshold) mask.isDiscontinuity(true);
 			}
 			if (sup.z <= RADIUS) {
-				float dS = depth.tex2D((int)x, (int)y - sup.z - 1);
+				float dS = depth.tex2D((int)x, (int)y - sup.z - RADIUS);
 				if (fabs(dS - d) > threshold) mask.isDiscontinuity(true);
 			}
 			if (sup.w <= RADIUS) {
-				float dS = depth.tex2D((int)x, (int)y + sup.w + 1);
+				float dS = depth.tex2D((int)x, (int)y + sup.w + RADIUS);
 				if (fabs(dS - d) > threshold) mask.isDiscontinuity(true);
 			}
         }
-- 
GitLab