Skip to content
Snippets Groups Projects

Implements #146 upsampling option

Merged Nicolas Pope requested to merge feature/146/upsample into master
1 file
+ 5
3
Compare changes
  • Side-by-side
  • Inline
@@ -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);
Loading