diff --git a/applications/reconstruct/src/dibr.cu b/applications/reconstruct/src/dibr.cu index ebf53b77013ce397de9d5b15c0c0ee397b0e6eac..141c5dc81df92e167281fded41e19bac39968039 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);