Skip to content
Snippets Groups Projects
Commit 1a480a3d authored by Nicolas Pope's avatar Nicolas Pope
Browse files

Working adaptive smoothing

parent d5a7d1d9
No related branches found
No related tags found
1 merge request!90Implement #150 splat resizing
This commit is part of merge request !90. Comments created here will be created in the context of that merge request.
...@@ -550,7 +550,7 @@ __device__ inline float warpMin(float e) { ...@@ -550,7 +550,7 @@ __device__ inline float warpMin(float e) {
if (maxenergy >= ENERGY_THRESHOLD) return; if (maxenergy >= ENERGY_THRESHOLD) return;
// Move to next possible surface... // Move to next possible surface...
clusterBase = minDepth + 0.01f; clusterBase = minDepth + SMOOTHING_MULTIPLIER_B*(minDepth / params.camera.fx);
}; };
} }
...@@ -613,7 +613,7 @@ __global__ void dibr_attribute_contrib_kernel( ...@@ -613,7 +613,7 @@ __global__ void dibr_attribute_contrib_kernel(
const float3 nearest = params.camera.kinectDepthToSkeleton((int)(screenPos.x+u),(int)(screenPos.y+v),d); 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? // What is contribution of our current point at this pixel?
const float weight = ftl::cuda::spatialWeighting(length(nearest - camPos), SPATIAL_SMOOTHING); const float weight = ftl::cuda::spatialWeighting(length(nearest - camPos), SMOOTHING_MULTIPLIER_B*(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 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 wcolour = colour * weight;
const float4 wnormal = normal * weight; const float4 wnormal = normal * weight;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment