diff --git a/applications/reconstruct/src/dibr.cu b/applications/reconstruct/src/dibr.cu index 423de0d4e30a8e740635a839112cf1b7d0d397f3..6a236b0793a90721d4f81ab4d2b9dfd66ae06442 100644 --- a/applications/reconstruct/src/dibr.cu +++ b/applications/reconstruct/src/dibr.cu @@ -400,8 +400,9 @@ __device__ inline float warpMin(float e) { } #define ENERGY_THRESHOLD 0.1f -#define SMOOTHING_MULTIPLIER_A 10.0f -#define SMOOTHING_MULTIPLIER_B 5.0f +#define SMOOTHING_MULTIPLIER_A 10.0f // For surface search +#define SMOOTHING_MULTIPLIER_B 5.0f // For z contribution +#define SMOOTHING_MULTIPLIER_C 5.0f // For colour contribution /* @@ -588,7 +589,7 @@ __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((5.0f*r) * params.camera.fx / camPos.z)); + const int upsample = 8; //min(UPSAMPLE_MAX, int((5.0f*r) * params.camera.fx / camPos.z)); // Not on screen so stop now... if (screenPos.x < 0 || screenPos.y < 0 || @@ -613,7 +614,7 @@ __global__ void dibr_attribute_contrib_kernel( const float3 nearest = params.camera.kinectDepthToSkeleton((int)(screenPos.x+u),(int)(screenPos.y+v),d); // What is contribution of our current point at this pixel? - const float weight = ftl::cuda::spatialWeighting(length(nearest - camPos), SMOOTHING_MULTIPLIER_B*(nearest.z/params.camera.fx)); + const float weight = ftl::cuda::spatialWeighting(length(nearest - camPos), SMOOTHING_MULTIPLIER_C*(nearest.z/params.camera.fx)); if (screenPos.x+u < colour_out.width() && screenPos.y+v < colour_out.height() && weight > 0.0f) { // TODO: Use confidence threshold here const float4 wcolour = colour * weight; const float4 wnormal = normal * weight;