From 738a0b06e295e769e7bdb542ef644e2310f482ed Mon Sep 17 00:00:00 2001 From: Nicolas Pope <nwpope@utu.fi> Date: Sun, 11 Aug 2019 11:31:20 +0300 Subject: [PATCH] Minor tidy --- applications/reconstruct/src/dibr.cu | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/applications/reconstruct/src/dibr.cu b/applications/reconstruct/src/dibr.cu index ebf53b770..141c5dc81 100644 --- a/applications/reconstruct/src/dibr.cu +++ b/applications/reconstruct/src/dibr.cu @@ -447,6 +447,8 @@ __device__ inline float warpMin(float e) { // Preload valid neighbour points from within a window. A point is valid // if it is within a specific distance of the minimum. // Also calculate the maximum at the same time. + // TODO: Could here do a small search in each camera? This would allow all + // points to be considered, even those masked in our depth input. const float3 minPos = params.camera.kinectDepthToSkeleton(x, y, minDepth); for (int i=lane; i<NEIGHBOR_WINDOW; i+=WARP_SIZE) { @@ -550,11 +552,11 @@ __global__ void dibr_attribute_contrib_kernel( if (camPos.z > params.camera.m_sensorDepthWorldMax) return; const uint2 screenPos = params.camera.cameraToKinectScreen(camPos); - const int upsample = min(UPSAMPLE_MAX, int((10.0f*r) * params.camera.fx / camPos.z)); + const int upsample = min(UPSAMPLE_MAX, int((5.0f*r) * params.camera.fx / camPos.z)); // Not on screen so stop now... - if (screenPos.x + upsample < 0 || screenPos.y + upsample < 0 || - screenPos.x - upsample >= depth_in.width() || screenPos.y - upsample >= depth_in.height()) return; + if (screenPos.x < 0 || screenPos.y < 0 || + screenPos.x >= depth_in.width() || screenPos.y >= depth_in.height()) return; // Is this point near the actual surface and therefore a contributor? const float d = ((float)depth_in.tex2D((int)screenPos.x, (int)screenPos.y)/1000.0f); -- GitLab