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

Minor tidy

parent 15bc458b
No related branches found
No related tags found
1 merge request!88Implements #146 upsampling option
Pipeline #12705 passed
...@@ -447,6 +447,8 @@ __device__ inline float warpMin(float e) { ...@@ -447,6 +447,8 @@ __device__ inline float warpMin(float e) {
// Preload valid neighbour points from within a window. A point is valid // Preload valid neighbour points from within a window. A point is valid
// if it is within a specific distance of the minimum. // if it is within a specific distance of the minimum.
// Also calculate the maximum at the same time. // 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); const float3 minPos = params.camera.kinectDepthToSkeleton(x, y, minDepth);
for (int i=lane; i<NEIGHBOR_WINDOW; i+=WARP_SIZE) { for (int i=lane; i<NEIGHBOR_WINDOW; i+=WARP_SIZE) {
...@@ -550,11 +552,11 @@ __global__ void dibr_attribute_contrib_kernel( ...@@ -550,11 +552,11 @@ __global__ void dibr_attribute_contrib_kernel(
if (camPos.z > params.camera.m_sensorDepthWorldMax) return; if (camPos.z > params.camera.m_sensorDepthWorldMax) return;
const uint2 screenPos = params.camera.cameraToKinectScreen(camPos); 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... // Not on screen so stop now...
if (screenPos.x + upsample < 0 || screenPos.y + upsample < 0 || if (screenPos.x < 0 || screenPos.y < 0 ||
screenPos.x - upsample >= depth_in.width() || screenPos.y - upsample >= depth_in.height()) return; screenPos.x >= depth_in.width() || screenPos.y >= depth_in.height()) return;
// Is this point near the actual surface and therefore a contributor? // 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); const float d = ((float)depth_in.tex2D((int)screenPos.x, (int)screenPos.y)/1000.0f);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment