diff --git a/applications/reconstruct/src/depth_camera.cu b/applications/reconstruct/src/depth_camera.cu index 9849ec09845e9007a134b745eb81d0cfbceba65f..4ba171c8e165d2f5b4af494bf8bc7a6956efd2fd 100644 --- a/applications/reconstruct/src/depth_camera.cu +++ b/applications/reconstruct/src/depth_camera.cu @@ -29,6 +29,9 @@ __global__ void mls_smooth_kernel(ftl::cuda::TextureObject<float> output, HashDa const DepthCameraCUDA &mainCamera = c_cameras[cam]; if (x < width && y < height) { + output(x,y) = 1000.0f; + __syncthreads(); + float depth = tex2D<float>(mainCamera.depth2, x, y); float3 wpos = make_float3(0.0f); @@ -67,7 +70,12 @@ __global__ void mls_smooth_kernel(ftl::cuda::TextureObject<float> output, HashDa wpos /= weights; } - output(x,y) = (weights >= 20.0f) ? (mainCamera.poseInverse * wpos).z : 1000.0f; + wpos = mainCamera.poseInverse * wpos; + const uint2 screenPos = make_uint2(mainCamera.params.cameraToKinectScreenInt(wpos)); + if (screenPos.x < output.width() && screenPos.y < output.height()) { + output(screenPos.x,screenPos.y) = (weights >= hashParams.m_confidenceThresh) ? wpos.z : 1000.0f; + //output(x,y) = (weights >= hashParams.m_confidenceThresh) ? wpos.z : 1000.0f; + } } }